[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Shouldn't org-back-to-heading skip inline tasks ?
From: |
Marc Ihm |
Subject: |
[O] Shouldn't org-back-to-heading skip inline tasks ? |
Date: |
Sat, 4 Nov 2017 16:44:55 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 |
Hi,
recently I have been surprised by the fact, that org-back-to-heading (or
outline-back-to-heading, for that matter) does stop at inline tasks,
as can be tried easily with this org-snippet:
* foo
*************** Inline
*************** END
M-x org-back-to-heading
In my opinion, the cursor should go straight up to the heading foo
instead of stopping at the inlinetask.
To fix this behaviour, one could insert a modified version of
org-back-to-heading right into org-inlinetask.el like this:
(defun org-back-to-heading ()
"Move to previous heading, skipping over inlinetasks."
(let (prev)
(save-excursion
(end-of-line)
(while (and (setq prev (re-search-backward org-outline-regexp-bol
nil t))
(>= (outline-level) org-inlinetask-min-level))))
(if prev
(goto-char prev)
(error (error "Before first headline at position %d in buffer %s"
(point) (current-buffer))))))
which does not yet accept an optional invisible-ok argument, however.
Would this be a useful change ?
Best regards,
Marc Ihm
- [O] Shouldn't org-back-to-heading skip inline tasks ?,
Marc Ihm <=