GNU bug report logs - #61658
30.0.50; server-eval-at might handle unreadable results better

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Mon, 20 Feb 2023 16:26:01 UTC

Severity: normal

Found in version 30.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61658 in the body.
You can then email your comments to 61658 AT debbugs.gnu.org in the normal way.

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#61658; Package emacs. (Mon, 20 Feb 2023 16:26:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sean Whitton <spwhitton <at> spwhitton.name>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Feb 2023 16:26:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; server-eval-at might handle unreadable results better
Date: Mon, 20 Feb 2023 09:25:34 -0700
Hello,

I use server-eval-at to call a function, in another daemon, which
returns a buffer.  So, server-eval-at tries (read "#<buffer *foo*>")
which of course fails, and indeed signals an error.

I wonder if server-eval-at should return a special value to indicate
that the remote computation returned something that is not readably
printable?  Or signal a particular error, which the caller might catch?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Mon, 20 Feb 2023 17:09:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50;
 server-eval-at might handle unreadable results better
Date: Mon, 20 Feb 2023 19:09:00 +0200
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Date: Mon, 20 Feb 2023 09:25:34 -0700
> 
> I use server-eval-at to call a function, in another daemon, which
> returns a buffer.  So, server-eval-at tries (read "#<buffer *foo*>")
> which of course fails, and indeed signals an error.
> 
> I wonder if server-eval-at should return a special value to indicate
> that the remote computation returned something that is not readably
> printable?  Or signal a particular error, which the caller might catch?

Why can't you make that function return something more sensible?  Or
even just nil?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Wed, 22 Feb 2023 17:29:02 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Wed, 22 Feb 2023 10:28:05 -0700
Hello,

On Mon 20 Feb 2023 at 07:09PM +02, Eli Zaretskii wrote:

>> From: Sean Whitton <spwhitton <at> spwhitton.name>
>> Date: Mon, 20 Feb 2023 09:25:34 -0700
>>
>> I use server-eval-at to call a function, in another daemon, which
>> returns a buffer.  So, server-eval-at tries (read "#<buffer *foo*>")
>> which of course fails, and indeed signals an error.
>>
>> I wonder if server-eval-at should return a special value to indicate
>> that the remote computation returned something that is not readably
>> printable?  Or signal a particular error, which the caller might catch?
>
> Why can't you make that function return something more sensible?  Or
> even just nil?

Yes, that is a way to handle cases like this.  I was thinking it might
be better to have

    (define-error 'server-return-invalid-read-syntax
                  "Remote function returned unreadable form"
                  'invalid-read-syntax)

for a more flexible way to handle the situation.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Wed, 22 Feb 2023 20:08:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Wed, 22 Feb 2023 22:07:09 +0200
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: 61658 <at> debbugs.gnu.org
> Date: Wed, 22 Feb 2023 10:28:05 -0700
> 
> >> I use server-eval-at to call a function, in another daemon, which
> >> returns a buffer.  So, server-eval-at tries (read "#<buffer *foo*>")
> >> which of course fails, and indeed signals an error.
> >>
> >> I wonder if server-eval-at should return a special value to indicate
> >> that the remote computation returned something that is not readably
> >> printable?  Or signal a particular error, which the caller might catch?
> >
> > Why can't you make that function return something more sensible?  Or
> > even just nil?
> 
> Yes, that is a way to handle cases like this.  I was thinking it might
> be better to have
> 
>     (define-error 'server-return-invalid-read-syntax
>                   "Remote function returned unreadable form"
>                   'invalid-read-syntax)
> 
> for a more flexible way to handle the situation.

But what we have now already gives you almost the same information:

  invalid-read-syntax, "#"

I'm not sure I understand what would the above add to this.  Is
"Remote function returned unreadable form" really that much more
informative, when the user doesn't expect an error?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Thu, 23 Feb 2023 00:25:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Wed, 22 Feb 2023 17:24:26 -0700
Hello,

On Wed 22 Feb 2023 at 10:07PM +02, Eli Zaretskii wrote:

>> From: Sean Whitton <spwhitton <at> spwhitton.name>
>> Cc: 61658 <at> debbugs.gnu.org
>> Date: Wed, 22 Feb 2023 10:28:05 -0700
>> [...]
>> Yes, that is a way to handle cases like this.  I was thinking it might
>> be better to have
>>
>>     (define-error 'server-return-invalid-read-syntax
>>                   "Remote function returned unreadable form"
>>                   'invalid-read-syntax)
>>
>> for a more flexible way to handle the situation.
>
> But what we have now already gives you almost the same information:
>
>   invalid-read-syntax, "#"
>
> I'm not sure I understand what would the above add to this.  Is
> "Remote function returned unreadable form" really that much more
> informative, when the user doesn't expect an error?

I'm thinking about the design of calling code, not errors that bubble up
all the way to the user.  If I want to catch this situation in calling
code, I can catch 'invalid-read-syntax'.  But for that to catch only the
errors I intend to catch, I have to assume that the only call to 'read'
in server-eval-at is the one that reads the remote daemon's output.  But
that's an implementation detail of server-eval-at, that could change.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Thu, 23 Feb 2023 06:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Thu, 23 Feb 2023 08:24:42 +0200
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: 61658 <at> debbugs.gnu.org
> Date: Wed, 22 Feb 2023 17:24:26 -0700
> 
> Hello,
> 
> On Wed 22 Feb 2023 at 10:07PM +02, Eli Zaretskii wrote:
> 
> >> From: Sean Whitton <spwhitton <at> spwhitton.name>
> >> Cc: 61658 <at> debbugs.gnu.org
> >> Date: Wed, 22 Feb 2023 10:28:05 -0700
> >> [...]
> >> Yes, that is a way to handle cases like this.  I was thinking it might
> >> be better to have
> >>
> >>     (define-error 'server-return-invalid-read-syntax
> >>                   "Remote function returned unreadable form"
> >>                   'invalid-read-syntax)
> >>
> >> for a more flexible way to handle the situation.
> >
> > But what we have now already gives you almost the same information:
> >
> >   invalid-read-syntax, "#"
> >
> > I'm not sure I understand what would the above add to this.  Is
> > "Remote function returned unreadable form" really that much more
> > informative, when the user doesn't expect an error?
> 
> I'm thinking about the design of calling code, not errors that bubble up
> all the way to the user.  If I want to catch this situation in calling
> code, I can catch 'invalid-read-syntax'.  But for that to catch only the
> errors I intend to catch, I have to assume that the only call to 'read'
> in server-eval-at is the one that reads the remote daemon's output.  But
> that's an implementation detail of server-eval-at, that could change.

So you want server.el to catch the error and re-throw it with a
different signal in this particular case?  Or am I misunderstanding?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Thu, 23 Feb 2023 17:28:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Thu, 23 Feb 2023 10:27:11 -0700
Hello,

On Thu 23 Feb 2023 at 08:24AM +02, Eli Zaretskii wrote:

> So you want server.el to catch the error and re-throw it with a
> different signal in this particular case?  Or am I misunderstanding?

Yes, that's what I'd like to do.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Thu, 23 Feb 2023 17:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Thu, 23 Feb 2023 19:42:07 +0200
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: 61658 <at> debbugs.gnu.org
> Date: Thu, 23 Feb 2023 10:27:11 -0700
> 
> On Thu 23 Feb 2023 at 08:24AM +02, Eli Zaretskii wrote:
> 
> > So you want server.el to catch the error and re-throw it with a
> > different signal in this particular case?  Or am I misunderstanding?
> 
> Yes, that's what I'd like to do.

But then just define-error isn't enough, is it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Thu, 23 Feb 2023 18:09:02 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Thu, 23 Feb 2023 11:08:10 -0700
Hello,

On Thu 23 Feb 2023 at 07:42PM +02, Eli Zaretskii wrote:

>> From: Sean Whitton <spwhitton <at> spwhitton.name>
>> Cc: 61658 <at> debbugs.gnu.org
>> Date: Thu, 23 Feb 2023 10:27:11 -0700
>>
>> On Thu 23 Feb 2023 at 08:24AM +02, Eli Zaretskii wrote:
>>
>> > So you want server.el to catch the error and re-throw it with a
>> > different signal in this particular case?  Or am I misunderstanding?
>>
>> Yes, that's what I'd like to do.
>
> But then just define-error isn't enough, is it?

Right.  I didn't mean to suggest it was -- my apologies.

-- 
Sean Whitton




Reply sent to Sean Whitton <spwhitton <at> spwhitton.name>:
You have taken responsibility. (Thu, 09 Mar 2023 00:11:02 GMT) Full text and rfc822 format available.

Notification sent to Sean Whitton <spwhitton <at> spwhitton.name>:
bug acknowledged by developer. (Thu, 09 Mar 2023 00:11:02 GMT) Full text and rfc822 format available.

Message #34 received at 61658-done <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: 61658-done <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Wed, 08 Mar 2023 17:10:51 -0700
Hello,

Now implemented.  Doesn't seem to me like a NEWS entry is warranted, but
if anyone strongly disagrees I can write one.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Thu, 09 Mar 2023 09:41:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: 61658 <at> debbugs.gnu.org
Cc: spwhitton <at> spwhitton.name
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Thu, 09 Mar 2023 10:40:30 +0100
>>>>> On Wed, 08 Mar 2023 17:10:51 -0700, Sean Whitton <spwhitton <at> spwhitton.name> said:

    Sean> Hello,
    Sean> Now implemented.  Doesn't seem to me like a NEWS entry is warranted, but
    Sean> if anyone strongly disagrees I can write one.

It changes the possible behaviour of a public function, so I think it
is warranted (and I have some comments on the docstrings, but Iʼll
address those separately).

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61658; Package emacs. (Sat, 11 Mar 2023 18:49:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 61658 <at> debbugs.gnu.org
Subject: Re: bug#61658: 30.0.50; server-eval-at might handle unreadable
 results better
Date: Sat, 11 Mar 2023 11:48:42 -0700
Hello,

On Thu 09 Mar 2023 at 10:40AM +01, Robert Pluim wrote:

>>>>>> On Wed, 08 Mar 2023 17:10:51 -0700, Sean Whitton <spwhitton <at> spwhitton.name> said:
>
>     Sean> Hello,
>     Sean> Now implemented.  Doesn't seem to me like a NEWS entry is warranted, but
>     Sean> if anyone strongly disagrees I can write one.
>
> It changes the possible behaviour of a public function, so I think it
> is warranted (and I have some comments on the docstrings, but Iʼll
> address those separately).

But the new condition is a subtype of the old one, so it's a fully
backwards-compatible change to the behaviour.  Indeed, barely a change.
Does anyone else have any intuitions about this?

-- 
Sean Whitton




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 09 Apr 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 12 days ago.

Previous Next


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