emacs-devel
[Top][All Lists]
Advanced

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

Re: insert-file-name-into-minibuffer


From: Alexander Klimov
Subject: Re: insert-file-name-into-minibuffer
Date: Sat, 9 Feb 2019 22:19:35 +0000

On Sat, 9 Feb 2019, Marcin Borkowski wrote:
> > Yes (M-0 w), but opening Dired (BTW, dired-jump is not bound to C-x 
> > C-j in `emacs -Q') is likely even less direct.
> 
> Of course, but I thought it might be useful for others reading this.

I use

(defun copy-buffer-file-name-as-kill (&optional nondirectory)
  (interactive "P")
  (let ((f (buffer-file-name)))
    (when nondirectory
      (setq f (file-name-nondirectory f)))
    (kill-new f)
    (message "%s" f)))

IMO it would be nice to have something like this bound to some key in 
`emacs -Q'; as well as something like insert-file-name-into-minibuffer
because it is common to recall that you need the buffer file name only 
once you already started typing the compilation command. Furthermore, 
M-n does not insert buffer file name in M-x compile.

-- 
Regards,
ASK



reply via email to

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