From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.devel Subject: Re: insert-file-name-into-minibuffer Date: Wed, 13 Feb 2019 19:49:07 +0100 Message-ID: <871s4bplr0.fsf@mbork.pl> References: <837ee9nhi6.fsf@gnu.org> <87bm3ky74i.fsf@mbork.pl> <87a7j4y66y.fsf@mbork.pl> <4b24dbec3ecedf09159344f588268145@5bd3166184dda72f5bd6289323991d158> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="70490"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: emacs-devel@gnu.org To: Alexander Klimov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 13 19:53:42 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtzfC-000IAu-Fg for ged-emacs-devel@m.gmane.org; Wed, 13 Feb 2019 19:53:42 +0100 Original-Received: from localhost ([127.0.0.1]:33676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtzfB-0003Sg-Go for ged-emacs-devel@m.gmane.org; Wed, 13 Feb 2019 13:53:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtzc0-0001Pm-Tf for emacs-devel@gnu.org; Wed, 13 Feb 2019 13:50:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtzbw-0003ds-DR for emacs-devel@gnu.org; Wed, 13 Feb 2019 13:50:22 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:55638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtzbw-0003Zr-5z for emacs-devel@gnu.org; Wed, 13 Feb 2019 13:50:20 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9F820E671E; Wed, 13 Feb 2019 19:50:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4hOS2X47_EiA; Wed, 13 Feb 2019 19:49:54 +0100 (CET) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id C8F7CE6554; Wed, 13 Feb 2019 19:49:53 +0100 (CET) In-reply-to: <4b24dbec3ecedf09159344f588268145@5bd3166184dda72f5bd6289323991d158> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.110.48.8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233288 Archived-At: On 2019-02-09, at 23:19, Alexander Klimov 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