Skip to content

Commit

Permalink
Prefer #' to quote function names
Browse files Browse the repository at this point in the history
  • Loading branch information
monnier authored and axelf4 committed Aug 7, 2023
1 parent 623de71 commit fa41a49
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 71 deletions.
16 changes: 8 additions & 8 deletions evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -3234,7 +3234,7 @@ not interfere with another."
(if (null list)
(user-error
"Enable one of the following modes for folding to work: %s"
(mapconcat 'symbol-name (mapcar 'caar evil-fold-list) ", "))
(mapconcat #'symbol-name (mapcar #'caar evil-fold-list) ", "))
(let* ((modes (caar list)))
(if (evil--mode-p modes)
(let* ((actions (cdar list))
Expand Down Expand Up @@ -5105,9 +5105,9 @@ if the previous state was Emacs state."
"No insert-state repeat info is recorded after executing in normal state.
Restore the disabled repeat hooks on insert-state exit."
(evil-repeat-stop)
(add-hook 'pre-command-hook 'evil-repeat-pre-hook)
(add-hook 'post-command-hook 'evil-repeat-post-hook)
(remove-hook 'evil-insert-state-exit-hook 'evil--restore-repeat-hooks))
(add-hook 'pre-command-hook #'evil-repeat-pre-hook)
(add-hook 'post-command-hook #'evil-repeat-post-hook)
(remove-hook 'evil-insert-state-exit-hook #'evil--restore-repeat-hooks))

(defvar evil--execute-normal-return-state nil
"The state to return to after executing in normal state.")
Expand Down Expand Up @@ -5146,9 +5146,9 @@ Restore the disabled repeat hooks on insert-state exit."
(unless (memq evil-state '(replace insert))
(evil-change-state ',evil-state))
(when (eq 'insert evil-state)
(remove-hook 'pre-command-hook 'evil-repeat-pre-hook)
(remove-hook 'post-command-hook 'evil-repeat-post-hook)
(add-hook 'evil-insert-state-exit-hook 'evil--restore-repeat-hooks))
(remove-hook 'pre-command-hook #'evil-repeat-pre-hook)
(remove-hook 'post-command-hook #'evil-repeat-post-hook)
(add-hook 'evil-insert-state-exit-hook #'evil--restore-repeat-hooks))
(setq evil-execute-normal-keys nil))
'post-command-hook)
(setq evil-insert-count nil
Expand All @@ -5161,7 +5161,7 @@ Restore the disabled repeat hooks on insert-state exit."
(defun evil-stop-execute-in-emacs-state ()
(when (and (not (eq this-command #'evil-execute-in-emacs-state))
(not (minibufferp)))
(remove-hook 'post-command-hook 'evil-stop-execute-in-emacs-state)
(remove-hook 'post-command-hook #'evil-stop-execute-in-emacs-state)
(when (buffer-live-p evil-execute-in-emacs-state-buffer)
(with-current-buffer evil-execute-in-emacs-state-buffer
(if (and (eq evil-previous-state 'visual)
Expand Down
10 changes: 5 additions & 5 deletions evil-common.el
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ last, sorting in between."
,(when (and command doc-form)
`(put ',command 'function-documentation ,doc-form))
;; set command properties for symbol or lambda function
(let ((func ',(if (and (null command) body)
`(lambda ,args
,interactive
,@body)
command)))
(let ((func ,(if (and (null command) body)
`(lambda ,args
,interactive
,@body)
`#',command)))
(apply #'evil-set-command-properties func ',keys)
func))))

Expand Down
2 changes: 1 addition & 1 deletion evil-integration.el
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ Based on `evil-enclose-ace-jump-for-motion'."
(expand-abbrev)))

(eval-after-load 'abbrev
'(add-hook 'evil-insert-state-exit-hook 'evil-maybe-expand-abbrev))
'(add-hook 'evil-insert-state-exit-hook #'evil-maybe-expand-abbrev))

;;; ElDoc
(eval-after-load 'eldoc
Expand Down
4 changes: 2 additions & 2 deletions evil-search.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ To swap out relevant keybindings, see `evil-select-search-module' function."
:type '(radio (const :tag "Emacs built-in isearch." :value isearch)
(const :tag "Evil interactive search." :value evil-search))
:group 'evil
:set 'evil-select-search-module
:initialize 'evil-custom-initialize-pending-reset)
:set #'evil-select-search-module
:initialize #'evil-custom-initialize-pending-reset)

(defun evil-push-search-history (string forward)
"Push STRING into the appropriate search history (determined by FORWARD)."
Expand Down
58 changes: 29 additions & 29 deletions evil-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ New Tex[t]
";; [T]his buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y3s")
(should (string= (current-kill 0) "Thi\nIf \nthe"))
(should (eq (car-safe (get-text-property 0 'yank-handler
Expand Down Expand Up @@ -2057,7 +2057,7 @@ New Tex[t]
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("d3s")
"[T]his buffer is for notes you don't want to save.
If you want to create a file, visit that file with C-x C-f,
Expand Down Expand Up @@ -2302,7 +2302,7 @@ for this test."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("c3sABC" [escape])
"AB[C]This buffer is for notes you don't want to save.
ABCIf you want to create a file, visit that file with C-x C-f,
Expand Down Expand Up @@ -2615,7 +2615,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ysP")
"[;]; ;; This buffer is for notes you don't want to save.
;; ;; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2625,7 +2625,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ys2P")
"[;]; ;; ;; This buffer is for notes you don't want to save.
;; ;; ;; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2635,7 +2635,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; Above some line

;; Below some empty line"
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ys2P")
"[;]; ;; ;; Above some line
\n\
Expand All @@ -2645,7 +2645,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ysj")
";; This buffer is for notes you don't want to save.
\[;]; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2660,7 +2660,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ys$")
";; This buffer is for notes you don't want to save[.]
;; If you want to create a file, visit that file with C-x C-f,
Expand Down Expand Up @@ -2742,7 +2742,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ysp")
";[;]; ; This buffer is for notes you don't want to save.
;;; ; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2752,7 +2752,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ys2p")
";[;]; ;; ; This buffer is for notes you don't want to save.
;;; ;; ; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2762,7 +2762,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; Above some line

;; Below some empty line"
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ys2p")
";;; ;; ; Above some line

Expand All @@ -2772,7 +2772,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ysj")
";; This buffer is for notes you don't want to save.
\[;]; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2787,7 +2787,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("3ys$")
";; This buffer is for notes you don't want to save[.]
;; If you want to create a file, visit that file with C-x C-f,
Expand Down Expand Up @@ -2817,7 +2817,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sj")
";; This buffer is for notes you don't want to save.
\[;]; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2832,7 +2832,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjP\C-p")
";; This buffer is for notes you don't want to save.
\[;]; This buffer is for notes you don't want to save.
Expand All @@ -2844,7 +2844,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjP\C-p\C-p")
";; This buffer is for notes you don't want to save.
;; Thi[s];; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2854,7 +2854,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjP2\C-p")
";; This buffer is for notes you don't want to save.
;; Thi[s];; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2864,7 +2864,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjP2\C-p\C-n")
";; This buffer is for notes you don't want to save.
\[;]; This buffer is for notes you don't want to save.
Expand All @@ -2876,7 +2876,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjP\C-p\C-p2\C-n")
";; This buffer is for notes you don't want to save.
\[;]; ;; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2891,7 +2891,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sj")
";; This buffer is for notes you don't want to save.
\[;]; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2906,7 +2906,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjp\C-p")
";; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2918,7 +2918,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjp\C-p\C-p")
";; This buffer is for notes you don't want to save.
;;; Thi[s]; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2928,7 +2928,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjp2\C-p")
";; This buffer is for notes you don't want to save.
;;; Thi[s]; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2938,7 +2938,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjp2\C-p\C-n")
";; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2950,7 +2950,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
"[;]; This buffer is for notes you don't want to save.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjp\C-p\C-p2\C-n")
";; This buffer is for notes you don't want to save.
;[;]; ; If you want to create a file, visit that file with C-x C-f,
Expand All @@ -2966,7 +2966,7 @@ This bufferThis bufferThis buffe[r];; and for Lisp evaluation."))
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer."
(setq buffer-undo-list t)
(define-key evil-operator-state-local-map "s" 'evil-test-square-motion)
(define-key evil-operator-state-local-map "s" #'evil-test-square-motion)
("y2e2yyy3sjP\C-p\C-p2\C-n")
";; This buffer is for notes you don't want to save.
\[;]; ;; If you want to create a file, visit that file with C-x C-f,
Expand Down Expand Up @@ -7450,7 +7450,7 @@ golf h[o]>tel")))
([backspace backspace backspace backspace backspace backspace backspace])
";; This buffer is for [n]otes"))
(ert-info ("Replace from line below and restore")
(define-key evil-replace-state-map (kbd "C-e") 'evil-copy-from-below)
(define-key evil-replace-state-map (kbd "C-e") #'evil-copy-from-below)
(evil-test-buffer
";; [f]oo bar\n;; qux quux"
("R\C-e\C-e\C-e")
Expand All @@ -7459,7 +7459,7 @@ golf h[o]>tel")))
";; [f]oo bar\n;; qux quux")
(define-key evil-replace-state-map (kbd "C-e") nil))
(ert-info ("Replace from line above and restore")
(define-key evil-replace-state-map (kbd "C-y") 'evil-copy-from-above)
(define-key evil-replace-state-map (kbd "C-y") #'evil-copy-from-above)
(evil-test-buffer
";; foo bar\n;; [q]ux quux"
("R\C-y\C-y\C-y")
Expand Down Expand Up @@ -9491,7 +9491,7 @@ parameter set."
(ert-info ("Find file at point with line and column numbers")
(let* ((line-number 3)
(column-number 5)
(file-content (mapconcat 'identity
(file-content (mapconcat #'identity
(make-list (* 2 line-number)
(make-string (* 2 column-number) ?\s))
"\n")))
Expand Down

0 comments on commit fa41a49

Please sign in to comment.