unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30163: describe-function and modules
@ 2018-01-18 22:44 Glenn Morris
  2018-01-28 20:59 ` Philipp Stephani
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2018-01-18 22:44 UTC (permalink / raw)
  To: 30163

Package: emacs
Version: 26.0.91
Severity: minor

In a --with-modules build:

./src/emacs -Q -l ./test/data/emacs-module/mod-test.so

C-h f mod-test-sum RET

  -> "mod-test-sum is ."

Normally one sees something like "is a built-in function in foo.c." etc.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#30163: describe-function and modules
  2018-01-18 22:44 bug#30163: describe-function and modules Glenn Morris
@ 2018-01-28 20:59 ` Philipp Stephani
  2018-02-02 10:37   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Stephani @ 2018-01-28 20:59 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 30163


[-- Attachment #1.1: Type: text/plain, Size: 380 bytes --]

Glenn Morris <rgm@gnu.org> schrieb am Do., 18. Jan. 2018 um 23:46 Uhr:

> Package: emacs
> Version: 26.0.91
> Severity: minor
>
> In a --with-modules build:
>
> ./src/emacs -Q -l ./test/data/emacs-module/mod-test.so
>
> C-h f mod-test-sum RET
>
>   -> "mod-test-sum is ."
>
> Normally one sees something like "is a built-in function in foo.c." etc.
>
>
>
>
I've attached a patch.

[-- Attachment #1.2: Type: text/html, Size: 727 bytes --]

[-- Attachment #2: 0001-Add-support-for-module-functions-to-C-h-f-Bug-30163.txt --]
[-- Type: text/plain, Size: 2021 bytes --]

From c94ae50b715365a019b40e1e1b8365fe50483d23 Mon Sep 17 00:00:00 2001
From: Philipp Stephani <phst@google.com>
Date: Sun, 28 Jan 2018 21:57:59 +0100
Subject: [PATCH] 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 7a94d2f61a..a592809de6 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -642,6 +642,8 @@ help-fns-function-description-header
 		  (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 a6407524ad..05be8383dc 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 @@ module--test-assertion
       (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
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#30163: describe-function and modules
  2018-01-28 20:59 ` Philipp Stephani
@ 2018-02-02 10:37   ` Eli Zaretskii
  2018-02-02 19:36     ` Philipp Stephani
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-02-02 10:37 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 30163

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 28 Jan 2018 20:59:35 +0000
> Cc: 30163@debbugs.gnu.org
> 
>  C-h f mod-test-sum RET
> 
>    -> "mod-test-sum is ."
> 
>  Normally one sees something like "is a built-in function in foo.c." etc.
> 
> I've attached a patch. 

LGTM, thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#30163: describe-function and modules
  2018-02-02 10:37   ` Eli Zaretskii
@ 2018-02-02 19:36     ` Philipp Stephani
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Stephani @ 2018-02-02 19:36 UTC (permalink / raw)
  To: Eli Zaretskii, 30163-done

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Eli Zaretskii <eliz@gnu.org> schrieb am Fr., 2. Feb. 2018 um 16:52 Uhr:

> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Sun, 28 Jan 2018 20:59:35 +0000
> > Cc: 30163@debbugs.gnu.org
> >
> >  C-h f mod-test-sum RET
> >
> >    -> "mod-test-sum is ."
> >
> >  Normally one sees something like "is a built-in function in foo.c." etc.
> >
> > I've attached a patch.
>
> LGTM, thanks.
>

Thanks, pushed to master as  f3d0db7f0f9639ec0198d4f4f2c3eb9c7b495778.

[-- Attachment #2: Type: text/html, Size: 958 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-02 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18 22:44 bug#30163: describe-function and modules Glenn Morris
2018-01-28 20:59 ` Philipp Stephani
2018-02-02 10:37   ` Eli Zaretskii
2018-02-02 19:36     ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).