help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is "splicing mode" in el-search.el?


From: tomas
Subject: Re: What is "splicing mode" in el-search.el?
Date: Tue, 6 Sep 2016 16:48:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]