diff options
| author | Axel Forsman <axel@axelf.se> | 2023-08-08 21:56:53 +0200 |
|---|---|---|
| committer | Tom Dalziel <tom_dl@hotmail.com> | 2023-08-20 23:46:23 +0100 |
| commit | 1c4c3bfff8987aa498d6bb8bd88e2e4ba9615ab9 (patch) | |
| tree | 9f827e8ae63cd57f2e842d07c63bbd3c8b1e00b1 /evil-common.el | |
| parent | a9a9c65b5d0777048c4e8a66fcc06032e3dafc18 (diff) | |
Some cleanups
Diffstat (limited to 'evil-common.el')
| -rw-r--r-- | evil-common.el | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/evil-common.el b/evil-common.el index 9af0863..84b0817 100644 --- a/evil-common.el +++ b/evil-common.el @@ -35,7 +35,6 @@ (declare-function evil-visual-restore "evil-states") (declare-function evil-motion-state "evil-states") (declare-function evil-replace-state-p "evil-states") -(declare-function evil-ex-p "evil-ex") (declare-function evil-set-jump "evil-jumps") ;;; Compatibility with different Emacs versions @@ -58,8 +57,8 @@ If LOCAL is non-nil, the buffer-local value of HOOK is modified." (cl-destructuring-bind (hook-sym &optional append local name) (mapcar #'macroexp-quote (if (consp hook) hook (list hook))) (macroexp-let2* nil - ((fun-name `',(make-symbol - (or name (format "evil-delay-in-%s" hook-sym)))) + ((fun-name `(make-symbol + ,(or name (format "evil-delay-in-%s" hook-sym)))) (fun `(lambda (&rest _) (when ,(or condition t) (remove-hook ,hook-sym ,fun-name ,local) @@ -762,15 +761,14 @@ cursor type is either `evil-force-cursor' or the current state." (defmacro evil-save-cursor (&rest body) "Save the current cursor; execute BODY; restore the cursor." - (declare (indent defun) - (debug t)) + (declare (indent defun) (debug t) (obsolete nil "1.15.0")) `(let ((cursor cursor-type) (color (frame-parameter (selected-frame) 'cursor-color)) (inhibit-quit t)) (unwind-protect (progn ,@body) - (evil-set-cursor cursor) - (evil-set-cursor color)))) + (setq cursor-type cursor) + (evil-set-cursor-color color)))) (defun evil-echo (string &rest args) "Display an unlogged message in the echo area. @@ -798,15 +796,12 @@ Does not restore if `evil-write-echo-area' is non-nil." (defmacro evil-save-echo-area (&rest body) "Save the echo area; execute BODY; restore the echo area. Intermittent messages are not logged in the *Messages* buffer." - (declare (indent defun) - (debug t)) + (declare (indent defun) (debug t)) `(let ((inhibit-quit t) - evil-echo-area-message - evil-write-echo-area) + evil-echo-area-message evil-write-echo-area) + (evil-echo-area-save) (unwind-protect - (progn - (evil-echo-area-save) - ,@body) + (progn ,@body) (evil-echo-area-restore)))) (defmacro evil-without-display (&rest body) |
