branch: externals/objed commit db3c6d0025eb037d31f23cad6c0e7a18a6f53f30 Author: Clemens Radermacher <clem...@posteo.net> Commit: Clemens Radermacher <clem...@posteo.net>
Add option to pass major-mode for test --- test/tests.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/tests.el b/test/tests.el index 5c3d658..504b57d 100644 --- a/test/tests.el +++ b/test/tests.el @@ -77,7 +77,7 @@ Insert KEY if there's no command." ;; (should (equal (objed-decode-keysequence "3\C-?") ;; '(3 "")))) -(defmacro objed-with (in body &optional object file) +(defmacro objed-with (in body &optional object mode) (let ((init (if object `(objed--init ',object) '(objed--init 'char))) (body (if (stringp body) `(kbd ,body) body))) @@ -86,7 +86,8 @@ Insert KEY if there's no command." (unwind-protect (progn (switch-to-buffer temp-buffer) - (emacs-lisp-mode) + (or (and ,mode (funcall ',mode 1)) + (emacs-lisp-mode)) (transient-mark-mode 1) (insert ,in) (goto-char (point-min))