From 9ad4a39690bb84ea3bc9a7cef63302ec420fca29 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 18 Oct 2023 15:00:06 +1100 Subject: [PATCH] Respell "window:" as "Window:". It seems more consistent to capitalise these Windows now that I can. Signed-off-by: NeilBrown --- DOC/Calls | 16 ++++++++-------- DOC/Developer/07-displays.md | 10 +++++----- core-window.c | 18 +++++++++--------- display-ncurses.c | 6 +++--- display-x11-xcb.c | 14 +++++++------- edlib.c | 14 +++++++------- lib-input.c | 8 ++++---- lib-menubar.c | 2 +- lib-messageline.c | 10 +++++----- lib-view.c | 2 +- mode-basic.c | 2 +- mode-emacs.c | 8 ++++---- python/display-pygtk.py | 16 ++++++++-------- python/lib-macro.py | 14 +++++++------- python/lib-server.py | 24 ++++++++++++------------ python/lib-url.py | 2 +- python/module-notmuch.py | 2 +- python/render-present.py | 10 +++++----- 18 files changed, 89 insertions(+), 89 deletions(-) diff --git a/DOC/Calls b/DOC/Calls index 04350e98..591325f7 100644 --- a/DOC/Calls +++ b/DOC/Calls @@ -46,11 +46,11 @@ Known notifications include: # Window/input -## window:request:FOO +## Window:request:FOO Ask to receive notification "FOO" send to current window. -## window:notify:FOO +## Window:notify:FOO Send notification "FOO" to current window. @@ -155,20 +155,20 @@ When a close request is sent to the display, it should call from this display), it should generally refuse, as closing the last display can be awkward. -## window:close +## Window:close This is a request for the display to close - may be rejected if it is the only display left. -## window:set:ATTR +## Window:set:ATTR Set any attribute on the display pane. -The attribute "no-close" affects closing. If a window:close request +The attribute "no-close" affects closing. If a Window:close request arrives when "no-close" attribute is a non-empty string, that string should be reported via a message, and the close should be rejected. -## window:external-viewer +## Window:external-viewer str1 is a filename and str2 is (optionally) a basename template containing "XXXXXX". An external viewer (typically xdg-open) should be @@ -176,12 +176,12 @@ run on the file. If the display is on a different host to where the file is stored, some action might be taken to copy it and provide a local names, based on str2. -## window:fullscreen +## Window:fullscreen If num1 > 0, display should switch to full-screen mode if possible. If num1 <= 0, display should switch away from full-screen mode. -## window:new +## Window:new If it is possible to duplicate the display (e.g. similar window on same output), do that. diff --git a/DOC/Developer/07-displays.md b/DOC/Developer/07-displays.md index 66ba54ba..467b2727 100644 --- a/DOC/Developer/07-displays.md +++ b/DOC/Developer/07-displays.md @@ -97,11 +97,11 @@ Draw:image ## Window management commands -window:close -window:set:no-close -window:external-viewer -window:fullscreen -window:new +Window:close +Window:set:no-close +Window:external-viewer +Window:fullscreen +Window:new all-displays diff --git a/core-window.c b/core-window.c index 36c8d90a..9ce21527 100644 --- a/core-window.c +++ b/core-window.c @@ -62,14 +62,14 @@ struct window_data { DEF_CMD(request_notify) { - pane_add_notify(ci->focus, ci->home, ksuffix(ci, "window:request:")); + pane_add_notify(ci->focus, ci->home, ksuffix(ci, "Window:request:")); return 1; } DEF_CMD(send_notify) { - /* window:notify:... */ - return home_pane_notify(ci->home, ksuffix(ci, "window:notify:"), + /* Window:notify:... */ + return home_pane_notify(ci->home, ksuffix(ci, "Window:notify:"), ci->focus, ci->num, ci->mark, ci->str, ci->num2, ci->mark2, ci->str2, ci->comm2); @@ -77,7 +77,7 @@ DEF_CMD(send_notify) DEF_CMD(window_set) { - const char *val = ksuffix(ci, "window:set:"); + const char *val = ksuffix(ci, "Window:set:"); if (!*val) val = ci->str2; @@ -355,12 +355,12 @@ void window_setup(struct pane *ed safe) { window_map = key_alloc(); - key_add_prefix(window_map, "window:request:", &request_notify); - key_add_prefix(window_map, "window:notify:", &send_notify); + key_add_prefix(window_map, "Window:request:", &request_notify); + key_add_prefix(window_map, "Window:notify:", &send_notify); - key_add(window_map, "window:close", &window_close); + key_add(window_map, "Window:close", &window_close); - key_add_prefix(window_map, "window:set:", &window_set); + key_add_prefix(window_map, "Window:set:", &window_set); key_add(window_map, "selection:claim", &selection_claim); key_add(window_map, "selection:commit", &selection_commit); @@ -368,7 +368,7 @@ void window_setup(struct pane *ed safe) key_add(window_map, "Notify:Close", &close_notify); key_add(window_map, "Draw:scale-image", &scale_image); - key_add(window_map, "window:activate-display", + key_add(window_map, "Window:activate-display", &window_activate_display); call_comm("global-set-command", ed, &window_attach, 0, NULL, diff --git a/display-ncurses.c b/display-ncurses.c index 40012043..86995cd4 100644 --- a/display-ncurses.c +++ b/display-ncurses.c @@ -1820,9 +1820,9 @@ void edlib_init(struct pane *ed safe) "attach-display-ncurses"); nc_map = key_alloc(); - key_add(nc_map, "window:refresh", &force_redraw); - key_add(nc_map, "window:close", &nc_close_display); - key_add(nc_map, "window:external-viewer", &nc_external_viewer); + key_add(nc_map, "Window:refresh", &force_redraw); + key_add(nc_map, "Window:close", &nc_close_display); + key_add(nc_map, "Window:external-viewer", &nc_external_viewer); key_add(nc_map, "Close", &nc_close); key_add(nc_map, "Draw:clear", &nc_clear); key_add(nc_map, "Draw:text-size", &nc_text_size); diff --git a/display-x11-xcb.c b/display-x11-xcb.c index 5772df93..3aa0f73c 100644 --- a/display-x11-xcb.c +++ b/display-x11-xcb.c @@ -1603,7 +1603,7 @@ static void handle_client_message(struct pane *home safe, cme->format == 32 && cme->window == xd->win && cme->data.data32[0] == xd->atoms[a_WM_DELETE_WINDOW]) { - call("window:close", pane_focus(home)); + call("Window:close", pane_focus(home)); return; } @@ -1703,7 +1703,7 @@ DEF_CMD(xcb_input) xcb_flush(xd->conn); } if (xcb_connection_has_error(xd->conn)) { - call("window:close", ci->home->parent); + call("Window:close", ci->home->parent); pane_close(ci->home); } return ret; @@ -1997,7 +1997,7 @@ DEF_CMD(xcb_new_display) p = xcb_display_init(d, disp_auth, ci->focus); if (strcmp(ci->key, "interactive-cmd-x11window") == 0) p = home_call_ret(pane, p, - "window:activate-display", ci->focus); + "Window:activate-display", ci->focus); if (p) comm_call(ci->comm2, "cb", p); return 1; @@ -2012,10 +2012,10 @@ void edlib_init(struct pane *ed safe) xcb_map = key_alloc(); - key_add(xcb_map, "window:close", &xcb_close_display); - key_add(xcb_map, "window:external-viewer", &xcb_external_viewer); - key_add(xcb_map, "window:fullscreen", &xcb_fullscreen); - key_add(xcb_map, "window:new", &xcb_new_display); + key_add(xcb_map, "Window:close", &xcb_close_display); + key_add(xcb_map, "Window:external-viewer", &xcb_external_viewer); + key_add(xcb_map, "Window:fullscreen", &xcb_fullscreen); + key_add(xcb_map, "Window:new", &xcb_new_display); key_add(xcb_map, "Close", &xcb_close); key_add(xcb_map, "Draw:clear", &xcb_clear); diff --git a/edlib.c b/edlib.c index bac2c5f2..86c73c20 100644 --- a/edlib.c +++ b/edlib.c @@ -117,25 +117,25 @@ int main(int argc, char *argv[]) char *e; e = getenv("SSH_CONNECTION"); if (e && *e) - call("window:set:REMOTE_SESSION", p, + call("Window:set:REMOTE_SESSION", p, 0, NULL, "yes"); - call("window:set:DISPLAY", p, + call("Window:set:DISPLAY", p, 0, NULL, getenv("DISPLAY")); - call("window:set:XAUTHORITY", p, + call("Window:set:XAUTHORITY", p, 0, NULL, getenv("XAUTHORITY")); if (!first_window) first_window = p; - call("window:set:no-close", p, 1, NULL, + call("Window:set:no-close", p, 1, NULL, "Cannot close primary display"); - home_call(p, "window:activate-display", doc); + home_call(p, "Window:activate-display", doc); } } if (gtk) { p = call_ret(pane, "attach-display-gtk", ed, 0, NULL, getenv("DISPLAY")); - home_call(p, "window:activate-display", doc); + home_call(p, "Window:activate-display", doc); if (!first_window) first_window = p; } @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) p = call_ret(pane, "attach-display-x11", ed, 0, NULL, getenv("DISPLAY"), 0, NULL, getenv("XAUTHORITY")); - home_call(p, "window:activate-display", doc); + home_call(p, "Window:activate-display", doc); if (!first_window) first_window = p; } diff --git a/lib-input.c b/lib-input.c index 017ec89e..f68e0386 100644 --- a/lib-input.c +++ b/lib-input.c @@ -107,7 +107,7 @@ DEF_CMD(set_mode) free((void*)im->context); im->context = strdup(ci->str2); attr_set_str(&ci->home->attrs, "display-context", im->context); - call("window:notify:display-context", ci->home); + call("Window:notify:display-context", ci->home); } report_status(ci->focus, im); return 1; @@ -142,7 +142,7 @@ DEF_CMD(set_all) free((void*)im->context); im->context = strdup(ci->str2); attr_set_str(&ci->home->attrs, "display-context", im->context); - call("window:notify:display-context", ci->home); + call("Window:notify:display-context", ci->home); } im->num = ci->num; im->num2 = ci->num; @@ -192,7 +192,7 @@ DEF_CMD(keystroke) if (!ci->str) return Enoarg; - call("window:notify:Keystroke-notify", ci->home, 0, NULL, ci->str); + call("Window:notify:Keystroke-notify", ci->home, 0, NULL, ci->str); log_add(im, "K", ci->str); im->mode = strdup(""); @@ -293,7 +293,7 @@ DEF_CMD(mouse_event) if (!ci->str) return Enoarg; - call("window:notify:Mouse-event-notify", ci->home, + call("Window:notify:Mouse-event-notify", ci->home, ci->num, NULL, ci->str, ci->num2); log_add(im, "M", ci->str); diff --git a/lib-menubar.c b/lib-menubar.c index 38465f89..a1377cfe 100644 --- a/lib-menubar.c +++ b/lib-menubar.c @@ -443,7 +443,7 @@ void edlib_init(struct pane *ed safe) 0, NULL, "attach-menubar"); menubar_map = key_alloc(); - key_add(menubar_map, "window:border", &menubar_border); + key_add(menubar_map, "Window:border", &menubar_border); key_add(menubar_map, "Refresh:size", &menubar_refresh_size); key_add(menubar_map, "Child-Notify", &menubar_child_notify); key_add(menubar_map, "Refresh:view", &menubar_refresh); diff --git a/lib-messageline.c b/lib-messageline.c index 090caffe..83dc228e 100644 --- a/lib-messageline.c +++ b/lib-messageline.c @@ -69,8 +69,8 @@ DEF_CMD(messageline_msg) if (ci->str && (strcmp(ci->key, "Message:default") != 0 || mli->message == NULL)) { if (!mli->message) { - call("window:request:Keystroke-notify", ci->home); - call("window:request:Mouse-event-notify", ci->home); + call("Window:request:Keystroke-notify", ci->home); + call("Window:request:Mouse-event-notify", ci->home); } if (strcmp(ci->key, "Message:modal") == 0) { free(mli->modal); @@ -105,8 +105,8 @@ DEF_CMD(messageline_abort) struct mlinfo *mli = ci->home->data; if (!mli->message) { - call("window:request:Keystroke-notify", ci->home); - call("window:request:Mouse-event-notify", ci->home); + call("Window:request:Keystroke-notify", ci->home); + call("Window:request:Mouse-event-notify", ci->home); } free(mli->message); mli->message = strdup("ABORTED"); @@ -298,7 +298,7 @@ void edlib_init(struct pane *ed safe) return; messageline_map = key_alloc(); key_add(messageline_map, "Clone", &messageline_clone); - key_add(messageline_map, "window:border", &messageline_border); + key_add(messageline_map, "Window:border", &messageline_border); key_add(messageline_map, "Message", &messageline_msg); key_add(messageline_map, "Message:modal", &messageline_msg); key_add(messageline_map, "Message:default", &messageline_msg); diff --git a/lib-view.c b/lib-view.c index 99523277..973b32d5 100644 --- a/lib-view.c +++ b/lib-view.c @@ -414,7 +414,7 @@ static struct pane *do_view_attach(struct pane *par safe, int border) call("doc:request:doc:replaced", p); call("doc:request:mark:moving", p); /* And update display-context */ - call("window:request:display-context", p); + call("Window:request:display-context", p); return p; } diff --git a/mode-basic.c b/mode-basic.c index ee31d3d9..e8974ea4 100644 --- a/mode-basic.c +++ b/mode-basic.c @@ -576,7 +576,7 @@ DEF_CMD(basic_close) DEF_CMD(basic_refresh) { - call("window:refresh", ci->focus); + call("Window:refresh", ci->focus); return 1; } diff --git a/mode-emacs.c b/mode-emacs.c index d5b37d0b..6d4248dd 100644 --- a/mode-emacs.c +++ b/mode-emacs.c @@ -460,7 +460,7 @@ DEF_CMD(emacs_recenter) } else { /* Move point to middle and refresh */ call("Move-View-Line", ci->focus, 0, ci->mark); - call("window:refresh", ci->focus); + call("Window:refresh", ci->focus); } call("Mode:set-num2", ci->focus, N2_recentre | (step << 16)); return 1; @@ -481,8 +481,8 @@ static struct simple_command { {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), "Window:new", "K:CX5-2"}, + {CMD(emacs_simple), "Window:close", "K:CX5-0"}, {CMD(emacs_simple), "lib-server:done", "K:CX-#"}, {CMD(emacs_simple), "mode-swap-mark", "K:CX:C-X"}, {CMD(emacs_simple), "Abort", "K:C-G"}, @@ -2323,7 +2323,7 @@ DEF_CMD(emacs_scale_relative) else scale = 12 * scale / 10; snprintf(num, sizeof(num)-1, "%d", scale); - call("window:set:scale", p, 0, NULL, num); + call("Window:set:scale", p, 0, NULL, num); return 1; } diff --git a/python/display-pygtk.py b/python/display-pygtk.py index 392169eb..359ce86d 100644 --- a/python/display-pygtk.py +++ b/python/display-pygtk.py @@ -72,7 +72,7 @@ class EdDisplay(edlib.Pane): return 1 def handle_close_window(self, key, focus, **a): - "handle:window:close" + "handle:Window:close" nc = self['no-close'] if nc: focus.call("Message", nc) @@ -86,7 +86,7 @@ class EdDisplay(edlib.Pane): return 1 def handle_fullscreen(self, key, num, **a): - "handle:window:fullscreen" + "handle:Window:fullscreen" if num > 0: self.win.fullscreen() else: @@ -94,16 +94,16 @@ class EdDisplay(edlib.Pane): return 1 def handle_new(self, key, focus, **a): - "handle:window:new" + "handle:Window:new" p = focus.call("attach-window-core", ret='pane') if not p: return edlib.Efail newdisp = EdDisplay(p, self['DISPLAY']) - newdisp.call("window:activate-display", focus) + newdisp.call("Window:activate-display", focus) return 1 def handle_external(self, key, str, **a): - "handle:window:external-viewer" + "handle:Window:external-viewer" disp = self['DISPLAY'] if not str or not disp: return edlib.Enoarg @@ -545,11 +545,11 @@ class EdDisplay(edlib.Pane): # This must not happen. What should I do? def close_win(self, *a): - self.call("window:close") + self.call("Window:close") return True def destroy_win(self, *a): - self.parent("window:close") + self.parent("Window:close") return False def create_ui(self): @@ -805,7 +805,7 @@ def new_display(key, focus, comm2, str1, **a): return edlib.Efail; disp = EdDisplay(p, display) if key == "interactive-cmd-gtkwindow": - p = disp.call("window:activate-display", focus, ret='pane') + p = disp.call("Window:activate-display", focus, ret='pane') if comm2: comm2('callback', p) return 1 diff --git a/python/lib-macro.py b/python/lib-macro.py index 87e4ca2a..43ab1395 100644 --- a/python/lib-macro.py +++ b/python/lib-macro.py @@ -50,9 +50,9 @@ class CapturePane(edlib.Pane): while root.parent != root: root = root.parent edlib.Pane.__init__(self, root) - focus.call("window:request:Keystroke-notify", self) - focus.call("window:request:macro:capture-active", self) - focus.call("window:request:macro:capture-done", self) + focus.call("Window:request:Keystroke-notify", self) + focus.call("Window:request:macro:capture-active", self) + focus.call("Window:request:macro:capture-done", self) focus.call("Mode:set-mode", str2 = "()") self.line = [] @@ -82,23 +82,23 @@ class CapturePane(edlib.Pane): return ret def start_capture(key, focus, **a): - if focus.call("window:notify:macro:capture-active") >= 1: + if focus.call("Window:notify:macro:capture-active") >= 1: # capture currently active return edlib.Efalse CapturePane(focus) - if focus.call("window:notify:macro:capture-active") >= 1: + if focus.call("Window:notify:macro:capture-active") >= 1: # Good, it is active now return 1 return edlib.Efail def end_capture(key, focus, num, **a): try: - if focus.call("window:notify:macro:capture-active") <= 0: + if focus.call("Window:notify:macro:capture-active") <= 0: # capture currently active return edlib.Efalse except edlib.commandfailed: return edlib.Efalse - ret = focus.call("window:notify:macro:capture-done", num) + ret = focus.call("Window:notify:macro:capture-done", num) if ret == 0: return edlib.Efalse if ret > 0: diff --git a/python/lib-server.py b/python/lib-server.py index 5fb8e4cf..11499f6a 100755 --- a/python/lib-server.py +++ b/python/lib-server.py @@ -51,7 +51,7 @@ if sys.argv[0] == "": if not msg : if self.disp: - self.disp.call("window:close") + self.disp.call("Window:close") if self.sock: self.sock.close() self.sock = None @@ -123,7 +123,7 @@ if sys.argv[0] == "": self.add_notify(d, "Notify:Close") self.doc = d if self.term: - self.term.call("window:set:no-close", + self.term.call("Window:set:no-close", "Cannot close display until document done - use 'C-x #'") self.sock.send(b"OK") return 1 @@ -139,7 +139,7 @@ if sys.argv[0] == "": arg, env['XAUTHORITY'], ret='pane') if p: for v in env: - p.call("window:set:", env[v], v) + p.call("Window:set:", env[v], v) p.call("Tile:bury") self.term = p @@ -151,8 +151,8 @@ if sys.argv[0] == "": p = p.call("attach-display-ncurses", path, env['TERM'], ret='pane') for v in env: - p.call("window:set:", env[v], v) - p = p.call("window:activate-display", ret='pane') + p.call("Window:set:", env[v], v) + p = p.call("Window:activate-display", ret='pane') self.term = p self.disp = self.term self.add_notify(self.disp, "Notify:Close") @@ -167,8 +167,8 @@ if sys.argv[0] == "": return 1 if cmd == "close": if self.disp: - self.disp.call("window:set:no-close") - self.disp.call("window:close") + self.disp.call("Window:set:no-close") + self.disp.call("Window:close") self.disp = None self.call("event:free", self.read) self.sock.close() @@ -201,8 +201,8 @@ if sys.argv[0] == "": # same as doc:done self.doc = None if self.term: - self.term.call("window:set:no-close") - self.term.call("window:close") + self.term.call("Window:set:no-close") + self.term.call("Window:close") self.sock.send(b"Done") return 1 @@ -210,8 +210,8 @@ if sys.argv[0] == "": "handle:doc:done" if str != "test": if self.term: - self.term.call("window:set:no-close") - self.term.call("window:close") + self.term.call("Window:set:no-close") + self.term.call("Window:close") self.sock.send(b"Done") return 1 @@ -243,7 +243,7 @@ if sys.argv[0] == "": self.sock.close() self.sock = None if self.disp: - self.disp.call("window:close") + self.disp.call("Window:close") self.disp = None global server_sock diff --git a/python/lib-url.py b/python/lib-url.py index 9eb64013..d368ee07 100644 --- a/python/lib-url.py +++ b/python/lib-url.py @@ -92,7 +92,7 @@ class url_view(edlib.Pane): if url: focus.call("Message", "Url: <%s>" % url) if self.displayed_tag == tag: - focus.call("window:external-viewer", url) + focus.call("Window:external-viewer", url) self.displayed_tag = tag else: focus.call("Message", "URL tag %s not found" % tag) diff --git a/python/module-notmuch.py b/python/module-notmuch.py index aaf5fd0c..6588e979 100644 --- a/python/module-notmuch.py +++ b/python/module-notmuch.py @@ -3508,7 +3508,7 @@ class notmuch_message_view(edlib.Pane): fd, path = tempfile.mkstemp(ext, prefix) os.write(fd, content) os.close(fd) - focus.call("window:external-viewer", path, prefix+"XXXXX"+ext) + focus.call("Window:external-viewer", path, prefix+"XXXXX"+ext) return 1 def handle_map_attr(self, key, focus, mark, str, str2, comm2, **a): diff --git a/python/render-present.py b/python/render-present.py index 9a5e4620..d77fb084 100644 --- a/python/render-present.py +++ b/python/render-present.py @@ -682,13 +682,13 @@ class PresenterPane(edlib.Pane): "handle:K:A-f" if self.borderless: self.call("Tile:border", 1) - self.call("window:border", 1) - self.call("window:fullscreen", -1) + self.call("Window:border", 1) + self.call("Window:fullscreen", -1) self.borderless = False else: self.call("Tile:border", -1) - self.call("window:border", -1) - self.call("window:fullscreen", 1) + self.call("Window:border", -1) + self.call("Window:fullscreen", 1) self.borderless = True return 1 @@ -719,7 +719,7 @@ class MarkdownPane(edlib.Pane): return 1 def handle_refresh(self, key, focus, mark, **a): - "handle:window:refresh" + "handle:Window:refresh" # Refresh causes presentation page to recenter # page-down just moves down to start of next page. focus.call("doc:notify:doc:Recentre", mark) -- 2.39.5