emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/objed db3c6d0 06/19: Add option to pass major-mode for


From: Clemens Radermacher
Subject: [elpa] externals/objed db3c6d0 06/19: Add option to pass major-mode for test
Date: Fri, 25 Jan 2019 07:51:30 -0500 (EST)

branch: externals/objed
commit db3c6d0025eb037d31f23cad6c0e7a18a6f53f30
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]