--- Begin Message ---
Subject: |
24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use |
Date: |
Wed, 22 May 2013 13:32:32 +0530 |
Enable `hi-lock-auto-select-face''
(custom-set-variables
'(hi-lock-auto-select-face t))
Install the following occur specific customizations.
(0) Always lookup symbol at point
(setq occur-read-regexp-defaults-function 'find-tag-default-as-regexp)
(1) Delete occur window
(add-hook 'occur-hook (lambda nil (next-error)
(delete-other-windows)))
(2) Highlight the regexp that was looked up.
(add-hook 'occur-mode-find-occurrence-hook
(lambda nil (highlight-regexp
(find-tag-default-as-regexp))))
Current behaviour
1. Run M-x occur twice on two different symbols
2. Note that both the symbols are highlighted in hi-yellow
Expected behaviour
Since face auto-selection is on, I would prefer that the two symbols be
highlighted with two *different* colors.
In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
of 2013-05-20 on debian-6.05
Bzr revision: 112643 address@hidden
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
value of $LANG: en_IN
locale-coding-system: iso-latin-1-unix
default enable-multibyte-characters: t
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#14438: 24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use |
Date: |
Mon, 03 Jun 2013 11:59:10 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) |
>> (add-hook 'occur-mode-find-occurrence-hook
>> (lambda nil (highlight-regexp
>> (find-tag-default-as-regexp))))
>
> You could use
>
> (add-hook 'occur-mode-find-occurrence-hook
> (lambda nil (highlight-regexp
> (find-tag-default-as-regexp)
> (let ((hi-lock-auto-select-face t))
> (hi-lock-read-face-name)))))
>
> like I proposed to do in bug#14427 to get the next face automatically.
>
> BTW, what do you think about bug#14405 that adds a new defcustom
> `read-regexp-defaults-function' that is more user-friendly
> to customize than changing the values of several functions like
> `occur-read-regexp-defaults-function' and
> `hi-lock-read-regexp-defaults-function'?
It seems this report can be closed since `hi-lock-auto-select-face'
works as expected for interactive commands, and `hi-lock-read-face-name'
can be added as the second arg of the `highlight-regexp' call
when used programmatically:
(add-hook 'occur-mode-find-occurrence-hook
(lambda nil (highlight-regexp
(find-tag-default-as-regexp)
(hi-lock-read-face-name))))
--- End Message ---