branch: externals/doc-view-follow commit c5dad4fd8d7285f31c038f17e9a7100e05377174 Author: Paul Nelson <ultr...@gmail.com> Commit: Paul Nelson <ultr...@gmail.com>
Fix ordering of `doc-follow-mode` definition Move minor mode definition before functions that use it to avoid forward references. * doc-follow.el (doc-follow-mode): Move definition before the functions that reference it, placing it after variable definitions but before `doc-follow--sync-pages`. --- doc-follow.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc-follow.el b/doc-follow.el index 9a6eecdab0..4d06e17225 100644 --- a/doc-follow.el +++ b/doc-follow.el @@ -84,6 +84,15 @@ by adding entries to this list.") (defvar doc-follow--sync-in-progress nil "Flag to prevent recursive sync operations.") +;;;###autoload +(define-minor-mode doc-follow-mode + "Minor mode to sync pages between two windows showing the same document." + :global nil + (if doc-follow-mode + (doc-follow--manage-advice 'add) + (unless (doc-follow--some-buffer-active-p) + (doc-follow--manage-advice 'remove)))) + (defun doc-follow--sync-pages (&rest _args) "Sync pages between windows showing the same document." (when (and doc-follow-mode @@ -123,15 +132,6 @@ ADD-OR-REMOVE should be either 'add or 'remove." (buffer-local-value 'doc-follow-mode buf)) (buffer-list))) -;;;###autoload -(define-minor-mode doc-follow-mode - "Minor mode to sync pages between two windows showing the same document." - :global nil - (if doc-follow-mode - (doc-follow--manage-advice 'add) - (unless (doc-follow--some-buffer-active-p) - (doc-follow--manage-advice 'remove)))) - (defun doc-follow--maybe-enable () "Enable `doc-follow-mode' if appropriate for this buffer." (when (assq major-mode doc-follow-modes)