GNU bug report logs - #77679
[PATCH] recentf, abbrev: insert a lexical-binding cookie

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; Reported by: Arsen Arsenović <arsen@HIDDEN>; Keywords: wontfix notabug patch; Done: Eli Zaretskii <eliz@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 77679 <at> debbugs.gnu.org and Arsen Arsenović <arsen@HIDDEN> Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) wontfix and notabug. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 77679) by debbugs.gnu.org; 9 Apr 2025 13:11:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 09 09:11:24 2025
Received: from localhost ([127.0.0.1]:38313 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u2VDA-00058r-5i
	for submit <at> debbugs.gnu.org; Wed, 09 Apr 2025 09:11:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:54838)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>)
 id 1u2VD7-00058W-5v; Wed, 09 Apr 2025 09:11:22 -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 1u2VCz-0008Uj-RB; Wed, 09 Apr 2025 09:11:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Hi7EUca9r1vnNSxe5lpLqbKzI+ftB3WhjGQzbKbBGjA=; b=bMVIIsBr3pVvcbfrUZqq
 aI4CrXR0VVjIV5DHGt29Nmzr46Us1XRl4XMgTtvOM9i8aHfA4c3FrKtJyHFuBRYUKmae+S1wx5cDo
 OGYXQ/v/roWpwNC6hZtMoD7fa5u072N50Vwa8ZXkMz2eQFMojEoZrSMIj+rPPFYyoVTYS49NuIm17
 hpKcFVn9WvD1BGLjf0Nnp0d/coKftoY2Dy7Tz5FfCrJASi/lRmxARjZSt6rpZrF+e/4laso91i6J7
 c0tI7jh6CexxtoI9+gUztbxLJCR4SSLzwCdbCc/fjNGLBPNYUlrBpk3PwuNg/OiibpCQ5XJPbhcZI
 6Dsm+fvC2rBVTw==;
Date: Wed, 09 Apr 2025 16:10:49 +0300
Message-Id: <864iyxsco6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Arsen =?utf-8?Q?Arsenovi=C4=87?= <arsen@HIDDEN>
In-Reply-To: <20250409122249.1672647-1-arsen@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#77679: [PATCH] recentf,
 abbrev: insert a lexical-binding cookie
References: <20250409122249.1672647-1-arsen@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77679
Cc: 77679 <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 (---)

tags 77679 notabug wontfix
close 77679

> Cc: Arsen Arsenović <arsen@HIDDEN>
> Date: Wed,  9 Apr 2025 14:21:06 +0200
> From:  Arsen Arsenović via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> * lisp/recentf.el (recentf-save-file-header): Change default
> header to include a lexical-binding cookie.
> * lisp/abbrev.el (write-abbrev-file): Insert a lexical-binding
> cookie into abbrev files.
> ---
> This fixes a few lexical-binding warnings I noticed when updating Emacs
> today.

Thanks, but sorry, no.  We cannot make this change, definitely not as
a means to avoid this new warning, because there are gazillions of
such files out there, and we cannot possibly annoy users who will
upgrade to Emacs 31 due to these files.

We should instead disable the warning when these files are loaded.
The warning is for Lisp programs written by users, not for snippets of
Lisp written by Emacs itself for its own consumption.

I'm therefore closing this non-bug.




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

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


Received: (at submit) by debbugs.gnu.org; 9 Apr 2025 12:23:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 09 08:23:28 2025
Received: from localhost ([127.0.0.1]:38171 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u2USl-0002Zs-5I
	for submit <at> debbugs.gnu.org; Wed, 09 Apr 2025 08:23:27 -0400
Received: from lists.gnu.org ([2001:470:142::17]:55164)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <arsen@HIDDEN>) id 1u2USh-0002Zb-Mf
 for submit <at> debbugs.gnu.org; Wed, 09 Apr 2025 08:23:24 -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 <arsen@HIDDEN>) id 1u2USb-0002w4-5y
 for bug-gnu-emacs@HIDDEN; Wed, 09 Apr 2025 08:23:17 -0400
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <arsen@HIDDEN>) id 1u2USZ-0000g9-H3
 for bug-gnu-emacs@HIDDEN; Wed, 09 Apr 2025 08:23:16 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4ZXhtB0cZTz9t7h;
 Wed,  9 Apr 2025 14:22:58 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; 
 t=1744201378;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=Rsezfar9Ian9vY5su+dvKRz4z+bvD0GIvRHSQAFY8TE=;
 b=g5xcppfydpEd0q5REWEXSzdrgt98fUmOlCg/RFj9KfX6nC1kOc2PDU1B7bWEqeImn/HNHD
 nZVwyYB4WL98ELQDoRgPuZPKoRFXJvmASjbSqskaI70Puai1czI8iH9Jhvifde1fboMRyk
 FTA3/d7aIzdCUaZV8nBvyykw3+Y5zgIcDsJDdOdk9DI8+pVuyrSNtKhmSXvxTErCbQNMvu
 b8FE0VszAFLft88dwPul8SYzXvHoYY8aCYqgjX/qdDxi+aA7k41EqjXqJUUR9b1diQnmqb
 Xvak1a47JmEsWtFjfPpIFU/yJ746xyhYP/SSON/Msk3sAh8XzQyZnWhrNIpoww==
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] recentf, abbrev: insert a lexical-binding cookie
Date: Wed,  9 Apr 2025 14:21:06 +0200
Message-ID: <20250409122249.1672647-1-arsen@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2001:67c:2050:0:465::202;
 envelope-from=arsen@HIDDEN; helo=mout-p-202.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
Cc: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@HIDDEN>
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.3 (/)

* lisp/recentf.el (recentf-save-file-header): Change default
header to include a lexical-binding cookie.
* lisp/abbrev.el (write-abbrev-file): Insert a lexical-binding
cookie into abbrev files.
---
This fixes a few lexical-binding warnings I noticed when updating Emacs
today.

 lisp/abbrev.el  | 3 ++-
 lisp/recentf.el | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 93eb086da7a..2868919283a 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -270,7 +270,8 @@ write-abbrev-file
       (when (unencodable-char-position (point-min) (point-max) 'utf-8)
 	(setq coding-system-for-write 'utf-8-emacs))
       (goto-char (point-min))
-      (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write))
+      (insert (format ";;-*-coding: %s; lexical-binding: t;-*-\n"
+                      coding-system-for-write))
       (write-region nil nil file nil (and (not verbose) 0)))))
 
 (defun abbrev-edit-save-to-file (file)
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 172ce704d93..c58964959e8 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1316,7 +1316,8 @@ recentf-open-most-recent-file
 ;;; Save/load/cleanup the recent list
 ;;
 (defconst recentf-save-file-header
-  ";;; Automatically generated by `recentf' on %s.  -*- mode: lisp-data -*-\n"
+  ";;; Automatically generated by `recentf' on %s.  \
+-*- mode: lisp-data; lexical-binding: t; -*-\n"
   "Header to be written into the `recentf-save-file'.")
 
 (defconst recentf-save-file-coding-system
-- 
2.49.0





Acknowledgement sent to Arsen Arsenović <arsen@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#77679; 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: Wed, 9 Apr 2025 13:15:02 UTC

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