emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Subject: Not on a heading error while setting priorities
Date: Sat, 01 Aug 2009 20:18:31 -0400	[thread overview]
Message-ID: <87ab2jt6eg.fsf@gimli.intra.norang.ca> (raw)

Hi,

I noticed the following error while playing with task priorities.  If
you are in an org-file and use C-c , on a headline it works fine.

If you try this after the headline (anywhere in the body of the task)
you get a "Not on a heading" error but it still seems to work (it puts
the appropriate priority in the heading of the task.)

I like the idea of allowing the task priority to change while anywhere
in the task and other than signalling the error this seems to work fine.

I've attached the debug backtrace.  A patch to fix this is in the
following email.

-Bernt

Debugger entered--Lisp error: (error "Not on a heading")
  signal(error ("Not on a heading"))
  error("Not on a heading")
  (if (org-on-heading-p t) nil (error "Not on a heading"))
  (unless (org-on-heading-p t) (error "Not on a heading"))
  org-get-tags-string()
  (let* ((re ...) (current ...) (col ...) (org-setting-tags t) table current-tags inherited-tags tags p0 c0 c1 rpl) (if arg (save-excursion ... ... ...) (if just-align ... ... ...) (if org-tags-sort-function ...) (if ... ... ... ...) (beginning-of-line 1) (cond ... ... ...) (org-move-to-column col) (unless just-align ...)))
  org-set-tags(nil align)
  (progn (org-set-tags nil (quote align)))
  (unwind-protect (progn (org-set-tags nil ...)) (goto-line _line) (org-move-to-column _col))
  (let ((_line ...) (_col ...)) (unwind-protect (progn ...) (goto-line _line) (org-move-to-column _col)))
  (org-preserve-lc (org-set-tags nil (quote align)))
  (let (current new news have remove) (save-excursion (org-back-to-heading t) (if ... ... ...) (cond ... ... ... ...) (if ... ...) (setq news ...) (if have ... ...)) (org-preserve-lc (org-set-tags nil ...)) (if remove (message "Priority removed") (message "Priority of current item set to %s" news)))
  org-priority()
  call-interactively(org-priority)

             reply	other threads:[~2009-08-02  3:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02  0:18 Bernt Hansen [this message]
2009-08-02 14:58 ` [PATCH] Fix "Not on a heading" error when setting priority inside a task Bernt Hansen
2009-08-02 19:03   ` Bastien

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=87ab2jt6eg.fsf@gimli.intra.norang.ca \
    --to=bernt@norang.ca \
    --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).