unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Can el-search-query-replace replace mapcar with --map ?
@ 2017-12-22 11:45 Chunyang Xu
  2017-12-22 17:17 ` Michael Heerdegen
  0 siblings, 1 reply; 4+ messages in thread
From: Chunyang Xu @ 2017-12-22 11:45 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: michael_heerdegen

Hi.

'C-h P el-search' mentions 'el-search-query-replace' can replace 'mapc'
with 'dolist'. I would like to know if it is also possible to replace
'mapcar' with '--map' (from dash.el), for example, change

  (mapcar (lambda (x) (* x x)) '(1 2 3))

into

  (--map (* it it) '(1 2 3))

I have tried:

   M-x el-search-query-replace RET
   `(mapcar (lambda (,val) . ,body) ,list) -> `(--map ,@body ,list) RET

It gives me:

  (--map
   (* x x)
   '(1 2 3))

it is almost right except the variable name, '--map' only knows 'it',
not 'x'.

Any suggestion?

Thanks.



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

end of thread, other threads:[~2017-12-23 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-22 11:45 Can el-search-query-replace replace mapcar with --map ? Chunyang Xu
2017-12-22 17:17 ` Michael Heerdegen
2017-12-23  6:17   ` Chunyang Xu
2017-12-23 14:03     ` Michael Heerdegen

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