* bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out
@ 2023-01-06 5:47 Sean Whitton
2023-01-06 7:37 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Sean Whitton @ 2023-01-06 5:47 UTC (permalink / raw)
To: 60592
Hello,
When calling 'emacsclient --timeout N --eval' from scripts, it would be
nice if you could determine for sure when a failure was just due to a
timeout, rather than, say, a Lisp exception.
inotifywait(1) exits with code 2 to indicate a timeout.
emacsclient could do the same.
We might then consider adding a separate exit code for a Lisp error.
Then a failure of emacsclient to connect, a request that timed out, and
an error from Lisp would be readily distinguishable.
At present the best one could do is parse emacsclient's output, but
that doesn't seem robust.
--
Sean Whitton
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out
2023-01-06 5:47 bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out Sean Whitton
@ 2023-01-06 7:37 ` Eli Zaretskii
2023-01-06 17:57 ` Sean Whitton
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-01-06 7:37 UTC (permalink / raw)
To: Sean Whitton; +Cc: 60592
> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Thu, 05 Jan 2023 22:47:49 -0700
>
> When calling 'emacsclient --timeout N --eval' from scripts, it would be
> nice if you could determine for sure when a failure was just due to a
> timeout, rather than, say, a Lisp exception.
>
> inotifywait(1) exits with code 2 to indicate a timeout.
> emacsclient could do the same.
It would be more portable to have the exception handler send a special
message to emacsclient, so that it would know the reason without
guessing.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out
2023-01-06 7:37 ` Eli Zaretskii
@ 2023-01-06 17:57 ` Sean Whitton
2023-01-06 18:12 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Sean Whitton @ 2023-01-06 17:57 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 60592
Hello,
On Fri 06 Jan 2023 at 09:37AM +02, Eli Zaretskii wrote:
>> From: Sean Whitton <spwhitton@spwhitton.name>
>> Date: Thu, 05 Jan 2023 22:47:49 -0700
>>
>> When calling 'emacsclient --timeout N --eval' from scripts, it would be
>> nice if you could determine for sure when a failure was just due to a
>> timeout, rather than, say, a Lisp exception.
>>
>> inotifywait(1) exits with code 2 to indicate a timeout.
>> emacsclient could do the same.
>
> It would be more portable to have the exception handler send a special
> message to emacsclient, so that it would know the reason without
> guessing.
I think this is wholly complimentary to what I'm suggesting, right?
--
Sean Whitton
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out
2023-01-06 17:57 ` Sean Whitton
@ 2023-01-06 18:12 ` Eli Zaretskii
2023-01-06 19:03 ` Sean Whitton
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-01-06 18:12 UTC (permalink / raw)
To: Sean Whitton; +Cc: 60592
> From: Sean Whitton <spwhitton@spwhitton.name>
> Cc: 60592@debbugs.gnu.org
> Date: Fri, 06 Jan 2023 10:57:18 -0700
>
> Hello,
>
> On Fri 06 Jan 2023 at 09:37AM +02, Eli Zaretskii wrote:
>
> >> From: Sean Whitton <spwhitton@spwhitton.name>
> >> Date: Thu, 05 Jan 2023 22:47:49 -0700
> >>
> >> When calling 'emacsclient --timeout N --eval' from scripts, it would be
> >> nice if you could determine for sure when a failure was just due to a
> >> timeout, rather than, say, a Lisp exception.
> >>
> >> inotifywait(1) exits with code 2 to indicate a timeout.
> >> emacsclient could do the same.
> >
> > It would be more portable to have the exception handler send a special
> > message to emacsclient, so that it would know the reason without
> > guessing.
>
> I think this is wholly complimentary to what I'm suggesting, right?
I didn't think so, but maybe I was missing something.
My point is that if we make the exception known to emacsclient, then
when the timeout ends without exceptions, it should be clear it was a
real timeout.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out
2023-01-06 18:12 ` Eli Zaretskii
@ 2023-01-06 19:03 ` Sean Whitton
0 siblings, 0 replies; 5+ messages in thread
From: Sean Whitton @ 2023-01-06 19:03 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 60592
Hello,
On Fri 06 Jan 2023 at 08:12PM +02, Eli Zaretskii wrote:
>> From: Sean Whitton <spwhitton@spwhitton.name>
>> Cc: 60592@debbugs.gnu.org
>> Date: Fri, 06 Jan 2023 10:57:18 -0700
>>
>> Hello,
>>
>> On Fri 06 Jan 2023 at 09:37AM +02, Eli Zaretskii wrote:
>>
>> >> From: Sean Whitton <spwhitton@spwhitton.name>
>> >> Date: Thu, 05 Jan 2023 22:47:49 -0700
>> >>
>> >> When calling 'emacsclient --timeout N --eval' from scripts, it would be
>> >> nice if you could determine for sure when a failure was just due to a
>> >> timeout, rather than, say, a Lisp exception.
>> >>
>> >> inotifywait(1) exits with code 2 to indicate a timeout.
>> >> emacsclient could do the same.
>> >
>> > It would be more portable to have the exception handler send a special
>> > message to emacsclient, so that it would know the reason without
>> > guessing.
>>
>> I think this is wholly complimentary to what I'm suggesting, right?
>
> I didn't think so, but maybe I was missing something.
>
> My point is that if we make the exception known to emacsclient, then
> when the timeout ends without exceptions, it should be clear it was a
> real timeout.
Right. This is a good addition to my proposal -- no conflicts.
--
Sean Whitton
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-06 19:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06 5:47 bug#60592: 30.0.50; emacsclient: exit with a different code when the request times out Sean Whitton
2023-01-06 7:37 ` Eli Zaretskii
2023-01-06 17:57 ` Sean Whitton
2023-01-06 18:12 ` Eli Zaretskii
2023-01-06 19:03 ` Sean Whitton
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).