From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QPzSBKVaa193CQAA0tVLHw (envelope-from ) for ; Wed, 23 Sep 2020 14:24:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mOPJAKVaa1/KLgAA1q6Kng (envelope-from ) for ; Wed, 23 Sep 2020 14:24:37 +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 DA50194066B for ; Wed, 23 Sep 2020 14:24:35 +0000 (UTC) Received: from localhost ([::1]:36556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL5hB-0005O2-MG for larch@yhetil.org; Wed, 23 Sep 2020 10:24:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL5gh-0005Lx-6Y for emacs-orgmode@gnu.org; Wed, 23 Sep 2020 10:24:03 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:36479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kL5ge-0003rn-TC; Wed, 23 Sep 2020 10:24:02 -0400 Received: by mail-pj1-x1034.google.com with SMTP id b17so3248727pji.1; Wed, 23 Sep 2020 07:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=VDK+Ph0zdm/G8IojWiggQMCQVB0gIXberTnVL0kZzJ4=; b=pYTUmcRsHtlgp70miJS9Zm74q+u1HKPxbmUN25/sxu0fClzYDM1TuS0q7DpECOUP2w 9Qui4hdPKYoI4WWkx/883T4D9O0uf5JIf0Hg1gYhr9mU3dyB+9WqdJE2Yop1vSv1BmIY FSOqkvBlvuKIFZhYWjNImC2Q2Xpn9hm4VAW6rJqQeQYOnJxfauRU4LEB6xANYDim/eT2 TfN/fLeY1Uq8cAglgP7BCk8Opdn3MwNrL0xvqUZue68qcnxYbwL8tGZjN9nnLcw2nwyz VS/lzVaVAUEufS1KkYsIllFb6h3khP70BGLjtl3cnRgMBFyjdZSDZVYbGfZ4OH7j2i4t uPLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=VDK+Ph0zdm/G8IojWiggQMCQVB0gIXberTnVL0kZzJ4=; b=WyeuMJLdbSnSkc1GDxHc8nW10ajTMxRyUYVCCPxuaxcLGa60TdjWCovQQFQwa2f8m7 FZq6qNtxS0TCMn+SkUV9/wLNYS/z1RJW2Ugw6SiHPIcX+/FOVgHBvfN+tjm3XPdDnenA D3r7qabf5KBLxpBwMep9mrbgNq6jF44/S3XolftlbDt/x/T706Yjz9P9wqu8B6GVQoYe zjuG0zAlgiiGUHF3YbXtC2/VluMSq5jIj1e4TMK1jP8kU6CZDz3UxnneLHAFIT/bHPBh aFR+NuuxfFwd19lcJt/nuQLrmthtS7gDBW2zlwQ6DTqMInnVKJ4CwhfV73kZa/DbiATm t9OA== X-Gm-Message-State: AOAM532bIlLm5PP3JuemV7PXBFVjqSFdxC32UzVxQzljbdlhJc/L+HeF e4ITo+kh+nrbc3TK2ls02aBhe87wOtC3CWOG X-Google-Smtp-Source: ABdhPJy4jLMmlarLwz144Dd+JzKqDEC/h7l4zGo0eUkWZuxpL2R0tiOugnypr/m4be7YAEYHLI3FuA== X-Received: by 2002:a17:90a:e549:: with SMTP id ei9mr8522347pjb.52.1600871038141; Wed, 23 Sep 2020 07:23:58 -0700 (PDT) Received: from localhost ([173.254.200.139]) by smtp.gmail.com with ESMTPSA id w14sm7902130pfu.87.2020.09.23.07.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 07:23:57 -0700 (PDT) From: Ihor Radchenko To: emacs18@gmail.com, Bastien Subject: Re: Cycling through TODO workflow joins the next line onto the current one In-Reply-To: <87d02cppsm.fsf@gmail.com> References: <87tuvparnu.fsf@gnu.org> <87h7ropqph.fsf@gmail.com> <87d02cppsm.fsf@gmail.com> Date: Wed, 23 Sep 2020 22:22:52 +0800 Message-ID: <87ft78608z.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1034.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Krishan Kharagjitsing , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=pYTUmcRs; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -1.21 X-TUID: RgL18lFilM49 --=-=-= Content-Type: text/plain > On my emacs 27, following demonstrates the problem. The patch is attached. It should fix the problem. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Do-not-remove-trailing-newline-when-deleting-plannin.patch >From 8e99e5dea780041d314f666f506a120224f064eb Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Wed, 23 Sep 2020 21:54:47 +0800 Subject: [PATCH] Do not remove trailing newline when deleting planning info line. * lisp/org.el (org-add-planning-info): Remove front newline instead of trailing newline when deleting planning info is completetly removed from a heading. Fixes "Cycling through TODO workflow joins the next line onto the current one". The old behaviour affected folded headlines containing only planning info in the body: Before deletion: * DONE Headline CLOSED: [2020-09-23 Wed 21:39] * test After deletion: * DONE Headline * test The newline after the first headline is hidden making both the headlines appear at the same visual line. New behaviour: After deletion: * DONE Headline * test All the folded text is completely removed. --- lisp/org.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a9fdc7b77..845920a71 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10684,8 +10684,8 @@ WHAT entry will also be removed." ;; If there is nothing more to add and no more keyword is ;; left, remove the line completely. (if (and (looking-at-p "[ \t]*$") (not what)) - (delete-region (line-beginning-position) - (line-beginning-position 2)) + (delete-region (line-end-position 0) + (line-end-position)) ;; If we removed last keyword, do not leave trailing white ;; space at the end of line. (let ((p (point))) -- 2.26.2 --=-=-= Content-Type: text/plain Richard Kim writes: > Richard Kim writes: > >> Bastien writes: >> >>> Hi Krishan, >>> >>> Krishan Kharagjitsing writes: >>> >>>> Hello, I found the following weird behaviour. >>> >>> What is M-x org-version RET ? >> >> Because of (setq org-log-done 'time) according to >> https://github.com/syl20bnr/spacemacs/issues/13901#issuecomment-697323151 >> >>>> When I set some tasks to DONE and fold the headings with TAB, then >>>> when I cycle back from DONE to TODO it joins the next line with the >>>> current one. >>>> >>>> org_mode_bug >>>> >>>> Reproduction guide >>>> >>>> Make two TODO headings in org mode >>>> Cycle both TODO items to DONE >>>> Fold the headings (so the dots appear, because the timestamp gets >>>> folded with the heading) >>>> Cycle the first DONE heading >>> >>> Why are there timestamps? Can you provide a test .org file where we >>> can reproduce the problem? >>> >>> Thanks, >> >> The original report at the top of >> https://github.com/syl20bnr/spacemacs/issues/13901 >> has gif animation on how this problem can be seen. > > On my emacs 27, following demonstrates the problem. > > (let () > (switch-to-buffer (generate-new-buffer "*demo line joining bug*")) > (erase-buffer) > (org-mode) > (setq org-log-done 'time) > (insert "* one\n") > (insert "* two\n") > (goto-line 1) > (org-todo) > (org-todo) > (org-todo) > (org-cycle) > (org-todo) > (org-todo) > ) --=-=-=--