emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Improve the clock-out message
@ 2025-02-02  8:21 Rudolf Adamkovič
  2025-02-02  8:27 ` Rudolf Adamkovič
  0 siblings, 1 reply; 3+ messages in thread
From: Rudolf Adamkovič @ 2025-02-02  8:21 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Rudolf Adamkovič

* lisp/org-clock.el (org-clock-kill-emacs-query): Reword the "Clock
out and save?" message to "Clock out before saving?" to convey the
important fact that no data will be lost when answered "no".
---
 lisp/org-clock.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 5fd0580d0..f10d7f339 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -3316,7 +3316,7 @@ The details of what will be saved are regulated by the variable
   "Query user when killing Emacs.
 This function is added to `kill-emacs-query-functions'."
   (let ((buf (org-clocking-buffer)))
-    (when (and buf (yes-or-no-p "Clock out and save? "))
+    (when (and buf (yes-or-no-p "Clock out before saving? "))
       (with-current-buffer buf
         (org-clock-out)
         (save-buffer))))
-- 
2.48.1



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

* Re: [PATCH] Improve the clock-out message
  2025-02-02  8:21 [PATCH] Improve the clock-out message Rudolf Adamkovič
@ 2025-02-02  8:27 ` Rudolf Adamkovič
  2025-02-02 10:34   ` Kévin Le Gouguec
  0 siblings, 1 reply; 3+ messages in thread
From: Rudolf Adamkovič @ 2025-02-02  8:27 UTC (permalink / raw)
  To: emacs-orgmode

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

Rudolf Adamkovič <rudolf@adamkovic.org> writes:

> * lisp/org-clock.el (org-clock-kill-emacs-query): Reword the "Clock
> out and save?" message to "Clock out before saving?" to convey the
> important fact that no data will be lost when answered "no".

I forgot to prefix the commit title with the package name.

See the attached v2.

P.S. This message has been making me confused ever since I started using
Org, and it still makes me pause and think today, hence the patch.

Rudy

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-clock-Improve-the-clock-out-message.patch --]
[-- Type: text/x-patch, Size: 1088 bytes --]

From c8d7e985f728d38e7eff3c5eaa4db0f0171f90a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org>
Date: Sun, 2 Feb 2025 09:14:49 +0100
Subject: [PATCH] org-clock: Improve the clock-out message

* lisp/org-clock.el (org-clock-kill-emacs-query): Reword the "Clock
out and save?" message to "Clock out before saving?" to convey the
important fact that no data will be lost when answered "no".
---
 lisp/org-clock.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 5fd0580d0..f10d7f339 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -3316,7 +3316,7 @@ The details of what will be saved are regulated by the variable
   "Query user when killing Emacs.
 This function is added to `kill-emacs-query-functions'."
   (let ((buf (org-clocking-buffer)))
-    (when (and buf (yes-or-no-p "Clock out and save? "))
+    (when (and buf (yes-or-no-p "Clock out before saving? "))
       (with-current-buffer buf
         (org-clock-out)
         (save-buffer))))
-- 
2.39.5 (Apple Git-154)


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

-- 
"I would prefer an intelligent hell to a stupid paradise."
--- Blaise Pascal

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org

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

* Re: [PATCH] Improve the clock-out message
  2025-02-02  8:27 ` Rudolf Adamkovič
@ 2025-02-02 10:34   ` Kévin Le Gouguec
  0 siblings, 0 replies; 3+ messages in thread
From: Kévin Le Gouguec @ 2025-02-02 10:34 UTC (permalink / raw)
  To: Rudolf Adamkovič; +Cc: emacs-orgmode

Rudolf Adamkovič <rudolf@adamkovic.org> writes:

> Rudolf Adamkovič <rudolf@adamkovic.org> writes:
>
>> * lisp/org-clock.el (org-clock-kill-emacs-query): Reword the "Clock
>> out and save?" message to "Clock out before saving?" to convey the
>> important fact that no data will be lost when answered "no".
>
> I forgot to prefix the commit title with the package name.
>
> See the attached v2.
>
> P.S. This message has been making me confused ever since I started using
> Org, and it still makes me pause and think today, hence the patch.

Seconded, thanks for taking the time to tweak this!  I sometime clock in
to some task that may require restarting Emacs (or the DE session, or
the computer); the message no longer gives me pause but it would be good
to spare future users.

One question: should it be "before saving" or "before exiting"?

* My usage pattern is "clock in; save; exit", so the buffer is already
saved;
* also, if I'm reading save-buffers-kill-emacs right, the
-query-functions are run _after_ the save prompts?


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

end of thread, other threads:[~2025-02-02 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02  8:21 [PATCH] Improve the clock-out message Rudolf Adamkovič
2025-02-02  8:27 ` Rudolf Adamkovič
2025-02-02 10:34   ` Kévin Le Gouguec

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).