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 eC6+HV1Ya18VZAAA0tVLHw (envelope-from ) for ; Wed, 23 Sep 2020 14:14:53 +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 kELSGV1Ya1+TJwAA1q6Kng (envelope-from ) for ; Wed, 23 Sep 2020 14:14:53 +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 042589403D6 for ; Wed, 23 Sep 2020 14:14:53 +0000 (UTC) Received: from localhost ([::1]:43062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL5Xn-0004GM-W3 for larch@yhetil.org; Wed, 23 Sep 2020 10:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL5XC-0004Em-K1 for emacs-orgmode@gnu.org; Wed, 23 Sep 2020 10:14:14 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kL5XA-0002TX-6W; Wed, 23 Sep 2020 10:14:14 -0400 Received: by mail-pf1-x431.google.com with SMTP id f18so15110188pfa.10; Wed, 23 Sep 2020 07:14:11 -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=Lw8TngcAr4FrTtMDWmQIaFF79eJj8bKzfCqtilDI88U=; b=ClVhOeNYsVyPO+SVPg/aipP3Qy1Mkkz7RfwtSlUs6hZpRjQaRVgcLMFkxzjUnl3WXZ ZhYFCTuJGT4AaupZQBKJ1yyJKEvMr6ykkFXARq4rE9IrdDPoJ/+OHVmpx//BKUHFgFJZ XOC3pIxC0wNKiq3n+LIpJHOeoMaQvrPcVE55NA3QVulrkzJeOCceklE6WFNIIxqfBZc7 ihsEJibWVjK5O9OdlHLz37t646LGMAPijEPCHAb1Rd2E+F2607ahwXVuUamfjIEe2VNl TDUdW6wXnNXAw7c4OY/ISxwAUKj9WewTFRh4k9smlFnfa+0UNmtWO3+oiT81KTbQjzxV MxHQ== 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=Lw8TngcAr4FrTtMDWmQIaFF79eJj8bKzfCqtilDI88U=; b=QMEaCpTcvcVZdFIh7fbSKJkFBxuX89QXfOSRZjfLKi9qAFgBgW9/9aeXyOLAkcbrJo Dn0ZYvq7VjK5j7zU6cDf5/ERRqCwq1JOXDmGnePZ+2eKhjAVcnQRyZRt2ETaynySboJs UChg4suoOJcMLpXN7J4MyuHWuK3zeAcjXpMlDNaTGuKjvL9tCzL2i8K+lCc68v3YBbfk kSSAQ0xlYyYPyMqa6ZZZ71B2IYj5vRnZwyVpIxofNijMSXGsVXzds3bg4JT4OJNtsV+g +y2ASFaVWnLzxp/NW+ny++jBc5K+aSr8VNif1DhM9fk8HLSNj5nsWkxsZLguxNlO5jw9 UDJA== X-Gm-Message-State: AOAM531jg10B5/KZOLq/7E4T6/c7KQi532tzW3ogM5Ic6ExolDF0JKaG T3vcEOzrTt9iMqm7lbiLXOa5OIfMwYMDyzIp X-Google-Smtp-Source: ABdhPJxwkncIGrNqveeBrSQfvMjC2d/gWx8Z1dR+bTbDzsm2fSv9S5WQZ41oCyFeFm6tnKsQLaZfdg== X-Received: by 2002:a63:fd11:: with SMTP id d17mr3578327pgh.213.1600870449871; Wed, 23 Sep 2020 07:14:09 -0700 (PDT) Received: from localhost ([173.254.200.139]) by smtp.gmail.com with ESMTPSA id h9sm113529pgk.52.2020.09.23.07.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 07:14:08 -0700 (PDT) From: Ihor Radchenko To: Bastien , stardiviner Subject: [PATCH] Re: Bug: org-cycle stops working on Org files with empty lines at end of buffer [9.4 (9.4-elpaplus @ /home/brentg/.emacs.d/elpa/org-plus-contrib-20200914/)] In-Reply-To: <87k0wkheik.fsf@gnu.org> References: <50f165b2-bdaf-4861-aab5-122cfef7d67c@www.fastmail.com> <5f6aa2e2.1c69fb81.9bff7.9127@mx.google.com> <87k0wkheik.fsf@gnu.org> Date: Wed, 23 Sep 2020 22:13:04 +0800 Message-ID: <87lfh060pb.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=yantar92@gmail.com; helo=mail-pf1-x431.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: Nicholas Savage , 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=ClVhOeNY; 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: J1sP4dJz6A/i --=-=-= Content-Type: text/plain > Also, if you can provide a patch, please go ahead. Here it is. --=-=-= 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 Bastien writes: > Hi, > > stardiviner writes: > >> I also did a bisect debug. Found the function ~org-cycle-show-empty-lines~ in hook >> ~org-cycle-hook~ caused this problem. > > Did you find the commit that introduces this bug? > > Also, if you can provide a patch, please go ahead. > > Thanks! > > -- > Bastien --=-=-=--