]> git.eshelyaron.com Git - emacs.git/commitdiff
single function native compilation doc + interactive support + tests
authorAndrea Corallo <akrl@sdf.org>
Sun, 8 Dec 2019 19:52:34 +0000 (20:52 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:12 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el
test/src/comp-tests.el

index ffd4985301e812bd43caece7f295a1c7fce033a5..0f0a90c82fbbdf20956cf8fe33218af8066c2ee1 100644 (file)
@@ -420,7 +420,9 @@ Put PREFIX in front of it."
   "Byte compile FUNCTION-NAME spilling data from the byte compiler."
   (let* ((f (symbol-function function-name))
          (func (make-comp-func :name function-name
-                               :c-name (comp-c-func-name function-name"F"))))
+                               :c-name (comp-c-func-name function-name"F")
+                               :doc (documentation f)
+                               :int-spec (interactive-form f))))
       (when (byte-code-function-p f)
         (signal 'native-compiler-error
                 "can't native compile an already bytecompiled function"))
index 230d5bfbdafa43b0a7d88cfc222c6bf0987fc4d0..82a30424d09e5c400d1ed8c1f2ccfbcd4e32bc29 100644 (file)
@@ -328,10 +328,18 @@ Check that the resulting binaries do not differ."
 (ert-deftest comp-tests-free-fun ()
   "Check we are able to compile a single function."
   (defun comp-tests-free-fun-f ()
+    "Some doc."
+    (interactive)
     3)
   (load (native-compile #'comp-tests-free-fun-f))
+
   (should (subr-native-elisp-p (symbol-function #'comp-tests-free-fun-f)))
-  (should (= (comp-tests-free-fun-f) 3)))
+  (should (= (comp-tests-free-fun-f) 3))
+  (should (string= (documentation #'comp-tests-free-fun-f)
+                   "Some doc."))
+  (should (commandp #'comp-tests-free-fun-f))
+  (should (equal (interactive-form #'comp-tests-free-fun-f)
+                 '(interactive))))
 
 \f
 ;;;;;;;;;;;;;;;;;;;;