GNU bug report logs - #77292
[PATCH] ; Add newline to 'elisp-eldoc-var-docstring-with-value'

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Wed, 26 Mar 2025 18:09:02 UTC

Severity: normal

Tags: patch

Full log


Message #11 received at 77292 <at> debbugs.gnu.org (full text, mbox):

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77292 <at> debbugs.gnu.org
Subject: Re: bug#77292: [PATCH] ; Add newline to
 'elisp-eldoc-var-docstring-with-value'
Date: Wed, 26 Mar 2025 16:12:03 -0600
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
>> Date: Wed, 26 Mar 2025 12:08:11 -0600

>> This patch display variable docstring in
>> 'elisp-eldoc-var-docstring-with-value' as:


>> font-lock-keywords: nil
>> A list of keywords and corresponding font-lock highlighting rules.
>> There are two kinds of values: user-level, and compiled.
>> [...]

>> instead:


>> font-lock-keywords: nil A list of keywords and corresponding font-lock highlighting rules.
>> There are two kinds of values: user-level, and compiled.
>> [...]


> That has the disadvantage of enlarging the mini-window.

Eldoc echo window will be truncated if documentation is very large.

Also since =elisp-eldoc-var-docstring-with-value= includes full
variable docstring (including docstring newlines and length)
I don't see any difference with an additional newline here.

> Also, what does that do when ElDoc displays the documentation on the
> mode line for some reason (like when the mini-window is taken)?

It displays (full) documentation without the newlines in the modeline.
/(Note: the newlines in modeline are displayed as a ^J char for some reason)/

I think there should be a length limit for the eldoc documentation in
modeline.

Like in the below patch:

#+begin_src diff
  diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 966158024dd..f4726798e6d 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -314,8 +314,8 @@ eldoc-minibuffer-message
 	    (setq mode-line-format
                   (funcall
                    (if (listp mode-line-format) #'append #'list)
-                   (list "" '(eldoc-mode-line-string
-			      (" " eldoc-mode-line-string " ")))
+                   (list "" '((truncate-string-to-width eldoc-mode-line-string 50 nil nil t)
+			      (" " (truncate-string-to-width eldoc-mode-line-string 50 nil nil t) " ")))
                    mode-line-format)))
           (setq eldoc-mode-line-string
                 (when (stringp format-string)
#+end_src


[Message part 2 (text/html, inline)]
[Message part 3 (text/plain, inline)]

-- 
                                          - E.G via GNU Emacs and Org.

This bug report was last modified 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.