GNU bug report logs - #31953
feature request - `highlight-rx` interactively

Previous Next

Package: emacs;

Reported by: Van L <van <at> scratch.space>

Date: Sun, 24 Jun 2018 07:48:02 UTC

Severity: wishlist

Full log


Message #56 received at 31953 <at> debbugs.gnu.org (full text, mbox):

From: VanL <van <at> scratch.space>
To: Juri Linkov <juri <at> linkov.net>
Cc: 31953 <at> debbugs.gnu.org
Subject: Re: bug#31953: feature request - `highlight-rx` interactively
Date: Tue, 19 Nov 2019 23:34:53 +1100
>> Towards the transition to rx from regexp
>> may I suggest `highlight-rx` for `highlight-regexp`.
>>
>> A usecase is to mark a region or string of few words
>> and to call `highlight-rx` which does a verbatim highlight.
>
> Nothing stops you from using rx in regexp commands already.
>
> The first example shows how to use rx to find all Lisp comments:
>
>  M-s o      ;; occur
>  M-:        ;; eval-expression, then type or yank the following rx:
>  (insert (rx bol (* whitespace) ";" (* nonl)))
>  <return>   ;; exit-minibuffer inserts the converted regexp to the minibuffer
>  <return>   ;; exit-minibuffer uses this regexp
>

Ah, got it.

> The second example shows how to use rx to remove all Lisp comments:
>
>  C-M-%      ;; query-replace-regexp
>  M-:        ;; eval-expression
>  M-p        ;; previous-history-element inserts the previous rx from history
>  <return>   ;; exit-minibuffer inserts the converted regexp to the minibuffer
>  <return>   ;; exit-minibuffer uses an empty string as replacement
<  !          ;; exit-minibuffer replaces all comments with empty string
>
> in 'emacs -Q' with (setq enable-recursive-minibuffers t)
> The same can be used for 'highlight-regexp' as well.

Thanks for the examples.




This bug report was last modified 5 years and 214 days ago.

Previous Next


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