From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: Bug: org-clock commands spawn drawer outside of narrowing [9.2.1 (9.2.1-2-gc6d37c-elpaplus @ /home/zaeph/.emacs.d/elpa/org-plus-contrib-20190204/)] Date: Thu, 14 Feb 2019 15:53:22 +0100 Message-ID: <8736oqs9p9.fsf@nicolasgoaziou.fr> References: <87lg2m6u85.fsf@hidden> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:47568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guIOR-0003r8-Bo for emacs-orgmode@gnu.org; Thu, 14 Feb 2019 09:53:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guIOQ-0003rE-Be for emacs-orgmode@gnu.org; Thu, 14 Feb 2019 09:53:39 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:53003) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guION-0003ie-9Y for emacs-orgmode@gnu.org; Thu, 14 Feb 2019 09:53:36 -0500 In-Reply-To: <87lg2m6u85.fsf@hidden> (Leo Vivier's message of "Mon, 11 Feb 2019 19:44:10 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Leo Vivier Cc: emacs-orgmode@gnu.org Hello, Leo Vivier writes: > The bug only happens in narrowed org-mode buffers when the tree at > point (or targeted by the resolving) is a single line not followed by a > blank line. [...] > MWE: > > --------------------------------[START]-------------------------------- > * Tree 1 > * Tree 2 > ---------------------------------[END]--------------------------------- > > - Narrow to =E2=80=98Tree 1=E2=80=99l > - Clock in. > > Observations: > - No clock drawer visible in the narrowed buffer. > - Feedback in the minibuffer that the clock was started. > - Widening the buffer confirms the presence of the buffer where it > should be. This looks correct, indeed. > Whilst the observations would lead one to think that everything =E2=80=98= Just > Works=E2=84=A2=E2=80=99, it causes a slew of problems. Two examples: > - After clocking in, adding a new heading =E2=80=98Subtree=E2=80=99 bello= w =E2=80=98Tree 1=E2=80=99 > would make the drawer belong to =E2=80=98Subtree=E2=80=99 instead of = =E2=80=98Tree 1=E2=80=99 This is to be expected. The same would happen in a widened buffer, if you insert a new headline (M-RET) at the end of the one being clocked. The difference here is that you cannot see the running clock, but this is to be expected when you narrow the document to a single line which is not meaningful syntactically. Try narrowing the buffer to a single character: all weird things may happen. I suggest to narrow only to meaningful parts of a document, e.g., a paragraph, a subtree=E2=80=A6 > - `org-clock-out-when-done` isn=E2=80=99t respected since the drawer is n= ot > visible This is a bug. I fixed it. Regards, --=20 Nicolas Goaziou