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: Wed, 05 Jul 2017 21:28:07 +0300 Message-ID: <83wp7mn3go.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 1499279360 3263 195.159.176.226 (5 Jul 2017 18:29:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Jul 2017 18:29:20 +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 Wed Jul 05 20:29:15 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 1dSp30-00008p-6o for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jul 2017 20:29:10 +0200 Original-Received: from localhost ([::1]:47597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSp32-0005JC-EU for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jul 2017 14:29:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSp2w-0005J7-IL for bug-gnu-emacs@gnu.org; Wed, 05 Jul 2017 14:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSp2t-0007hd-F9 for bug-gnu-emacs@gnu.org; Wed, 05 Jul 2017 14:29:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSp2t-0007hP-AZ for bug-gnu-emacs@gnu.org; Wed, 05 Jul 2017 14:29:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dSp2r-00071J-Q8 for bug-gnu-emacs@gnu.org; Wed, 05 Jul 2017 14:29:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jul 2017 18:29: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.149927932826964 (code B ref 24150); Wed, 05 Jul 2017 18:29:01 +0000 Original-Received: (at 24150) by debbugs.gnu.org; 5 Jul 2017 18:28:48 +0000 Original-Received: from localhost ([127.0.0.1]:53687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSp2e-00070q-IC for submit@debbugs.gnu.org; Wed, 05 Jul 2017 14:28:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSp2c-00070e-Kw for 24150@debbugs.gnu.org; Wed, 05 Jul 2017 14:28:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSp2W-0007aX-9r for 24150@debbugs.gnu.org; Wed, 05 Jul 2017 14:28:41 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSp2G-0007Wp-RB; Wed, 05 Jul 2017 14:28:24 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3070 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dSp2G-0004EK-0a; Wed, 05 Jul 2017 14:28:24 -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:134216 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 > > If there are no objections, i would like to apply the following patch > in a few days: If no one else chimes in until this weekend, please push, after taking care of the few minor issues below: > (dired-create-empty-file): New command. I'd prefer a non-Dired function, and I think files.el is a better place for such a general function. > +@kindex _ @r{(Dired)} > +@findex dired-create-empty-file > + Likewise, @kbd{_} (@code{dired-create-empty-file}) reads a > +file name, and creates an empty file with that name. It signals > +an error if the file already exists. Please add here a @cindex entry about "create empty file". Also, if the command is going to be not Dired-specific, it should be described in another section of the manual. > ** Dired > -You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', it gets replaced > -by the current file name. > + > +*** New command 'dired-create-empty-file' (similar to > +'dired-create-directory') creates a new empty file; bound to '_'. Since this is documented in the manual, it should be marked with "+++". (Renaming the command affects this part as well.) > +*** You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', > +it gets replaced by the current file name. This looks unrelated. > + (when (file-exists-p expanded) > + (error "Cannot create file %s: file exists" expanded)) If the file is actually a directory, I think the error message should say so. Finally, how about some simple tests for this new command? Thanks.