emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101688: lisp/server.el: Use just one


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101688: lisp/server.el: Use just one way to pass the Emacs PID to emacsclient.
Date: Thu, 30 Sep 2010 04:53:26 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101688
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Thu 2010-09-30 04:53:26 +0200
message:
  lisp/server.el: Use just one way to pass the Emacs PID to emacsclient.
  
  * lib-src/emacsclient.c (get_server_config): Don't read Emacs pid from
    the authentication file.
  
  * lisp/server.el (server-start): Don't write pid to the authentication file.
    (server-create-tty-frame): Don't send pid.
    (server-process-filter): Send pid at the start of every connection.
modified:
  lib-src/ChangeLog
  lib-src/emacsclient.c
  lisp/ChangeLog
  lisp/server.el
=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2010-09-29 15:07:34 +0000
+++ b/lib-src/ChangeLog 2010-09-30 02:53:26 +0000
@@ -1,3 +1,8 @@
+2010-09-30  Juanma Barranquero  <address@hidden>
+
+       * emacsclient.c (get_server_config): Don't read Emacs pid from
+       the authentication file.
+
 2010-09-29  Juanma Barranquero  <address@hidden>
 
        * makefile.w32-in (../src/config.h): Remove target, it is stale.

=== modified file 'lib-src/emacsclient.c'
--- a/lib-src/emacsclient.c     2010-09-29 08:18:40 +0000
+++ b/lib-src/emacsclient.c     2010-09-30 02:53:26 +0000
@@ -910,14 +910,13 @@
 
 /*
  * Read the information needed to set up a TCP comm channel with
- * the Emacs server: host, port, pid and authentication string.
+ * the Emacs server: host, port, and authentication string.
  */
 int
 get_server_config (struct sockaddr_in *server, char *authentication)
 {
   char dotted[32];
   char *port;
-  char *pid;
   FILE *config = NULL;
 
   if (file_name_absolute_p (server_file))
@@ -948,12 +947,8 @@
     return FALSE;
 
   if (fgets (dotted, sizeof dotted, config)
-      && (port = strchr (dotted, ':'))
-      && (pid = strchr (port, ' ')))
-    {
-      *port++ = '\0';
-      *pid++  = '\0';
-    }
+      && (port = strchr (dotted, ':')))
+    *port++ = '\0';
   else
     {
       message (TRUE, "%s: invalid configuration info\n", progname);
@@ -972,8 +967,6 @@
 
   fclose (config);
 
-  emacs_pid = atoi (pid);
-
   return TRUE;
 }
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-09-30 02:18:24 +0000
+++ b/lisp/ChangeLog    2010-09-30 02:53:26 +0000
@@ -1,3 +1,9 @@
+2010-09-30  Juanma Barranquero  <address@hidden>
+
+       * server.el (server-start): Don't write pid to the authentication file.
+       (server-create-tty-frame): Don't send pid.
+       (server-process-filter): Send pid at the start of every connection.
+
 2010-09-30  Glenn Morris  <address@hidden>
 
        * calendar/diary-lib.el (view-diary-entries, list-diary-entries)

=== modified file 'lisp/server.el'
--- a/lisp/server.el    2010-09-25 00:32:09 +0000
+++ b/lisp/server.el    2010-09-30 02:53:26 +0000
@@ -586,7 +586,6 @@
                (setq buffer-file-coding-system 'no-conversion)
                (insert (format-network-address
                         (process-contact server-process :local))
-                       " " (int-to-string (emacs-pid))
                        "\n" auth-key)))))))))
 
 ;;;###autoload
@@ -706,9 +705,6 @@
     ;; Display *scratch* by default.
     (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
 
-    ;; Reply with our pid.
-    (server-send-string proc (concat "-emacs-pid "
-                                     (number-to-string (emacs-pid)) "\n"))
     frame))
 
 (defun server-create-window-system-frame (display nowait proc parent-id)
@@ -889,6 +885,9 @@
   (condition-case err
       (progn
        (server-add-client proc)
+       ;; Send our pid
+       (server-send-string proc (concat "-emacs-pid "
+                                        (number-to-string (emacs-pid)) "\n"))
        (if (not (string-match "\n" string))
             ;; Save for later any partial line that remains.
             (when (> (length string) 0)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]