all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: P G L Porta Mana <porta.mana@gmail.com>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: saveplace does not work with emacsclient
Date: Tue, 15 Jan 2008 16:50:26 -0500	[thread overview]
Message-ID: <jwvzlv6iwso.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20080107200259.e64707f0.porta.mana@gmail.com> (P. G. L. Porta Mana's message of "Mon, 7 Jan 2008 20:02:59 +0100")

>> I have temporarily fixed the bug now, by setting
>> 
>> (setq server-visit-hook (quote (save-place-find-file-hook)))
>> 
>> in my .emacs file. I must yet see whether this interferes with inverse
>> search, ie when emacsclient(w) is called with the +[line] option.

> No, it doesn't interfere, so it's a good solution for the moment.
> Something similar should preferably be present either in saveplace.el or
> in server.el.

Can you try the patch below (and remove your temporary workaround of
course) and tell us if it fixes the problem?


        Stefan


--- orig/lisp/server.el
+++ mod/lisp/server.el
@@ -805,8 +805,8 @@
                 (tty-name nil)       ;nil, `window-system', or the tty name.
                 tty-type             ;string.
 		(files nil)
-		(lineno 1)
-		(columnno 0)
+		(lineno nil)
+		(columnno nil)
 		command-line-args-left
 		arg)
 	    ;; Remove this line from STRING.
@@ -889,9 +889,10 @@
 		    (setq file (command-line-normalize-file-name file))
 		    (push (list file lineno columnno) files)
 		    (server-log (format "New file: %s (%d:%d)"
-                                        file lineno columnno) proc))
-		  (setq lineno 1
-			columnno 0))
+                                        file (or lineno 0) (or columnno 0))
+                                proc))
+		  (setq lineno nil
+			columnno nil))
 
 		 ;; -eval EXPR:  Evaluate a Lisp expression.
 		 ((and (equal "-eval" arg)
@@ -901,8 +902,8 @@
 			(setq expr (decode-coding-string expr coding-system)))
                     (push (lambda () (server-eval-and-print expr proc))
                           commands)
-		    (setq lineno 1
-			  columnno 0)))
+		    (setq lineno nil
+			  columnno nil)))
 
 		 ;; -env NAME=VALUE:  An environment variable.
 		 ((and (equal "-env" arg) command-line-args-left)
@@ -995,10 +996,11 @@
   "Move point to the position indicated in FILE-LINE-COL.
 FILE-LINE-COL should be a three-element list as described in
 `server-visit-files'."
-  (goto-line (nth 1 file-line-col))
-  (let ((column-number (nth 2 file-line-col)))
-    (when (> column-number 0)
-      (move-to-column (1- column-number)))))
+  (when (nth 1 file-line-col)
+    (goto-line (nth 1 file-line-col))
+    (let ((column-number (nth 2 file-line-col)))
+      (when (> column-number 0)
+        (move-to-column (1- column-number))))))
 
 (defun server-visit-files (files proc &optional nowait)
   "Find FILES and return a list of buffers created.

      reply	other threads:[~2008-01-15 21:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-06  3:48 saveplace does not work with emacsclient P G L Porta Mana
2008-01-07 16:41 ` Karl Fogel
2008-01-07 14:55   ` Juanma Barranquero
2008-01-07 15:01   ` P G L Porta Mana
2008-01-07 19:02     ` P G L Porta Mana
2008-01-15 21:50       ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvzlv6iwso.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=porta.mana@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.