From: Marcin Borkowski <mbork@mbork.pl>
To: Alexander Klimov <alserkli@inbox.ru>
Cc: emacs-devel@gnu.org
Subject: Re: insert-file-name-into-minibuffer
Date: Wed, 13 Feb 2019 19:49:07 +0100 [thread overview]
Message-ID: <871s4bplr0.fsf@mbork.pl> (raw)
In-Reply-To: <4b24dbec3ecedf09159344f588268145@5bd3166184dda72f5bd6289323991d158>
On 2019-02-09, at 23:19, Alexander Klimov <alserkli@inbox.ru> wrote:
> 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)))
Nice, and really useful! I'm going to put it in my init.el, thanks.
> 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.
+1
--
Marcin Borkowski
http://mbork.pl
next prev parent reply other threads:[~2019-02-13 18:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-09 14:39 insert-file-name-into-minibuffer Alexander Klimov
2019-02-09 14:50 ` insert-file-name-into-minibuffer Eli Zaretskii
2019-02-09 21:30 ` insert-file-name-into-minibuffer Alexander Klimov
2019-02-09 21:38 ` insert-file-name-into-minibuffer Marcin Borkowski
2019-02-09 21:50 ` insert-file-name-into-minibuffer Alexander Klimov
2019-02-09 21:59 ` insert-file-name-into-minibuffer Marcin Borkowski
2019-02-09 22:19 ` insert-file-name-into-minibuffer Alexander Klimov
2019-02-13 18:49 ` Marcin Borkowski [this message]
2019-02-17 7:09 ` insert-file-name-into-minibuffer Marcin Borkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871s4bplr0.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=alserkli@inbox.ru \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.