From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sMI7FdoiLGD+cwAA0tVLHw (envelope-from ) for ; Tue, 16 Feb 2021 19:54:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IPb7ENoiLGBefQAAbx9fmQ (envelope-from ) for ; Tue, 16 Feb 2021 19:54:02 +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 ADC312B902 for ; Tue, 16 Feb 2021 20:54:01 +0100 (CET) Received: from localhost ([::1]:41554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC6Q4-00053y-T7 for larch@yhetil.org; Tue, 16 Feb 2021 14:54:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC6Pj-00053m-1E for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 14:53:39 -0500 Received: from smtprelay06.ispgateway.de ([80.67.31.104]:47295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC6Ph-0001l5-Bb for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 14:53:38 -0500 Received: from [95.156.215.246] (helo=gandalf) by smtprelay06.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lC6P8-00048a-V6; Tue, 16 Feb 2021 20:53:03 +0100 References: <87y2fokm6b.fsf@gaillourdet.net> User-agent: mu4e 1.4.13; emacs 27.1 From: Jean-Marie Gaillourdet To: emacs-orgmode@gnu.org Subject: Re: A small bugfix in org-clock-in In-reply-to: <87y2fokm6b.fsf@gaillourdet.net> Date: Tue, 16 Feb 2021 20:53:33 +0100 Message-ID: <87sg5vlrgi.fsf@gaillourdet.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Df-Sender: am1nQGdhaWxsb3VyZGV0Lm5ldA== Received-SPF: none client-ip=80.67.31.104; envelope-from=jmg@gaillourdet.net; helo=smtprelay06.ispgateway.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.36 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: ADC312B902 X-Spam-Score: -2.36 X-Migadu-Scanner: scn1.migadu.com X-TUID: zLz8PxXrPPmd --=-=-= Content-Type: text/plain; format=flowed Hello, I am sorry, for the mess in my previous mail. I've experienced occasionally errors while executing org-clock-in from the agenda. The errors seems to be that indent-line-to is called with a negative argument. Moving from the agenda to the todo headline in the underlying org file and repeating org-clock-in and org-clock-out usually lead to a state in which I could successfully run org-clock-in. The following patch fixes the issue for me and I believe it does no harm. I've used it daily for two month. I'd appreciate if you could add it to org-mode. Kind regards, Jean-Marie --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-clock-fix-runtime-error-in-org-clock-in.patch >From 319785492d55d33cdf819aa891c3e7834dafacff Mon Sep 17 00:00:00 2001 From: Jean-Marie Gaillourdet Date: Sun, 13 Dec 2020 12:50:52 +0100 Subject: [PATCH] org-clock: fix runtime error in org-clock-in * org-clock.el (org-clock-in): Under certain configurations of org, Emacs doom, evil-org-mode and my custom settings, org-clock-in aborts with an an error because indent-line-to is called with -2. --- 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 6c7a797ff..4256b1a21 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1368,7 +1368,7 @@ the default behavior." (end-of-line 0) (org-in-item-p))) (beginning-of-line 1) - (indent-line-to (- (current-indentation) 2))) + (indent-line-to (max 0 (- (current-indentation) 2)))) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item -- 2.29.2 --=-=-= Content-Type: text/plain; format=flowed -- Jean-Marie Gaillourdet --=-=-=--