From unknown Fri Jun 20 19:45:46 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#76912 <76912@debbugs.gnu.org> To: bug#76912 <76912@debbugs.gnu.org> Subject: Status: 31.0.50; hack-local-variables docstring inaccurate about directory-local variables Reply-To: bug#76912 <76912@debbugs.gnu.org> Date: Sat, 21 Jun 2025 02:45:46 +0000 retitle 76912 31.0.50; hack-local-variables docstring inaccurate about dire= ctory-local variables reassign 76912 emacs submitter 76912 Sean Whitton severity 76912 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 10 04:58:55 2025 Received: (at submit) by debbugs.gnu.org; 10 Mar 2025 08:58:55 +0000 Received: from localhost ([127.0.0.1]:36307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trYyM-0006TK-D3 for submit@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 ) id 1trYyJ-0006Sz-5j for submit@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 ) id 1trYy8-0004Ux-8t for bug-gnu-emacs@gnu.org; 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 ) id 1trYy4-0002CA-7W for bug-gnu-emacs@gnu.org; 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@gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -843092715 for (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 To: bug-gnu-emacs@gnu.org 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@melete.silentflame.com> 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@spwhitton.name; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 10 12:52:19 2025 Received: (at 76912) by debbugs.gnu.org; 10 Mar 2025 16:52:19 +0000 Received: from localhost ([127.0.0.1]:39521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trgMV-0005Qe-Bo for submit@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 ) id 1trgMR-0005QN-G3 for 76912@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 ) 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@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <8734fll0sr.fsf@melete.silentflame.com> (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@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76912 Cc: 76912@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 10 17:05:42 2025 Received: (at control) by debbugs.gnu.org; 10 Mar 2025 21:05:43 +0000 Received: from localhost ([127.0.0.1]:40077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trkJi-0003kX-Jp for submit@debbugs.gnu.org; Mon, 10 Mar 2025 17:05:42 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:49606) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1trkJg-0003k3-7h for control@debbugs.gnu.org; Mon, 10 Mar 2025 17:05:40 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5e6c18e2c7dso3176674a12.3 for ; Mon, 10 Mar 2025 14:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741640734; x=1742245534; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=Od4yywYBZJ9S2opW3oecITk9M9Zz9kaXY281piAIyj4=; b=LSYwng+ClbYNqvvDdoAgT3OyjeMJyZgC6jOILs4WKUwl3WcJwaNMMfv4FpKKmfSmEE y7Hvu/UoXttWzi3geG7lrkqMBQLfRZVBtJJYmnbE+4S0iUturhndlyKOqyaxwxwoT4Sp NpeZJTwSxhQYi6bjWgotOw/Mk66i+n4szUtQLRiF4VwxzWJcjVlWBwe5OJvXgPY0oGn8 p7wC6x+dZRFtrOn/9Is/u6PXEiBeIFcZSZGOfzgAiOHg8K1PgqLII2rXElua+T7YSBi1 NV2eWXZUV4Lb+mnk0EIftRSVdaayQPNQqMxHL7X/fhRLERzKbVVkilEdg4Nj0gkPQZ29 hKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741640734; x=1742245534; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Od4yywYBZJ9S2opW3oecITk9M9Zz9kaXY281piAIyj4=; b=rkQPeRTZ6AL5s8BiJjPlMbKj4+Jgne0aXAUWfiHeAD/cBoIAgALbAF60ODqd+N+/zU gVd2DGgStKZk66ilUNc6Niy41PvIUTxOgTZHE9YiIBAzI6mG3Y2qqBye/xPYZKWb4GOh 5zOL+9Xrcnz22e+B9uE9tc194KWgJtvTrHr174PV4YZJr1Ze7F/gkrNPOf5wMFbteyO1 /O4wLdcJypBwwHEih3phSxTAsH4wim23vyngM8hN0BjvSBrCYszqY2y07vkV05qLIkYQ qnOkyX+jr8y0b2OvR3j7wnoqGFMjpz3o/wtNn7Uzq+CwD7U6i2x1XC4gwM5xfeS255ZY DTTA== X-Gm-Message-State: AOJu0YyVi4fBWnYR9HA011zUD+f0dIzrIUIx2Y2law+qBVOOmofcmmaH zf+84DWm152nPu35azKpjRhbLjroMgG1XpFaE/ZazubMfKlfTsbTym2iJMcRUfJtPgPgJp29zCb z9sbaphdO8TSaroM87StHxal2dHdv3e3w X-Gm-Gg: ASbGncsUOa8MipGhQVpFCDmvZxN5LiAnShXqDkOTo5WIxKrntRttWx9lzpKmI5H0UZP bVnEWMwh83a2vBiLApomhtJr50Yr3wcVBmZhx99FG9obSTW/TRUUhOwDQhUoZ9o2gZ6JpNjsxMJ C47APFmaKOgTEukqX4ymrqs1GnUXs= X-Google-Smtp-Source: AGHT+IHFJyzxm42eKEzJMbtaEXSJZbNDRqoIBxW8VSqkZ7r61ZMhlEOzXrklntqO+bsCNQvNi2jz8shruel9jM0lqBg= X-Received: by 2002:a05:6402:13d4:b0:5de:dd44:929e with SMTP id 4fb4d7f45d1cf-5e5e24a9a94mr14948910a12.21.1741640733970; Mon, 10 Mar 2025 14:05:33 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 10 Mar 2025 17:05:32 -0400 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 10 Mar 2025 17:05:32 -0400 X-Gm-Features: AQ5f1JoBiPPJhTQD_kRXisb8o2X3tmYVn4q2B3h3iXuX1bt6vdxoyO1dTzZGWko Message-ID: Subject: control message for bug #76912 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 76912 minor quit From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 00:36:27 2025 Received: (at 76912) by debbugs.gnu.org; 11 Mar 2025 04:36:27 +0000 Received: from localhost ([127.0.0.1]:41034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trrLu-00017Y-Vt for submit@debbugs.gnu.org; Tue, 11 Mar 2025 00:36:27 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:54228) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1trrLr-00017H-6w for 76912@debbugs.gnu.org; Tue, 11 Mar 2025 00:36:24 -0400 DKIM-Signature: a=rsa-sha256; b=K2qsA/xfdsw2fWcgWCLAB/DXjplsuDoCav88DlcvRi/8NbKST3PQekvzyJiOTYKcpCYq6BY3uIeOtmeOPey79HtRL0dwKGvzb2mzdWd0KfY43IjguVY9dekGH4yvSTA9Wp0JyNSWEZC6Ujzg9KlsuNVddq7JPvLJngwAqQJIUcFMKJZcIZdHu9NtsgpSSGR8qsWIa9OgKZ57l1bLc10H6iXavcwDzQv1oTfTiHkhE1MbyEpTl/QM8RnpcgL6/hUktxHYvAYvjNBKbZpjPpR0xn86JEVl1R2mUNmGwK4TCV6jMLAAd9ZCmXNTSwF7MUq5od7MM1TbhX7EWzncaf11BA==; s=purelymail3; d=spwhitton.name; v=1; bh=wLAUqII2RP87GZ0sebTBJ1rlAng8njOTqOfTG9Bzl60=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=I9D/YrxmZ1x1z+d0d/HHabm4UB+ivVoixwuaSPJqu82lsnw6gRUAqL4g1pG9h2jKFmhXEox67UB5RmG1n2R2nOkgnWe3VuGC4LF76/DC9f9OIvIA+UU072ZkZ0/ec2stYS0gBJP+71iFwoUBqaOEZW2yWTZfnAt6BwBmzvuTQGhHvk+yYhYojOsCVBbJQ5h9GqHSFB5hyy1FDuDaWnYzwEWoegylx3VSMznsokb6JN/qgH9I4Sgsax6XWNleyMslSm27FzFDS5xsWSmzH5zkezmIUfQIY1363RYyhG30nNlsFitpxGWa9n8hdZSeUlJcvkw5dOimkkJPVGGlEID+Mg==; s=purelymail3; d=purelymail.com; v=1; bh=wLAUqII2RP87GZ0sebTBJ1rlAng8njOTqOfTG9Bzl60=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 76912@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1543011710; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 11 Mar 2025 04:36:16 +0000 (UTC) Received: by melete.silentflame.com (Postfix, from userid 1000) id 9FDAC7E10FB; Tue, 11 Mar 2025 12:36:13 +0800 (CST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#76912: 31.0.50; hack-local-variables docstring inaccurate about directory-local variables In-Reply-To: <867c4wesly.fsf@gnu.org> References: <8734fll0sr.fsf@melete.silentflame.com> <867c4wesly.fsf@gnu.org> Date: Tue, 11 Mar 2025 12:36:13 +0800 Message-ID: <87ldtcgp4y.fsf@melete.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76912 Cc: 76912@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 10 Mar 2025 at 06:51pm +02, Eli Zaretskii wrote: > 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. Okay, thanks for confirming, I will fix the docstring and manual. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 02:36:20 2025 Received: (at 76912) by debbugs.gnu.org; 11 Mar 2025 06:36:20 +0000 Received: from localhost ([127.0.0.1]:41233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trtDv-0006lb-UI for submit@debbugs.gnu.org; Tue, 11 Mar 2025 02:36:20 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:52936) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1trtDs-0006lM-JR for 76912@debbugs.gnu.org; Tue, 11 Mar 2025 02:36:17 -0400 DKIM-Signature: a=rsa-sha256; b=ttVwTYzNu+8KadaYrROL4i9iNCVKsrSUNDxthaxTwmh67VMqp3mqUaiEdclmXZdwtzvIRHdt09kI5wAdbEtQwnNJCcUdZ+xF6+4K9n8+TXZpdhr0wr2WVtVZObRD3VacHiHyDZWQoptgN/2XLpLG768/GtPpD3qBtZltfTYbTX4F4EICvgke3x2n34tgrpxB1RT7OkP0MkpLxfjsyyb2W6up1cYJZ5jzGg/9MC+YGCQ2zVVK3wTXYbKSwnzwZiLXAgqdGxAk399lTjVvVHmuIrB1Lduynt5FlsJpUICGV6DNmv4n3jqTI0G3uE3ShQkAVlJng7Ks7AosS8eEYScZ5Q==; s=purelymail3; d=spwhitton.name; v=1; bh=3LG5LGJcCO0vUGTRWtDTWoDlDe5y5xJ6EAvE7pfza+E=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Vn02M+VGFDn2KDz7K4HnQUutjTnQZS7cdwPb4wO8wgIGzVt6f7M/JUx29tF245GuhF9up2Vh6ku6c6gOlaNOwyFmc6zna08eAESBnVNdxvwbYPSaYsqQmYBuD5TTR3Z9UQGZx8xsGN/aIaJmmL78bdduQZhgDERDF+MwksIV2t0KmS3JzrQhDl01ofKTSBJcJA8JH4AvAg7GvZ1jA55qO45+pYniSkgVxsyrfaVb/m3WYSKMq7bC9GSStXBGK98SlAA5pfd8I27puV962CqFukGUuA1LoVuXagBMnhlw5TxDgNSDQcQWEb4+IPoFzheH9q0KDaqxXAtPJ3Q7jPltEw==; s=purelymail3; d=purelymail.com; v=1; bh=3LG5LGJcCO0vUGTRWtDTWoDlDe5y5xJ6EAvE7pfza+E=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 76912@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -426464712; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 11 Mar 2025 06:36:10 +0000 (UTC) Received: by melete.silentflame.com (Postfix, from userid 1000) id 0E0437EC97E; Tue, 11 Mar 2025 14:36:07 +0800 (CST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#76912: 31.0.50; hack-local-variables docstring inaccurate about directory-local variables In-Reply-To: <867c4wesly.fsf@gnu.org> References: <8734fll0sr.fsf@melete.silentflame.com> <867c4wesly.fsf@gnu.org> Date: Tue, 11 Mar 2025 14:36:07 +0800 Message-ID: <87r034f50o.fsf@melete.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76912 Cc: 76912@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, On Mon 10 Mar 2025 at 06:51pm +02, Eli Zaretskii wrote: > 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. How's this -- targeting the emacs-30 branch. -- Sean Whitton --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Correct-some-outdated-docs-for-hack-local-variables.patch >From 843579380a5d0d5015fe1883deec7c70a72e5897 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 11 Mar 2025 14:35:48 +0800 Subject: [PATCH] Correct some outdated docs for hack-local-variables * doc/lispref/modes.texi (Major Mode Conventions, Mode Hooks): Don't say that hack-local-variables is called for only buffers visiting files. * doc/lispref/variables.texi (File Local Variables): : Say that it applies directory-local variables too. : New entry for this variable. * lisp/files.el (hack-local-variables): Say that it always puts into effect directory-local variables. --- doc/lispref/modes.texi | 9 ++++----- doc/lispref/variables.texi | 28 +++++++++++++++++++++------- lisp/files.el | 5 +++-- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 31d420eedb6..a748e76ea4f 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -546,7 +546,7 @@ Major Mode Conventions @code{@var{modename}-mode-hook}. The very last thing the major mode command should do is to call @code{run-mode-hooks}. This runs the normal hook @code{change-major-mode-after-body-hook}, the mode hook, the -function @code{hack-local-variables} (when the buffer is visiting a file), +function @code{hack-local-variables}, and then the normal hook @code{after-change-major-mode-hook}. @xref{Mode Hooks}. @@ -1124,10 +1124,9 @@ Mode Hooks Major modes should run their mode hook using this function. It is similar to @code{run-hooks} (@pxref{Hooks}), but it also runs @code{change-major-mode-after-body-hook}, @code{hack-local-variables} -(when the buffer is visiting a file) (@pxref{File Local Variables}), -and @code{after-change-major-mode-hook}. The last thing it does is to -evaluate any @code{:after-hook} forms declared by parent modes -(@pxref{Derived Modes}). +(@pxref{File Local Variables}), and @code{after-change-major-mode-hook}. +The last thing it does is to evaluate any @code{:after-hook} forms +declared by parent modes (@pxref{Derived Modes}). When this function is called during the execution of a @code{delay-mode-hooks} form, it does not run the hooks or diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 7bc9243649c..d8dd08691c2 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2014,14 +2014,20 @@ File Local Variables @w{@samp{-*-}} line. @code{set-auto-mode} does that, also taking @code{enable-local-variables} into account (@pxref{Auto Major Mode}). -This function works by walking the alist stored in -@code{file-local-variables-alist} and applying each local variable in -turn. It calls @code{before-hack-local-variables-hook} and +This function also puts into effect directory-local variables as +specified in @file{.dir-locals.el}. If the buffer is not visiting any +file, then the directory-local variables that apply are those which +would be applicable to files in the @code{default-directory}. + +This function works by walking the alists stored in +@code{file-local-variables-alist} and @code{dir-local-variables-alist} +and applying each local variable in turn. It calls +@code{before-hack-local-variables-hook} and @code{hack-local-variables-hook} before and after applying the -variables, respectively. It only calls the before-hook if the alist -is non-@code{nil}; it always calls the other hook. This -function ignores a @samp{mode} element if it specifies the same major -mode as the buffer already has. +variables, respectively. It only calls the before-hook if +@code{file-local-variables-alist} is non-@code{nil}; it always calls the +other hook. This function ignores a @samp{mode} element if it specifies +the same major mode as the buffer already has. If the optional argument @var{handle-mode} is @code{t}, then all this function does is return a symbol specifying the major mode, if the @@ -2044,6 +2050,14 @@ File Local Variables one. @end defvar +@defvar dir-local-variables-alist +This buffer-local variable holds the alist of directory-local variable +settings. Its elements have the same structure as those of +@code{file-local-variables-alist}. When Emacs visits a file, it +collects all the directory-local variables into this alist, and then the +@code{hack-local-variables} function applies them one by one. +@end defvar + @defvar before-hack-local-variables-hook Emacs calls this hook immediately before applying file-local variables stored in @code{file-local-variables-alist}. diff --git a/lisp/files.el b/lisp/files.el index 007fd23a5f5..bd2c7c44e12 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4163,8 +4163,9 @@ hack-local-variables--warned-lexical (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. +Also puts into effect directory-local variables. +For buffers not visiting files, apply the directory-local variables that +would be applicable to files in `default-directory'. Uses `hack-local-variables-apply' to apply the variables. -- 2.45.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 09:12:48 2025 Received: (at 76912) by debbugs.gnu.org; 11 Mar 2025 13:12:49 +0000 Received: from localhost ([127.0.0.1]:42181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trzPZ-0006nE-5B for submit@debbugs.gnu.org; Tue, 11 Mar 2025 09:12:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39762) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1trzPV-0006mc-VK for 76912@debbugs.gnu.org; Tue, 11 Mar 2025 09:12:42 -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 ) id 1trzPQ-0002LQ-Fv; Tue, 11 Mar 2025 09:12:36 -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=vyYyzsud/MYSKFGEfdmLuTuNTYyZt/Pj8S9Rvw5RZ3I=; b=PSAGh8zRGN/w Y9DLlQBs99OVCUKijoozBDPJ6eSjv4ns/J2Jr3KWZRRelwS/EdZa04i7mW3YRjunGLatTgQAkITlH hTLL47VXxKqH31kHUh7PCCa9qO4eSg8mlbthurtaRcy8kSiLzDks8mNpHvgO3l6XHIpVXeuF3DhKM sfLtbLSRfh251VQmYUglOec4TAPqByx5p67/v4A6zdVCT5jVlWcbMZms7fFpuDpHdCENQJsJ5J+3T ERJxK+5p0O7wDcdot+kwNDonQDIAnkI8BUghbmm2JZrwoiSaoxZIiT4kA+IhORVcXhNhlC1kUicvW W/wFlRfuPIy6jTXLzTAyAA==; Date: Tue, 11 Mar 2025 15:12:29 +0200 Message-Id: <861pv3d83m.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87r034f50o.fsf@melete.silentflame.com> (message from Sean Whitton on Tue, 11 Mar 2025 14:36:07 +0800) Subject: Re: bug#76912: 31.0.50; hack-local-variables docstring inaccurate about directory-local variables References: <8734fll0sr.fsf@melete.silentflame.com> <867c4wesly.fsf@gnu.org> <87r034f50o.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76912 Cc: 76912@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: 76912@debbugs.gnu.org > Date: Tue, 11 Mar 2025 14:36:07 +0800 > > > It would be good to document which directory is used for non-file > > buffers, btw. > > How's this -- targeting the emacs-30 branch. Thanks, a few comments below. > --- a/doc/lispref/modes.texi > +++ b/doc/lispref/modes.texi > @@ -546,7 +546,7 @@ Major Mode Conventions > @code{@var{modename}-mode-hook}. The very last thing the major mode command > should do is to call @code{run-mode-hooks}. This runs the normal > hook @code{change-major-mode-after-body-hook}, the mode hook, the > -function @code{hack-local-variables} (when the buffer is visiting a file), > +function @code{hack-local-variables}, This hunk doesn't seem to be correct. From run-mode-hooks: (if (buffer-file-name) (with-demoted-errors "File local-variables error: %s" (hack-local-variables 'no-mode))) > @@ -1124,10 +1124,9 @@ Mode Hooks > Major modes should run their mode hook using this function. It is > similar to @code{run-hooks} (@pxref{Hooks}), but it also runs > @code{change-major-mode-after-body-hook}, @code{hack-local-variables} > -(when the buffer is visiting a file) (@pxref{File Local Variables}), > -and @code{after-change-major-mode-hook}. The last thing it does is to > -evaluate any @code{:after-hook} forms declared by parent modes > -(@pxref{Derived Modes}). > +(@pxref{File Local Variables}), and @code{after-change-major-mode-hook}. > +The last thing it does is to evaluate any @code{:after-hook} forms > +declared by parent modes (@pxref{Derived Modes}). Likewise here. > --- a/doc/lispref/variables.texi > +++ b/doc/lispref/variables.texi > @@ -2014,14 +2014,20 @@ File Local Variables > @w{@samp{-*-}} line. @code{set-auto-mode} does that, also taking > @code{enable-local-variables} into account (@pxref{Auto Major Mode}). > > -This function works by walking the alist stored in > -@code{file-local-variables-alist} and applying each local variable in > -turn. It calls @code{before-hack-local-variables-hook} and > +This function also puts into effect directory-local variables as > +specified in @file{.dir-locals.el}. If the buffer is not visiting any > +file, then the directory-local variables that apply are those which > +would be applicable to files in the @code{default-directory}. Please add here a cross-reference to "Directory Local Variables". > +@defvar dir-local-variables-alist > +This buffer-local variable holds the alist of directory-local variable > +settings. Its elements have the same structure as those of > +@code{file-local-variables-alist}. When Emacs visits a file, it > +collects all the directory-local variables into this alist, and then the > +@code{hack-local-variables} function applies them one by one. > +@end defvar Should this be in the next node, "Directory Local Variables", with only a cross-reference to there in "File Local Variables"? > --- a/lisp/files.el > +++ b/lisp/files.el > @@ -4163,8 +4163,9 @@ hack-local-variables--warned-lexical > > (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. > +Also puts into effect directory-local variables. > +For buffers not visiting files, apply the directory-local variables that > +would be applicable to files in `default-directory'. I'd mention hack-dir-local-variables here. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 22:06:28 2025 Received: (at 76912-done) by debbugs.gnu.org; 12 Mar 2025 02:06:28 +0000 Received: from localhost ([127.0.0.1]:46508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tsBUJ-00082U-Ta for submit@debbugs.gnu.org; Tue, 11 Mar 2025 22:06:28 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:40342) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tsBUH-00082G-Dg for 76912-done@debbugs.gnu.org; Tue, 11 Mar 2025 22:06:26 -0400 DKIM-Signature: a=rsa-sha256; b=aOQg1ZOc9qY7ElUwpZSv5XOThCGMghnRKw5aDFWFWc6t9DNdSqRdmzt5yO8yCInqgj7KHLY3fMrwpBXavumWmYKib30BIH484PhLEuFc6iL8r/TOzmqxwBe+JY3ZXBws63BIIS8GYjuLEXLhBnlnh4wvImkNg2ceVQvlkMzu9jd0FA2b2vh9dW7PstusZX6JgDOsqH/Wux+RJaygO0kwfXgFlVExbQViTNdUQLL7hqO2SLoNDrFqYDESM68U3vrKbfeGM7xbkyy40R2IKHNjJBXYjLOSWPq5XeL9zhQHZBne1wIGGFujVAdBdO2Q9aZxq91OxvMYkL4OocQVS2SR4A==; s=purelymail1; d=spwhitton.name; v=1; bh=fllqVrWMwJNlqhHbn5peHkqBy1eS4fGhV8AgeTj83cw=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=JiwlqSbSI5s7CW+U0GQFNpPxRlO1+NbYcQlY1cRC6tRWd6EPXdMtWbE3b/z2PbkCkMtjhnYw5qRyN5P5Bs5KE2a0DkHUldArZ7+5sFjzufHtpXEAM4fc9K6YfvLSlOAC6q0gPsgiTzpQH4ydt2KiN2o8HqmC8lzQ19PS3+BNTnZoTRa6yiMa6nT0Cj+6WGxXYZUolVZyUxNfVU0fmd0IJWXlVEpyG2OZ7rMf/JDm8Nl71KiStMhJD882us2JoS6T3gCxNgKVIYqID5E3zCIm1eYfxGHG4iaVLWfTdJPSkkCyRvpk5MJRSvU/UUBgP5+a4k+Syfyd/4iR+q42kEkAug==; s=purelymail1; d=purelymail.com; v=1; bh=fllqVrWMwJNlqhHbn5peHkqBy1eS4fGhV8AgeTj83cw=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 76912-done@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1666919250; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 12 Mar 2025 02:06:11 +0000 (UTC) Received: by melete.silentflame.com (Postfix, from userid 1000) id 002277EE2A1; Wed, 12 Mar 2025 10:06:06 +0800 (CST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#76912: 31.0.50; hack-local-variables docstring inaccurate about directory-local variables In-Reply-To: <861pv3d83m.fsf@gnu.org> References: <8734fll0sr.fsf@melete.silentflame.com> <867c4wesly.fsf@gnu.org> <87r034f50o.fsf@melete.silentflame.com> <861pv3d83m.fsf@gnu.org> Date: Wed, 12 Mar 2025 10:06:06 +0800 Message-ID: <87a59ratpt.fsf@melete.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76912-done Cc: 76912-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Tue 11 Mar 2025 at 03:12pm +02, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: 76912@debbugs.gnu.org >> Date: Tue, 11 Mar 2025 14:36:07 +0800 >> >> > It would be good to document which directory is used for non-file >> > buffers, btw. >> >> How's this -- targeting the emacs-30 branch. > > Thanks, a few comments below. Thanks, changed all those and installed. I'm very glad you checked the modes.texi changes. -- Sean Whitton From unknown Fri Jun 20 19:45:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 09 Apr 2025 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator