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."
(interactive)
(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])
HTH
Joost