changeset 37273:e558d3f235fd

(server-visit-files): Set server-existing-buffer correctly. (server-visit-files): Run server-visit-hook after going to line 1 so that the hook can set point as it sees fit.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 09 Apr 2001 14:29:17 +0000
parents 8b4e6ceca824
children 686cd6704f1a
files lisp/server.el
diffstat 1 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Mon Apr 09 12:38:20 2001 +0000
+++ b/lisp/server.el	Mon Apr 09 14:29:17 2001 +0000
@@ -1,6 +1,6 @@
 ;;; server.el --- Lisp code for GNU Emacs running as server process.
 
-;; Copyright (C) 1986, 87, 92, 94, 95, 96, 97, 98, 99, 2000
+;; Copyright (C) 1986, 87, 92, 94, 95, 96, 97, 98, 99, 2000, 2001
 ;;	 Free Software Foundation, Inc.
 
 ;; Author: William Sommerfeld <wesommer@athena.mit.edu>
@@ -310,20 +310,22 @@
 		 (obuf (get-file-buffer filen)))
 	    (push filen file-name-history)
 	    (if (and obuf (set-buffer obuf))
-		(cond ((file-exists-p filen)
-		       (if (or (not (verify-visited-file-modtime obuf))
-			       (buffer-modified-p obuf))
-			   (revert-buffer t nil)))
-		      (t
-		       (if (y-or-n-p
-			    (concat "File no longer exists: "
-				    filen
-				    ", write buffer to file? "))
-			   (write-file filen))))
+		(progn
+		  (cond ((file-exists-p filen)
+			 (if (or (not (verify-visited-file-modtime obuf))
+				 (buffer-modified-p obuf))
+			     (revert-buffer t nil)))
+			(t
+			 (if (y-or-n-p
+			      (concat "File no longer exists: "
+				      filen
+				      ", write buffer to file? "))
+			     (write-file filen))))
+		  (setq server-existing-buffer t)
+		  (goto-line (nth 1 (car files))))
 	      (set-buffer (find-file-noselect filen))
-	      (setq server-existing-buffer t)
+	      (goto-line (nth 1 (car files)))
 	      (run-hooks 'server-visit-hook)))
-	  (goto-line (nth 1 (car files)))
 	  (if (not nowait)
 	      (setq server-buffer-clients
 		    (cons (car client) server-buffer-clients)))