From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH 1/2] Fix narrowing for 1-line subtrees Date: Tue, 19 Feb 2019 11:01:47 +0100 Message-ID: <87mumsqepg.fsf@nicolasgoaziou.fr> References: <20190218002547.30325-1-leo.vivier@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw2E6-00026h-Vx for emacs-orgmode@gnu.org; Tue, 19 Feb 2019 05:02:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw2Dy-0002Cf-Px for emacs-orgmode@gnu.org; Tue, 19 Feb 2019 05:02:10 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:51431) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gw2Dy-0001k3-JG for emacs-orgmode@gnu.org; Tue, 19 Feb 2019 05:02:02 -0500 In-Reply-To: <20190218002547.30325-1-leo.vivier@gmail.com> (Leo Vivier's message of "Mon, 18 Feb 2019 01:25:46 +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,j Leo Vivier writes: > The problem is inherent to Emacs's narrowing. In org-mode, the > narrowing commands use `org-end-of-subtree' to retrieve the > end-position of the region to be narrowed. However, with a 1-line > subtree, `org-end-of-subtree' moves the point to the end of the line > which is before the position where clocking and scheduling commands > print their modifications, i.e. right below the headline. > > To address the problem, we need to change the way we narrow and widen > buffers in org-mode: Thank you for your effort. However, I don't think this is going into a good direction. Narrowing should probably be the same everywhere in Emacs, including Org mode. > - We patch the narrowing commands in org-mode to always add a newline > at the end of subtrees (not only the 1-line subtrees). This ensures > that clocking and scheduling commands print their modifications > within the narrowed buffer. > - We create a wrapper for `widen' within org-mode (called `org-widen') > which deletes the newline added when we narrowed the buffer to the > subtree. > > However, for this solution to be complete, we need to ensure that the > newlines added by the narrowing commands cannot be deleted by the > user. IMO, this is very hackish. You imply that narrowing is only done interactively, but this is not always the case. In non-interactive usage, messing with newline characters could be a bad idea. In a nutshell, I suggest not going this route. Sorry for not having been clear about it earlier. Regards, -- Nicolas Goaziou