emacs-devel
[Top][All Lists]
Advanced

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

emacsclient on already opened files changes point


From: Denis Stuenkel
Subject: emacsclient on already opened files changes point
Date: Thu, 22 Feb 2007 19:11:18 +0100

Hi,

when you invoke emacsclient (without +line:column argument) with
a file that is already loaded in a buffer, the buffer is
displayed and the point is moved to the beginning of the file.

Is this intended?  I think the point should only be moved when
specified, otherwise staying where it was.

I did this with a few changes to server.el:

--- server.el.orig      2007-02-22 18:40:22.000000000 +0100
+++ server.el   2007-02-22 18:44:13.000000000 +0100
@@ -423,7 +423,7 @@
                                  default-file-name-coding-system)))
          client nowait eval
          (files nil)
-         (lineno 1)
+         (lineno 0)
          (tmp-frame nil) ;; Sometimes used to embody the selected display.
          (columnno 0))
       ;; Remove this line from STRING.
@@ -502,8 +502,10 @@
     (process-put proc :previous-string string)))
 
 (defun server-goto-line-column (file-line-col)
-  (goto-line (nth 1 file-line-col))
-  (let ((column-number (nth 2 file-line-col)))
+  (let ((line-number (nth 1 file-line-col))
+       (column-number (nth 2 file-line-col)))
+    (when (> line-number 0)
+      (goto-line line-number))
     (when (> column-number 0)
       (move-to-column (1- column-number)))))





reply via email to

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