unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38222: describe-mode shows (fn...)
@ 2019-11-15 18:32 Juanma Barranquero
  2019-11-16  5:14 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Juanma Barranquero @ 2019-11-15 18:32 UTC (permalink / raw)
  To: 38222


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

Package: emacs
Severity: minor
Tags: patch

Currently, the output of `describe-mode' includes the (fn...) calling
convention specifiers from the docstrings of major and minor modes.

Assuming that's not intended, here's a patch to fix it.

OK to install?

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

[-- Attachment #2: 0001-Strip-fn.-from-output-of-describe-mode.patch --]
[-- Type: application/octet-stream, Size: 1562 bytes --]

From eda6eeadb99f0b1ccfaa251ec9f7d510b5b8121a Mon Sep 17 00:00:00 2001
From: Juanma Barranquero <lekktu@gmail.com>
Date: Fri, 15 Nov 2019 19:21:48 +0100
Subject: [PATCH] Strip "(fn...)" from output of `describe-mode'

* lisp/help.el (help--doc-w/o-fn): New function.
(describe-mode): Use it.
---
 lisp/help.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/help.el b/lisp/help.el
index 3b3d1f977e..2286e4ff93 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -878,6 +878,10 @@ describe-key
             (princ ", which is ")
 	    (describe-function-1 defn)))))))
 \f
+(defun help--doc-w/o-fn (mode)
+  ;; Remove the (fn...) thingy at the end of the docstring
+  (replace-regexp-in-string "\n\n(fn[^)]*?)\\'" "" (documentation mode)))
+
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.
 A brief summary of the minor modes comes first, followed by the
@@ -951,7 +955,7 @@ describe-mode
 				     "no indicator"
 				   (format "indicator%s"
 					   indicator))))
-		  (princ (documentation mode-function)))
+		  (princ (help--doc-w/o-fn mode-function)))
 		(insert-button pretty-minor-mode
 			       'action (car help-button-cache)
 			       'follow-link t
@@ -981,7 +985,7 @@ describe-mode
                                     nil t)
 		(help-xref-button 1 'help-function-def mode file-name)))))
 	(princ ":\n")
-	(princ (documentation major-mode)))))
+	(princ (help--doc-w/o-fn major-mode)))))
   ;; For the sake of IELM and maybe others
   nil)
 
-- 
2.23.0.windows.1


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

* bug#38222: describe-mode shows (fn...)
  2019-11-15 18:32 bug#38222: describe-mode shows (fn...) Juanma Barranquero
@ 2019-11-16  5:14 ` Lars Ingebrigtsen
  2019-11-16  5:20   ` Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-16  5:14 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 38222

Juanma Barranquero <lekktu@gmail.com> writes:

> Currently, the output of `describe-mode' includes the (fn...) calling
> convention specifiers from the docstrings of major and minor modes.
>
> Assuming that's not intended, here's a patch to fix it.
>
> OK to install?

[...]

> +(defun help--doc-w/o-fn (mode)

We generally avoid using abbreviations in function names, I think.
Otherwise, makes sense to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#38222: describe-mode shows (fn...)
  2019-11-16  5:14 ` Lars Ingebrigtsen
@ 2019-11-16  5:20   ` Juanma Barranquero
  2019-11-19 10:20     ` Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Juanma Barranquero @ 2019-11-16  5:20 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 38222

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

On Sat, Nov 16, 2019 at 6:14 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> We generally avoid using abbreviations in function names, I think.

Yes, though w/o is used in two function names in uniquify.el.

I'll change it to help--doc-without-fn.

> Otherwise, makes sense to me.

Thanks.

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

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

* bug#38222: describe-mode shows (fn...)
  2019-11-16  5:20   ` Juanma Barranquero
@ 2019-11-19 10:20     ` Juanma Barranquero
  0 siblings, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2019-11-19 10:20 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 38222-done

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

Committed as 49192e9510fe3c491b8c759a639bbe8bccf35856.

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

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

end of thread, other threads:[~2019-11-19 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-15 18:32 bug#38222: describe-mode shows (fn...) Juanma Barranquero
2019-11-16  5:14 ` Lars Ingebrigtsen
2019-11-16  5:20   ` Juanma Barranquero
2019-11-19 10:20     ` Juanma Barranquero

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