From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id xnrQDR9aQGDSKQAA0tVLHw (envelope-from ) for ; Thu, 04 Mar 2021 03:55:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8EUgCR9aQGAfIwAA1q6Kng (envelope-from ) for ; Thu, 04 Mar 2021 03:55:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 59BC818178 for ; Thu, 4 Mar 2021 04:55:10 +0100 (CET) Received: from localhost ([::1]:41474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHf4u-00011W-SZ for larch@yhetil.org; Wed, 03 Mar 2021 22:55:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHf4Q-00011H-3D for emacs-orgmode@gnu.org; Wed, 03 Mar 2021 22:54:38 -0500 Received: from out0.migadu.com ([94.23.1.103]:61441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHf4N-000462-84 for emacs-orgmode@gnu.org; Wed, 03 Mar 2021 22:54:37 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1614830070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4ScA6eRrLaf6fNovyzph11MOOg/p/OIi031Xg863eZs=; b=LM7NRJgq4bKyGMpDpkLMBsKoVePZWRfeYocNcyUiqmYMYzBWS0xB+GqCG3nNaN13yKAUz6 K4M0FexvLRK9ek0sMzYVROe2AdVGA2q3ALnjahg+nBf0ncIlr/2Kh0upFBc2lXmRqFYlKN H08XqyYMcK6DFcH8lyeYrBa6kTLmYmMVOJkCr4nmOD4Tak5WSSBxZGw4jr1cv8231/teyi kk5lpCf7UqePzZbRFVgO7wIZR2QXVYsC3WBjddfUbFpa13DcHaNCSC6riadHqBAQ94iPGc 7omDrv3hpXQIuaPoUvdgeC0EEOVDQZL0sgNLm7qxcT0R0iIiMHFao/Xy16jupg== From: Kyle Meyer To: Allen Li Subject: Re: [PATCH] Query when exiting with running clock In-Reply-To: References: <80o8hu356e.fsf@felesatra.moe> <878s85ya9u.fsf@kyleam.com> X-Woof-Patch: applied Date: Wed, 03 Mar 2021 22:54:23 -0500 Message-ID: <87mtvjd15c.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=94.23.1.103; envelope-from=kyle@kyleam.com; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org Mode List Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614830110; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4ScA6eRrLaf6fNovyzph11MOOg/p/OIi031Xg863eZs=; b=N41meKxWLvJEO0ZvMHkMApndSYAEOJy0ZNUNPosUWudeDkbvKC+mdroA4X+3Pct00bdTq6 BagEbBZBf61C7ew+28i2iv/MDWpmwEiP89RBP9U3MY9nzHdQkNo7fCfb8uxTJ0BIN5qkkm I2zdQJj0l56Fz37pGlDTWTyZ21D9YVSK4DGTwcJMD9TH5d5nB//7wkOV60ILPu0IWUcm/n p23Y8XEHWmvah5Uy0XMrdKvydzJxMidZfXCcVIglF+kz8wvTtxymc5JUmJfNgf397R7mJ1 lx+w+zWhQza3LFpBx/YEKHzJmlEpa30GzdWwOZsLKjhfyUJKC0V+BLra6mVOJQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614830110; a=rsa-sha256; cv=none; b=tSASwjwqAm5G8+5tDjqC9qo9DT0VMJ3jp1hvxb+xz1L7+uSpN2N+iaNiL+aHQSKm+/d/B7 nR1vgZHugvy2mV0VSrfyrqJvdcz6C3u4RMavyuEMlTm04LB+cf3DMTKaGAi9mZ9zZsXDW7 E3IzUuGoBMEo+NNF9ww+PyS++Gwi34Qg86eL9++kngz/2fa1n+KFFOP6ymlIJQxWx+Tijw ysqHDamwxOYTWgw5MuFjhW9ZHtKyWufoUYb3+SuPfx/eKV2I9bykanu4Y5N7vVrclPjikN 7k9YSHSGvLRRyOULu/Bw5ge8vWSntTnYLwQk03hMBjMmqHMzP6ojErZ6HhCXig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=LM7NRJgq; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=LM7NRJgq; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 59BC818178 X-Spam-Score: -2.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: uaE11J7rZf52 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: @@ 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