unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: "Garreau\, Alexandre" <galex-713@galex-713.eu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: el-search usage (doc, strings, pcase, etc.)
Date: Mon, 29 Oct 2018 00:39:48 +0100	[thread overview]
Message-ID: <874ld5iqt7.fsf@web.de> (raw)
In-Reply-To: <8736sp7k5a.fsf@portable.galex-713.eu> (Alexandre Garreau's message of "Sun, 28 Oct 2018 23:59:13 +0100")

"Garreau, Alexandre" <galex-713@galex-713.eu> writes:

> If rx is available in pcase, then, it is already in el-search anyway,
> right?

Sure!

> > A setq in the pattern is a side effect.  Side effects in the patterns
> > can behave unexpectedly AFAIR, due to optimizations pcase performs with
> > the code.  I hardly learned when composing el-search patterns that it is
> > really not a good idea to try to make use of side effects.  There was
> > once a warning about this in the pcase docstring, but seems it has
> > disappeared since the rewrite.
>
> Maybe a such feature should be integrated into pcase?

In pcase' real life it is not really a restriction since you can export
any information via variables.  Therefore you gain cleaner code: no side
effects by pattern matching, side effects (possibly) in the bodies.

Wouldn't it be confusing if there was an (and P1 P2 P3 P4), and P1, P2,
P3 would cause side effects, and matching P4 finally fails (and so the
whole pattern)?

> Not if you want to condition that according contextual sexp patterns.
> And it will still be easier and cleaner to replace only in strings
> using el-search than a complex half-lisp-parsing regexp in isearch.

My current solution is that el-search will allow you to hit a key (it
will be "e") to edit a match manually in a separate buffer.

el-search is not really good at "text processing" since it currently
completely ignores comments.

> If it was well written enough, it should be easy to take extra features
> apart, and modularily change the base while still keeping the basic
> thing working, then progressively adapt the (hopefully modular)
> features.  But that’s the ideal state and I guess it’s only in a better
> shape than other similarily complex features of emacs.

I don't know, really.  But you would have to expect to introduce a lot
of bugs.  I'm not against what you propose, it's just my time
is...limited.

> Yes, as a map, without prefix, as you invoked it anyway.  And to quit
> you hit <backspace>.  Do you think that would bother other more
> use-once usages?

The problem here is that if a user doesn't like the default bindings, he
needs to remove them explicitly.  Since there are already two very
different suggested binding schemes (AFAIR they also slightly
interfere), I decided against that.  I'll think about what could be a
good solution.


Michael.



  reply	other threads:[~2018-10-28 23:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27 14:48 el-search usage (doc, strings, pcase, etc.) Garreau, Alexandre
2018-10-27 15:43 ` Michael Heerdegen
2018-10-27 16:37   ` Garreau, Alexandre
2018-10-27 20:19     ` Michael Heerdegen
2018-10-27 22:30       ` Garreau, Alexandre
2018-10-28  0:01         ` Michael Heerdegen
2018-10-28  1:11           ` Michael Heerdegen
2018-10-28  1:55           ` Garreau, Alexandre
2018-10-28 22:26             ` Michael Heerdegen
2018-10-28 22:59               ` Garreau, Alexandre
2018-10-28 23:39                 ` Michael Heerdegen [this message]
2018-10-27 15:55 ` Michael Heerdegen

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=874ld5iqt7.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=galex-713@galex-713.eu \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).