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#26272: default-directory: Remark that it must be a directory name Date: Mon, 27 Mar 2017 17:43:19 +0300 Message-ID: <83k27a93w8.fsf@gnu.org> References: <87y3vrhvta.fsf@calancha-pc> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1490625855 30228 195.159.176.226 (27 Mar 2017 14:44:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2017 14:44:15 +0000 (UTC) Cc: 26272@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 27 16:44:11 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 1csVsM-00071Z-Mo for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Mar 2017 16:44:06 +0200 Original-Received: from localhost ([::1]:47104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csVsS-0002h5-DM for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Mar 2017 10:44:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csVsM-0002gy-Fd for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 10:44:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csVsI-0004BD-IL for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 10:44:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1csVsI-0004B7-F8 for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 10:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1csVsI-0002Je-3k for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 10:44: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: Mon, 27 Mar 2017 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26272-submit@debbugs.gnu.org id=B26272.14906258108852 (code B ref 26272); Mon, 27 Mar 2017 14:44:02 +0000 Original-Received: (at 26272) by debbugs.gnu.org; 27 Mar 2017 14:43:30 +0000 Original-Received: from localhost ([127.0.0.1]:47523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csVrm-0002Ii-7g for submit@debbugs.gnu.org; Mon, 27 Mar 2017 10:43:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csVrl-0002IV-2u for 26272@debbugs.gnu.org; Mon, 27 Mar 2017 10:43:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csVrb-0003sb-Qp for 26272@debbugs.gnu.org; Mon, 27 Mar 2017 10:43:23 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csVrb-0003sX-O1; Mon, 27 Mar 2017 10:43:19 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3742 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1csVra-0001q8-U4; Mon, 27 Mar 2017 10:43:19 -0400 In-reply-to: <87y3vrhvta.fsf@calancha-pc> (message from Tino Calancha on Mon, 27 Mar 2017 19:13:05 +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:131010 Archived-At: > From: Tino Calancha > Date: Mon, 27 Mar 2017 19:13:05 +0900 > > > The docstring of `file-name-as-directory' suggests that is > important that `default-directory' be a directory name, i.e., > for instance in GNU/Linux ends with '/'. The docstring of > `default-directory' doesn't mention it. Didn't we discuss that at some point in the past? > DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory), > Qstringp, > doc: /* Name of default directory of current buffer. > -To interactively change the default directory, use command `cd'. */); > +It must be a directory name, as the output of `file-name-as-directory'. > +To interactively change the default directory, use command `cd'. > +In a Elisp program is better to do > +(setq default-directory (file-name-as-directory DIR)) */); A word of advice for the future: it is usually best to start from informal text that describes well what you mean in your own words, and then "formalize" it as needed, taking care not to lose key words and concepts. If you compare your informal description above with the patched doc string, I think you will agree with me that the former says what you mean in a much more clear and concise way. So something important got lost in transition, and you tried to make up for that by adding more explanations and an example. Here's my suggestion: It should be a directory name (as opposed to a directory file-name). On GNU and Unix systems, directory names and in a slash `/'. This basically says what your original description said, which is spot on. Thanks.