unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
@ 2024-06-22 12:44 James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-06-22 13:03 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-06-22 12:44 UTC (permalink / raw
  To: 71720

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

- emacs -Q
- C-x C-f test.py
- M-x run-python
- C-x o
- Type: print(

Only one line is shown, even with:

- M-x eldoc-doc-buffer.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Do not prematurely truncate python eldoc string --]
[-- Type: text/x-patch, Size: 891 bytes --]

From 9fb4b45ef2c408ff76d5e145ea3c38eac60b4d16 Mon Sep 17 00:00:00 2001
From: James Thomas <jimjoe@gmx.net>
Date: Sat, 22 Jun 2024 17:57:00 +0530
Subject: [PATCH] Do not prematurely truncate python eldoc string

'eldoc-echo-area-use-multiline-p' is there for that.
* lisp/progmodes/python.el (python-eldoc-setup-code):
Make the change.
---
 lisp/progmodes/python.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index bb2bf1731b4..a52e21f625e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5607,8 +5607,6 @@ python-eldoc-setup-code
                 doc = '{objtype} {name}{args}'.format(
                     objtype=objtype, name=name, args=args
                 )
-        else:
-            doc = doc.splitlines()[0]
     except:
         doc = ''
     return doc"
--
2.43.0


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-22 12:44 bug#71720: [PATCH] Do not prematurely truncate python eldoc string James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-06-22 13:03 ` Eli Zaretskii
  2024-06-22 14:16   ` kobarity
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2024-06-22 13:03 UTC (permalink / raw
  To: James Thomas, kobarity; +Cc: 71720

> Date: Sat, 22 Jun 2024 18:14:21 +0530
> From:  James Thomas via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> - emacs -Q
> - C-x C-f test.py
> - M-x run-python
> - C-x o
> - Type: print(
> 
> Only one line is shown, even with:
> 
> - M-x eldoc-doc-buffer.
> 
> 
> From 9fb4b45ef2c408ff76d5e145ea3c38eac60b4d16 Mon Sep 17 00:00:00 2001
> From: James Thomas <jimjoe@gmx.net>
> Date: Sat, 22 Jun 2024 17:57:00 +0530
> Subject: [PATCH] Do not prematurely truncate python eldoc string
> 
> 'eldoc-echo-area-use-multiline-p' is there for that.
> * lisp/progmodes/python.el (python-eldoc-setup-code):
> Make the change.
> ---
>  lisp/progmodes/python.el | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index bb2bf1731b4..a52e21f625e 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -5607,8 +5607,6 @@ python-eldoc-setup-code
>                  doc = '{objtype} {name}{args}'.format(
>                      objtype=objtype, name=name, args=args
>                  )
> -        else:
> -            doc = doc.splitlines()[0]
>      except:
>          doc = ''
>      return doc"
> --
> 2.43.0

kobarity, any comments?





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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-22 13:03 ` Eli Zaretskii
@ 2024-06-22 14:16   ` kobarity
  2024-06-22 15:50     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: kobarity @ 2024-06-22 14:16 UTC (permalink / raw
  To: Eli Zaretskii, James Thomas; +Cc: 71720

Eli Zaretskii wrote:
> 
> > Date: Sat, 22 Jun 2024 18:14:21 +0530
> > From:  James Thomas via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> > 
> > - emacs -Q
> > - C-x C-f test.py
> > - M-x run-python
> > - C-x o
> > - Type: print(
> > 
> > Only one line is shown, even with:
> > 
> > - M-x eldoc-doc-buffer.
> > 
> > 
> > From 9fb4b45ef2c408ff76d5e145ea3c38eac60b4d16 Mon Sep 17 00:00:00 2001
> > From: James Thomas <jimjoe@gmx.net>
> > Date: Sat, 22 Jun 2024 17:57:00 +0530
> > Subject: [PATCH] Do not prematurely truncate python eldoc string
> > 
> > 'eldoc-echo-area-use-multiline-p' is there for that.
> > * lisp/progmodes/python.el (python-eldoc-setup-code):
> > Make the change.
> > ---
> >  lisp/progmodes/python.el | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> > index bb2bf1731b4..a52e21f625e 100644
> > --- a/lisp/progmodes/python.el
> > +++ b/lisp/progmodes/python.el
> > @@ -5607,8 +5607,6 @@ python-eldoc-setup-code
> >                  doc = '{objtype} {name}{args}'.format(
> >                      objtype=objtype, name=name, args=args
> >                  )
> > -        else:
> > -            doc = doc.splitlines()[0]
> >      except:
> >          doc = ''
> >      return doc"
> > --
> > 2.43.0
> 
> kobarity, any comments?

I agree with this fix.  For those who want the same behavior as
before, setting eldoc-echo-area-use-multiline-p to nil should be
sufficient.  It might be better to make this change known in etc/NEWS,
though.





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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-22 14:16   ` kobarity
@ 2024-06-22 15:50     ` Eli Zaretskii
  2024-06-22 21:12       ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2024-06-22 15:50 UTC (permalink / raw
  To: kobarity; +Cc: 71720, jimjoe

> Date: Sat, 22 Jun 2024 23:16:51 +0900
> From: kobarity <kobarity@gmail.com>
> Cc: 71720@debbugs.gnu.org
> 
> Eli Zaretskii wrote:
> > 
> > kobarity, any comments?
> 
> I agree with this fix.  For those who want the same behavior as
> before, setting eldoc-echo-area-use-multiline-p to nil should be
> sufficient.  It might be better to make this change known in etc/NEWS,
> though.

Thanks.

James, can you add a NEWS entry and resubmit?





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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-22 15:50     ` Eli Zaretskii
@ 2024-06-22 21:12       ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-06-23  0:47         ` kobarity
  0 siblings, 1 reply; 9+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-06-22 21:12 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: kobarity, 71720

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

Eli Zaretskii wrote:

>> Date: Sat, 22 Jun 2024 23:16:51 +0900
>> From: kobarity <kobarity@gmail.com>
>> Cc: 71720@debbugs.gnu.org
>>
>> Eli Zaretskii wrote:
>> >
>> > kobarity, any comments?
>>
>> I agree with this fix.  For those who want the same behavior as
>> before, setting eldoc-echo-area-use-multiline-p to nil should be
>> sufficient.  It might be better to make this change known in etc/NEWS,
>> though.
>
> Thanks.
>
> James, can you add a NEWS entry and resubmit?

How about this?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Do not prematurely truncate python eldoc string --]
[-- Type: text/x-patch, Size: 1552 bytes --]

From 905983647acc87c0e9c9b76fa7922d0288af20b9 Mon Sep 17 00:00:00 2001
From: James Thomas <jimjoe@gmx.net>
Date: Sat, 22 Jun 2024 17:57:00 +0530
Subject: [PATCH] Do not prematurely truncate python eldoc string

'eldoc-echo-area-use-multiline-p' is there for that.
* lisp/progmodes/python.el (python-eldoc-setup-code):
Make the change.
---
 etc/NEWS                 | 5 +++++
 lisp/progmodes/python.el | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 2349cc0cacb..f810b3d04a3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1499,6 +1499,11 @@ interactive Python interpreter specified by 'python-interpreter'.
 It sends the python block delimited by 'python-nav-beginning-of-block'
 and 'python-nav-end-of-block' to the inferior Python process.

+*** 'eldoc' no longer truncates to a single line by default.
+Previously, the entire docstring was not available to eldoc, which made
+'eldoc-echo-area-use-multiline-p' ineffective. The old behaviour may be
+kept by setting that.
+
 ** Inferior Python mode

 ---
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index bb2bf1731b4..a52e21f625e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5607,8 +5607,6 @@ python-eldoc-setup-code
                 doc = '{objtype} {name}{args}'.format(
                     objtype=objtype, name=name, args=args
                 )
-        else:
-            doc = doc.splitlines()[0]
     except:
         doc = ''
     return doc"
--
2.43.0


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-22 21:12       ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-06-23  0:47         ` kobarity
  2024-06-23  3:02           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: kobarity @ 2024-06-23  0:47 UTC (permalink / raw
  To: James Thomas; +Cc: Eli Zaretskii, 71720

James Thomas wrote:
> Eli Zaretskii wrote:
> 
> >> Date: Sat, 22 Jun 2024 23:16:51 +0900
> >> From: kobarity <kobarity@gmail.com>
> >> Cc: 71720@debbugs.gnu.org
> >>
> >> Eli Zaretskii wrote:
> >> >
> >> > kobarity, any comments?
> >>
> >> I agree with this fix.  For those who want the same behavior as
> >> before, setting eldoc-echo-area-use-multiline-p to nil should be
> >> sufficient.  It might be better to make this change known in etc/NEWS,
> >> though.
> >
> > Thanks.
> >
> > James, can you add a NEWS entry and resubmit?
> 
> How about this?

> +*** 'eldoc' no longer truncates to a single line by default.
> +Previously, the entire docstring was not available to eldoc, which made
> +'eldoc-echo-area-use-multiline-p' ineffective. The old behaviour may be
> +kept by setting that.
> +

Thanks, I think the content is perfect, but from other examples, it
might be better to have two spaces after the period.





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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-23  0:47         ` kobarity
@ 2024-06-23  3:02           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-06-23  3:53             ` kobarity
  2024-06-27  8:56             ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-06-23  3:02 UTC (permalink / raw
  To: kobarity; +Cc: Eli Zaretskii, 71720

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

kobarity wrote:

> James Thomas wrote:
>> Eli Zaretskii wrote:
>>
>> >> Date: Sat, 22 Jun 2024 23:16:51 +0900
>> >> From: kobarity <kobarity@gmail.com>
>> >> Cc: 71720@debbugs.gnu.org
>> >>
>> >> Eli Zaretskii wrote:
>> >> >
>> >> > kobarity, any comments?
>> >>
>> >> I agree with this fix.  For those who want the same behavior as
>> >> before, setting eldoc-echo-area-use-multiline-p to nil should be
>> >> sufficient.  It might be better to make this change known in etc/NEWS,
>> >> though.
>> >
>> > Thanks.
>> >
>> > James, can you add a NEWS entry and resubmit?
>>
>> How about this?
>
>> +*** 'eldoc' no longer truncates to a single line by default.
>> +Previously, the entire docstring was not available to eldoc, which made
>> +'eldoc-echo-area-use-multiline-p' ineffective. The old behaviour may be
>> +kept by setting that.
>> +
>
> Thanks, I think the content is perfect, but from other examples, it
> might be better to have two spaces after the period.

Fixed:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Do not prematurely truncate python eldoc string --]
[-- Type: text/x-patch, Size: 1553 bytes --]

From f91a94aca5119ebde21e24392b0d46d44dd9e078 Mon Sep 17 00:00:00 2001
From: James Thomas <jimjoe@gmx.net>
Date: Sat, 22 Jun 2024 17:57:00 +0530
Subject: [PATCH] Do not prematurely truncate python eldoc string

'eldoc-echo-area-use-multiline-p' is there for that.
* lisp/progmodes/python.el (python-eldoc-setup-code):
Make the change.
---
 etc/NEWS                 | 5 +++++
 lisp/progmodes/python.el | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 2349cc0cacb..201ef46bac5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1499,6 +1499,11 @@ interactive Python interpreter specified by 'python-interpreter'.
 It sends the python block delimited by 'python-nav-beginning-of-block'
 and 'python-nav-end-of-block' to the inferior Python process.

+*** 'eldoc' no longer truncates to a single line by default.
+Previously, the entire docstring was not available to eldoc, which made
+'eldoc-echo-area-use-multiline-p' ineffective.  The old behaviour may be
+kept by setting that.
+
 ** Inferior Python mode

 ---
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index bb2bf1731b4..a52e21f625e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5607,8 +5607,6 @@ python-eldoc-setup-code
                 doc = '{objtype} {name}{args}'.format(
                     objtype=objtype, name=name, args=args
                 )
-        else:
-            doc = doc.splitlines()[0]
     except:
         doc = ''
     return doc"
--
2.43.0


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-23  3:02           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-06-23  3:53             ` kobarity
  2024-06-27  8:56             ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: kobarity @ 2024-06-23  3:53 UTC (permalink / raw
  To: James Thomas, Eli Zaretskii; +Cc: 71720

James Thomas wrote:
> kobarity wrote:
> 
> > James Thomas wrote:
> >> Eli Zaretskii wrote:
> >>
> >> >> Date: Sat, 22 Jun 2024 23:16:51 +0900
> >> >> From: kobarity <kobarity@gmail.com>
> >> >> Cc: 71720@debbugs.gnu.org
> >> >>
> >> >> Eli Zaretskii wrote:
> >> >> >
> >> >> > kobarity, any comments?
> >> >>
> >> >> I agree with this fix.  For those who want the same behavior as
> >> >> before, setting eldoc-echo-area-use-multiline-p to nil should be
> >> >> sufficient.  It might be better to make this change known in etc/NEWS,
> >> >> though.
> >> >
> >> > Thanks.
> >> >
> >> > James, can you add a NEWS entry and resubmit?
> >>
> >> How about this?
> >
> >> +*** 'eldoc' no longer truncates to a single line by default.
> >> +Previously, the entire docstring was not available to eldoc, which made
> >> +'eldoc-echo-area-use-multiline-p' ineffective. The old behaviour may be
> >> +kept by setting that.
> >> +
> >
> > Thanks, I think the content is perfect, but from other examples, it
> > might be better to have two spaces after the period.
> 
> Fixed:

Thanks, it looks good to me.





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

* bug#71720: [PATCH] Do not prematurely truncate python eldoc string
  2024-06-23  3:02           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-06-23  3:53             ` kobarity
@ 2024-06-27  8:56             ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2024-06-27  8:56 UTC (permalink / raw
  To: James Thomas; +Cc: kobarity, 71720-done

> From: James Thomas <jimjoe@gmx.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  71720@debbugs.gnu.org
> Date: Sun, 23 Jun 2024 08:32:19 +0530
> 
> kobarity wrote:
> 
> > James Thomas wrote:
> >> Eli Zaretskii wrote:
> >>
> >> >> Date: Sat, 22 Jun 2024 23:16:51 +0900
> >> >> From: kobarity <kobarity@gmail.com>
> >> >> Cc: 71720@debbugs.gnu.org
> >> >>
> >> >> Eli Zaretskii wrote:
> >> >> >
> >> >> > kobarity, any comments?
> >> >>
> >> >> I agree with this fix.  For those who want the same behavior as
> >> >> before, setting eldoc-echo-area-use-multiline-p to nil should be
> >> >> sufficient.  It might be better to make this change known in etc/NEWS,
> >> >> though.
> >> >
> >> > Thanks.
> >> >
> >> > James, can you add a NEWS entry and resubmit?
> >>
> >> How about this?
> >
> >> +*** 'eldoc' no longer truncates to a single line by default.
> >> +Previously, the entire docstring was not available to eldoc, which made
> >> +'eldoc-echo-area-use-multiline-p' ineffective. The old behaviour may be
> >> +kept by setting that.
> >> +
> >
> > Thanks, I think the content is perfect, but from other examples, it
> > might be better to have two spaces after the period.
> 
> Fixed:

Thanks, installed on the emacs-30 branch, and closing the bug.





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

end of thread, other threads:[~2024-06-27  8:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-22 12:44 bug#71720: [PATCH] Do not prematurely truncate python eldoc string James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-22 13:03 ` Eli Zaretskii
2024-06-22 14:16   ` kobarity
2024-06-22 15:50     ` Eli Zaretskii
2024-06-22 21:12       ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-23  0:47         ` kobarity
2024-06-23  3:02           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-23  3:53             ` kobarity
2024-06-27  8:56             ` Eli Zaretskii

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