(in-package :editor) ; Copied from fontlock.lisp in the editor sources (defmacro with-hidden-font-lock-changes (buffer &body body) (rebinding (buffer) (with-unique-names (modified writable) `(let ((*dont-undo* t) (,modified (buffer-modified ,buffer)) (,writable (shiftf (buffer-writable ,buffer) t))) (unwind-protect (progn ,@body) (unless ,modified (setf (buffer-modified ,buffer) nil)) (setf (buffer-writable ,buffer) ,writable)))))) (defmacro in-vim-command (&body body) `(progn (unless *vim-in-command* (invoke-hook 'vim-before-top-level-command-hooks)) (invoke-hook 'vim-before-command-hooks) (let ((was-in-command *vim-in-command*) (*vim-in-command* t)) (unwind-protect (progn ,@body) (invoke-hook 'vim-after-command-hooks) (unless was-in-command (invoke-hook 'vim-after-top-level-command-hooks))))))