emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Not on a heading error while setting priorities
@ 2009-08-02  0:18 Bernt Hansen
  2009-08-02 14:58 ` [PATCH] Fix "Not on a heading" error when setting priority inside a task Bernt Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2009-08-02  0:18 UTC (permalink / raw)
  To: emacs-orgmode

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)

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

end of thread, other threads:[~2009-08-02 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-02  0:18 Not on a heading error while setting priorities Bernt Hansen
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

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