branch: elpa/magit
commit e959ab1057016fd1759b9b4a930eca8aa71828ef
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Let the byte-compiler check more function references
The sequel. Part 1 was [1: 7f47299581].
1: 2025-01-05 7f47299581abb6f77870cb5abdae159fcd35b3d5
Let the byte-compiler check more function references
---
lisp/git-commit.el | 14 +++++++-------
lisp/magit-autorevert.el | 6 +++---
lisp/magit-base.el | 5 +++--
lisp/magit-diff.el | 10 +++++-----
lisp/magit-log.el | 10 +++++-----
lisp/magit-mode.el | 21 +++++++++++----------
lisp/magit-repos.el | 20 ++++++++++----------
lisp/magit-submodule.el | 22 +++++++++++-----------
8 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index d1cbd9ba191..aa5413f805e 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -194,12 +194,12 @@ The major mode configured here is turned on by the minor
mode
Also note that `git-commit-mode' (which see) is not a major-mode.")
(defcustom git-commit-setup-hook
- '(git-commit-ensure-comment-gap
- git-commit-save-message
- git-commit-setup-changelog-support
- git-commit-turn-on-auto-fill
- git-commit-propertize-diff
- bug-reference-mode)
+ (list #'git-commit-ensure-comment-gap
+ #'git-commit-save-message
+ #'git-commit-setup-changelog-support
+ #'git-commit-turn-on-auto-fill
+ #'git-commit-propertize-diff
+ #'bug-reference-mode)
"Hook run at the end of `git-commit-setup'."
:group 'git-commit
:type 'hook
@@ -245,7 +245,7 @@ commit, then the hook is not run at all."
:type 'number)
(defcustom git-commit-finish-query-functions
- '(git-commit-check-style-conventions)
+ (list #'git-commit-check-style-conventions)
"List of functions called to query before performing commit.
The commit message buffer is current while the functions are
diff --git a/lisp/magit-autorevert.el b/lisp/magit-autorevert.el
index f3403027999..5ddcd387bcb 100644
--- a/lisp/magit-autorevert.el
+++ b/lisp/magit-autorevert.el
@@ -58,9 +58,9 @@ is enabled."
:group 'auto-revert
:group 'magit-auto-revert
:group 'magit-related
- :type '(radio (const :tag "No filter" nil)
- (function-item magit-auto-revert-buffer-p)
- (function-item magit-auto-revert-repository-buffer-p)
+ :type `(radio (const :tag "No filter" nil)
+ (function-item ,#'magit-auto-revert-buffer-p)
+ (function-item ,#'magit-auto-revert-repository-buffer-p)
function))
(defcustom magit-auto-revert-tracked-only t
diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index e2b0d5a198a..221a86089f1 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -81,13 +81,14 @@ option to use `ivy-completing-read' or
`ivy-completing-read', note that the items may always be shown in
alphabetical order, depending on your version of Ivy."
:group 'magit-essentials
- :type '(radio (function-item magit-builtin-completing-read)
- (function-item magit-ido-completing-read)
+ :type `(radio (function-item ,#'magit-builtin-completing-read)
+ (function-item ,#'magit-ido-completing-read)
(function-item ivy-completing-read)
(function-item helm--completing-read-default)
(function :tag "Other function")))
(defcustom magit-dwim-selection
+ ;; Do not function-quote to avoid circular dependencies.
'((magit-stash-apply nil t)
(magit-ediff-resolve-all nil t)
(magit-ediff-resolve-rest nil t)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index cd1dd9c19b9..43943600e81 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -115,8 +115,8 @@
:type 'hook)
(defcustom magit-diff-sections-hook
- '(magit-insert-diff
- magit-insert-xref-buttons)
+ (list #'magit-insert-diff
+ #'magit-insert-xref-buttons)
"Hook run to insert sections into a `magit-diff-mode' buffer."
:package-version '(magit . "2.3.0")
:group 'magit-diff
@@ -317,7 +317,7 @@ here: `--stat-width', `--stat-name-width',
`--stat-graph-width'
and `--compact-summary'. See the git-diff(1) manpage."
:package-version '(magit . "3.0.0")
:group 'magit-diff
- :type '(radio (function-item magit-diff-use-window-width-as-stat-width)
+ :type `(radio (function-item ,#'magit-diff-use-window-width-as-stat-width)
function
(list string)
(const :tag "None" nil)))
@@ -339,8 +339,8 @@ and `--compact-summary'. See the git-diff(1) manpage."
:group 'magit-modes)
(defcustom magit-revision-mode-hook
- '(bug-reference-mode
- goto-address-mode)
+ (list #'bug-reference-mode
+ #'goto-address-mode)
"Hook run after entering Magit-Revision mode."
:group 'magit-revision
:type 'hook
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index 37a4f04c9e0..bb23609aaf5 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -173,8 +173,8 @@ want to use the same functions for both hooks."
"Function used to generate text shown in header line of log buffers."
:package-version '(magit . "2.12.0")
:group 'magit-log
- :type '(choice (function-item magit-log-header-line-arguments)
- (function-item magit-log-header-line-sentence)
+ :type `(choice (function-item ,#'magit-log-header-line-arguments)
+ (function-item ,#'magit-log-header-line-sentence)
function))
(defcustom magit-log-trace-definition-function #'magit-which-function
@@ -184,9 +184,9 @@ You should prefer `magit-which-function' over
`which-function'
because the latter may make use of Imenu's outdated cache."
:package-version '(magit . "3.0.0")
:group 'magit-log
- :type '(choice (function-item magit-which-function)
- (function-item which-function)
- (function-item add-log-current-defun)
+ :type `(choice (function-item ,#'magit-which-function)
+ (function-item ,#'which-function)
+ (function-item ,#'add-log-current-defun)
function))
(defcustom magit-log-color-graph-limit 256
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index efa8e6fa410..a980c44edc7 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -123,12 +123,12 @@ All Magit buffers (buffers whose major-modes derive from
which in turn uses the function specified here."
:package-version '(magit . "2.3.0")
:group 'magit-buffers
- :type '(radio (function-item magit-display-buffer-traditional)
- (function-item magit-display-buffer-same-window-except-diff-v1)
- (function-item magit-display-buffer-fullframe-status-v1)
- (function-item
magit-display-buffer-fullframe-status-topleft-v1)
- (function-item magit-display-buffer-fullcolumn-most-v1)
- (function-item display-buffer)
+ :type `(radio (function-item ,#'magit-display-buffer-traditional)
+ (function-item
,#'magit-display-buffer-same-window-except-diff-v1)
+ (function-item ,#'magit-display-buffer-fullframe-status-v1)
+ (function-item
,#'magit-display-buffer-fullframe-status-topleft-v1)
+ (function-item ,#'magit-display-buffer-fullcolumn-most-v1)
+ (function-item ,#'display-buffer)
(function :tag "Function")))
(defcustom magit-pre-display-buffer-hook
@@ -153,7 +153,7 @@ which in turn uses the function specified here."
"The function used to generate the name for a Magit buffer."
:package-version '(magit . "2.3.0")
:group 'magit-buffers
- :type '(radio (function-item magit-generate-buffer-name-default-function)
+ :type `(radio (function-item ,#'magit-generate-buffer-name-default-function)
(function :tag "Function")))
(defcustom magit-buffer-name-format "%x%M%v: %t%x"
@@ -202,9 +202,9 @@ support additional %-sequences."
"The function used to bury or kill the current Magit buffer."
:package-version '(magit . "3.2.0")
:group 'magit-buffers
- :type '(radio (function-item quit-window)
- (function-item magit-mode-quit-window)
- (function-item magit-restore-window-configuration)
+ :type `(radio (function-item ,#'quit-window)
+ (function-item ,#'magit-mode-quit-window)
+ (function-item ,#'magit-restore-window-configuration)
(function :tag "Function")))
(defcustom magit-prefix-use-buffer-arguments 'selected
@@ -1329,6 +1329,7 @@ Later, when the buffer is buried, it may be restored by
'help-echo (purecopy "mouse-2, RET: go back to next history entry"))
(defvar magit-xref-modes
+ ;; Do not function-quote to avoid circular dependencies.
'(magit-log-mode
magit-reflog-mode
magit-diff-mode
diff --git a/lisp/magit-repos.el b/lisp/magit-repos.el
index 510bb1b0927..d1f83e370b0 100644
--- a/lisp/magit-repos.el
+++ b/lisp/magit-repos.el
@@ -56,28 +56,28 @@ This option controls which repositories are being listed by
:link '(info-link "(magit)Repository List")
:group 'magit-modes)
-(defcustom magit-repolist-mode-hook '(hl-line-mode)
+(defcustom magit-repolist-mode-hook (list #'hl-line-mode)
"Hook run after entering Magit-Repolist mode."
:package-version '(magit . "2.9.0")
:group 'magit-repolist
:type 'hook
:get #'magit-hook-custom-get
- :options '(hl-line-mode))
+ :options (list #'hl-line-mode))
(defcustom magit-repolist-columns
- '(("Name" 25 magit-repolist-column-ident
+ `(("Name" 25 ,#'magit-repolist-column-ident
())
- ("Version" 25 magit-repolist-column-version
+ ("Version" 25 ,#'magit-repolist-column-version
((:sort magit-repolist-version<)))
- ("B<U" 3 magit-repolist-column-unpulled-from-upstream
+ ("B<U" 3 ,#'magit-repolist-column-unpulled-from-upstream
(;; (:help-echo "Upstream changes not in branch")
(:right-align t)
(:sort <)))
- ("B>U" 3 magit-repolist-column-unpushed-to-upstream
+ ("B>U" 3 ,#'magit-repolist-column-unpushed-to-upstream
(;; (:help-echo "Local changes not in upstream")
(:right-align t)
(:sort <)))
- ("Path" 99 magit-repolist-column-path
+ ("Path" 99 ,#'magit-repolist-column-path
()))
"List of columns displayed by `magit-list-repositories'.
@@ -118,9 +118,9 @@ than 9."
(sexp :tag "Value"))))))
(defcustom magit-repolist-column-flag-alist
- '((magit-untracked-files . "N")
- (magit-unstaged-files . "U")
- (magit-staged-files . "S"))
+ `((,#'magit-untracked-files . "N")
+ (,#'magit-unstaged-files . "U")
+ (,#'magit-staged-files . "S"))
"Association list of predicates and flags for `magit-repolist-column-flag'.
Each element is of the form (FUNCTION . FLAG). Each FUNCTION is
diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el
index d6cb3ce4805..b6129b1df7b 100644
--- a/lisp/magit-submodule.el
+++ b/lisp/magit-submodule.el
@@ -53,37 +53,37 @@ is inserted. If it is nil, then all sections listed in
:group 'magit-status
:type 'boolean)
-(defcustom magit-submodule-list-mode-hook '(hl-line-mode)
+(defcustom magit-submodule-list-mode-hook (list #'hl-line-mode)
"Hook run after entering Magit-Submodule-List mode."
:package-version '(magit . "2.9.0")
:group 'magit-repolist
:type 'hook
:get 'magit-hook-custom-get
- :options '(hl-line-mode))
+ :options (list #'hl-line-mode))
(defcustom magit-submodule-list-columns
- '(("Path" 25 magit-modulelist-column-path
+ `(("Path" 25 ,#'magit-modulelist-column-path
())
- ("Version" 25 magit-repolist-column-version
+ ("Version" 25 ,#'magit-repolist-column-version
((:sort magit-repolist-version<)))
- ("Branch" 20 magit-repolist-column-branch
+ ("Branch" 20 ,#'magit-repolist-column-branch
())
- ("B<P" 3 magit-repolist-column-unpulled-from-pushremote
+ ("B<P" 3 ,#'magit-repolist-column-unpulled-from-pushremote
((:right-align t)
(:sort <)))
- ("B<U" 3 magit-repolist-column-unpulled-from-upstream
+ ("B<U" 3 ,#'magit-repolist-column-unpulled-from-upstream
((:right-align t)
(:sort <)))
- ("B>P" 3 magit-repolist-column-unpushed-to-pushremote
+ ("B>P" 3 ,#'magit-repolist-column-unpushed-to-pushremote
((:right-align t)
(:sort <)))
- ("B>U" 3 magit-repolist-column-unpushed-to-upstream
+ ("B>U" 3 ,#'magit-repolist-column-unpushed-to-upstream
((:right-align t)
(:sort <)))
- ("S" 3 magit-repolist-column-stashes
+ ("S" 3 ,#'magit-repolist-column-stashes
((:right-align t)
(:sort <)))
- ("B" 3 magit-repolist-column-branches
+ ("B" 3 ,#'magit-repolist-column-branches
((:right-align t)
(:sort <))))
"List of columns displayed by `magit-list-submodules'.