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

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

Can el-search-query-replace replace mapcar with --map ?


From: Chunyang Xu
Subject: Can el-search-query-replace replace mapcar with --map ?
Date: Fri, 22 Dec 2017 19:45:07 +0800
User-agent: mu4e 0.9.18; emacs 27.0.50

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.



reply via email to

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