all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* yes-or-no-p and dialogs
@ 2022-12-27 16:06 Petteri Hintsanen
  2022-12-27 17:07 ` Eli Zaretskii
  2022-12-27 17:28 ` Jean Louis
  0 siblings, 2 replies; 9+ messages in thread
From: Petteri Hintsanen @ 2022-12-27 16:06 UTC (permalink / raw)
  To: help-gnu-emacs

Hello list,

Is there any way to "quit" yes-or-no-p queries with MS Windows dialogs?
I mean in the same way C-g would do in the minibuffer?

Case in point: I am visiting an Org file with an active (running) clock.
The file has no unsaved changes.

Then I try to close (kill) Emacs by clicking on the "X" button on the
upper right corner of the frame.

A dialog pops up, asking whether I'd like to clock out and save.  This
dialog has "Yes" or "No" buttons, but no way to cancel, as far as I can
see.

Now occasionally I'd like to interrupt Emacs quitting, and go back to my
file to adjust the clock and whatnot, but with that (modal) dialog it
seems to be impossible -- Emacs will unconditionally quit.  Should the
dialog have "Cancel" or "X" or something?  I could set use-dialog-box to
nil, but occasionally dialogs are useful.

This is Emacs 28.2 on MS Windows 10.

Thanks,
Petteri





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

* Re: yes-or-no-p and dialogs
  2022-12-27 16:06 yes-or-no-p and dialogs Petteri Hintsanen
@ 2022-12-27 17:07 ` Eli Zaretskii
  2022-12-27 17:37   ` Thibaut Verron
  2022-12-27 18:23   ` Petteri Hintsanen
  2022-12-27 17:28 ` Jean Louis
  1 sibling, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-27 17:07 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Petteri Hintsanen <petterih@iki.fi>
> Date: Tue, 27 Dec 2022 18:06:19 +0200
> 
> Is there any way to "quit" yes-or-no-p queries with MS Windows dialogs?
> I mean in the same way C-g would do in the minibuffer?
> 
> Case in point: I am visiting an Org file with an active (running) clock.
> The file has no unsaved changes.

What is "an active (running) clock"?  Can you show simple instructions
to reproduce this, for someone who doesn't use Org every hour of every
day?



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

* Re: yes-or-no-p and dialogs
  2022-12-27 16:06 yes-or-no-p and dialogs Petteri Hintsanen
  2022-12-27 17:07 ` Eli Zaretskii
@ 2022-12-27 17:28 ` Jean Louis
  1 sibling, 0 replies; 9+ messages in thread
From: Jean Louis @ 2022-12-27 17:28 UTC (permalink / raw)
  To: Petteri Hintsanen; +Cc: help-gnu-emacs

* Petteri Hintsanen <petterih@iki.fi> [2022-12-27 19:07]:
> Is there any way to "quit" yes-or-no-p queries with MS Windows dialogs?
> I mean in the same way C-g would do in the minibuffer?

(setq use-dialog-box nil) ➜ t

and now you can interrupt it by using C-g:

(y-or-n-p "OK? ")

> Then I try to close (kill) Emacs by clicking on the "X" button on the
> upper right corner of the frame.
> 
> A dialog pops up, asking whether I'd like to clock out and save.  This
> dialog has "Yes" or "No" buttons, but no way to cancel, as far as I can
> see.

I understand, that is serious usability problem. There shall be option to cancl such dialogs.

On my system I can't see them, I do not know why, even though my variable:

use-dialog-box ➜ nil

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: yes-or-no-p and dialogs
  2022-12-27 17:07 ` Eli Zaretskii
@ 2022-12-27 17:37   ` Thibaut Verron
  2022-12-27 18:13     ` Eli Zaretskii
  2022-12-27 18:23   ` Petteri Hintsanen
  1 sibling, 1 reply; 9+ messages in thread
From: Thibaut Verron @ 2022-12-27 17:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Le mar. 27 déc. 2022 à 18:07, Eli Zaretskii <eliz@gnu.org> a écrit :

> > From: Petteri Hintsanen <petterih@iki.fi>
> > Date: Tue, 27 Dec 2022 18:06:19 +0200
> >
> > Is there any way to "quit" yes-or-no-p queries with MS Windows dialogs?
> > I mean in the same way C-g would do in the minibuffer?
> >
> > Case in point: I am visiting an Org file with an active (running) clock.
> > The file has no unsaved changes.
>
> What is "an active (running) clock"?  Can you show simple instructions
> to reproduce this, for someone who doesn't use Org every hour of every
> day?
>

Hi,

I'm not the original poster, but I can reproduce it by:
1. Opening a .org file
2. Creating a headline
3. Calling org-clock-in
4. Saving the buffer
5. Clicking the X to close the window

By the way, the clock is not required, the same happens with an unsaved
buffer: first there is a right-click style menu asking what to do, then at
the end, the "modified buffers exist, quit anyway?" dialog only has "yes"
and "no", no "cancel".

I agree with Petteri, imo those dialogs should have a "cancel" button.

Best wishes,
Thibaut


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

* Re: yes-or-no-p and dialogs
  2022-12-27 17:37   ` Thibaut Verron
@ 2022-12-27 18:13     ` Eli Zaretskii
  2022-12-27 19:09       ` Thibaut Verron
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-27 18:13 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Thibaut Verron <thibaut.verron@gmail.com>
> Date: Tue, 27 Dec 2022 18:37:19 +0100
> Cc: help-gnu-emacs@gnu.org
> 
> I'm not the original poster, but I can reproduce it by:
> 1. Opening a .org file

OK

> 2. Creating a headline

What does it mean? which command(s) to invoke and how?

> 3. Calling org-clock-in

What do I do here? just "M-x org-clock-in RET" or something else?

> 4. Saving the buffer
> 5. Clicking the X to close the window
> 
> By the way, the clock is not required, the same happens with an unsaved buffer: first there is a right-click
> style menu asking what to do, then at the end, the "modified buffers exist, quit anyway?" dialog only has
> "yes" and "no", no "cancel".

On my system, I see "Cancel" as the 3rd possibility, when I do this
the other way, i.e. with a buffer with unsaved changes.  So maybe this
is a Windows 10 thing.



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

* Re: yes-or-no-p and dialogs
  2022-12-27 17:07 ` Eli Zaretskii
  2022-12-27 17:37   ` Thibaut Verron
@ 2022-12-27 18:23   ` Petteri Hintsanen
  2022-12-27 18:56     ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Petteri Hintsanen @ 2022-12-27 18:23 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> What is "an active (running) clock"?  Can you show simple instructions
> to reproduce this, for someone who doesn't use Org every hour of every
> day?

Org-mode can clock your working time, in the same way as timeclock
package does.  Starting a clock is similar to doing M-x timeclock-in.
Actually the same issue can be replicated simply by:

- M-x timeclock-in RET
- Enter any project name.
- Quit Emacs by clicking on "X" button.
- Dialog pops up asking "You're currently clocking time, clock out?"
- No way to cancel?


For completeness, here are instructions for org-mode:

- C-x C-f foo.org RET
- Enter a headline, for example

* foo

- Move point onto the headline and do C-c C-x C-i (org-clock-in) to
  start the clock.
- Save the buffer by C-x C-s
- Quit emacs by clicking on "X" button
- Dialog pops up asking "Clock out and save?"
- No way to cancel?


However, I found an acceptable workaround: set confirm-kill-emacs to
y-or-n-p.

Thanks,
Petteri




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

* Re: yes-or-no-p and dialogs
  2022-12-27 18:23   ` Petteri Hintsanen
@ 2022-12-27 18:56     ` Eli Zaretskii
  2022-12-27 19:38       ` Petteri Hintsanen
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-27 18:56 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Petteri Hintsanen <petterih@iki.fi>
> Date: Tue, 27 Dec 2022 20:23:26 +0200
> 
> - M-x timeclock-in RET
> - Enter any project name.
> - Quit Emacs by clicking on "X" button.
> - Dialog pops up asking "You're currently clocking time, clock out?"
> - No way to cancel?

OK, thanks.  I've now made it show also a 3rd button "Cancel".



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

* Re: yes-or-no-p and dialogs
  2022-12-27 18:13     ` Eli Zaretskii
@ 2022-12-27 19:09       ` Thibaut Verron
  0 siblings, 0 replies; 9+ messages in thread
From: Thibaut Verron @ 2022-12-27 19:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Le mar. 27 déc. 2022 à 19:13, Eli Zaretskii <eliz@gnu.org> a écrit :

> On my system, I see "Cancel" as the 3rd possibility, when I do this
> the other way, i.e. with a buffer with unsaved changes.  So maybe this
> is a Windows 10 thing.
>

That's interesting, why does the windows version make a difference?

Anyway, I was wrong and the situation is not the same: with a buffer with
unsaved changed, "yes" means "exit without saving" and "no" means "don't
exit", so "no" is really the cancel button.


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

* Re: yes-or-no-p and dialogs
  2022-12-27 18:56     ` Eli Zaretskii
@ 2022-12-27 19:38       ` Petteri Hintsanen
  0 siblings, 0 replies; 9+ messages in thread
From: Petteri Hintsanen @ 2022-12-27 19:38 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> OK, thanks.  I've now made it show also a 3rd button "Cancel".

Great!  I'll use my workaround (confirm-kill-emacs) until your change is
released.

Thanks for your time.
Petteri




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

end of thread, other threads:[~2022-12-27 19:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 16:06 yes-or-no-p and dialogs Petteri Hintsanen
2022-12-27 17:07 ` Eli Zaretskii
2022-12-27 17:37   ` Thibaut Verron
2022-12-27 18:13     ` Eli Zaretskii
2022-12-27 19:09       ` Thibaut Verron
2022-12-27 18:23   ` Petteri Hintsanen
2022-12-27 18:56     ` Eli Zaretskii
2022-12-27 19:38       ` Petteri Hintsanen
2022-12-27 17:28 ` Jean Louis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.