[Top][All Lists]

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

Re: goof in small function where???

From: ken
Subject: Re: goof in small function where???
Date: Tue, 22 Jul 2014 06:16:25 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 07/22/2014 05:41 AM Joost Kremers wrote:
ken wrote:
The function below half works: it does put the buffer-file-name into the
kill ring, but nothing is displayed in the minibuffer.  Why?  And how to
fix this?

(defun file-name-into-kill-buffer ()
"Put path/filename of current buffer onto kill-ring so to paste
into an X application.  Also display it in minibuffer."
       (let ((str (buffer-file-name)))
         (and str
              (kill-new str)
              (message "Copied filename %s to kill ring" str)))

Works for me. You're probably doing something (or Emacs does something)
that makes the message disappear right away. (Messages in the minibuffer
disappear as soon as you press a key or even hit a cursor key.)

Check the *Messages* buffer if the message is there (`C-h e` or mouse-1
in the minibuffer.[1])



Thanks, Joost. But "Copied filename..." isn't anywhere in *Messages* buffer. If, however, I do in a file:

(message "Hello Message")C-x C-e

I do see "Hello Message" in the minibuffer and (some seconds later) in *Messages*.

Very weird!  How could this be?

reply via email to

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