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

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

Re: execute function in replace-regexp


From: Emanuel Berg
Subject: Re: execute function in replace-regexp
Date: Sun, 01 Oct 2017 10:44:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

t wrote:

>  - There should be no space between the comma
> and the paren: \,(...)
>
>  - I *think* you should string-quote the \1
> (the \1 itself gets, AFAIR, replaced
> literally: to have correct elisp you need
> quotes, but I might be wrong on that)
>
> This would make:
>
>      \,(downcase "\1")

Did you get it to work? I did :)

(progn
  (push 13 unread-command-events)
  (dolist (c (reverse (string-to-list "\\,(downcase \\1)")))
    (push c unread-command-events))
  (push 13 unread-command-events)
  (dolist (c (reverse (string-to-list "\\(DOWNCASE ME\\)")))
    (push c unread-command-events))
  (call-interactively #'replace-regexp))
                                     ;; ^ eval here
;; DOWNCASE ME

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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