[Top][All Lists]

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

[Emacs-diffs] Changes to emacs/lisp/server.el,v

From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/server.el,v
Date: Sat, 06 Sep 2008 17:17:07 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/09/06 17:17:06

Index: server.el
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -b -r1.166 -r1.167
--- server.el   6 May 2008 07:57:49 -0000       1.166
+++ server.el   6 Sep 2008 17:17:05 -0000       1.167
@@ -986,7 +986,7 @@
           (message "%s" (substitute-command-keys
                          "When done with this frame, type \\[delete-frame]")))
          ((not (null buffers))
-          (server-switch-buffer (car buffers))
+          (server-switch-buffer (car buffers) nil (cdr (car files)))
           (run-hooks 'server-switch-hook)
           (unless nowait
             (message "%s" (substitute-command-keys
@@ -1206,14 +1206,18 @@
     (server-clients (apply 'server-switch-buffer (server-done)))
     (t (message "No server editing buffers exist"))))
-(defun server-switch-buffer (&optional next-buffer killed-one)
+(defun server-switch-buffer (&optional next-buffer killed-one filepos)
   "Switch to another buffer, preferably one that has a client.
 Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it.
 KILLED-ONE is t in a recursive call if we have already killed one
 temp-file server buffer.  This means we should avoid the final
 \"switch to some other buffer\" since we've already effectively
-done that."
+done that.
+FILEPOS specifies a new buffer position for NEXT-BUFFER, if we
+visit NEXT-BUFFER in an existing window.  If non-nil, it should
+be a cons cell (LINENUMBER . COLUMNNUMBER)."
   (if (null next-buffer)
        (let ((rest server-clients))
@@ -1238,10 +1242,14 @@
          (funcall server-window next-buffer)
        (let ((win (get-buffer-window next-buffer 0)))
          (if (and win (not server-window))
-             ;; The buffer is already displayed: just reuse the window.
+             ;; The buffer is already displayed: just reuse the
+             ;; window.  If FILEPOS is non-nil, use it to replace the
+             ;; window's own value of point.
                 (select-window win)
-                (set-buffer next-buffer))
+                (set-buffer next-buffer)
+               (when filepos
+                 (server-goto-line-column filepos)))
            ;; Otherwise, let's find an appropriate window.
            (cond ((window-live-p server-window)
                   (select-window server-window))

reply via email to

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