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

To reply to this bug, email your comments to 77292 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77292; Package emacs. (Wed, 26 Mar 2025 18:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Elijah Gabe Pérez <eg642616 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Mar 2025 18:09:02 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] ; Add newline to 'elisp-eldoc-var-docstring-with-value'
Date: Wed, 26 Mar 2025 12:08:11 -0600
[Message part 1 (text/plain, inline)]
Tags: patch

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

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

instead:

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




[Message part 2 (text/html, inline)]
[0001-Add-newline-to-elisp-eldoc-var-docstring-with-value.patch (text/patch, attachment)]
[Message part 4 (text/plain, inline)]
-- 
                                          - E.G via GNU Emacs and Org.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77292; Package emacs. (Wed, 26 Mar 2025 19:02:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
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 21:01:38 +0200
> 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.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77292; Package emacs. (Wed, 26 Mar 2025 22:13:02 GMT) Full text and rfc822 format available.

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 8 days ago.

Previous Next


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