From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#24150: 25.1.50; New command: dired-create-empty-file Date: Thu, 4 Aug 2016 09:54:11 -0400 Message-ID: <73fd10e8-726d-adbb-20e4-8bdbc52b021e@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EpPTvQFUbrD5L6Xv8vr7PalNOVT5Sl6LL" X-Trace: blaine.gmane.org 1470318926 29891 195.159.176.226 (4 Aug 2016 13:55:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 Aug 2016 13:55:26 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 To: 24150@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 04 15:55:22 2016 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 1bVJ7J-00079E-11 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Aug 2016 15:55:21 +0200 Original-Received: from localhost ([::1]:40034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVJ7F-00026B-I0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Aug 2016 09:55:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVJ74-00020U-Oa for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:55:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVJ70-0003If-LM for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVJ70-0003Ib-IF for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bVJ70-00048l-EI for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2016 13:55:02 +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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147031886915859 (code B ref -1); Thu, 04 Aug 2016 13:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Aug 2016 13:54:29 +0000 Original-Received: from localhost ([127.0.0.1]:55320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVJ6T-00047j-Ee for submit@debbugs.gnu.org; Thu, 04 Aug 2016 09:54:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVJ6R-00047X-S2 for submit@debbugs.gnu.org; Thu, 04 Aug 2016 09:54:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVJ6L-0003E5-Lk for submit@debbugs.gnu.org; Thu, 04 Aug 2016 09:54:22 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVJ6L-0003E1-Ib for submit@debbugs.gnu.org; Thu, 04 Aug 2016 09:54:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVJ6J-0001At-1w for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:54:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVJ6E-0003DJ-VQ for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:54:18 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:54211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVJ6E-0003DE-Ks for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 09:54:14 -0400 Original-Received: from [18.189.62.146] ([18.189.62.146]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MSpj3-1betu41eWD-00RoP1 for ; Thu, 04 Aug 2016 15:54:13 +0200 In-Reply-To: X-Provags-ID: V03:K0:Xjz9ZYZNeOXzoaERq2IOAjrBw/VTBEXvZPN6M7iGoPsgxN0IcB+ dbtFiJB3WLZSsCdRScanIBdDiYfo9Iieaoo9pwVPRdUEqxqW9XlK4vptc1kMyEaOyPxv6NZ 3FnX8mDsZTu3e7ItckuFrO7sSguEKL8s+llbiyax+Es+yMDzni+HGb7UcfA5SRxUTaH0GAi vGvIEK8+h/KbPSahdJC2A== X-UI-Out-Filterresults: notjunk:1;V01:K0:kJ2tyH8m0Tw=:JeUG0XG3w1KjVmk8Sf1mWn JZ+VDUu96XHhFgKrJ+VWUn+B8x+VFr/5cbRiH69wmsnpkMi7C7eJuMBV6muNzf71ZCxs3+m4U CRbmRRuhln/uRKHjx5kOywLZatYi6h7qkswQ8SG5Wu8ZMcPxOBjmd06tnpc3uw1DmMxG4WpJh hr0Kq5Gmy39175sxinK9Jg2I6eMpNOM6nDueM2l6Td10ptNDSZFuFJLOXo+a8kr7m0yhY7huX phVucpysb6bjbDcyVW74fxsFMUtJNGXDrGXAPpCbNGQ+X6C6BHEYjo6dbozxwgd7Lw3rKPfDK +LW6lE8l9nJn43SuJBO8rdU0+znOf1ii5yySr2ANA2EBAcTi6KHgdCHvbW5+qHcU/Hctk9BTE 5h/tI6tfFxUHo3NYnWIWS3vhXbrsc2Z9cINZVaHCvNzi44TobYcudTpdtB19hDSTFxqPP9TtU rdKi81WouUkfL8/8ZtS9S1KLp6GxNIRZvuMtHos+Do8zla85D3uEg64lOHeKdcqMkQmlDJUA5 c8JRDosVVhPitpda+TR1B3fA2ZjG8cSgfDwA1JZX1oSCUD/uj5PlEaQNfbamVLKLo6HzLTNf8 cLg/CAdbRW4i/mtqVO4Y28O14/5dIzUW7eXJz+w0jX++Xdb7e1Ek7cFQ0s2ihtKssew5hGHDP c+kIZagazYNeoC/Z315xhhgps2UJUvEi98jm4hNQjS31dWppIBQwjARtMVJ9jOmPieSM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:121820 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EpPTvQFUbrD5L6Xv8vr7PalNOVT5Sl6LL Content-Type: multipart/mixed; boundary="QnfflAb61XINcC4TRv3CpTiFUj8TxuBBF" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Message-ID: <73fd10e8-726d-adbb-20e4-8bdbc52b021e@gmail.com> Subject: Re: bug#24150: 25.1.50; New command: dired-create-empty-file References: In-Reply-To: --QnfflAb61XINcC4TRv3CpTiFUj8TxuBBF Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-08-04 09:25, Tino Calancha wrote: > Hi all, Hi Tino, > It might be useful having a Dired command creating > an empty file with a name provided by the user; something > like 'dired-create-directory' ('+') but for files. Neat idea; that's like `touch', right? > Following patch propose a new command 'dired-create-empty-file' > bound to 'M-+'. I've added comments inline below. > +@kindex M-+ @r{(Dired)} > +@findex dired-create-empty-file > + The command @kbd{M-+} (@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. Ah, so it's different from touch. Is there already a command in dired tha= t sets the access and modification time of a file? If not, maybe this com= mand could do it? I'm not sure it's useful to have the command fail if th= e file exists. If you go that, maybe renaming the command to eg dired-tou= ch would be useful? Although I see the parallel with dired-create-directo= ry, so maybe it's fine. > +++ > +*** A new command 'dired-create-empty-file' similar as > +'dired-create-directory' but it creates a new empty file; > +bound to 'M-+'. I think there's a slight problem with this sentence. Maybe *** New command 'dired-create-empty-file' (similar to 'dired-create-directory') creates a new empty file; bound to 'M-+'. > +(defmacro dired--create-empty-file-or-directory (fname &optional creat= e-file) > + "Create an empty file or directory called FNAME. > +If FNAME already exists, signal an error. > +Optional arg CREATE-FILE if non-nil, then create a file. Otherwise cr= eate > +a directory. " Do you think this could be a defun instead of a macro?=20 > + (define-key map "\M-+" 'dired-create-empty-file) Is there a convention on using (kbd "M-+") vs "\M-+"? --QnfflAb61XINcC4TRv3CpTiFUj8TxuBBF-- --EpPTvQFUbrD5L6Xv8vr7PalNOVT5Sl6LL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXo0kDAAoJEPqg+cTm90wjrckP/jJi0Ssj+0I8j3YSYzUNw8/H ZtGoMuKBfFnjZkJUISKN7LzAuTz5j+SUcEGv0dxV+zmiWk+FtiBG92QdEQ8Bp9jC INka8ftoiPUbBiMAgHLwUo/oFqAoKWdx5qi2puGJQd4JgqhoErHXp0jPWI2v0Oxy SH7ylisQnmfe69b+DV2nMN3DmGa6jp1D/KfoPy3G20CUCw3xwsiHMBl33SbZ2hY/ tS34z0ldPDsgz7q/EYo3msMk9mYWfkR4NglsD6AAAdzyWMHy2VxhYKUfUBRhOJrj yjKZ6g4P8eLncmO9BoJW3TaxZdYJibxT2QWQi6ryADrmA60cCjS+GxxH+83OZPzz PsDqMkSb8QxqdsZ4RQc4EiGKcVzG1R110riO1KmVvC+eaefn1fDuy2dPWqSXuxie d86zERqN1b7vkDwL+aCaiqLRYTdmxWr9Cv+mEREZT5pmrIBFDvAjs5wxEvAJj6Ip I5GOH/50lC6/TTMUPKSxrUDzs3+9Fh33iEEsCrzavqPbtyBJgdgGng1wshanCjOm XjgWi0oqe6zqNXN+DIDoQTdkOXzH2ZcK+1/RaevHK01IZbmIXLRYoRU/DX2774im LJ6XnNnRCiol/PQlCP1P1/VQMV/6jkXmKfrhZEc6d0LP+pXOM3GXBWo8TjTJFw+j qSoBNHQmOq6jkOpnKQVY =c9Zo -----END PGP SIGNATURE----- --EpPTvQFUbrD5L6Xv8vr7PalNOVT5Sl6LL--