diff options
| author | Stefan Monnier | 2023-10-21 13:05:58 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-10-21 13:05:58 -0400 |
| commit | c221db0402031c23b983eea3a6bc129e5abb98f6 (patch) | |
| tree | 4ec9e57c1bef7c1f7b2f7f002d06f5814e4627a0 | |
| parent | 1e25f1d997848375ca301bea8192c806bcd5fa4b (diff) | |
| download | emacs-c221db0402031c23b983eea3a6bc129e5abb98f6.tar.gz emacs-c221db0402031c23b983eea3a6bc129e5abb98f6.zip | |
so-long.el: Don't load `advice` during compilation
* lisp/so-long.el: Prefer #' to quote function names.
(global-so-long-mode): Remove redundant `:group` arg.
(<toplevel>): Don't load needlessly the obsolete `advice` library
during compilation.
| -rw-r--r-- | lisp/so-long.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/so-long.el b/lisp/so-long.el index b93b047ce55..b7cfce31173 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el | |||
| @@ -310,7 +310,7 @@ | |||
| 310 | ;; possibly also `so-long-max-lines' and `so-long-skip-leading-comments' (these | 310 | ;; possibly also `so-long-max-lines' and `so-long-skip-leading-comments' (these |
| 311 | ;; latter two are not used by default starting from Emacs 28.1). E.g.: | 311 | ;; latter two are not used by default starting from Emacs 28.1). E.g.: |
| 312 | ;; | 312 | ;; |
| 313 | ;; (add-hook 'js-mode-hook 'my-js-mode-hook) | 313 | ;; (add-hook 'js-mode-hook #'my-js-mode-hook) |
| 314 | ;; | 314 | ;; |
| 315 | ;; (defun my-js-mode-hook () | 315 | ;; (defun my-js-mode-hook () |
| 316 | ;; "Custom `js-mode' behaviors." | 316 | ;; "Custom `js-mode' behaviors." |
| @@ -324,7 +324,7 @@ | |||
| 324 | ;; set `bidi-inhibit-bpa' in XML files, on the basis that XML files with long | 324 | ;; set `bidi-inhibit-bpa' in XML files, on the basis that XML files with long |
| 325 | ;; lines are less likely to trigger BPA-related performance problems: | 325 | ;; lines are less likely to trigger BPA-related performance problems: |
| 326 | ;; | 326 | ;; |
| 327 | ;; (add-hook 'nxml-mode-hook 'my-nxml-mode-hook) | 327 | ;; (add-hook 'nxml-mode-hook #'my-nxml-mode-hook) |
| 328 | ;; | 328 | ;; |
| 329 | ;; (defun my-nxml-mode-hook () | 329 | ;; (defun my-nxml-mode-hook () |
| 330 | ;; "Custom `nxml-mode' behaviors." | 330 | ;; "Custom `nxml-mode' behaviors." |
| @@ -366,7 +366,7 @@ | |||
| 366 | ;; variable. Refer to M-: (info "(emacs) Specifying File Variables") RET | 366 | ;; variable. Refer to M-: (info "(emacs) Specifying File Variables") RET |
| 367 | ;; | 367 | ;; |
| 368 | ;; `so-long-minor-mode' can also be called directly if desired. e.g.: | 368 | ;; `so-long-minor-mode' can also be called directly if desired. e.g.: |
| 369 | ;; (add-hook 'FOO-mode-hook 'so-long-minor-mode) | 369 | ;; (add-hook 'FOO-mode-hook #'so-long-minor-mode) |
| 370 | ;; | 370 | ;; |
| 371 | ;; In Emacs 26.1 or later (see "Caveats" below) you also have the option of | 371 | ;; In Emacs 26.1 or later (see "Caveats" below) you also have the option of |
| 372 | ;; using file-local and directory-local variables to determine how `so-long' | 372 | ;; using file-local and directory-local variables to determine how `so-long' |
| @@ -1320,8 +1320,8 @@ This minor mode is a standard `so-long-action' option." | |||
| 1320 | (so-long--ensure-enabled) | 1320 | (so-long--ensure-enabled) |
| 1321 | (setq so-long--active t | 1321 | (setq so-long--active t |
| 1322 | so-long-detected-p t | 1322 | so-long-detected-p t |
| 1323 | so-long-function 'turn-on-so-long-minor-mode | 1323 | so-long-function #'turn-on-so-long-minor-mode |
| 1324 | so-long-revert-function 'turn-off-so-long-minor-mode) | 1324 | so-long-revert-function #'turn-off-so-long-minor-mode) |
| 1325 | (so-long-remember-all :reset) | 1325 | (so-long-remember-all :reset) |
| 1326 | (unless (derived-mode-p 'so-long-mode) | 1326 | (unless (derived-mode-p 'so-long-mode) |
| 1327 | (setq so-long-mode-line-info (so-long-mode-line-info)))) | 1327 | (setq so-long-mode-line-info (so-long-mode-line-info)))) |
| @@ -1345,7 +1345,7 @@ This minor mode is a standard `so-long-action' option." | |||
| 1345 | 1345 | ||
| 1346 | (defvar so-long-mode-map | 1346 | (defvar so-long-mode-map |
| 1347 | (let ((map (make-sparse-keymap))) | 1347 | (let ((map (make-sparse-keymap))) |
| 1348 | (define-key map (kbd "C-c C-c") 'so-long-revert) | 1348 | (define-key map (kbd "C-c C-c") #'so-long-revert) |
| 1349 | ;; Define the major mode menu. We have an awkward issue whereby | 1349 | ;; Define the major mode menu. We have an awkward issue whereby |
| 1350 | ;; [menu-bar so-long] is already defined in the global map and is | 1350 | ;; [menu-bar so-long] is already defined in the global map and is |
| 1351 | ;; :visible so-long-detected-p, but we also want this to be | 1351 | ;; :visible so-long-detected-p, but we also want this to be |
| @@ -1396,12 +1396,12 @@ configure the behavior." | |||
| 1396 | (so-long--ensure-enabled) | 1396 | (so-long--ensure-enabled) |
| 1397 | (setq so-long--active t | 1397 | (setq so-long--active t |
| 1398 | so-long-detected-p t | 1398 | so-long-detected-p t |
| 1399 | so-long-function 'so-long-mode | 1399 | so-long-function #'so-long-mode |
| 1400 | so-long-revert-function 'so-long-mode-revert)) | 1400 | so-long-revert-function #'so-long-mode-revert)) |
| 1401 | ;; Use `after-change-major-mode-hook' to disable minor modes and override | 1401 | ;; Use `after-change-major-mode-hook' to disable minor modes and override |
| 1402 | ;; variables. Append, to act after any globalized modes have acted. | 1402 | ;; variables. Append, to act after any globalized modes have acted. |
| 1403 | (add-hook 'after-change-major-mode-hook | 1403 | (add-hook 'after-change-major-mode-hook |
| 1404 | 'so-long-after-change-major-mode :append :local) | 1404 | #'so-long-after-change-major-mode :append :local) |
| 1405 | ;; Override variables. This is the first of two instances where we do this | 1405 | ;; Override variables. This is the first of two instances where we do this |
| 1406 | ;; (the other being `so-long-after-change-major-mode'). It is desirable to | 1406 | ;; (the other being `so-long-after-change-major-mode'). It is desirable to |
| 1407 | ;; set variables here in order to cover cases where the setting of a variable | 1407 | ;; set variables here in order to cover cases where the setting of a variable |
| @@ -1591,8 +1591,8 @@ because we do not want to downgrade the major mode in that scenario." | |||
| 1591 | (when (and (symbolp (so-long-function)) | 1591 | (when (and (symbolp (so-long-function)) |
| 1592 | (provided-mode-derived-p (so-long-function) 'so-long-mode)) | 1592 | (provided-mode-derived-p (so-long-function) 'so-long-mode)) |
| 1593 | ;; Downgrade from `so-long-mode' to the `so-long-minor-mode' behavior. | 1593 | ;; Downgrade from `so-long-mode' to the `so-long-minor-mode' behavior. |
| 1594 | (setq so-long-function 'turn-on-so-long-minor-mode | 1594 | (setq so-long-function #'turn-on-so-long-minor-mode |
| 1595 | so-long-revert-function 'turn-off-so-long-minor-mode)))) | 1595 | so-long-revert-function #'turn-off-so-long-minor-mode)))) |
| 1596 | 1596 | ||
| 1597 | (defun so-long-inhibit (&optional _mode) | 1597 | (defun so-long-inhibit (&optional _mode) |
| 1598 | "Prevent `global-so-long-mode' from having any effect. | 1598 | "Prevent `global-so-long-mode' from having any effect. |
| @@ -1897,7 +1897,6 @@ Use \\[so-long-commentary] for more information. | |||
| 1897 | Use \\[so-long-customize] to open the customization group `so-long' to | 1897 | Use \\[so-long-customize] to open the customization group `so-long' to |
| 1898 | configure the behavior." | 1898 | configure the behavior." |
| 1899 | :global t | 1899 | :global t |
| 1900 | :group 'so-long | ||
| 1901 | (if global-so-long-mode | 1900 | (if global-so-long-mode |
| 1902 | ;; Enable | 1901 | ;; Enable |
| 1903 | (progn | 1902 | (progn |
| @@ -2030,7 +2029,7 @@ If it appears in `%s', you should remove it." | |||
| 2030 | ;; Update to version 1.0 from earlier versions: | 2029 | ;; Update to version 1.0 from earlier versions: |
| 2031 | (when (version< so-long-version "1.0") | 2030 | (when (version< so-long-version "1.0") |
| 2032 | (remove-hook 'change-major-mode-hook 'so-long-change-major-mode) | 2031 | (remove-hook 'change-major-mode-hook 'so-long-change-major-mode) |
| 2033 | (eval-and-compile (require 'advice)) ;; Both macros and functions. | 2032 | (require 'advice) ;; It should already be loaded, but just in case. |
| 2034 | (declare-function ad-find-advice "advice") | 2033 | (declare-function ad-find-advice "advice") |
| 2035 | (declare-function ad-remove-advice "advice") | 2034 | (declare-function ad-remove-advice "advice") |
| 2036 | (declare-function ad-activate "advice") | 2035 | (declare-function ad-activate "advice") |