Subject: Re: bug#78446: [PATCH] * lisp/emacs-lisp/find-func.el: Fix Eager macro-expansion failure

From: Lin Sun <[email-masked]>
Date: Wed, 21 May 2025 15:40:16 +0000

> LGTM, except that the comment should begin with a capital letter.

Sure, fixed in the attached patch. Thanks all of you.
From d21801e92b1eb7e5cacb576e272a4f43c74c031b Mon Sep 17 00:00:00 2001
From: Lin Sun <[email-masked]>
Date: Thu, 15 May 2025 06:30:44 +0000
Subject: [PATCH] * lisp/emacs-lisp/find-func.el: Fix Eager macro-expansion
 failure

---
 lisp/emacs-lisp/find-func.el | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 6bdfb4bc38b..4d315556433 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -197,20 +197,9 @@ find-library-include-other-files
   :version "29.1"
   :group 'find-function)
 
-(defcustom find-function-mode-lower-precedence nil
-  "If non-nil, `find-function-mode' defines keys in the global map.
-This is for compatibility with the historical behavior of
-the old `find-function-setup-keys'."
-  :type 'boolean
-  :version "31.1"
-  :group 'find-function
-  :set (lambda (symbol value)
-         ;; Toggle the mode off before changing this setting in order to
-         ;; avoid getting into an inconsistent state.
-         (let ((already-on find-function-mode))
-           (when already-on (find-function-mode -1))
-           (set-default symbol value)
-           (when already-on (find-function-mode 1)))))
+;; Compiler defvars.  The variable will be defined later with
+;; `defcustom' when everything used in the :set functions is defined.
+(defvar find-function-mode-lower-precedence)
 
 ;;; Functions:
 
@@ -891,6 +880,22 @@ find-function-setup-keys
   (find-function-mode 1))
 (make-obsolete 'find-function-setup-keys 'find-function-mode "31.1")
 
+;; Custom variables with :set requires everything be defined
+(defcustom find-function-mode-lower-precedence nil
+  "If non-nil, `find-function-mode' defines keys in the global map.
+This is for compatibility with the historical behavior of
+the old `find-function-setup-keys'."
+  :type 'boolean
+  :version "31.1"
+  :group 'find-function
+  :set (lambda (symbol value)
+         ;; Toggle the mode off before changing this setting in order to
+         ;; avoid getting into an inconsistent state.
+         (let ((already-on find-function-mode))
+           (when already-on (find-function-mode -1))
+           (set-default symbol value)
+           (when already-on (find-function-mode 1)))))
+
 (provide 'find-func)
 
 ;;; find-func.el ends here
-- 
2.34.1