From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: saveplace does not work with emacsclient Date: Tue, 15 Jan 2008 16:50:26 -0500 Message-ID: References: <20080106044814.1e6ff426.porta.mana@gmail.com> <87r6gtd1vm.fsf@red-bean.com> <20080107160124.6f4e9af1.piero.mana@physics.umu.se> <20080107200259.e64707f0.porta.mana@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1200433851 6816 80.91.229.12 (15 Jan 2008 21:50:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2008 21:50:51 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: P G L Porta Mana Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 15 22:51:13 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JEtgb-0000Lu-Sv for ged-emacs-devel@m.gmane.org; Tue, 15 Jan 2008 22:51:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEtgD-0006VZ-FL for ged-emacs-devel@m.gmane.org; Tue, 15 Jan 2008 16:50:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JEtg8-0006RH-Es for emacs-devel@gnu.org; Tue, 15 Jan 2008 16:50:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JEtg7-0006PE-Jr for emacs-devel@gnu.org; Tue, 15 Jan 2008 16:50:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEtg7-0006Ov-7B for emacs-devel@gnu.org; Tue, 15 Jan 2008 16:50:39 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JEtg6-0001JO-U3 for emacs-devel@gnu.org; Tue, 15 Jan 2008 16:50:39 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JEtg6-0002Bj-KJ for emacs-pretest-bug@gnu.org; Tue, 15 Jan 2008 16:50:38 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JEtg3-0001Iw-JW for emacs-pretest-bug@gnu.org; Tue, 15 Jan 2008 16:50:38 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JEtg3-0001Is-8o for emacs-pretest-bug@gnu.org; Tue, 15 Jan 2008 16:50:35 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id D94DC2CF321; Tue, 15 Jan 2008 16:50:32 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id D76623FE0; Tue, 15 Jan 2008 16:50:26 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id C20F26CA44; Tue, 15 Jan 2008 16:50:26 -0500 (EST) 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") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:86940 gmane.emacs.pretest.bugs:20664 Archived-At: >> 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.