GNU bug report logs - #6910
23: hl-line-mode fails to work with emacsclient

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Wed, 25 Aug 2010 14:01:01 UTC

Severity: normal

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: David Reitter <david.reitter <at> gmail.com>
To: 6910 <at> debbugs.gnu.org
Cc: konrad.podczeck <at> univie.ac.at
Subject: bug#6910: 23: hl-line-mode fails to work with emacsclient
Date: Wed, 25 Aug 2010 10:02:20 -0400
X-debbugs-cc: konrad.podczeck <at> univie.ac.at

The report below points out, in essence, that when we jump to a line with an emacsclient command such as

emacsclient --no-wait +55 "~/foo.tex"

then the line highlighting is not updated in hl-line-mode.

This turns out to be due to server-execute running the post-command-hooks without the right buffers being current, and hl-line-mode defines buffer-local hooks.   The patch below addresses that and I'm going to commit it unless somebody objects.


diff --git a/lisp/server.el b/lisp/server.el
index aadaeae..1905f70 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1083,8 +1083,7 @@ The following commands are accepted by the client:
         (let* ((buffers
                 (when files
                   (run-hooks 'pre-command-hook)
-                  (prog1 (server-visit-files files proc nowait)
-                    (run-hooks 'post-command-hook)))))
+                  (server-visit-files files proc nowait))))
 
           (mapc 'funcall (nreverse commands))
 
@@ -1169,7 +1168,8 @@ so don't mark these buffers specially, just visit them normally."
             (unless server-buffer-clients
               (setq server-existing-buffer t)))
           (server-goto-line-column (cdr file))
-          (run-hooks 'server-visit-hook))
+          (run-hooks 'server-visit-hook)
+	  (run-hooks 'post-command-hook)) ;; hooks may be specific to current buffer
 	(unless nowait
 	  ;; When the buffer is killed, inform the clients.
 	  (add-hook 'kill-buffer-hook 'server-kill-buffer nil t)



Begin forwarded message:

> From: Konrad Podczeck <konrad.podczeck <at> univie.ac.at>
> Date: August 23, 2010 4:22:54 PM EDT
> To: aquamacs-devel <at> aquamacs.org
> Cc: Reitter David <david.reitter <at> gmail.com>
> Subject: Syncing from Skim to Aquamacs and HL-line mode don't work together
> 
> Hi David,
> 
> I observe the following with the actual Aquamacs (in contrast to the 2.0 distribution):
> 
> Turn HL-line mode on. Syncing from Skim (or Xdvi) to Aquamacs makes the cursor going to the appropriate line, however the line does not get highlighted. 
> 
> Konrad





This bug report was last modified 14 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.