emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Shouldn't org-back-to-heading skip inline tasks ?
@ 2017-11-04 15:44 Marc Ihm
  2017-11-04 21:15 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Ihm @ 2017-11-04 15:44 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Shouldn't org-back-to-heading skip inline tasks ?
  2017-11-04 15:44 Shouldn't org-back-to-heading skip inline tasks ? Marc Ihm
@ 2017-11-04 21:15 ` Nicolas Goaziou
  2017-11-05  7:15   ` Marc Ihm
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-11-04 21:15 UTC (permalink / raw)
  To: Marc Ihm; +Cc: emacs-orgmode

Hello,

Marc Ihm <marc@ihm.name> writes:

> 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

Use `org-with-limited-levels' macro to ignore inlinetasks, e.g.:

  (org-with-limited-levels (org-back-to-heading))

This is how Org somewhat handles inlinetasks.

/me closes the can of worms.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Shouldn't org-back-to-heading skip inline tasks ?
  2017-11-04 21:15 ` Nicolas Goaziou
@ 2017-11-05  7:15   ` Marc Ihm
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Ihm @ 2017-11-05  7:15 UTC (permalink / raw)
  Cc: emacs-orgmode

Am 04.11.2017 um 22:15 schrieb Nicolas Goaziou:

>
> Use `org-with-limited-levels' macro to ignore inlinetasks, e.g.:
>
>    (org-with-limited-levels (org-back-to-heading))
>
> This is how Org somewhat handles inlinetasks.
>
> /me closes the can of worms.
>
> Regards,
>

Good enough for me too. Thanx !

Best regards
Marc

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-05  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-04 15:44 Shouldn't org-back-to-heading skip inline tasks ? Marc Ihm
2017-11-04 21:15 ` Nicolas Goaziou
2017-11-05  7:15   ` Marc Ihm

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).