GNU bug report logs - #76912
31.0.50; hack-local-variables docstring inaccurate about directory-local variables

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Sean Whitton <spwhitton@HIDDEN>; dated Mon, 10 Mar 2025 08:59:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 76912 <at> debbugs.gnu.org:


Received: (at 76912) by debbugs.gnu.org; 10 Mar 2025 16:52:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 10 12:52:19 2025
Received: from localhost ([127.0.0.1]:39521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trgMV-0005Qe-Bo
	for submit <at> debbugs.gnu.org; Mon, 10 Mar 2025 12:52:19 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35740)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1trgMR-0005QN-G3
 for 76912 <at> debbugs.gnu.org; Mon, 10 Mar 2025 12:52:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1trgMJ-0005pO-Oh; Mon, 10 Mar 2025 12:52:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=jzSzx+NhXE7Ysb7KHoVDOL5hSPmqNpG8alfdhcmvRhQ=; b=UHGvppVOIIuH
 9B6LA1f3qJmuQ2Rp/FcGdPLoLmrVlbWfbfBLj8xFjFfzc0RstsXJQ198BhgK4QXU0+7CqlFJUiXnR
 m6Vgga2yrKUZGoW5GcbQMgmQXMIg/4s7qFvLBUl4XbyBXI6T1tpo1OgVUeCa72DpZS1CLufmXwl/d
 sJ6o5UJUfY8wl7jfu8I5jSWG/Qixtm6pZrvv1qX3WDbRSRTmZHX4ekGpdqfcSNpgZdkuDD11BMP3x
 NXND+BInB5VcHlxWAKqYfHzk3nkmK/KTplWo0j9d+ymKR7Unj7U2V0l8dhrD+Z9JnjFJrQa7vGo4/
 UT8A0zZaAcTIt+kTFhpgpw==;
Date: Mon, 10 Mar 2025 18:51:53 +0200
Message-Id: <867c4wesly.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
In-Reply-To: <8734fll0sr.fsf@HIDDEN> (message from Sean
 Whitton on Mon, 10 Mar 2025 16:58:28 +0800)
Subject: Re: bug#76912: 31.0.50;
 hack-local-variables docstring inaccurate about directory-local
 variables
References: <8734fll0sr.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76912
Cc: 76912 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Sean Whitton <spwhitton@HIDDEN>
> Date: Mon, 10 Mar 2025 16:58:28 +0800
> 
> We have:
> 
>     (defun hack-local-variables (&optional handle-mode inhibit-locals)
>       "Parse and put into effect this buffer's local variables spec.
>     For buffers visiting files, also puts into effect directory-local
>     variables.
> 
> but this second sentence is wrong -- buffers not visiting files get
> them, too.  For example
> 
> - emacs -Q
> - C-x v d ~/src/emacs/trunk/ RET
> - C-h v fill-column RET
> => local value of 72, from our .dir-locals.el, but VC-Dir is not a
>    file-visiting buffer.
> 
> I think this is not a bug in the implementation and the docstring just
> needs changing.  Would someone kindly confirm?

The code clearly calls hack-dir-local-variables, and has been doing so
since 2008, AFAICT.  As usual, we changed the code, but failed pt
update the doc string.

Note that the ELisp manual keeps silence about this aspect of
hack-local-variables.

It would be good to document which directory is used for non-file
buffers, btw.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76912; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Mar 2025 08:58:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 10 04:58:55 2025
Received: from localhost ([127.0.0.1]:36307 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trYyM-0006TK-D3
	for submit <at> debbugs.gnu.org; Mon, 10 Mar 2025 04:58:54 -0400
Received: from lists.gnu.org ([2001:470:142::17]:37866)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1trYyJ-0006Sz-5j
 for submit <at> debbugs.gnu.org; Mon, 10 Mar 2025 04:58:51 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spwhitton@HIDDEN>)
 id 1trYy8-0004Ux-8t
 for bug-gnu-emacs@HIDDEN; Mon, 10 Mar 2025 04:58:40 -0400
Received: from sendmail.purelymail.com ([34.202.193.197])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spwhitton@HIDDEN>)
 id 1trYy4-0002CA-7W
 for bug-gnu-emacs@HIDDEN; Mon, 10 Mar 2025 04:58:38 -0400
DKIM-Signature: a=rsa-sha256;
 b=VbbT1r7bZBKFOlutj98wlUGXUoNU9pN7WsuHXF1jA+epmTbpp22oGhtCnaT1cjmdnxOXj3wmX3JFZQcxPSIGATYXvDP7MOd9WWJzVCq4NbPCObByFsx+U4BLOGjAtS59vVa28oqdODHvYYLnWBcZ+0AM+CLXd6z3XdvzdUprBGGc3+D8/dGNu/0FfrOsKwyy9Y9ZWTTR/zbm/HxFWukVaOGN8VGv1/KOax4JEvyt9UnrwJvD117EBi4Uyd3lH2DJE8k9/HH1rihWDPKysP9df8oLa+CXelrLcXK/EkEoWmp1zf8/pxdHrW/wCPj8AEO9I/cv3c16CZFYdiYS1eU4yA==;
 s=purelymail3; d=spwhitton.name; v=1;
 bh=+jnV7JpM4foAx4/uUhn+/45afRgMQW07AVr2hE1p9rw=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=VJmwKx+8YmtVDqnpzPwcwgQyeGLzXXjTAsSAiN9RxMph80tVs4Y/PPtyCvLdafigABkasCrNEfhdd7rx9xWPojUIM+D5JZfLGb7dGe1QiwaAruM12lwvhisSdp6urWykLLp4hxsa2Z1CRONjRROhz1ydD8sxK1UarAxg4yhCE0dEG9rHu/4e+WRaMNkR2NjmSN83auUYV3Fg+r+bntfYWmUJEFlFpdDvoNwLRu7yNRgGYzoFLSvItYA79YoYszmSaImmHR0R513GyEK+ucVqfjRhenOp85sNjz+ASx9aL6oW048Lk6ZQblL/w4lPjdk+Pbpocco2Sp/drVdhikyROA==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=+jnV7JpM4foAx4/uUhn+/45afRgMQW07AVr2hE1p9rw=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: bug-gnu-emacs@HIDDEN
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -843092715
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 10 Mar 2025 08:58:31 +0000 (UTC)
Received: by melete.silentflame.com (Postfix, from userid 1000)
 id A85E07E1AC3; Mon, 10 Mar 2025 16:58:28 +0800 (CST)
From: Sean Whitton <spwhitton@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; hack-local-variables docstring inaccurate about
 directory-local variables
Date: Mon, 10 Mar 2025 16:58:28 +0800
Message-ID: <8734fll0sr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=34.202.193.197;
 envelope-from=spwhitton@HIDDEN; helo=sendmail.purelymail.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hello,

We have:

    (defun hack-local-variables (&optional handle-mode inhibit-locals)
      "Parse and put into effect this buffer's local variables spec.
    For buffers visiting files, also puts into effect directory-local
    variables.

but this second sentence is wrong -- buffers not visiting files get
them, too.  For example

- emacs -Q
- C-x v d ~/src/emacs/trunk/ RET
- C-h v fill-column RET
=> local value of 72, from our .dir-locals.el, but VC-Dir is not a
   file-visiting buffer.

I think this is not a bug in the implementation and the docstring just
needs changing.  Would someone kindly confirm?

-- 
Sean Whitton




Acknowledgement sent to Sean Whitton <spwhitton@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76912; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 10 Mar 2025 21:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.