emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marc Ihm <marc@ihm.name>
To: emacs-orgmode@gnu.org
Subject: Shouldn't org-back-to-heading skip inline tasks ?
Date: Sat, 4 Nov 2017 16:44:55 +0100	[thread overview]
Message-ID: <otkn9f$ams$1@blaine.gmane.org> (raw)

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

             reply	other threads:[~2017-11-04 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-04 15:44 Marc Ihm [this message]
2017-11-04 21:15 ` Shouldn't org-back-to-heading skip inline tasks ? Nicolas Goaziou
2017-11-05  7:15   ` Marc Ihm

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='otkn9f$ams$1@blaine.gmane.org' \
    --to=marc@ihm.name \
    --cc=emacs-orgmode@gnu.org \
    /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).