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

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

Re: Copying a list for insertion


From: Jean Louis
Subject: Re: Copying a list for insertion
Date: Fri, 21 Oct 2022 18:57:28 +0300
User-agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02)

* Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> 
[2022-10-21 17:18]:
> I am printing a list named "cunex" in the messages buffer. I would also like 
> to store what is printed so I can insert
> the contents somewhere else, without having to go to the "*Messages*" buffer 
> to copy it.
> 
> (message "%s" cunex)

I use this function:

(defun rcd-kill-new (kill)
  (cond ((stringp kill) (progn 
                          (kill-new kill)
                          (rcd-message "Killed: %s" kill)))
         (t (rcd-message "😧 WARNING: Nothing to kill."))))

You may change `rcd-message' to message.

If you wish to kill the list, then you need to do something like:

(kill-new (prin1-to-string '(1 2 3 "My" "List" 10 20))) ⇒ t

Then you do C-y:

(1 2 3 "My" "List" 10 20)


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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