unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: What is "splicing mode" in el-search.el?
Date: Tue, 6 Sep 2016 16:48:14 +0200	[thread overview]
Message-ID: <20160906144814.GA29274@tuxteam.de> (raw)
In-Reply-To: <CAHs_4i=wDBHZRDq_uDF_6TY9SQD3+KUhH3kd9vqK0dekKyNCdg@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Sep 06, 2016 at 10:09:15PM +0800, Chunyang Xu wrote:
> Hello!
> 
> I tried el-search.el from gnu elpa and have one problem with it. The
> Commentary of el-search.el mentions "splicing mode", but I can't
> figure out what it means, can you give me an example?
> 
> ;; It is possible to replace a match with multiple expressions using
> ;; "splicing mode".  When it is active, the replacement expression
> ;; must evaluate to a list, and is spliced instead of inserted into
> ;; the buffer for any replaced match.

Since it is for Lisp, I guess it does something similar to `,@' in
macros: i.e. "unwrap" one level of the replacement value, which should
be a list, and insert it in place,

I.e. if the search expression is `foo' and the replacement is (bar baz quux),
you'd get

  (one foo three) -> (one (bar baz quux) three) in non-splicing,

                  -> (one bar baz quux three) in splicing mode.

In macros, this is typically used to insert the whole "body" of
something (e.g. an if, a function def and so on), which isn't
an S-expression but a sequence of things.

But this all is just a guess.

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlfO1y4ACgkQBcgs9XrR2kYE+QCfSkxUBNHV9jcBabqEBLPaIk3i
gPUAnRR05UJu11dcuPSMFmm53ptc3NAD
=5RML
-----END PGP SIGNATURE-----



      parent reply	other threads:[~2016-09-06 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 14:09 What is "splicing mode" in el-search.el? Chunyang Xu
2016-09-06 14:45 ` Michael Heerdegen
2016-09-06 14:58   ` Michael Heerdegen
2016-09-06 17:55   ` Chunyang Xu
2016-09-06 23:07     ` Michael Heerdegen
2016-09-06 14:48 ` tomas [this message]

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=20160906144814.GA29274@tuxteam.de \
    --to=tomas@tuxteam.de \
    --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).