home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.349 < prev    next >
Encoding:
Internet Message Format  |  2003-02-19  |  19.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.349
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.349
  11. Problem:    "vim --serverlist" when no server was ever started gives an error
  12.         message without "\n".
  13.         "vim --serverlist" doesn't exit when the X server can't be
  14.         contacted, it starts Vim unexpectedly. (Ricardo Signes)
  15. Solution:   Don't give an error when no Vim server was ever started.
  16.         Treat failing of opening the display equal to errors inside the
  17.         remote*() functions. (Flemming Madsen)
  18. Files:        src/if_xcmdsrv.c, src/main.c
  19.  
  20.  
  21. *** ../vim61.348/src/if_xcmdsrv.c    Mon Feb  4 12:26:26 2002
  22. --- src/if_xcmdsrv.c    Mon Feb 17 21:18:32 2003
  23. ***************
  24. *** 174,180 ****
  25.   static int    SendInit __ARGS((Display *dpy));
  26.   static int    DoRegisterName __ARGS((Display *dpy, char_u *name));
  27.   static void    DeleteAnyLingerer __ARGS((Display *dpy, Window w));
  28. ! static int    GetRegProp __ARGS((Display *dpy, char_u **regPropp, long_u *numItemsp, long_u *bytesAfterp, int msg));
  29.   static int    WaitForPend __ARGS((void *p));
  30.   static int    WaitForReply __ARGS((void *p));
  31.   static int    WindowValid __ARGS((Display *dpy, Window w));
  32. --- 174,180 ----
  33.   static int    SendInit __ARGS((Display *dpy));
  34.   static int    DoRegisterName __ARGS((Display *dpy, char_u *name));
  35.   static void    DeleteAnyLingerer __ARGS((Display *dpy, Window w));
  36. ! static int    GetRegProp __ARGS((Display *dpy, char_u **regPropp, long_u *numItemsp, int domsg));
  37.   static int    WaitForPend __ARGS((void *p));
  38.   static int    WaitForReply __ARGS((void *p));
  39.   static int    WindowValid __ARGS((Display *dpy, Window w));
  40. ***************
  41. *** 628,634 ****
  42.       char_u    *regProp;
  43.       char_u    *entry;
  44.       char_u    *p;
  45. !     long_u    numItems, bytesAfter;
  46.       int_u    w;
  47.       garray_T    ga;
  48.   
  49. --- 628,634 ----
  50.       char_u    *regProp;
  51.       char_u    *entry;
  52.       char_u    *p;
  53. !     long_u    numItems;
  54.       int_u    w;
  55.       garray_T    ga;
  56.   
  57. ***************
  58. *** 642,648 ****
  59.       /*
  60.        * Read the registry property.
  61.        */
  62. !     if (GetRegProp(dpy, ®Prop, &numItems, &bytesAfter, TRUE) == FAIL)
  63.       return NULL;
  64.   
  65.       /*
  66. --- 642,648 ----
  67.       /*
  68.        * Read the registry property.
  69.        */
  70. !     if (GetRegProp(dpy, ®Prop, &numItems, TRUE) == FAIL)
  71.       return NULL;
  72.   
  73.       /*
  74. ***************
  75. *** 913,925 ****
  76.   {
  77.       char_u    *regProp, *entry;
  78.       char_u    *p;
  79. !     long_u    numItems, bytesAfter;
  80.       int_u    returnValue;
  81.   
  82.       /*
  83.        * Read the registry property.
  84.        */
  85. !     if (GetRegProp(dpy, ®Prop, &numItems, &bytesAfter, FALSE) == FAIL)
  86.       return 0;
  87.   
  88.       /*
  89. --- 913,925 ----
  90.   {
  91.       char_u    *regProp, *entry;
  92.       char_u    *p;
  93. !     long_u    numItems;
  94.       int_u    returnValue;
  95.   
  96.       /*
  97.        * Read the registry property.
  98.        */
  99. !     if (GetRegProp(dpy, ®Prop, &numItems, FALSE) == FAIL)
  100.       return 0;
  101.   
  102.       /*
  103. ***************
  104. *** 1003,1015 ****
  105.   {
  106.       char_u    *regProp, *entry = NULL;
  107.       char_u    *p;
  108. !     long_u    numItems, bytesAfter;
  109.       Window    wwin;
  110.   
  111.       /*
  112.        * Read the registry property.
  113.        */
  114. !     if (GetRegProp(dpy, ®Prop, &numItems, &bytesAfter, FALSE) == FAIL)
  115.       return;
  116.   
  117.       /* Scan the property for the window id.  */
  118. --- 1003,1015 ----
  119.   {
  120.       char_u    *regProp, *entry = NULL;
  121.       char_u    *p;
  122. !     long_u    numItems;
  123.       Window    wwin;
  124.   
  125.       /*
  126.        * Read the registry property.
  127.        */
  128. !     if (GetRegProp(dpy, ®Prop, &numItems, FALSE) == FAIL)
  129.       return;
  130.   
  131.       /* Scan the property for the window id.  */
  132. ***************
  133. *** 1056,1083 ****
  134.    * Return OK when successful.
  135.    */
  136.       static int
  137. ! GetRegProp(dpy, regPropp, numItemsp, bytesAfterp, msg)
  138.       Display    *dpy;
  139.       char_u    **regPropp;
  140.       long_u    *numItemsp;
  141. !     long_u    *bytesAfterp;
  142. !     int        msg;        /* When TRUE give error message. */
  143.   {
  144.       int        result, actualFormat;
  145.       Atom    actualType;
  146.   
  147.       *regPropp = NULL;
  148.       result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0L,
  149.                   (long)MAX_PROP_WORDS, False,
  150.                   XA_STRING, &actualType,
  151. !                 &actualFormat, numItemsp, bytesAfterp,
  152.                   regPropp);
  153.   
  154.       if (actualType == None)
  155.       {
  156. !     if (msg)
  157. !         EMSG(_("E249: couldn't read VIM instance registry property"));
  158. !     return FAIL;
  159.       }
  160.   
  161.       /* If the property is improperly formed, then delete it. */
  162. --- 1056,1084 ----
  163.    * Return OK when successful.
  164.    */
  165.       static int
  166. ! GetRegProp(dpy, regPropp, numItemsp, domsg)
  167.       Display    *dpy;
  168.       char_u    **regPropp;
  169.       long_u    *numItemsp;
  170. !     int        domsg;        /* When TRUE give error message. */
  171.   {
  172.       int        result, actualFormat;
  173. +     long_u    bytesAfter;
  174.       Atom    actualType;
  175.   
  176.       *regPropp = NULL;
  177.       result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0L,
  178.                   (long)MAX_PROP_WORDS, False,
  179.                   XA_STRING, &actualType,
  180. !                 &actualFormat, numItemsp, &bytesAfter,
  181.                   regPropp);
  182.   
  183.       if (actualType == None)
  184.       {
  185. !     /* No prop yet. Logically equal to the empty list */
  186. !     *numItemsp = 0;
  187. !     *regPropp = (char_u *)"";
  188. !     return OK;
  189.       }
  190.   
  191.       /* If the property is improperly formed, then delete it. */
  192. ***************
  193. *** 1086,1092 ****
  194.       if (*regPropp != NULL)
  195.           XFree(*regPropp);
  196.       XDeleteProperty(dpy, RootWindow(dpy, 0), registryProperty);
  197. !     if (msg)
  198.           EMSG(_("E251: VIM instance registry property is badly formed.  Deleted!"));
  199.       return FAIL;
  200.       }
  201. --- 1087,1093 ----
  202.       if (*regPropp != NULL)
  203.           XFree(*regPropp);
  204.       XDeleteProperty(dpy, RootWindow(dpy, 0), registryProperty);
  205. !     if (domsg)
  206.           EMSG(_("E251: VIM instance registry property is badly formed.  Deleted!"));
  207.       return FAIL;
  208.       }
  209. *** ../vim61.348/src/main.c    Tue Feb  4 20:07:52 2003
  210. --- src/main.c    Mon Feb 17 21:13:53 2003
  211. ***************
  212. *** 2380,2387 ****
  213.   # endif
  214.   #endif
  215.   #ifdef FEAT_CLIENTSERVER
  216. !     main_msg(_("--remote <files>\tEdit <files> in a Vim server and exit"));
  217.       main_msg(_("--remote-wait <files>  As --remote but wait for files to have been edited"));
  218.       main_msg(_("--remote-send <keys>\tSend <keys> to a Vim server and exit"));
  219.       main_msg(_("--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"));
  220.       main_msg(_("--serverlist\t\tList available Vim server names and exit"));
  221. --- 2395,2404 ----
  222.   # endif
  223.   #endif
  224.   #ifdef FEAT_CLIENTSERVER
  225. !     main_msg(_("--remote <files>\tEdit <files> in a Vim server if possible"));
  226. !     main_msg(_("--remote-silent <files>  Same, don't complain if there is no server"));
  227.       main_msg(_("--remote-wait <files>  As --remote but wait for files to have been edited"));
  228. +     main_msg(_("--remote-wait-silent <files>  Same, don't complain if there is no server"));
  229.       main_msg(_("--remote-send <keys>\tSend <keys> to a Vim server and exit"));
  230.       main_msg(_("--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"));
  231.       main_msg(_("--serverlist\t\tList available Vim server names and exit"));
  232. ***************
  233. *** 2606,2804 ****
  234.       if (sname == NULL)
  235.       return;
  236.   
  237. ! # ifdef FEAT_X11
  238. !     if (xterm_dpy != NULL)    /* Win32 always works? */
  239. ! # endif
  240.       {
  241. !     /*
  242. !      * Execute the command server related arguments and remove them
  243. !      * from the argc/argv array; We may have to return into main()
  244. !      */
  245. !     for (i = 1; i < Argc; i++)
  246.       {
  247. !         res = NULL;
  248. !         if (STRCMP(argv[i], "--") == 0)    /* end of options */
  249.           {
  250. !         for (; i < *argc; i++)
  251. !         {
  252. !             *newArgV++ = argv[i];
  253. !             newArgC++;
  254. !         }
  255. !         break;
  256.           }
  257.   
  258. !         if (STRICMP(argv[i], "--remote") == 0)
  259. !         argtype = ARGTYPE_EDIT;
  260. !         else if (STRICMP(argv[i], "--remote-silent") == 0)
  261. !         {
  262. !         argtype = ARGTYPE_EDIT;
  263. !         silent = TRUE;
  264. !         }
  265. !         else if (STRICMP(argv[i], "--remote-wait") == 0)
  266. !         argtype = ARGTYPE_EDIT_WAIT;
  267. !         else if (STRICMP(argv[i], "--remote-wait-silent") == 0)
  268.           {
  269. !         argtype = ARGTYPE_EDIT_WAIT;
  270. !         silent = TRUE;
  271.           }
  272. -         else if (STRICMP(argv[i], "--remote-send") == 0)
  273. -         argtype = ARGTYPE_SEND;
  274.           else
  275. -         argtype = ARGTYPE_OTHER;
  276. -         if (argtype != ARGTYPE_OTHER)
  277.           {
  278. !         if (i == *argc - 1)
  279. !             mainerr_arg_missing((char_u *)argv[i]);
  280. !         if (argtype == ARGTYPE_SEND)
  281. !         {
  282. !             *serverStr = (char_u *)argv[i + 1];
  283. !             i++;
  284. !         }
  285. !         else
  286. !         {
  287. !             *serverStr = build_drop_cmd(*argc - i - 1, argv + i + 1,
  288.                           argtype == ARGTYPE_EDIT_WAIT);
  289. !             if (*serverStr == NULL)
  290. !             {
  291. !             /* Probably out of memory, exit. */
  292. !             didone = TRUE;
  293. !             exiterr = 1;
  294. !             break;
  295. !             }
  296. !             Argc = i;
  297.           }
  298.   # ifdef FEAT_X11
  299.           ret = serverSendToVim(xterm_dpy, sname, *serverStr,
  300.                               NULL, &srv, 0, 0, silent);
  301.   # else
  302. !         ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0, silent);
  303.   # endif
  304. !         if (ret < 0)
  305.           {
  306. !             if (argtype == ARGTYPE_SEND)
  307. !             {
  308. !             /* Failed to send, abort. */
  309. !             mch_errmsg(_("\nSend failed.\n"));
  310. !             didone = TRUE;
  311. !             exiterr = 1;
  312. !             }
  313. !             else if (!silent)
  314. !             /* Let vim start normally.  */
  315. !             mch_errmsg(_("\nSend failed. Trying to execute locally\n"));
  316. !             break;
  317.           }
  318.   
  319.   # ifdef FEAT_GUI_W32
  320. !         /* Guess that when the server name starts with "g" it's a GUI
  321. !          * server, which we can bring to the foreground here.
  322. !          * Foreground() in the server doesn't work very well. */
  323. !         if (argtype != ARGTYPE_SEND && TOUPPER_ASC(*sname) == 'G')
  324. !             SetForegroundWindow(srv);
  325.   # endif
  326.   
  327. !         /*
  328. !          * For --remote-wait: Wait until the server did edit each
  329. !          * file.  Also detect that the server no longer runs.
  330. !          */
  331. !         if (ret >= 0 && argtype == ARGTYPE_EDIT_WAIT)
  332. !         {
  333. !             int        numFiles = *argc - i - 1;
  334. !             int        j;
  335. !             char_u  *done = alloc(numFiles);
  336. !             char_u  *p;
  337.   # ifdef FEAT_GUI_W32
  338. !             NOTIFYICONDATA ni;
  339. !             int count = 0;
  340. !             extern HWND message_window;
  341. !             ni.cbSize = sizeof(ni);
  342. !             ni.hWnd = message_window;
  343. !             ni.uID = 0;
  344. !             ni.uFlags = NIF_ICON|NIF_TIP;
  345. !             ni.hIcon = LoadIcon((HINSTANCE)GetModuleHandle(0),
  346. !                                    "IDR_VIM");
  347. !             sprintf(ni.szTip, _("%d of %d edited"), count, numFiles);
  348. !             Shell_NotifyIcon(NIM_ADD, &ni);
  349. ! # endif
  350. !             /* Wait for all files to unload in remote */
  351. !             memset(done, 0, numFiles);
  352. !             while (memchr(done, 0, numFiles) != NULL)
  353. !             {
  354.   # ifdef WIN32
  355. !             p = serverGetReply(srv, NULL, TRUE, TRUE);
  356. !             if (p == NULL)
  357. !                 break;
  358.   # else
  359. !             if (serverReadReply(xterm_dpy, srv, &p, TRUE) < 0)
  360. !                 break;
  361.   # endif
  362. !             j = atoi((char *)p);
  363. !             if (j >= 0 && j < numFiles)
  364. !             {
  365.   # ifdef FEAT_GUI_W32
  366. !                 ++count;
  367. !                 sprintf(ni.szTip, _("%d of %d edited"),
  368.                                    count, numFiles);
  369. !                 Shell_NotifyIcon(NIM_MODIFY, &ni);
  370.   # endif
  371. !                 done[j] = 1;
  372. !             }
  373.               }
  374.   # ifdef FEAT_GUI_W32
  375. !             Shell_NotifyIcon(NIM_DELETE, &ni);
  376.   # endif
  377. -         }
  378.           }
  379. !         else if (STRICMP(argv[i], "--remote-expr") == 0)
  380. !         {
  381. !         if (i == *argc - 1)
  382. !             mainerr_arg_missing((char_u *)argv[i]);
  383.   # ifdef WIN32
  384. !         if (serverSendToVim(sname, (char_u *)argv[i + 1],
  385.                               &res, NULL, 1, FALSE) < 0)
  386.   # else
  387. !         if (serverSendToVim(xterm_dpy, sname, (char_u *)argv[i + 1],
  388.                            &res, NULL, 1, 1, FALSE) < 0)
  389.   # endif
  390. -             mch_errmsg(_("Send expression failed.\n"));
  391. -         }
  392. -         else if (STRICMP(argv[i], "--serverlist") == 0)
  393.           {
  394.   # ifdef WIN32
  395. !         res = serverGetVimNames();
  396. ! #else
  397.           res = serverGetVimNames(xterm_dpy);
  398. ! #endif
  399. !         }
  400. !         else if (STRICMP(argv[i], "--servername") == 0)
  401. !         {
  402. !         /* Alredy processed. Take it out of the command line */
  403. !         i++;
  404. !         continue;
  405. !         }
  406. !         else
  407. !         {
  408. !         *newArgV++ = argv[i];
  409. !         newArgC++;
  410. !         continue;
  411. !         }
  412. !         didone = TRUE;
  413. !         if (res != NULL && *res != NUL)
  414. !         {
  415. !         mch_msg((char *)res);
  416. !         if (res[STRLEN(res) - 1] != '\n')
  417. !             mch_msg("\n");
  418. !         }
  419. !         vim_free(res);
  420.       }
  421. !     if (didone)
  422.       {
  423. !         display_errors();    /* display any collected messages */
  424. !         exit(exiterr);    /* Mission accomplished - get out */
  425.       }
  426.       }
  427.       /* Return back into main() */
  428.       *argc = newArgC;
  429.       vim_free(sname);
  430. --- 2623,2839 ----
  431.       if (sname == NULL)
  432.       return;
  433.   
  434. !     /*
  435. !      * Execute the command server related arguments and remove them
  436. !      * from the argc/argv array; We may have to return into main()
  437. !      */
  438. !     for (i = 1; i < Argc; i++)
  439.       {
  440. !     res = NULL;
  441. !     if (STRCMP(argv[i], "--") == 0)    /* end of options */
  442.       {
  443. !         for (; i < *argc; i++)
  444.           {
  445. !         *newArgV++ = argv[i];
  446. !         newArgC++;
  447.           }
  448. +         break;
  449. +     }
  450.   
  451. !     if (STRICMP(argv[i], "--remote") == 0)
  452. !         argtype = ARGTYPE_EDIT;
  453. !     else if (STRICMP(argv[i], "--remote-silent") == 0)
  454. !     {
  455. !         argtype = ARGTYPE_EDIT;
  456. !         silent = TRUE;
  457. !     }
  458. !     else if (STRICMP(argv[i], "--remote-wait") == 0)
  459. !         argtype = ARGTYPE_EDIT_WAIT;
  460. !     else if (STRICMP(argv[i], "--remote-wait-silent") == 0)
  461. !     {
  462. !         argtype = ARGTYPE_EDIT_WAIT;
  463. !         silent = TRUE;
  464. !     }
  465. !     else if (STRICMP(argv[i], "--remote-send") == 0)
  466. !         argtype = ARGTYPE_SEND;
  467. !     else
  468. !         argtype = ARGTYPE_OTHER;
  469. !     if (argtype != ARGTYPE_OTHER)
  470. !     {
  471. !         if (i == *argc - 1)
  472. !         mainerr_arg_missing((char_u *)argv[i]);
  473. !         if (argtype == ARGTYPE_SEND)
  474.           {
  475. !         *serverStr = (char_u *)argv[i + 1];
  476. !         i++;
  477.           }
  478.           else
  479.           {
  480. !         *serverStr = build_drop_cmd(*argc - i - 1, argv + i + 1,
  481.                           argtype == ARGTYPE_EDIT_WAIT);
  482. !         if (*serverStr == NULL)
  483. !         {
  484. !             /* Probably out of memory, exit. */
  485. !             didone = TRUE;
  486. !             exiterr = 1;
  487. !             break;
  488.           }
  489. +         Argc = i;
  490. +         }
  491.   # ifdef FEAT_X11
  492. +         if (xterm_dpy == NULL)
  493. +         {
  494. +         mch_errmsg(_("No display"));
  495. +         ret = -1;
  496. +         }
  497. +         else
  498.           ret = serverSendToVim(xterm_dpy, sname, *serverStr,
  499.                               NULL, &srv, 0, 0, silent);
  500.   # else
  501. !         /* Win32 always works? */
  502. !         ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0, silent);
  503.   # endif
  504. !         if (ret < 0)
  505. !         {
  506. !         if (argtype == ARGTYPE_SEND)
  507.           {
  508. !             /* Failed to send, abort. */
  509. !             mch_errmsg(_(": Send failed.\n"));
  510. !             didone = TRUE;
  511. !             exiterr = 1;
  512.           }
  513. +         else if (!silent)
  514. +             /* Let vim start normally.  */
  515. +             mch_errmsg(_(": Send failed. Trying to execute locally\n"));
  516. +         break;
  517. +         }
  518.   
  519.   # ifdef FEAT_GUI_W32
  520. !         /* Guess that when the server name starts with "g" it's a GUI
  521. !          * server, which we can bring to the foreground here.
  522. !          * Foreground() in the server doesn't work very well. */
  523. !         if (argtype != ARGTYPE_SEND && TOUPPER_ASC(*sname) == 'G')
  524. !         SetForegroundWindow(srv);
  525.   # endif
  526.   
  527. !         /*
  528. !          * For --remote-wait: Wait until the server did edit each
  529. !          * file.  Also detect that the server no longer runs.
  530. !          */
  531. !         if (ret >= 0 && argtype == ARGTYPE_EDIT_WAIT)
  532. !         {
  533. !         int    numFiles = *argc - i - 1;
  534. !         int    j;
  535. !         char_u  *done = alloc(numFiles);
  536. !         char_u  *p;
  537.   # ifdef FEAT_GUI_W32
  538. !         NOTIFYICONDATA ni;
  539. !         int    count = 0;
  540. !         extern HWND message_window;
  541. !         ni.cbSize = sizeof(ni);
  542. !         ni.hWnd = message_window;
  543. !         ni.uID = 0;
  544. !         ni.uFlags = NIF_ICON|NIF_TIP;
  545. !         ni.hIcon = LoadIcon((HINSTANCE)GetModuleHandle(0), "IDR_VIM");
  546. !         sprintf(ni.szTip, _("%d of %d edited"), count, numFiles);
  547. !         Shell_NotifyIcon(NIM_ADD, &ni);
  548. ! # endif
  549. !         /* Wait for all files to unload in remote */
  550. !         memset(done, 0, numFiles);
  551. !         while (memchr(done, 0, numFiles) != NULL)
  552. !         {
  553.   # ifdef WIN32
  554. !             p = serverGetReply(srv, NULL, TRUE, TRUE);
  555. !             if (p == NULL)
  556. !             break;
  557.   # else
  558. !             if (serverReadReply(xterm_dpy, srv, &p, TRUE) < 0)
  559. !             break;
  560.   # endif
  561. !             j = atoi((char *)p);
  562. !             if (j >= 0 && j < numFiles)
  563. !             {
  564.   # ifdef FEAT_GUI_W32
  565. !             ++count;
  566. !             sprintf(ni.szTip, _("%d of %d edited"),
  567.                                    count, numFiles);
  568. !             Shell_NotifyIcon(NIM_MODIFY, &ni);
  569.   # endif
  570. !             done[j] = 1;
  571.               }
  572. +         }
  573.   # ifdef FEAT_GUI_W32
  574. !         Shell_NotifyIcon(NIM_DELETE, &ni);
  575.   # endif
  576.           }
  577. !     }
  578. !     else if (STRICMP(argv[i], "--remote-expr") == 0)
  579. !     {
  580. !         if (i == *argc - 1)
  581. !         mainerr_arg_missing((char_u *)argv[i]);
  582.   # ifdef WIN32
  583. !         /* Win32 always works? */
  584. !         if (serverSendToVim(sname, (char_u *)argv[i + 1],
  585.                               &res, NULL, 1, FALSE) < 0)
  586.   # else
  587. !         if (xterm_dpy == NULL)
  588. !         mch_errmsg(_("No display: Send expression failed.\n"));
  589. !         else if (serverSendToVim(xterm_dpy, sname, (char_u *)argv[i + 1],
  590.                            &res, NULL, 1, 1, FALSE) < 0)
  591.   # endif
  592.           {
  593. +         if (res != NULL && *res != NUL)
  594. +         {
  595. +             /* Output error from remote */
  596. +             mch_errmsg((char *)res);
  597. +             vim_free(res);
  598. +             res = NULL;
  599. +         }
  600. +         mch_errmsg(_(": Send expression failed.\n"));
  601. +         }
  602. +     }
  603. +     else if (STRICMP(argv[i], "--serverlist") == 0)
  604. +     {
  605.   # ifdef WIN32
  606. !         /* Win32 always works? */
  607. !         res = serverGetVimNames();
  608. ! # else
  609. !         if (xterm_dpy != NULL)
  610.           res = serverGetVimNames(xterm_dpy);
  611. ! # endif
  612. !         if (called_emsg)
  613. !         mch_errmsg("\n");
  614.       }
  615. !     else if (STRICMP(argv[i], "--servername") == 0)
  616. !     {
  617. !         /* Alredy processed. Take it out of the command line */
  618. !         i++;
  619. !         continue;
  620. !     }
  621. !     else
  622.       {
  623. !         *newArgV++ = argv[i];
  624. !         newArgC++;
  625. !         continue;
  626.       }
  627. +     didone = TRUE;
  628. +     if (res != NULL && *res != NUL)
  629. +     {
  630. +         mch_msg((char *)res);
  631. +         if (res[STRLEN(res) - 1] != '\n')
  632. +         mch_msg("\n");
  633. +     }
  634. +     vim_free(res);
  635. +     }
  636. +     if (didone)
  637. +     {
  638. +     display_errors();    /* display any collected messages */
  639. +     exit(exiterr);    /* Mission accomplished - get out */
  640.       }
  641.       /* Return back into main() */
  642.       *argc = newArgC;
  643.       vim_free(sname);
  644. ***************
  645. *** 2890,2899 ****
  646.       /* Set 'cpoptions' the way we want it.
  647.        *    B set - backslashes are *not* treated specially
  648.        *    k set - keycodes are *not* reverse-engineered
  649. !      *    < unset - <Key> sequenecs *are* interpreted
  650. !      *  last parameter of replace_termcodes() is TRUE so that
  651. !      *  the <lt> sequence is recognised - needed as backslash
  652. !      *  is not special...
  653.        */
  654.       p_cpo = (char_u *)"Bk";
  655.       str = replace_termcodes((char_u *)str, &ptr, FALSE, TRUE);
  656. --- 2925,2933 ----
  657.       /* Set 'cpoptions' the way we want it.
  658.        *    B set - backslashes are *not* treated specially
  659.        *    k set - keycodes are *not* reverse-engineered
  660. !      *    < unset - <Key> sequences *are* interpreted
  661. !      *  The last parameter of replace_termcodes() is TRUE so that the <lt>
  662. !      *  sequence is recognised - needed for a real backslash.
  663.        */
  664.       p_cpo = (char_u *)"Bk";
  665.       str = replace_termcodes((char_u *)str, &ptr, FALSE, TRUE);
  666. *** ../vim61.348/src/version.c    Thu Feb 20 21:44:37 2003
  667. --- src/version.c    Thu Feb 20 21:50:42 2003
  668. ***************
  669. *** 608,609 ****
  670. --- 612,615 ----
  671.   {   /* Add new patch number below this line */
  672. + /**/
  673. +     349,
  674.   /**/
  675.  
  676. -- 
  677.     [clop clop]
  678. GUARD #1:  Halt!  Who goes there?
  679. ARTHUR:    It is I, Arthur, son of Uther Pendragon, from the castle of
  680.            Camelot.  King of the Britons, defeator of the Saxons, sovereign of
  681.            all England!
  682. GUARD #1:  Pull the other one!
  683.                                   The Quest for the Holy Grail (Monty Python)
  684.  
  685.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  686. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  687. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  688.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  689.