branch: scratch/evil
commit 233dde76425fc1e083145869f69abdf1ebbce328
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>
Miscellanous minor changes.
Use #' to quote function names at a few more places.
* evil-types.el (inclusive): Silence warning.
* evil-macros.el (font-lock-add-keywords): Use the font-lock faces
rather than their obsolete variables.
* evil-ex.el (evil-ex-define-argument-type): Make sure the function
arguments can be compiled.
(evil-ex-init-shell-argument-completion): Don't let-bind
`completion-at-point-functions` because hooks aren't just variables.
* evil-core.el (evil--local-advice-add): New function.
(evil--global-advice-list): Rename from `evil--advice-list`.
(evil-mode): Only activate the global advices.
(evil--global-advice-add): Rename from `evil--advice-add`.
---
evil-core.el | 8 ++++----
evil-ex.el | 12 ++++++------
evil-macros.el | 8 ++++----
evil-types.el | 2 +-
evil-vars.el | 4 ++--
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/evil-core.el b/evil-core.el
index 8608b6bb08..518accc44e 100644
--- a/evil-core.el
+++ b/evil-core.el
@@ -134,12 +134,12 @@
(evil-initialize-state)
(add-hook 'input-method-activate-hook #'evil-activate-input-method t t)
(add-hook 'input-method-deactivate-hook #'evil-deactivate-input-method
t t)
- (add-hook 'activate-mark-hook 'evil-visual-activate-hook nil t)
+ (add-hook 'activate-mark-hook #'evil-visual-activate-hook nil t)
;; FIXME: Add these hooks buffer-locally and remove when disabling
- (add-hook 'pre-command-hook 'evil-repeat-pre-hook)
- (add-hook 'post-command-hook 'evil-repeat-post-hook))
+ (add-hook 'pre-command-hook #'evil-repeat-pre-hook)
+ (add-hook 'post-command-hook #'evil-repeat-post-hook))
(evil-refresh-mode-line)
- (remove-hook 'activate-mark-hook 'evil-visual-activate-hook t)
+ (remove-hook 'activate-mark-hook #'evil-visual-activate-hook t)
(remove-hook 'input-method-activate-hook #'evil-activate-input-method t)
(remove-hook 'input-method-deactivate-hook #'evil-deactivate-input-method
t)
(activate-input-method evil-input-method)
diff --git a/evil-ex.el b/evil-ex.el
index 246aa0d760..d91dd395f8 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -633,13 +633,13 @@ and function:
(func (pop body)))
(cond
((eq key :runner)
- (setq runner func))
+ (setq runner `#',func))
((eq key :collection)
- (setq completer (cons 'collection func)))
+ (setq completer `(cons 'collection #',func)))
((eq key :completion-at-point)
- (setq completer (cons 'completion-at-point func))))))
+ (setq completer `(cons 'completion-at-point #',func))))))
`(evil--add-to-alist evil-ex-argument-types
- ',arg-type '(,runner ,completer))))
+ ',arg-type (list ,runner ,completer))))
(evil-ex-define-argument-type file
"Handle a file argument."
@@ -666,8 +666,8 @@ argument handler that requires shell completion."
(require 'shell)
;; Set up Comint for Shell mode, except
;; `comint-completion-at-point' will be called manually.
- (let (completion-at-point-functions)
- (shell-completion-vars))))
+ (shell-completion-vars)
+ (remove-hook 'completion-at-point-functions #'comint-completion-at-point
t)))
(evil-ex-define-argument-type shell
"Shell argument type, supports completion."
diff --git a/evil-macros.el b/evil-macros.el
index 86eb8677b5..7589dffd67 100644
--- a/evil-macros.el
+++ b/evil-macros.el
@@ -762,13 +762,13 @@ via KEY-VALUE pairs. BODY should evaluate to a list of
values.
'(("(\\(evil-\\(?:ex-\\)?define-\
\\(?:[^ k][^ e][^ y]\\|[-[:word:]]\\{4,\\}\\)\\)\
\\>[ \f\t\n\r\v]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
- (1 font-lock-keyword-face)
- (2 font-lock-function-name-face nil t))
+ (1 'font-lock-keyword-face)
+ (2 'font-lock-function-name-face nil t))
("(\\(evil-\\(?:delay\\|narrow\\|signal\\|save\\|with\\(?:out\\)?\\)\
\\(?:-[-[:word:]]+\\)?\\)\\>\[ \f\t\n\r\v]+"
- 1 font-lock-keyword-face)
+ 1 'font-lock-keyword-face)
("(\\(evil-\\(?:[-[:word:]]\\)*loop\\)\\>[ \f\t\n\r\v]+"
- 1 font-lock-keyword-face))))
+ 1 'font-lock-keyword-face))))
(provide 'evil-macros)
diff --git a/evil-types.el b/evil-types.el
index 33f73c41d1..395dc2fa6b 100644
--- a/evil-types.el
+++ b/evil-types.el
@@ -93,7 +93,7 @@ If the end position is at the beginning of a line, then:
Handling for `evil-want-visual-char-semi-exclusive' is deprecated,
and will be removed in a future version."
:expand (lambda (beg end)
- (if (and evil-want-visual-char-semi-exclusive
+ (if (and (with-no-warnings evil-want-visual-char-semi-exclusive)
(evil-visual-state-p)
(< beg end)
(save-excursion
diff --git a/evil-vars.el b/evil-vars.el
index ad75421289..9bcc37c53f 100644
--- a/evil-vars.el
+++ b/evil-vars.el
@@ -2045,8 +2045,8 @@ This variable must be set before evil is loaded."
:set #'(lambda (sym value)
(set-default sym value)
(if value
- (add-hook 'minibuffer-setup-hook 'evil-initialize)
- (remove-hook 'minibuffer-setup-hook 'evil-initialize))))
+ (add-hook 'minibuffer-setup-hook #'evil-initialize)
+ (remove-hook 'minibuffer-setup-hook #'evil-initialize))))
(defun evil--redo-placeholder (_count)
(user-error "Customize `evil-undo-system' for redo functionality."))