From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24150: 26.0.50; New command: dired-create-empty-file Date: Mon, 03 Jul 2017 17:24:35 +0300 Message-ID: <83y3s5oaxo.fsf@gnu.org> References: <87mv8m3yya.fsf@calancha-pc> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1499091975 31287 195.159.176.226 (3 Jul 2017 14:26:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2017 14:26:15 +0000 (UTC) Cc: tzz@lifelogs.com, 24150@debbugs.gnu.org, sdl.web@gmail.com, clement.pit@gmail.com To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 03 16:26:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS2Ig-0007ay-2o for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 16:26:06 +0200 Original-Received: from localhost ([::1]:35535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS2Il-0007Mx-Eh for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 10:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS2If-0007Hz-B2 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 10:26:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS2Ic-0003ZE-6i for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 10:26:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS2Ic-0003Z7-2h for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 10:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dS2Ib-0006D0-U7 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 10:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jul 2017 14:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24150 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24150-submit@debbugs.gnu.org id=B24150.149909191023803 (code B ref 24150); Mon, 03 Jul 2017 14:26:01 +0000 Original-Received: (at 24150) by debbugs.gnu.org; 3 Jul 2017 14:25:10 +0000 Original-Received: from localhost ([127.0.0.1]:50452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS2Hl-0006Bq-N4 for submit@debbugs.gnu.org; Mon, 03 Jul 2017 10:25:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS2Hj-0006Be-T3 for 24150@debbugs.gnu.org; Mon, 03 Jul 2017 10:25:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS2Hb-0002pZ-BZ for 24150@debbugs.gnu.org; Mon, 03 Jul 2017 10:25:00 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS2HK-0002dk-9R; Mon, 03 Jul 2017 10:24:42 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4879 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dS2HJ-0006hY-E1; Mon, 03 Jul 2017 10:24:41 -0400 In-reply-to: <87mv8m3yya.fsf@calancha-pc> (message from Tino Calancha on Mon, 03 Jul 2017 13:51:25 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134124 Archived-At: > From: Tino Calancha > Date: Mon, 03 Jul 2017 13:51:25 +0900 > Cc: Ted Zlatanov , tino.calancha@gmail.com, > Clément Pit--Claudel , > Leo Liu > > After i found the following threads: > > https://stackoverflow.com/questions/20300137/how-to-create-new-file-from-dired-mode > https://stackoverflow.com/questions/2592095/how-do-i-create-an-empty-file-in-emacs > > and considering the significant number of views they have, i'd like to > reopen this issue. > > 1. In my config i've bound the new command to 'M-+'. > > 2. In the threads above they suggest the keybindings 'c' and '_'. > > 'c' is already bound to `dired-do-compress-to', so i propose to bind > the new command to '_' (unless you have a better proposal). > > If there are no objections, i would like to apply the following patch > in a few days: Thanks for working on this, Tino. I have a few concerns that I'd like to raise before we agree on adding this. First, I think this might be mixing two separate requests: one is the desire to start a new file from Dired, the other is to create an empty file on disk. I think these should be kept separate because they serve 2 different needs; in particular, the latter is not related to Dired in any way. I have no issues with adding a Dired keybinding that would call find-file without much ado. I'm not sure whether it should be bound to M-+ or to "C-u +", but I will defer to opinions of others on that. But I don't think M-+ or whatever we bind that command to should actually _create_ an empty file on disk. This is not how Emacs works with files; "C-x C-f" will not create a file until you save the buffer. That "+" actually creates a directory is IMO an exception rather than the rule: nothing else makes sense with directories, since users cannot type directory contents into a buffer and then save it, at least not easily. I do recognize a possible need for a function, or maybe even a command, to create an empty disk file. AFAIK, we don't have such a function, although it's not hard to write. But I think the use cases for such a command are quite rare and niche cases, so I think we shouldn't have a keybinding for it, not even in Dired. Let users who need this command frequently bind it to a key; with time, if it turns out I'm wrong and these use cases are much more frequent, we can decide on providing a binding by default. So, to summarize my POV: (a) it's okay to add a Dired keybinding for find-file; (b) let's add a command with no binding for creating an empty file. Thanks.