emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix "Not on a heading" error when setting priority inside a task
Date: Sun, 02 Aug 2009 10:58:36 -0400	[thread overview]
Message-ID: <878wi2b6ub.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: <87ab2jt6eg.fsf@gimli.intra.norang.ca> (Bernt Hansen's message of "Sat\, 01 Aug 2009 20\:18\:31 -0400")

Changing the priority of a task when the point is after the heading
(anywhere inside the task) worked but aligning the tags failed with
a not on a heading error due to the save-excursion not including
the tag alignment.  This change moves back to the heading and
includes that during tag alignment to remove the error text.
---
This patch is available at git://git.norang.ca/org-mode.git for-carsten

-Bernt

 lisp/org.el |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 119311a..942be39 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10294,13 +10294,12 @@ ACTION can be `set', `up', `down', or a character."
 		(goto-char (match-end 2))
 		(insert " [#" news "]"))
 	    (goto-char (match-beginning 3))
-	    (insert "[#" news "] ")))))
-    (org-preserve-lc (org-set-tags nil 'align))
+	    (insert "[#" news "] "))))
+      (org-preserve-lc (org-set-tags nil 'align)))
     (if remove
 	(message "Priority removed")
       (message "Priority of current item set to %s" news))))
 
-
 (defun org-get-priority (s)
   "Find priority cookie and return priority."
   (save-match-data
-- 
1.6.2.rc1.1002.g6345

  reply	other threads:[~2009-08-02 14:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02  0:18 Not on a heading error while setting priorities Bernt Hansen
2009-08-02 14:58 ` Bernt Hansen [this message]
2009-08-02 19:03   ` [PATCH] Fix "Not on a heading" error when setting priority inside a task 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=878wi2b6ub.fsf@gollum.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).