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

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

Re: hi-lock-buffer-mode and hi-lock-mode do not follow normal convention


From: Juri Linkov
Subject: Re: hi-lock-buffer-mode and hi-lock-mode do not follow normal convention
Date: Wed, 14 Dec 2005 19:09:48 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>> I have a local fix that displays Hi in the mode line only when the
>> list of regexps to highlight is not empty in the current buffer.
>> This means it is displayed only when hi-lock has something to highlight.
>> Do you think it would be useful to use this logic by default in
>> hi-lock.el?
>
> As a user, I would love that!  There's no reason for hi-lock-mode to
> not be enabled, as all it does is add a menu entry to the already
> small edit menu.  Only displaying the H when hi-lock mode is doing
> something would be perfect!

Below is a patch that implements this:

Index: lisp/hi-lock.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/hi-lock.el,v
retrieving revision 1.35
diff -c -r1.35 hi-lock.el
*** lisp/hi-lock.el     10 Dec 2005 11:47:28 -0000      1.35
--- lisp/hi-lock.el     14 Dec 2005 17:07:28 -0000
***************
*** 293,299 ****
   Hi-lock: end
  is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
    :group 'hi-lock
!   :lighter " H"
    :global nil
    :keymap hi-lock-map
    (when (and (equal (buffer-name) "*scratch*")
--- 305,314 ----
   Hi-lock: end
  is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
    :group 'hi-lock
!   :lighter (:eval (if (or hi-lock-interactive-patterns
!                         hi-lock-file-patterns)
!                     " Hi" ""))
    :global nil
    :keymap hi-lock-map
    (when (and (equal (buffer-name) "*scratch*")

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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