Skip to content

Commit

Permalink
Miscellaneous minor changes
Browse files Browse the repository at this point in the history
* evil-common.el (evil-with-delay): Add comment for last change.
* 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.
  • Loading branch information
monnier authored and axelf4 committed Sep 15, 2024
1 parent eb9586c commit 2800f91
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions evil-common.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ If LOCAL is non-nil, the buffer-local value of HOOK is modified."
(macroexp-let2* nil
((fun-name `(make-symbol
,(or name (format "evil-delay-in-%s" hook-sym))))
;; `apply-partially' is used in case this macro is expanded
;; (via `evil-define-key') in a file which still does not
;; activate `lexical-binding'.
(fun `(apply-partially
(lambda (name &rest _)
(when ,(or condition t)
Expand Down
12 changes: 6 additions & 6 deletions evil-ex.el
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,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."
Expand All @@ -668,8 +668,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."
Expand Down
8 changes: 4 additions & 4 deletions evil-macros.el
Original file line number Diff line number Diff line change
Expand Up @@ -759,13 +759,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)

Expand Down

0 comments on commit 2800f91

Please sign in to comment.