[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Query when exiting with running clock
From: |
Kyle Meyer |
Subject: |
Re: [PATCH] Query when exiting with running clock |
Date: |
Wed, 03 Mar 2021 22:54:23 -0500 |
Allen Li writes:
> Thanks for your feedback. I have addressed your comments. Please see
> the new patches.
Thanks. Pushed with a few modifications and a commit on top that adds a
NEWS entry.
1: 39422ba4a ! 1: 303e7c28e org-clock: Query when exiting with running clock
@@ Commit message
* lisp/org-clock.el (org-clock-kill-emacs-query): New function.
(org-clock-ask-before-exiting): New user option.
+ [km: added package-version keyword, fixed function name typo]
+
## Notes (amlog) ##
Message-Id:
<CADbSrJzNAwgTaPD1zUFVP=Ntuak2ccGBJvSKzW0gg3XxiykkOA@mail.gmail.com>
@@ lisp/org-clock.el: (defcustom org-clock-auto-clockout-timer nil
+(defcustom org-clock-ask-before-exiting t
+ "If non-nil, ask if the user wants to clock out before exiting Emacs.
-+ This variable only has effect if set with \\[customize]."
++This variable only has effect if set with \\[customize]."
+ :set (lambda (symbol value)
+ (if value
+ (add-hook 'kill-emacs-query-functions
#'org-clock-kill-emacs-query)
+ (remove-hook 'kill-emacs-query-functions
#'org-clock-kill-emacs-query))
+ (set symbol value))
-+ :type 'boolean)
++ :type 'boolean
++ :package-version '(Org . "9.5"))
+
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
@@ lisp/org-clock.el: (defun org-clock-load ()
+(defun org-clock-kill-emacs-query ()
+ "Query user when killing Emacs.
+This function is added to `kill-emacs-query-functions'."
-+ (let ((buf (org-clock-buffer)))
++ (let ((buf (org-clocking-buffer)))
+ (when (and buf (yes-or-no-p "Clock out and save? "))
+ (with-current-buffer buf
+ (org-clock-out)
2: d612adc77 = 2: 16b5ee0ef org-clock: Replace org-clocking-buffer with
org-clock-is-active
-: --------- > 3: 4d463ee4b ORG-NEWS: Add entry for
org-clock-ask-before-exiting