branch: elpa/magit
commit 07bcac67e343bde801fb3096f9e73cfff76cc0b1
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-post-refresh-hook: Autoload hook functions
Closes #5464.
---
lisp/magit-apply.el | 2 ++
lisp/magit-autorevert.el | 1 +
lisp/magit-commit.el | 1 +
lisp/magit-mode.el | 1 +
4 files changed, 5 insertions(+)
diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el
index c19e8860c61..75457ce8a66 100644
--- a/lisp/magit-apply.el
+++ b/lisp/magit-apply.el
@@ -396,6 +396,7 @@ ignored) files."
#'magit-stage-modified
'magit-file-stage))
+;;;###autoload
(defun magit-run-post-stage-hook ()
(when (memq this-command magit-post-stage-hook-commands)
(magit-run-hook-with-benchmark 'magit-post-stage-hook)))
@@ -473,6 +474,7 @@ ignored) files."
#'magit-unstage-all
'magit-file-unstage))
+;;;###autoload
(defun magit-run-post-unstage-hook ()
(when (memq this-command magit-post-unstage-hook-commands)
(magit-run-hook-with-benchmark 'magit-post-unstage-hook)))
diff --git a/lisp/magit-autorevert.el b/lisp/magit-autorevert.el
index 35403bdc431..0f5a86cf913 100644
--- a/lisp/magit-autorevert.el
+++ b/lisp/magit-autorevert.el
@@ -204,6 +204,7 @@ Also, you should not use `after-init-hook' to disable this
mode.
\(fn &optional ARG)")
+;;;###autoload
(defun magit-auto-revert-buffers ()
(when (and magit-auto-revert-immediately
(or global-auto-revert-mode
diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index e7949239548..4e4771c52b2 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -646,6 +646,7 @@ an alternative implementation."
#'magit-commit-instant-fixup
#'magit-commit-instant-squash))
+;;;###autoload
(defun magit-run-post-commit-hook ()
(when (and (not this-command)
(memq last-command magit-post-commit-hook-commands))
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 3cb0d4b15f7..cb0b0bcdf38 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -93,6 +93,7 @@ inside your function."
(defcustom magit-post-refresh-hook
;; Do not function-quote to avoid circular dependencies.
+ ;; Functions added here have to be autoloaded.
'(magit-auto-revert-buffers
magit-run-post-commit-hook
magit-run-post-stage-hook