unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: emacs-devel@gnu.org
Subject: Re: Sending multiple patches
Date: Tue, 03 Jun 2014 09:25:08 -0400	[thread overview]
Message-ID: <jwvegz65e65.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <xa1t38fmld6q.fsf@mina86.com> (Michal Nazarewicz's message of "Tue, 03 Jun 2014 08:28:13 +0200")

> Unfortunately that is not the case.  For example, imagine a hypothetical
                                                              ^^^^^^^^^^^^
As you say, it's hypothetical.

AFAICT, there's currently no actual use of regular expressions in the
"end pattern", so we very much can regexp-quote the whole thing (or
alternatively search it via search-forward instead of
re-search-forward).  If/when a need for something more flexible comes
up, we can allow the use of "a function returning a regexp" or maybe
even better "a function that jumps to the end" instead of a string.

> Do you think that adding Perl's \Q…\E support to `replace-match' would
> make sense?

No.  This would naturally lead to adding support for other operations
than regexp-quote, and then you end up quoting chunks of code inside
strings which is not only ugly but can't be macroexpanded, can't refer
to lexical-scoped vars, can't be byte-compiled, ...

If useful, we could extend replace-match such that NEWTEXT can be
a function instead of a string.  That should be easy and clean.


        Stefan



  reply	other threads:[~2014-06-03 13:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02  8:35 Sending multiple patches Michal Nazarewicz
2014-06-02 13:17 ` Stefan Monnier
2014-06-02 13:24   ` David Kastrup
2014-06-02 16:15     ` Stefan Monnier
2014-06-02 17:58       ` Yuri Khan
2014-06-02 15:47   ` Glenn Morris
2014-06-02 18:33   ` Michal Nazarewicz
2014-06-02 19:11     ` Stefan Monnier
2014-06-03  6:28       ` Michal Nazarewicz
2014-06-03 13:25         ` Stefan Monnier [this message]
2014-06-07 17:28           ` Michal Nazarewicz
2014-06-08  1:26             ` Stefan Monnier
2014-06-07 15:05         ` Herring, Davis
2014-06-02 19:03   ` Michal Nazarewicz
2014-06-03  0:00     ` Stefan Monnier

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=jwvegz65e65.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=mina86@mina86.com \
    /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).