* bug#14438: 24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use
@ 2013-05-22 8:02 Jambunathan K
2013-05-22 20:57 ` Juri Linkov
0 siblings, 1 reply; 3+ messages in thread
From: Jambunathan K @ 2013-05-22 8:02 UTC (permalink / raw)
To: 14438
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 mituharu@math.s.chiba-u.ac.jp-20130520031520-pq1c1qjertan94kq
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#14438: 24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use
2013-05-22 8:02 bug#14438: 24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use Jambunathan K
@ 2013-05-22 20:57 ` Juri Linkov
2013-06-03 8:59 ` Juri Linkov
0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2013-05-22 20:57 UTC (permalink / raw)
To: Jambunathan K; +Cc: 14438
> (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'?
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#14438: 24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use
2013-05-22 20:57 ` Juri Linkov
@ 2013-06-03 8:59 ` Juri Linkov
0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2013-06-03 8:59 UTC (permalink / raw)
To: Jambunathan K; +Cc: 14438-done
>> (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))))
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-03 8:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22 8:02 bug#14438: 24.3.50; Honor `hi-lock-auto-select-face' for non-interactive use Jambunathan K
2013-05-22 20:57 ` Juri Linkov
2013-06-03 8:59 ` Juri Linkov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).