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

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

Prefix for command to save it as a Lisp expression


From: Spencer Baugh
Subject: Prefix for command to save it as a Lisp expression
Date: Sat, 19 Feb 2022 23:45:22 +0000 (UTC)

Hi,

Is there any prefix I can type before entering a command which will add
that command as a Lisp expression to my kill ring?

For example, [prefix] C-n would add "(next-line)" to my kill-ring.

The specific use case I have in mind is [prefix] M-x global-set-key,
where after I finish running the global-set-key I'd have a Lisp
expression I can put into my init.el.

Currently, I can do this after the fact by looking at
list-command-history and kill things out of that.  But it would be cool
if I could type some prefix and just automatically have the command be
added to my kill ring.

Alternatively, maybe there's a way to yank things directly from
command-history?  Then I could just do that after the fact, rather than
using a prefix ahead of time, which might be even nicer.

Thanks!



reply via email to

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