bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: hl-line-mode is buffer-local in spite of its documentation


From: Kevin Rodgers
Subject: Re: hl-line-mode is buffer-local in spite of its documentation
Date: Mon, 08 Sep 2003 10:05:13 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Peter S Galbraith wrote:

hl-line.el says that `hl-line-mode' is a global mode and that:

;; You could make variable `hl-line-mode' buffer-local to avoid
;; highlighting specific buffers.

but somehow hl-line-mode is always a buffer-local variable after
invoking `emacs21 -q --no-site-file'.  The side-effect is that it
doesn't work as expected.  If you turn it on, it is enabled in only
that buffer and not globally.


That's a documentation bug:

*** emacs-21.3/lisp/hl-line.el.orig     Sun Aug 26 06:08:58 2001
--- emacs-21.3/lisp/hl-line.el  Mon Sep  8 09:58:00 2003
***************
*** 25,31 ****

  ;;; Commentary:

! ;; Provides a global minor mode (toggled by M-x hl-line-mode) to
  ;; highlight, on a suitable terminal, the line in the current window
  ;; on which point is (except in a minibuffer window).  Done to satisfy
  ;; a request for a feature of Lesser Editors.
--- 25,32 ----

  ;;; Commentary:

! ;; Provides a local minor mode (toggled by M-x hl-line-mode) and
! ;; a global minor mode (toggled by M-x global-hl-line-mode) to
  ;; highlight, on a suitable terminal, the line in the current window
  ;; on which point is (except in a minibuffer window).  Done to satisfy
  ;; a request for a feature of Lesser Editors.
***************
*** 44,52 ****
  ;; `hl-line-highlight', on `post-command-hook', activates it again
  ;; across the window width.

- ;; You could make variable `hl-line-mode' buffer-local to avoid
- ;; highlighting specific buffers.
-
  ;;; Code:

  (defgroup hl-line nil
--- 45,50 ----

If you turn it on in a second buffer,
it works in both buffers now, but if you turn it off in one of those
buffers then it doesn't work in either since the hooks are removed
globally.

Since hl-line-highlight tests the value of hl-line-mode and hl-line-unhighlight
test the value of hl-line-overlay, perhaps it's not necessary to remove them
from pre-command-hook and post-command-hook respectively (in hl-line-mode).

--
Kevin Rodgers





reply via email to

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