[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees |
Date: |
Tue, 19 Feb 2019 11:01:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello,j
Leo Vivier <address@hidden> 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
- [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/17
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees,
Nicolas Goaziou <=
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- [O] [PATCH] Fix narrowing for 1-line subtrees (squashed), Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Nicolas Goaziou, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Nicolas Goaziou, 2019/02/20
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/20
- [O] [PATCH] Fix narrowed 1-line subtrees, Leo Vivier, 2019/02/21
- Re: [O] [PATCH] Fix narrowed 1-line subtrees, Leo Vivier, 2019/02/21