From: Juri Linkov <juri@linkov.net>
To: Van L <van@scratch.space>
Cc: 31953@debbugs.gnu.org
Subject: bug#31953: feature request - `highlight-rx` interactively
Date: Mon, 18 Nov 2019 23:42:05 +0200 [thread overview]
Message-ID: <87ftiksvyq.fsf@mail.linkov.net> (raw)
In-Reply-To: <DACF1335-66D7-411F-AD12-ECC407AFCF56@scratch.space> (Van L.'s message of "Sun, 24 Jun 2018 17:47:31 +1000")
> 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
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
<return> ;; 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.
next prev parent reply other threads:[~2019-11-18 21:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-24 7:47 bug#31953: feature request - `highlight-rx` interactively Van L
2019-10-09 22:02 ` Lars Ingebrigtsen
2019-10-14 23:54 ` bug#31953: [VanL] " Lars Ingebrigtsen
2019-10-15 0:35 ` Lars Ingebrigtsen
2019-10-15 2:39 ` Phil Sainty
2019-10-15 7:53 ` Lars Ingebrigtsen
2019-10-15 8:37 ` Michael Heerdegen
2019-10-15 8:43 ` Lars Ingebrigtsen
2019-10-15 9:09 ` Michael Heerdegen
2019-10-15 14:34 ` Drew Adams
2019-11-03 22:27 ` Juri Linkov
2019-10-20 6:34 ` bug#31953: [VanL] " VanL
2019-10-20 15:49 ` Juri Linkov
2019-10-20 23:35 ` Noam Postavsky
2019-10-21 21:19 ` Juri Linkov
2019-11-02 8:30 ` VanL
2019-11-18 21:42 ` Juri Linkov [this message]
2019-11-19 12:34 ` VanL
2019-11-19 21:39 ` VanL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ftiksvyq.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=31953@debbugs.gnu.org \
--cc=van@scratch.space \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).