From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#26272: default-directory: Remark that it must be a directory name Date: Tue, 28 Mar 2017 00:15:07 +0900 Message-ID: <878tnqda4k.fsf@calancha-pc> References: <87y3vrhvta.fsf@calancha-pc> <83k27a93w8.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490627789 22541 195.159.176.226 (27 Mar 2017 15:16:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2017 15:16:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26272@debbugs.gnu.org, tino.calancha@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 27 17:16:23 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 1csWNP-0004Fw-8S for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Mar 2017 17:16:11 +0200 Original-Received: from localhost ([::1]:47289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csWNV-0003SO-3z for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Mar 2017 11:16:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csWNL-0003Qm-Q3 for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 11:16:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csWNG-00045D-Oi for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 11:16:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1csWNG-000450-E9 for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 11:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1csWNG-00036d-3Q for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 11:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Mar 2017 15:16: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.149062772911894 (code B ref 26272); Mon, 27 Mar 2017 15:16:02 +0000 Original-Received: (at 26272) by debbugs.gnu.org; 27 Mar 2017 15:15:29 +0000 Original-Received: from localhost ([127.0.0.1]:47537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csWMj-00035m-2q for submit@debbugs.gnu.org; Mon, 27 Mar 2017 11:15:29 -0400 Original-Received: from mail-pg0-f68.google.com ([74.125.83.68]:33221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csWMh-00035Z-CK for 26272@debbugs.gnu.org; Mon, 27 Mar 2017 11:15:27 -0400 Original-Received: by mail-pg0-f68.google.com with SMTP id 79so13720189pgf.0 for <26272@debbugs.gnu.org>; Mon, 27 Mar 2017 08:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vISJfBxFSBIL21sxL19IBLz+KE4iEJ3uDf68Js5My+o=; b=pr3GpJQ12h8mkHnnRx2dpKe0as5/dZ9CRJSlwt4BGgheuQp/RhTOyaes951H5FAab7 DYrukXi+h6w7CoIYsGZPnfJnBnvUMZM095ITKDUoOcFYUuBVR4mBe9tOMaGXUGFt1+KA DRRf6NC7upMzDILrb6nWe3BKqzpqWfyNLd3U+aQaAB+08+IvWoVil8C4Z1gxpjKK9w2s 2a5/KUS6aiuzkD/gMzZuftUjqcJDxqIK/ns4KsIzUp0qCnniNs9aQXPAn4g09g8Zlni3 xKtMRknOsPSqWitS3QeeIcolRCIYOOgsLACTKrv3OLhP/i3gfEAHrmCpJ292p649sgHJ 6Tzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vISJfBxFSBIL21sxL19IBLz+KE4iEJ3uDf68Js5My+o=; b=oOFXkbDzRbv0Ur2rcazMSZvpVsguRsyLlzGJbct+ngZW/xfriczFcSKoYxwImcOVth C8oC5vmuFx89eDUXvaCwU1TKwllg50yxccF63Aak6n39XwHSIuW2HCnoqh4wPIGEfC1F A+Y6OT1p6SYKOKTdYwTvNUdlzl7F1gTVc5cHxbhBuCoGP+ci8IcpXZKINK5Wca+fScKP v4DYLLrY8XaJ8wr0KN2sWgOW7VqwxKQNDLhthKLFqKzW418VkY9lLXukBvXoESqiL64K Ne9IYTHq2+FKPsjMs6nSK3o3cYPz1nx/sV2CDnObc3C9znvEnV3N+0x5mdPSOU2O4PeU Wsrw== X-Gm-Message-State: AFeK/H3rTuIJIw9IPQXaJxOBlS7cz454N60m4UKV8Y8cPty7IoKJ+JjqhB50tendoAny7w== X-Received: by 10.84.229.13 with SMTP id b13mr17613842plk.72.1490627721520; Mon, 27 Mar 2017 08:15:21 -0700 (PDT) Original-Received: from calancha-pc (234.204.100.220.dy.bbexcite.jp. [220.100.204.234]) by smtp.gmail.com with ESMTPSA id z19sm1891313pfd.81.2017.03.27.08.15.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Mar 2017 08:15:21 -0700 (PDT) In-Reply-To: <83k27a93w8.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 27 Mar 2017 17:43:19 +0300") 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:131012 Archived-At: Eli Zaretskii writes: >> 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? I don't remember it. Maybe with another person. >> 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. Thanks for the advice. It's a useful one. >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. I agree. > 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. Much clear. Updated the patch with yout suggestion. I have changed 'and in a slash' with 'end in a slash'. --8<-----------------------------cut here---------------start------------->8--- >From e63611ca54a59d8cff18de5ad1413f9678f3a51c Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 28 Mar 2017 00:07:35 +0900 Subject: [PATCH] default-directory: Remark that it must be a directory name * src/buffer.c (default-directory): Update docstring (Bug#26272). --- src/buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index c1c53dd220..8ef27dee0f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5754,7 +5754,9 @@ visual lines rather than logical lines. See the documentation of 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 should be a directory name (as opposed to a directory file-name). +On GNU and Unix systems, directory names end in a slash `/'. +To interactively change the default directory, use command `cd'. */); DEFVAR_PER_BUFFER ("auto-fill-function", &BVAR (current_buffer, auto_fill_function), Qnil, -- 2.11.0 --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 25.2.5 (x86_64-pc-linux-gnu, GTK+ Version 3.22.9) of 2017-03-27 Repository revision: fb18bff91f01a3051253319e766ca276e5b756bd