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: Tue, 31 Jul 2018 19:20:52 +0300 Message-ID: <83tvofnzq3.fsf@gnu.org> References: <87mv8m3yya.fsf@calancha-pc> <83wp7mn3go.fsf@gnu.org> <97b67d5a-fc1e-47ea-b6b1-4154206ed5f9@default> <87bmbfwp4x.fsf@calancha-pc.dy.bbexcite.jp> <879bc31155c8718745f44321382e9ecb@webmail.orcon.net.nz> <87lgaa9uq8.fsf@calancha-pc.dy.bbexcite.jp> <83pnzi1dpy.fsf@gnu.org> <87va9661uy.fsf@calancha-pc.dy.bbexcite.jp> <83r2jprs1h.fsf@gnu.org> <87effk1065.fsf@calancha-pc.dy.bbexcite.jp> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1533053947 11887 195.159.176.226 (31 Jul 2018 16:19:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2018 16:19:07 +0000 (UTC) Cc: psainty@orcon.net.nz, tzz@lifelogs.com, clement.pit@gmail.com, michael.albinus@gmx.de, 24150@debbugs.gnu.org, sdl.web@gmail.com To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 31 18:19:02 2018 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 1fkXMU-0002sd-6k for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jul 2018 18:19:02 +0200 Original-Received: from localhost ([::1]:59755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkXOZ-0001mF-1V for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jul 2018 12:21:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkXOR-0001lx-TN for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 12:21:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkXOQ-0008Bf-Vy for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 12:21:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkXOQ-0008Ba-QE for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 12:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fkXOQ-0003sB-I1 for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 12:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Jul 2018 16:21: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: Original-Received: via spool by 24150-submit@debbugs.gnu.org id=B24150.153305405614853 (code B ref 24150); Tue, 31 Jul 2018 16:21:02 +0000 Original-Received: (at 24150) by debbugs.gnu.org; 31 Jul 2018 16:20:56 +0000 Original-Received: from localhost ([127.0.0.1]:36608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkXOJ-0003rU-Oo for submit@debbugs.gnu.org; Tue, 31 Jul 2018 12:20:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkXOI-0003rH-FP for 24150@debbugs.gnu.org; Tue, 31 Jul 2018 12:20:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkXOC-000890-AO for 24150@debbugs.gnu.org; Tue, 31 Jul 2018 12:20:49 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkXO7-00087m-GD; Tue, 31 Jul 2018 12:20:43 -0400 Original-Received: from [176.228.60.248] (port=1784 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fkXO7-0000rD-0F; Tue, 31 Jul 2018 12:20:43 -0400 In-reply-to: <87effk1065.fsf@calancha-pc.dy.bbexcite.jp> (message from Tino Calancha on Tue, 31 Jul 2018 13:47:30 +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:149118 Archived-At: > From: Tino Calancha > Cc: psainty@orcon.net.nz, tzz@lifelogs.com, clement.pit@gmail.com, michael.albinus@gmx.de, 24150@debbugs.gnu.org, sdl.web@gmail.com > Date: Tue, 31 Jul 2018 13:47:30 +0900 > > >> +(defun dired--find-topmost-parent-dir (filename) > >> + "Return the topmost nonexistent parent dir of FILENAME. > >> +FILENAME is a full file name." > >> + (let ((try filename) new) > >> + (while (and try (not (file-exists-p try)) (not (equal new try))) > >> + (setq new try > >> + try (directory-file-name (file-name-directory try)))) > >> + new)) > > > > What is the purpose of using this function in dired-create-empty-file? > Same as in `dired-create-directory': to update the new entry in the Dired buffer. > I have extracted `dired--find-topmost-parent-dir' from `dired-create-directory' > to be DRY. > > What you do with the result of this function doesn't seem to be > > reflected in the doc string of dired-create-empty-file. > That's because `dired--find-topmost-parent-dir' is an internal function > (prefixed with 'dired--'). I don't think we need to detail in the docstring > what callers can do with the return value. Even not having a docstring could > be OK: users don't need to know about this function. No, that's not what I meant. I meant to say that if we call dired--find-topmost-parent-dir to update the new entry in the Dired buffer, then the doc string of dired-create-empty-file should say that it does so. Right now, the doc string says just this: Create an empty file called FILE. It says nothing about Dired entries. > I have added the following comment: > +;; We use this function in `dired-create-directory' and > +;; `dired-create-empty-file'; the return value is the new entry > +;; in the updated Dired buffer. That's fine. But my comment was about the doc string of dired-create-empty-file. Otherwise, this LGTM, thanks.