emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master f3d0db7: Add support for module functions to C-h f


From: Philipp Stephani
Subject: [Emacs-diffs] master f3d0db7: Add support for module functions to C-h f (Bug#30163).
Date: Fri, 2 Feb 2018 14:35:28 -0500 (EST)

branch: master
commit f3d0db7f0f9639ec0198d4f4f2c3eb9c7b495778
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Add support for module functions to C-h f (Bug#30163).
    
    * lisp/help-fns.el (help-fns-function-description-header): Handle
    module functions.
    
    * test/src/emacs-module-tests.el (module/describe-function-1): New
    test.
---
 lisp/help-fns.el               |  2 ++
 test/src/emacs-module-tests.el | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 7a94d2f..a592809 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -642,6 +642,8 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED 
REAL-DEF)."
                  (concat beg "Lisp macro"))
                 ((byte-code-function-p def)
                  (concat beg "compiled Lisp function"))
+                 ((module-function-p def)
+                  (concat beg "module function"))
                 ((eq (car-safe def) 'lambda)
                  (concat beg "Lisp function"))
                 ((eq (car-safe def) 'closure)
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index a640752..05be838 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -18,6 +18,7 @@
 ;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
 (require 'ert)
+(require 'help-fns)
 
 (defconst mod-test-emacs
   (expand-file-name invocation-name invocation-directory)
@@ -261,4 +262,17 @@ during garbage collection."
       (rx "Module function called during garbage collection\n")
     (mod-test-invalid-finalizer)))
 
+(ert-deftest module/describe-function-1 ()
+  "Check that Bug#30163 is fixed."
+  (with-temp-buffer
+    (let ((standard-output (current-buffer)))
+      (describe-function-1 #'mod-test-sum)
+      (should (equal (buffer-substring-no-properties 1 (point-max))
+                     ;; FIXME: This should print the filename.
+                     "a module function.
+
+(mod-test-sum a b)
+
+Return A + B")))))
+
 ;;; emacs-module-tests.el ends here



reply via email to

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