unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31953: feature request - `highlight-rx` interactively
@ 2018-06-24  7:47 Van L
  2019-10-09 22:02 ` Lars Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Van L @ 2018-06-24  7:47 UTC (permalink / raw)
  To: 31953

Hello.

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.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: feature request - `highlight-rx` interactively
  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-11-18 21:42 ` Juri Linkov
  2 siblings, 0 replies; 19+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-09 22:02 UTC (permalink / raw)
  To: Van L; +Cc: 31953

Van L <van@scratch.space> writes:

> 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.

Sorry, I'm not sure I understand what you're requesting here.

highlight-regexp is an alias for hi-lock-face-buffer which just does
some highlighting, as far as I can see.  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  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 ` Lars Ingebrigtsen
  2019-10-15  0:35   ` Lars Ingebrigtsen
  2019-11-18 21:42 ` Juri Linkov
  2 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-14 23:54 UTC (permalink / raw)
  To: 31953


-------------------- Start of forwarded message --------------------
From: VanL <van@scratch.space>
To: Lars Ingebrigtsen <larsi@gnus.org>
Subject: Re: bug#31953: feature request - `highlight-rx` interactively
Date: Thu, 10 Oct 2019 18:15:38 +1100


>> A usecase is to mark a region or string of few words
>> and to call `highlight-rx` which does a verbatim highlight.
>
>Sorry, I'm not sure I understand what you're requesting here.
>
>highlight-regexp is an alias for hi-lock-face-buffer which just does
>some highlighting, as far as I can see.  

I was wanting to migrate from regexp to rx syntax for highlighting.
-------------------- End of forwarded message --------------------

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-14 23:54 ` bug#31953: [VanL] " Lars Ingebrigtsen
@ 2019-10-15  0:35   ` Lars Ingebrigtsen
  2019-10-15  2:39     ` Phil Sainty
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-15  0:35 UTC (permalink / raw)
  To: 31953; +Cc: VanL

(Please keep the debbugs address in the Cc list -- otherwise the bug
tracker won't get the message.)

>>> A usecase is to mark a region or string of few words
>>> and to call `highlight-rx` which does a verbatim highlight.
>>
>>Sorry, I'm not sure I understand what you're requesting here.
>>
>>highlight-regexp is an alias for hi-lock-face-buffer which just does
>>some highlighting, as far as I can see.  
>
> I was wanting to migrate from regexp to rx syntax for highlighting.

`rx' returns a normal regexp, so you can use whatever you want, can't
you?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  0:35   ` Lars Ingebrigtsen
@ 2019-10-15  2:39     ` Phil Sainty
  2019-10-15  7:53       ` Lars Ingebrigtsen
  2019-10-20  6:34       ` bug#31953: [VanL] " VanL
  0 siblings, 2 replies; 19+ messages in thread
From: Phil Sainty @ 2019-10-15  2:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: VanL, 31953

On 2019-10-15 13:35, Lars Ingebrigtsen wrote:
>> I was wanting to migrate from regexp to rx syntax for highlighting.
> 
> `rx' returns a normal regexp, so you can use whatever you want, can't
> you?

I think the idea is to be able to *interactively* enter rx syntax
and have it highlighted (as opposed to `highlight-regexp' which will
obviously treat what you enter interactively as an actual regexp,
rather than something to be transformed into one).

i.e. These would be equivalent:

M-x highlight-rx RET (or "foo" "bar") RET
M-x highlight-regexp RET \(foo\|bar\) RET







^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  2:39     ` Phil Sainty
@ 2019-10-15  7:53       ` Lars Ingebrigtsen
  2019-10-15  8:37         ` Michael Heerdegen
                           ` (2 more replies)
  2019-10-20  6:34       ` bug#31953: [VanL] " VanL
  1 sibling, 3 replies; 19+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-15  7:53 UTC (permalink / raw)
  To: Phil Sainty; +Cc: VanL, 31953

Phil Sainty <psainty@orcon.net.nz> writes:

> I think the idea is to be able to *interactively* enter rx syntax
> and have it highlighted (as opposed to `highlight-regexp' which will
> obviously treat what you enter interactively as an actual regexp,
> rather than something to be transformed into one).
>
> i.e. These would be equivalent:
>
> M-x highlight-rx RET (or "foo" "bar") RET
> M-x highlight-regexp RET \(foo\|bar\) RET

Oh, I see.

I think it would be rather odd to have just one regexp-reading command
that uses the rx syntax interactively.  If this is something we want
(and I don't really envision people willingly typing in rx forms
interactively), then it should be fixed in `read-regexp'.  It could, for
instance, have a keystroke that changes the input mode.

But do we think that people want to type in rx forms?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  7:53       ` Lars Ingebrigtsen
@ 2019-10-15  8:37         ` Michael Heerdegen
  2019-10-15  8:43           ` Lars Ingebrigtsen
  2019-10-15 14:34         ` Drew Adams
  2019-11-03 22:27         ` Juri Linkov
  2 siblings, 1 reply; 19+ messages in thread
From: Michael Heerdegen @ 2019-10-15  8:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Phil Sainty, VanL, 31953

Lars Ingebrigtsen <larsi@gnus.org> writes:

> But do we think that people want to type in rx forms?

I would welcome such a change.

But IMO instead of

  M-x highlight-rx RET (or "foo" "bar") RET

it's not much harder to enter (rx (or "foo" "bar")) - so I wonder if we
could also just allow to enter any Elisp expression?

Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  8:37         ` Michael Heerdegen
@ 2019-10-15  8:43           ` Lars Ingebrigtsen
  2019-10-15  9:09             ` Michael Heerdegen
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-15  8:43 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Phil Sainty, VanL, 31953

Michael Heerdegen <michael_heerdegen@web.de> writes:

> But IMO instead of
>
>   M-x highlight-rx RET (or "foo" "bar") RET
>
> it's not much harder to enter (rx (or "foo" "bar")) - so I wonder if we
> could also just allow to enter any Elisp expression?

It's ambiguous, though -- you may want to search for "(rx (or "foo" "bar"))".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  8:43           ` Lars Ingebrigtsen
@ 2019-10-15  9:09             ` Michael Heerdegen
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Heerdegen @ 2019-10-15  9:09 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Phil Sainty, VanL, 31953

Lars Ingebrigtsen <larsi@gnus.org> writes:

> It's ambiguous, though -- you may want to search for "(rx (or "foo"
> "bar"))".

Unless I misunderstood, you would enter

  "(rx (or \"foo\" \"bar\"))"

instead of

  (rx (or "foo" "bar"))


Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  7:53       ` Lars Ingebrigtsen
  2019-10-15  8:37         ` Michael Heerdegen
@ 2019-10-15 14:34         ` Drew Adams
  2019-11-03 22:27         ` Juri Linkov
  2 siblings, 0 replies; 19+ messages in thread
From: Drew Adams @ 2019-10-15 14:34 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Phil Sainty; +Cc: VanL, 31953

> I think it would be rather odd to have just one regexp-reading command
> that uses the rx syntax interactively.  If this is something we want
> (and I don't really envision people willingly typing in rx forms
> interactively), then it should be fixed in `read-regexp'.  It could,
> for instance, have a keystroke that changes the input mode.
> 
> But do we think that people want to type in rx forms?

(Apologies for jumping in here, ignoring the thread.)

FWIW -

Many applications, including some good ones, provide
dialog boxes (modal or not) for things like search &
replace that let you check a number of settings that
configure the kind of search (and replace).

Emacs generally favors progressive interaction: if
you need to specify multiple things then you are
prompted multiple times, or you use a prefix arg
together with perhaps responding to a single prompt.

But there's no reason that Emacs could not or should
not also offer such dialog boxes - including for
things like Isearch.  (If I had more free time
perhaps I'd wrestle something up with widgets.)

The other thing is that originally Isearch was simple,
in terms of the possibilities it offered.  That's
changed over time (char folding and lots of other
things).  The ability to configure multiple search
settings at once, with a straightforward dialog box,
and then reuse the same settings or modify them, is
a feature waiting to happen.

And I think configuring rx searches would be a great
candidate for this kind of thing.  I don't use RX,
mainly because I'm used to regexps and it think it
would be slower to use RX.  But not necessarily so,
if it's just a question of checking a few boxes.

It should be quick to configure a given search.
And it's super clear because the dialog box can lay
it all out and even provide helpful tooltips for
fields/actions.  And once configured just repeat,
with or without changing some setting.

I say go for it - even without a dialog box.

Do people really "want to type in rx forms?"  Maybe
not.  But later on we could give them a dialog box
that takes the place of typing in rx syntax ("forms").





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  2:39     ` Phil Sainty
  2019-10-15  7:53       ` Lars Ingebrigtsen
@ 2019-10-20  6:34       ` VanL
  2019-10-20 15:49         ` Juri Linkov
  1 sibling, 1 reply; 19+ messages in thread
From: VanL @ 2019-10-20  6:34 UTC (permalink / raw)
  To: Phil Sainty; +Cc: Lars Ingebrigtsen, 31953

Phil Sainty <psainty@orcon.net.nz> writes:

> On 2019-10-15 13:35, Lars Ingebrigtsen wrote:
>>> I was wanting to migrate from regexp to rx syntax for highlighting.
>>
>> `rx' returns a normal regexp, so you can use whatever you want, can't
>> you?
>
> I think the idea is to be able to *interactively* enter rx syntax
> and have it highlighted (as opposed to `highlight-regexp' which will
> obviously treat what you enter interactively as an actual regexp,
> rather than something to be transformed into one).
>
> i.e. These would be equivalent:
>
> M-x highlight-rx RET (or "foo" "bar") RET
> M-x highlight-regexp RET \(foo\|bar\) RET

What I can tell from the emacs-devel list and the git log is the rx
feature is being worked on.  I'd like to use rx everywhere regexp occurs
and highlight-rx would be the first easy use case.  At the limit there
are things expressible in regexp that rx won't be able to.  And, in that
case, I'd like to see in the rx documentation a sign post to regexp at
depth for that.  And, if there are patterns rx and/or regexp are unable
to express then providing a see also for those would be a help.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-20  6:34       ` bug#31953: [VanL] " VanL
@ 2019-10-20 15:49         ` Juri Linkov
  2019-10-20 23:35           ` Noam Postavsky
  2019-11-02  8:30           ` VanL
  0 siblings, 2 replies; 19+ messages in thread
From: Juri Linkov @ 2019-10-20 15:49 UTC (permalink / raw)
  To: VanL; +Cc: Phil Sainty, Lars Ingebrigtsen, 31953

>> I think the idea is to be able to *interactively* enter rx syntax
>> and have it highlighted (as opposed to `highlight-regexp' which will
>> obviously treat what you enter interactively as an actual regexp,
>> rather than something to be transformed into one).
>>
>> i.e. These would be equivalent:
>>
>> M-x highlight-rx RET (or "foo" "bar") RET
>> M-x highlight-regexp RET \(foo\|bar\) RET
>
> What I can tell from the emacs-devel list and the git log is the rx
> feature is being worked on.  I'd like to use rx everywhere regexp occurs
> and highlight-rx would be the first easy use case.

Do you mean using rx also in all search and replace commands?

But the documentation says:

     The ‘rx’ notation is mainly useful in Lisp code; it cannot be used in
  most interactive situations where a regexp is requested, such as when
  running ‘query-replace-regexp’ or in variable customisation.

> At the limit there are things expressible in regexp that rx won't be
> able to.  And, in that case, I'd like to see in the rx documentation
> a sign post to regexp at depth for that.  And, if there are patterns
> rx and/or regexp are unable to express then providing a see also for
> those would be a help.

There is still some shortcomings in the current rx shorthands:

Such verbose constructs as ‘zero-or-more’ and ‘one-or-more’
are hard to remember and too long to type.  But fortunately
there are shorter synonyms ‘*’ and ‘+’ and other.  But they have
inconsistencies:

- ‘or’ has a synonym ‘|’, but ‘and’ has no synonym ‘&’

- ‘A{N}’ is the same as ‘=’, ‘A{N,}’ is ‘>=’, but ‘A{N,M}’ for some
  reason is ‘**’.  It would be more mnemonic something like ‘==’

- ‘line-start’ and ‘line-end’ have no shorter synonyms ‘^’ and ‘$’
  maybe because adding them would also require adding ‘\`’ and ‘\'’
  for ‘buffer-start’ and ‘buffer-end’, but ‘\`’ and ‘\'’ are very ugly.
  Fortunately there are already good synonyms ‘bol’ and ‘eol’
  that are easy to remember

- there is still problem with ‘buffer-start’ and ‘buffer-end’:
  their shorter synonyms are ‘bot’ and ‘eot’ that have no logic at all.
  Like there are already functions ‘bolp’, ‘eolp’, ‘bobp’ and ‘eobp’
  the best synonyms for buffer matches would be ‘bob’ and ‘eob’

- following the same logic ‘word-start’ could have a synonym ‘bow’
  and ‘word-end’ - ‘eow’.  I checked the implementation, and see
  there synonyms already are supported, but not documented.  Why?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  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
  1 sibling, 1 reply; 19+ messages in thread
From: Noam Postavsky @ 2019-10-20 23:35 UTC (permalink / raw)
  To: Juri Linkov; +Cc: VanL, Phil Sainty, Lars Ingebrigtsen, 31953

Juri Linkov <juri@linkov.net> writes:

> - ‘or’ has a synonym ‘|’, but ‘and’ has no synonym ‘&’

`and' is not the counterpart of `or', it's a synonym for `seq' or `:'.
We should probably deprecate `and', since this is a bit confusing.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively
  2019-10-20 23:35           ` Noam Postavsky
@ 2019-10-21 21:19             ` Juri Linkov
  0 siblings, 0 replies; 19+ messages in thread
From: Juri Linkov @ 2019-10-21 21:19 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: VanL, Phil Sainty, Lars Ingebrigtsen, 31953

>> - ‘or’ has a synonym ‘|’, but ‘and’ has no synonym ‘&’
>
> `and' is not the counterpart of `or', it's a synonym for `seq' or `:'.
> We should probably deprecate `and', since this is a bit confusing.

I consider ‘rx’ as an analogue of Definite Clause Grammar.

I'm so accustomed to Prolog paradigms used for defining grammars in DCG
that I can't use `rx' without its analogous constructs, e.g. such DCG:

  rx --> a, b; c.

where ‘,’ denotes conjunction, and ‘;’ denotes disjunction,
would naturally translate in ‘rx’ to corresponding and/or:

  (rx (| (& a b) c))

For example, this package parses a regexp and returns a DCG structure:
https://github.com/SWI-Prolog/packages-regex/blob/master/regex.dcg.pl





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: feature request - `highlight-rx` interactively
  2019-10-20 15:49         ` Juri Linkov
  2019-10-20 23:35           ` Noam Postavsky
@ 2019-11-02  8:30           ` VanL
  1 sibling, 0 replies; 19+ messages in thread
From: VanL @ 2019-11-02  8:30 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 31953

Juri Linkov <juri@linkov.net> writes:

>>> i.e. These would be equivalent:
>>>
>>> M-x highlight-rx RET (or "foo" "bar") RET
>>> M-x highlight-regexp RET \(foo\|bar\) RET
>>
>> What I can tell from the emacs-devel list and the git log is the rx
>> feature is being worked on.  I'd like to use rx everywhere regexp occurs
>> and highlight-rx would be the first easy use case.
>
> Do you mean using rx also in all search and replace commands?

I guess so if that makes sense to do farther down the track.
The advantage to using rx is to avoid those repeating
pathological toothpick sequences that are difficult to track.
For now, highlight-rx for searching is enough.

> But the documentation says:
>
>      The ‘rx’ notation is mainly useful in Lisp code; it cannot be used in
>   most interactive situations where a regexp is requested, such as when
>   running ‘query-replace-regexp’ or in variable customisation.

For search and replace, I don't know if it would be possible to
use in org-mode in the future, say, a table of three columns
having

1. input pattern
2. output 'desired' pattern
3. rx pattern which is generated automatically for 2

>> At the limit there are things expressible in regexp that rx won't be
>> able to.  And, in that case, I'd like to see in the rx documentation
>> a sign post to regexp at depth for that.  And, if there are patterns
>> rx and/or regexp are unable to express then providing a see also for
>> those would be a help.
>
> There is still some shortcomings in the current rx shorthands: ...

I guess the rx keywords will evolve to fit better with
experience.  Statistics are beginning to be collected on the
reported bugs.  Perhaps, rx can be used there where it makes
sense.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: feature request - `highlight-rx` interactively
  2019-10-15  7:53       ` Lars Ingebrigtsen
  2019-10-15  8:37         ` Michael Heerdegen
  2019-10-15 14:34         ` Drew Adams
@ 2019-11-03 22:27         ` Juri Linkov
  2 siblings, 0 replies; 19+ messages in thread
From: Juri Linkov @ 2019-11-03 22:27 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Phil Sainty, VanL, 31953

> If this is something we want (and I don't really envision people
> willingly typing in rx forms interactively), then it should be fixed
> in `read-regexp'.

Yep, `read-regexp' would be the right place to implement this.
Then like `read-from-minibuffer' has the arg `READ':

  If fourth arg READ is non-nil, interpret the result as a Lisp object
    and return that object:
    in other words, do ‘(car (read-from-string INPUT-STRING))’

`read-regexp' could have the same arg.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: feature request - `highlight-rx` interactively
  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-11-18 21:42 ` Juri Linkov
  2019-11-19 12:34   ` VanL
  2019-11-19 21:39   ` VanL
  2 siblings, 2 replies; 19+ messages in thread
From: Juri Linkov @ 2019-11-18 21:42 UTC (permalink / raw)
  To: Van L; +Cc: 31953

> 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.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: feature request - `highlight-rx` interactively
  2019-11-18 21:42 ` Juri Linkov
@ 2019-11-19 12:34   ` VanL
  2019-11-19 21:39   ` VanL
  1 sibling, 0 replies; 19+ messages in thread
From: VanL @ 2019-11-19 12:34 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 31953


>> 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.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#31953: feature request - `highlight-rx` interactively
  2019-11-18 21:42 ` Juri Linkov
  2019-11-19 12:34   ` VanL
@ 2019-11-19 21:39   ` VanL
  1 sibling, 0 replies; 19+ messages in thread
From: VanL @ 2019-11-19 21:39 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 31953


> Nothing stops you from using rx in regexp
> commands already.

From a human factor's usability standpoint, the UI would
be better initially intuitively as sourcetrail's is. [1]



--
Footnotes: 
[1]  https://invidio.us/watch?v=Cfu6f0uyzc8
     Sourcetrail - Introduction






^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-11-19 21:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-11-19 12:34   ` VanL
2019-11-19 21:39   ` VanL

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).