From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Leo Vivier <leo.vivier@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH 1/2] Fix narrowing for 1-line subtrees
Date: Tue, 19 Feb 2019 11:01:47 +0100 [thread overview]
Message-ID: <87mumsqepg.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <20190218002547.30325-1-leo.vivier@gmail.com> (Leo Vivier's message of "Mon, 18 Feb 2019 01:25:46 +0100")
Hello,j
Leo Vivier <leo.vivier@gmail.com> 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
next prev parent reply other threads:[~2019-02-19 10:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 0:25 [PATCH 1/2] Fix narrowing for 1-line subtrees Leo Vivier
2019-02-18 0:25 ` [PATCH 2/2] Prevent deletion of newline added by narrowing Leo Vivier
2019-02-18 1:02 ` [PATCH] Fix other commands for exiting narrowing Leo Vivier
2019-02-18 1:21 ` [PATCH] Fix other commands for exiting narrowing (2) Leo Vivier
2019-02-18 17:18 ` [PATCH] Fix problems Leo Vivier
2019-02-19 10:01 ` Nicolas Goaziou [this message]
2019-02-19 10:24 ` [PATCH 1/2] Fix narrowing for 1-line subtrees Leo Vivier
2019-02-19 10:35 ` [PATCH] Fix narrowing for 1-line subtrees (squashed) Leo Vivier
2019-02-19 12:05 ` [PATCH 1/2] Fix narrowing for 1-line subtrees Nicolas Goaziou
2019-02-19 13:37 ` Leo Vivier
2019-02-19 15:28 ` Leo Vivier
2019-02-19 15:40 ` Leo Vivier
2019-02-20 13:25 ` Nicolas Goaziou
2019-02-20 13:36 ` Leo Vivier
2019-02-21 15:38 ` [PATCH] Fix narrowed " Leo Vivier
2019-02-21 15:41 ` Leo Vivier
2019-02-21 15:43 ` [PATCH] Fix spaces with `org-remove-timestamp-with-keyword' Leo Vivier
2019-02-22 20:23 ` [PATCH] Fix narrowed 1-line subtrees Leo Vivier
2019-02-22 20:54 ` Leo Vivier
2019-02-22 21:53 ` Samuel Wales
2019-02-22 22:04 ` Leo Vivier
2019-02-22 23:58 ` Samuel Wales
2019-02-23 10:43 ` Leo Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mumsqepg.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=leo.vivier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).