From: NeilBrown Date: Tue, 17 Oct 2023 05:48:31 +0000 (+1100) Subject: Respell "Window:" as "Tile:". X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=7aad40c87b05ac0514125d1ac258356cea2293a8;p=edlib.git Respell "Window:" as "Tile:". A "Display" is a module for drawing. A "Window" is one particular instance of a Display A "Tile" is a rectangle within a Window. It might overlap other Tiles, it might now. Signed-off-by: NeilBrown --- diff --git a/DOC/TODO.md b/DOC/TODO.md index a1ab4b73..9048c77a 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -15,7 +15,7 @@ the file. then get confused. - [X] when search succeeds on final line then trying again loops back to there, redraw is strange -- [ ] There is a "window:close" and a "Window:close" and they are +- [X] There is a "window:close" and a "Window:close" and they are different. Fix this! - [X] unknown keysequence should be reported so e.g. if keyboard is is Greek mode, then I will be told that Cx-b doesn't work diff --git a/lib-autosave.c b/lib-autosave.c index c22cc124..86bd77c1 100644 --- a/lib-autosave.c +++ b/lib-autosave.c @@ -100,7 +100,7 @@ DEF_CMD(autosave_dir_ignore) doc_next(ci->home->parent, m); if (call("doc:render-line", ci->focus, 0, m) < 0 || m->ref.p == NULL) - call("Window:bury", ci->focus); + call("Tile:bury", ci->focus); mark_free(m); /* Ask viewer to move forward */ return 2; @@ -134,7 +134,7 @@ DEF_CMD(autosave_dir_delete) DEF_CMD(autosave_dir_empty) { - call("Window:bury", ci->focus); + call("Tile:bury", ci->focus); return 1; } diff --git a/lib-popup.c b/lib-popup.c index ee48fc51..328b666e 100644 --- a/lib-popup.c +++ b/lib-popup.c @@ -562,14 +562,14 @@ void edlib_init(struct pane *ed safe) key_add(popup_map, "OtherPane", &popup_other); key_add(popup_map, "ThisPopup", &popup_this); - key_add(popup_map, "Window:bury", &popup_do_close); - key_add(popup_map, "Window:close", &popup_abort); - key_add(popup_map, "Window:split-x", &popup_split); - key_add(popup_map, "Window:split-y", &popup_split); - key_add(popup_map, "Window:x+", &popup_ignore); - key_add(popup_map, "Window:x-", &popup_ignore); - key_add(popup_map, "Window:y+", &popup_ignore); - key_add(popup_map, "Window:y-", &popup_ignore); - key_add(popup_map, "Window:close-others", &popup_close_others); + key_add(popup_map, "Tile:bury", &popup_do_close); + key_add(popup_map, "Tile:close", &popup_abort); + key_add(popup_map, "Tile:split-x", &popup_split); + key_add(popup_map, "Tile:split-y", &popup_split); + key_add(popup_map, "Tile:x+", &popup_ignore); + key_add(popup_map, "Tile:x-", &popup_ignore); + key_add(popup_map, "Tile:y+", &popup_ignore); + key_add(popup_map, "Tile:y-", &popup_ignore); + key_add(popup_map, "Tile:close-others", &popup_close_others); key_add(popup_map, "pane:defocus", &popup_defocus); } diff --git a/lib-tile.c b/lib-tile.c index 89008c51..f6e56a21 100644 --- a/lib-tile.c +++ b/lib-tile.c @@ -106,7 +106,7 @@ DEF_CMD(tile_clone) return Efail; ti->p = p2; /* Remove borders as our children will provide their own. */ - call("Window:border", p2); + call("Tile:border", p2); attr_set_str(&p2->attrs, "borders", "BL"); while (!cti->leaf && child->focus) { child = child->focus; @@ -130,7 +130,7 @@ DEF_CMD(tile_attach) struct pane *p; /* Remove borders as our children will provide their own. */ - call("Window:border", display); + call("Tile:border", display); alloc(ti, pane); p = pane_register(display, 0, &tile_handle.c, ti); @@ -1039,17 +1039,17 @@ void edlib_init(struct pane *ed safe) { tile_map = key_alloc(); - key_add(tile_map, "Window:next", &tile_window_next); - key_add(tile_map, "Window:prev", &tile_window_prev); - key_add(tile_map, "Window:x+", &tile_window_xplus); - key_add(tile_map, "Window:x-", &tile_window_xminus); - key_add(tile_map, "Window:y+", &tile_window_yplus); - key_add(tile_map, "Window:y-", &tile_window_yminus); - key_add(tile_map, "Window:split-x", &tile_window_splitx); - key_add(tile_map, "Window:split-y", &tile_window_splity); - key_add(tile_map, "Window:close", &tile_window_close); - key_add(tile_map, "Window:close-others", &tile_window_close_others); - key_add(tile_map, "Window:bury", &tile_window_bury); + key_add(tile_map, "Tile:next", &tile_window_next); + key_add(tile_map, "Tile:prev", &tile_window_prev); + key_add(tile_map, "Tile:x+", &tile_window_xplus); + key_add(tile_map, "Tile:x-", &tile_window_xminus); + key_add(tile_map, "Tile:y+", &tile_window_yplus); + key_add(tile_map, "Tile:y-", &tile_window_yminus); + key_add(tile_map, "Tile:split-x", &tile_window_splitx); + key_add(tile_map, "Tile:split-y", &tile_window_splity); + key_add(tile_map, "Tile:close", &tile_window_close); + key_add(tile_map, "Tile:close-others", &tile_window_close_others); + key_add(tile_map, "Tile:bury", &tile_window_bury); key_add(tile_map, "OtherPane", &tile_other); key_add(tile_map, "ThisPane", &tile_this); diff --git a/lib-view.c b/lib-view.c index f64b6127..99523277 100644 --- a/lib-view.c +++ b/lib-view.c @@ -557,7 +557,7 @@ void edlib_init(struct pane *ed safe) key_add(view_map, "M:TPress-1", &view_click); key_add(view_map, "M:Press-4", &view_scroll); key_add(view_map, "M:Press-5", &view_scroll); - key_add(view_map, "Window:border", &view_border); + key_add(view_map, "Tile:border", &view_border); key_add(view_map, "Refresh:view", &view_refresh_view); key_add(view_map, "Close", &view_close); key_add(view_map, "Clone", &view_clone); diff --git a/lib-viewer.c b/lib-viewer.c index e313bd36..8e3685d2 100644 --- a/lib-viewer.c +++ b/lib-viewer.c @@ -115,7 +115,7 @@ DEF_CMD(viewer_bury) ret = call("doc:cmd-q", ci->focus, ci->num, ci->mark); switch (ret) { case 0: - call("Window:bury", ci->focus); + call("Tile:bury", ci->focus); break; case 2: /* request to move to next line */ call("K:Down", ci->focus, ci->num, ci->mark); diff --git a/mode-basic.c b/mode-basic.c index acdf5cf0..ee31d3d9 100644 --- a/mode-basic.c +++ b/mode-basic.c @@ -570,7 +570,7 @@ DEF_CMD(basic_interactive_delete) DEF_CMD(basic_close) { - call("Window:close", ci->focus); + call("Tile:close", ci->focus); return 1; } diff --git a/mode-emacs.c b/mode-emacs.c index 1294cec9..d5b37d0b 100644 --- a/mode-emacs.c +++ b/mode-emacs.c @@ -474,13 +474,13 @@ static struct simple_command { char *type safe; char *k safe; } simple_commands[] = { - {CMD(emacs_simple), "Window:next", "K:CX-o"}, - {CMD(emacs_simple), "Window:prev", "K:CX-O"}, - {CMD(emacs_simple), "Window:y+", "K:CX-^"}, - {CMD(emacs_simple), "Window:split-y", "K:CX-2"}, - {CMD(emacs_simple), "Window:split-x", "K:CX-3"}, - {CMD(emacs_simple), "Window:close", "K:CX-0"}, - {CMD(emacs_simple), "Window:bury", "K:A-B"}, + {CMD(emacs_simple), "Tile:next", "K:CX-o"}, + {CMD(emacs_simple), "Tile:prev", "K:CX-O"}, + {CMD(emacs_simple), "Tile:y+", "K:CX-^"}, + {CMD(emacs_simple), "Tile:split-y", "K:CX-2"}, + {CMD(emacs_simple), "Tile:split-x", "K:CX-3"}, + {CMD(emacs_simple), "Tile:close", "K:CX-0"}, + {CMD(emacs_simple), "Tile:bury", "K:A-B"}, {CMD(emacs_simple), "window:new", "K:CX5-2"}, {CMD(emacs_simple), "window:close", "K:CX5-0"}, {CMD(emacs_simple), "lib-server:done", "K:CX-#"}, @@ -538,7 +538,7 @@ DEF_CMD(emacs_close_others) if (strcmp(ci->key, "K-1") == 0 && N2(ci) != N2_close_others) return Efallthrough; - if (call("Window:close-others", ci->focus) <= 0) + if (call("Tile:close-others", ci->focus) <= 0) return Efalse; call("Mode:set-num2", ci->focus, N2_close_others); call("Message:modal", ci->focus, 0, NULL, "Type 1 to close more"); @@ -2279,9 +2279,9 @@ DEF_CMD(emacs_shift_again) DEF_CMD(emacs_growx) { if (ci->key[strlen(ci->key)-1] == '}') - call("Window:x+", ci->focus, ci->num); + call("Tile:x+", ci->focus, ci->num); else - call("Window:x-", ci->focus, ci->num); + call("Tile:x-", ci->focus, ci->num); call("Mode:set-num2", ci->focus, N2_growx); call("Message:modal", ci->focus, 0, NULL, "Type { or } to grow again"); return 1; diff --git a/python/lib-compose-email.py b/python/lib-compose-email.py index 17eef8bf..439a9a17 100644 --- a/python/lib-compose-email.py +++ b/python/lib-compose-email.py @@ -423,7 +423,7 @@ class compose_email(edlib.Pane): self.complete_start = None self.complete_end = None if self.complete_menu: - self.complete_menu("Window:Close") + self.complete_menu("Tile:Close") self.complete_menu = None if not mark: mark = focus.call("doc:point", ret='mark') @@ -556,7 +556,7 @@ class compose_email(edlib.Pane): self.complete_start = None self.complete_end = None if self.complete_menu: - self.complete_menu.call("Window:Close") + self.complete_menu.call("Tile:Close") self.complete_menu = None st = pt.dup() word = self.prev_addr(st) @@ -884,7 +884,7 @@ class compose_email(edlib.Pane): root.call("event:read", p.stdout.fileno(), lambda key, **a: read_status(p, key, **a)) focus.call("Message", "Queueing message to %s." % whoto) - focus.call("Window:bury") + focus.call("Tile:bury") return 1 # Cannot find pane to report status on, so do it sync @@ -895,7 +895,7 @@ class compose_email(edlib.Pane): focus.call("Message", "Email submission gives err: " + err.decode('utf-8','ignore')) focus.call("Message", "Email message to %s queued." % whoto) - focus.call("Window:bury") + focus.call("Tile:bury") return 1 diff --git a/python/lib-server.py b/python/lib-server.py index 686b9d86..5fb8e4cf 100755 --- a/python/lib-server.py +++ b/python/lib-server.py @@ -130,7 +130,7 @@ if sys.argv[0] == "": if cmd == "request-close": if self.term: # trigger finding a new document - self.term.call("Window:bury") + self.term.call("Tile:bury") self.want_close = True self.sock.send(b"OK") return 1 @@ -140,7 +140,7 @@ if sys.argv[0] == "": if p: for v in env: p.call("window:set:", env[v], v) - p.call("Window:bury") + p.call("Tile:bury") self.term = p self.sock.send(b'OK') @@ -269,7 +269,7 @@ if sys.argv[0] == "": focus.call("doc:notify:doc:done") # FIXME need something better than 'bury' # If it was already visible, it should stay that way - focus.call("Window:bury") + focus.call("Tile:bury") else: # Find and visit a doc waiting to be done choice = [] diff --git a/python/module-notmuch.py b/python/module-notmuch.py index cd86747e..aaf5fd0c 100644 --- a/python/module-notmuch.py +++ b/python/module-notmuch.py @@ -1877,7 +1877,7 @@ class notmuch_master_view(edlib.Pane): else: w = ch * 10 * max / 1000 if tile.w != w: - tile.call("Window:x+", "notmuch", int(w - tile.w)) + tile.call("Tile:x+", "notmuch", int(w - tile.w)) if self.query_pane and self.message_pane: # query_pane must be at least 4 lines, else 1/4 height # but never more than 1/2 the height @@ -1892,7 +1892,7 @@ class notmuch_master_view(edlib.Pane): if h > space / 2: h = space / 2 if tile.h != h: - tile.call("Window:y+", "notmuch", int(h - tile.h)) + tile.call("Tile:y+", "notmuch", int(h - tile.h)) def handle_getattr(self, key, focus, str, comm2, **a): "handle:get-attr" @@ -2430,7 +2430,7 @@ class notmuch_master_view(edlib.Pane): self.mark_read() p = self.message_pane self("notmuch-close-message", 1) - p.call("Window:close", "notmuch") + p.call("Tile:close", "notmuch") elif self.query_pane: if (self.query_pane.call("notmuch:close-whole-thread") == 1 and key != "doc:char-Q"): @@ -2450,7 +2450,7 @@ class notmuch_master_view(edlib.Pane): pnt['notmuch:query-name'] = "" self.list_pane.call("view:changed") - p.call("Window:close", "notmuch") + p.call("Tile:close", "notmuch") elif key == "doc:char-Q": p = self.call("ThisPane", ret='pane') if p and p.focus: @@ -2477,13 +2477,13 @@ class notmuch_master_view(edlib.Pane): def handle_o(self, key, focus, **a): "handle:doc:char-o" # focus to next window - focus.call("Window:next", "notmuch") + focus.call("Tile:next", "notmuch") return 1 def handle_O(self, key, focus, **a): "handle:doc:char-O" # focus to prev window - focus.call("Window:prev", "notmuch") + focus.call("Tile:prev", "notmuch") return 1 def handle_g(self, key, focus, **a): @@ -2504,7 +2504,7 @@ class notmuch_master_view(edlib.Pane): if self.message_pane: p = self.message_pane self("notmuch-close-message", 1) - p.call("Window:close", "notmuch") + p.call("Tile:close", "notmuch") self.message_pane = None # doc:notmuch:query might auto-select a message, which will diff --git a/python/render-present.py b/python/render-present.py index eeed4911..9a5e4620 100644 --- a/python/render-present.py +++ b/python/render-present.py @@ -681,12 +681,12 @@ class PresenterPane(edlib.Pane): def handle_M_f(self, key, **a): "handle:K:A-f" if self.borderless: - self.call("Window:border", 1) + self.call("Tile:border", 1) self.call("window:border", 1) self.call("window:fullscreen", -1) self.borderless = False else: - self.call("Window:border", -1) + self.call("Tile:border", -1) self.call("window:border", -1) self.call("window:fullscreen", 1) self.borderless = True diff --git a/render-imageview.c b/render-imageview.c index 161514be..d062d48f 100644 --- a/render-imageview.c +++ b/render-imageview.c @@ -185,7 +185,7 @@ DEF_CMD(imageview_reset) DEF_CMD(imageview_quit) { - call("Window:close", ci->focus); + call("Tile:close", ci->focus); return 1; }