To: vim-dev@vim.org Subject: Patch 6.3a.017 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.3a.017 Problem: servername() doesn't work when Vim was started with the "-X" argument or when the "exclude" in 'clipboard' matches the terminal name. (Robert Nowotniak) Solution: Force connecting to the X server when using client-server commands. Files: src/eval.c, src/globals.h, src/os_unix.c *** ../vim-6.3a.016/src/eval.c Wed May 12 14:12:34 2004 --- src/eval.c Wed May 12 20:51:54 2004 *************** *** 6599,6609 **** --- 6599,6622 ---- } #if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) + static int make_connection __ARGS((void)); static int check_connection __ARGS((void)); static int + make_connection() + { + if (X_DISPLAY == NULL && !gui.in_use) + { + x_force_connect = TRUE; + setup_term_clip(); + x_force_connect = FALSE; + } + } + + static int check_connection() { + make_connection(); if (X_DISPLAY == NULL) { EMSG(_("E240: No connection to Vim server")); *************** *** 6625,6630 **** --- 6638,6644 ---- # ifdef WIN32 r = serverGetVimNames(); # else + make_connection(); if (X_DISPLAY != NULL) r = serverGetVimNames(X_DISPLAY); # endif *** ../vim-6.3a.016/src/globals.h Tue May 11 22:32:13 2004 --- src/globals.h Wed May 12 20:36:51 2004 *************** *** 174,179 **** --- 174,182 ---- #endif #if (defined(UNIX) || defined(VMS)) && defined(FEAT_X11) EXTERN int x_no_connect INIT(= FALSE); /* don't connect to X server */ + EXTERN int x_force_connect INIT(= FALSE); /* Do connect to X server. + Overrules x_no_connect and + "exclude" in 'clipboard'. */ #endif EXTERN int vgetc_busy INIT(= FALSE); /* inside vgetc() now */ *** ../vim-6.3a.016/src/os_unix.c Wed May 12 14:12:34 2004 --- src/os_unix.c Wed May 12 20:39:12 2004 *************** *** 1295,1300 **** --- 1295,1302 ---- { regmatch_T regmatch; + if (x_force_connect) + return TRUE; if (x_no_connect) return FALSE; *** ../vim-6.3a.016/src/version.c Wed May 12 18:26:17 2004 --- src/version.c Wed May 12 20:50:21 2004 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 17, /**/ -- There is a fine line between courage and foolishness. Unfortunately, it's not a fence. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///