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

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

Re: goof in small function where???


From: Joost Kremers
Subject: Re: goof in small function where???
Date: 22 Jul 2014 09:41:27 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

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


[1] Thanks, Drew. (Sincerely.)

-- 
Joost Kremers                                   address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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