From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cCXGK8Iuv2GhRwEAgWs5BA (envelope-from ) for ; Sun, 19 Dec 2021 14:08:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6Gl8J8Iuv2GCMgAAbx9fmQ (envelope-from ) for ; Sun, 19 Dec 2021 13:08:18 +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 69FF43CE8A for ; Sun, 19 Dec 2021 14:08:18 +0100 (CET) Received: from localhost ([::1]:52224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myvvF-0007EX-JC for larch@yhetil.org; Sun, 19 Dec 2021 08:08:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myvuX-0007EP-4F for emacs-orgmode@gnu.org; Sun, 19 Dec 2021 08:07:33 -0500 Received: from [2607:f8b0:4864:20::529] (port=46662 helo=mail-pg1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myvuS-0000yz-Ul for emacs-orgmode@gnu.org; Sun, 19 Dec 2021 08:07:32 -0500 Received: by mail-pg1-x529.google.com with SMTP id r138so6813070pgr.13 for ; Sun, 19 Dec 2021 05:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WBJoZKn+vUJBNN10lfD9XOoxrxi8AXgkfXRVBpBxaFE=; b=b99k8KIbk8V4+JNUaA5gRf7xWmXjhL2wRidVvJc5o//vZ5Q1OJ6X2dGmdPByr1k/uP jTLf43Lp2AFpza+NXLA0/xoF+gAl9oe+B3cu/iqmHVnU/Z8jK4p71sxVN7fnh45TFWLk HSRucbjQ6y2Ka2P1a6ZpZqxMGXlkrF2w7BB4V9OsFWxN/XE+sc4v0TwpQf9CN4y9BbtP /uvyDX9rennfqJZiwqOxGcXYa90XxUZtmXyMzR7n3HSUNxbyD7BB8q8Nyv+rYg9LJxi3 SY8tJD9y9OLS8p91KKI1uGxlv8csQW0oZI7r3l5SQ0XDo5lAjr0gg8fuVWeiOY7Ubldv wrNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WBJoZKn+vUJBNN10lfD9XOoxrxi8AXgkfXRVBpBxaFE=; b=Pyeb6J/z7NqWJV1MrsMGjvnM1qoaVEmqhjR9Curb3maw9CyfTjvlLb5Ey82jsfnPzX GSGZ0Y+4vbN8nafPYeRBiBYFLGn+n1uOib5NVxLt8UerAu9hZk7Uj6+j+OMkZbv1FKcs O+g7OjoUToOigaM2TeI25fJsIebcUGpqgQiJQuc7KF4Ofs1t7v60OSdEEE9nUM1+Ozki Z6JHe1Mb8x9U71xMNOkssVLc542jWAirRxTHM5LuBlpPhKHWe4zE6ZlHtZuTnME3qqs+ GhTj71bwSPtTwmJn+N9egXEXd+MueLGNu6ovuZmzlzdQ766qoH/dZ97M7R2BpIDIg6eK rRdw== X-Gm-Message-State: AOAM532UM4Ivnua74BY6tU0j1Z4QzWZ6ce1xrn6LSWgVBIcwPobdY+Ya wzlt65yC0VIq6qnLijWDHlE= X-Google-Smtp-Source: ABdhPJxQTuNIiQb5SiQJY52x9FuJzXkX8yAvJHFaLmR+aXmcYuW10PcW6ehPLEEXXGRppNgfQ7jERw== X-Received: by 2002:a63:6b89:: with SMTP id g131mr10704543pgc.469.1639919247308; Sun, 19 Dec 2021 05:07:27 -0800 (PST) Received: from localhost ([217.138.212.194]) by smtp.gmail.com with ESMTPSA id ot6sm1493414pjb.32.2021.12.19.05.07.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 05:07:26 -0800 (PST) From: Ihor Radchenko To: Michael Eliachevitch Subject: Re: [BUG] Plain capture template clocks into following headline instead of given olp [9.5.1 (release_9.5.1-15-gdb4805 @ /usr/share/emacs/29.0.50/lisp/org/)] In-Reply-To: <87tufktz5z.fsf@posteo.de> References: <87tufktz5z.fsf@posteo.de> Date: Sun, 19 Dec 2021 21:08:51 +0800 Message-ID: <871r28spwc.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::529 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=yantar92@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639919298; 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=WBJoZKn+vUJBNN10lfD9XOoxrxi8AXgkfXRVBpBxaFE=; b=ov2mEdgpd8vooEMBEW3r0abVVvvi9J2XpLDd4rNOA2tImKxk6lnqErz4qBKcxmTPOUBmqL GBKJcUuQ3ply0U9N/2vU5Nj+P8JmOzxu/mEUoCvnKzUDK7IfP/+a6A56WNyQGdjvvAJvNC DEW6uEiYDz8fSLAeQLURUk/ChE4CeeDpjVvk7ZvX+b44Vk855dFzqOxG4jLBjCXL8iyai0 Hv4kniWTLd+CRk8JhJ8DBxULff3yL2nik4vpN8w9UyzYdW2epoaU0PBkobqzdMUxb5MW+b 9A5SvUv9B5Q+897K7Zw3JtzLlAmo8yzQ6R52ZAvCAH3QZTFrQKxmlmyWduFOuQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639919298; a=rsa-sha256; cv=none; b=pHabyhEx4naITmBImdRBTsa2Yb75qJA6zVjlvczfAluDgqsTLu6EB9/r8tMkl5rl8KVTMR nTYahwta2db4h81GZjhnv0N+MYWxw3liQwmJj4tnpnEz4nyTwvjst9drvyRTZZtqQrQ5do 59u1Cn+ZnWDdW8aCWm5KkATaIeC62gm78I90KvX3H/0b1NBS2BE05h2+iMLzfCFbmJbBfQ HiCJmCgpT5qD1ylmgEsUMosVlFSZSyFw8cTQAaikjzuRigHICtybwciDvE5aeSZqoMRlH6 HJciAQPcPZEr6BSLuMiYFKkFmo3CwEr4YHSLyHbDs47vYD2czrCya6ffUl8gjA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b99k8KIb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.52 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b99k8KIb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 69FF43CE8A X-Spam-Score: -5.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: q1kiwXklJyrN --=-=-= Content-Type: text/plain Michael Eliachevitch writes: > I found a potential bug in org which I can reproduce with a > minimal configuration. Can you try the attached patch? Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-clock.el-Consider-clocking-in-in-an-empty-narrow.patch >From c0e5f708a2b027ca701267bca383d367b7fee51f Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Sun, 19 Dec 2021 21:05:37 +0800 Subject: [PATCH] org-clock.el: Consider clocking-in in an empty narrowed buffer * lisp/org-clock.el (org-clock-in): Fix wrong calculation of TARGET-POS when we are inside an empty narrowing. Fixes https://orgmode.org/list/87tufktz5z.fsf@posteo.de --- 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 e6c7568a6..51a2019d0 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1322,7 +1322,7 @@ (defun org-clock-in (&optional select start-time) ;; Clock in at which position? (setq target-pos (if (and (eobp) (not (org-at-heading-p))) - (point-at-bol 0) + (org-with-wide-buffer (point-at-bol 0)) (point))) (save-excursion (when (and selected-task (marker-buffer selected-task)) -- 2.32.0 --=-=-=--