From e80cf5dafb3a04e3e4896049b5dffb7d7fecafe8 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 29 Jun 2023 06:44:50 +1000 Subject: [PATCH] display-xcb: merge display_xcb and xcb_new_display These two function are largely equivalent, so xcb_new_display does a couple of step that are not harmful for display_xcb. So discard display_xcb and just use xcb_new_display. Signed-off-by: NeilBrown --- display-x11-xcb.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/display-x11-xcb.c b/display-x11-xcb.c index 497ae3f1..4800793f 100644 --- a/display-x11-xcb.c +++ b/display-x11-xcb.c @@ -1915,23 +1915,6 @@ abort: return NULL; } -DEF_CMD(display_xcb) -{ - struct pane *p; - struct pane *ed = pane_root(ci->focus); - const char *d = ci->str; - - if (!d) - return Enoarg; - p = xcb_display_init(d, ci->str2, ed); - if (p && ci->focus != ed) - /* Assume ci->focus is a document */ - p = home_call_ret(pane, ci->focus, "doc:attach-view", p, 1); - if (p) - return comm_call(ci->comm2, "cb", p); - return Efail; -} - DEF_CMD(xcb_new_display) { struct pane *p; @@ -1957,7 +1940,7 @@ DEF_CMD(xcb_new_display) void edlib_init(struct pane *ed safe) { - call_comm("global-set-command", ed, &display_xcb, 0, NULL, + call_comm("global-set-command", ed, &xcb_new_display, 0, NULL, "attach-display-x11"); call_comm("global-set-command", ed, &xcb_new_display, 0, NULL, "interactive-cmd-x11window"); -- 2.39.5