diff options
| author | Philipp Stephani | 2018-01-28 21:57:59 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2018-02-02 20:31:40 +0100 |
| commit | f3d0db7f0f9639ec0198d4f4f2c3eb9c7b495778 (patch) | |
| tree | ea08cabfb0f6262e7c9fe8137f93d9d16d96ad42 | |
| parent | 344750aef4a8e8c67b1857cf0fe413ba855026d6 (diff) | |
| download | emacs-f3d0db7f0f9639ec0198d4f4f2c3eb9c7b495778.tar.gz emacs-f3d0db7f0f9639ec0198d4f4f2c3eb9c7b495778.zip | |
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.
| -rw-r--r-- | lisp/help-fns.el | 2 | ||||
| -rw-r--r-- | test/src/emacs-module-tests.el | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 7a94d2f61ae..a592809de6a 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)." | |||
| 642 | (concat beg "Lisp macro")) | 642 | (concat beg "Lisp macro")) |
| 643 | ((byte-code-function-p def) | 643 | ((byte-code-function-p def) |
| 644 | (concat beg "compiled Lisp function")) | 644 | (concat beg "compiled Lisp function")) |
| 645 | ((module-function-p def) | ||
| 646 | (concat beg "module function")) | ||
| 645 | ((eq (car-safe def) 'lambda) | 647 | ((eq (car-safe def) 'lambda) |
| 646 | (concat beg "Lisp function")) | 648 | (concat beg "Lisp function")) |
| 647 | ((eq (car-safe def) 'closure) | 649 | ((eq (car-safe def) 'closure) |
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index a6407524ad7..05be8383dcc 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ |
| 19 | 19 | ||
| 20 | (require 'ert) | 20 | (require 'ert) |
| 21 | (require 'help-fns) | ||
| 21 | 22 | ||
| 22 | (defconst mod-test-emacs | 23 | (defconst mod-test-emacs |
| 23 | (expand-file-name invocation-name invocation-directory) | 24 | (expand-file-name invocation-name invocation-directory) |
| @@ -261,4 +262,17 @@ during garbage collection." | |||
| 261 | (rx "Module function called during garbage collection\n") | 262 | (rx "Module function called during garbage collection\n") |
| 262 | (mod-test-invalid-finalizer))) | 263 | (mod-test-invalid-finalizer))) |
| 263 | 264 | ||
| 265 | (ert-deftest module/describe-function-1 () | ||
| 266 | "Check that Bug#30163 is fixed." | ||
| 267 | (with-temp-buffer | ||
| 268 | (let ((standard-output (current-buffer))) | ||
| 269 | (describe-function-1 #'mod-test-sum) | ||
| 270 | (should (equal (buffer-substring-no-properties 1 (point-max)) | ||
| 271 | ;; FIXME: This should print the filename. | ||
| 272 | "a module function. | ||
| 273 | |||
| 274 | (mod-test-sum a b) | ||
| 275 | |||
| 276 | Return A + B"))))) | ||
| 277 | |||
| 264 | ;;; emacs-module-tests.el ends here | 278 | ;;; emacs-module-tests.el ends here |