From: "Fraga, Eric" <email@example.com>
To: "Michaël Cadilhac" <firstname.lastname@example.org>
Cc: Org-Mode mailing list <email@example.com>
Subject: Re: Scheduling in a narrowed subtree: Bug?
Date: Tue, 10 Sep 2019 07:53:51 +0000 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
On Monday, 9 Sep 2019 at 15:17, Michaël Cadilhac wrote:
> Is this the expected behavior?
> 1. Create an empty org file
> 2. Insert
> * Test
> * Test 2
> 3. With the cursor at Test, hit C-x n s to narrow the view to the Test
> 4. Hit C-c C-s to schedule the line at any date.
> As a result, the SCHEDULED keyword is _not_ included in the narrow view,
> and inserting things after the Test heading moves the SCHEDULED keyword
> away from its second-line position.
I can confirm this.
However, normally, I do not use narrowing to subtree but instead use a
function based on the code originally from
My code looks like this:
(defun narrow-or-widen-dwim (p)
"Widen if buffer is narrowed, narrow-dwim otherwise.
Dwim means: region, org-src-block, org-subtree, or defun,
whichever applies first. Narrowing to org-src-block actually
With prefix P, don't widen, just narrow even if buffer is
(cond ((and (buffer-narrowed-p) (not p)) (widen))
(narrow-to-region (region-beginning) (region-end)))
;; `org-edit-src-code' is not a real narrowing
;; command. Remove this first conditional if you
;; don't want it.
(cond ((ignore-errors (org-edit-src-code))
((ignore-errors (org-narrow-to-block) t))
((ignore-errors (org-narrow-to-element) t))
This tries a number of different narrowing functions first. Using
this, everything works fine.
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-401-gfabd6d
next prev parent reply other threads:[~2019-09-10 7:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 20:17 Scheduling in a narrowed subtree: Bug? Michaël Cadilhac
2019-09-09 22:13 ` Gustavo Barros
2019-09-10 7:53 ` Fraga, Eric [this message]
2019-09-10 21:10 ` Gustavo Barros
2020-05-06 0:44 ` Nicolas Goaziou
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:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).