From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix "Not on a heading" error when setting priority inside a task Date: Sun, 02 Aug 2009 10:58:36 -0400 Message-ID: <878wi2b6ub.fsf@gollum.intra.norang.ca> References: <87ab2jt6eg.fsf@gimli.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXcWJ-0003TE-I2 for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 10:58:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXcWF-0003Ma-OF for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 10:58:42 -0400 Received: from [199.232.76.173] (port=56291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXcWF-0003MM-Fm for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 10:58:39 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:64217) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXcWF-0006R3-1i for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 10:58:39 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1MXcWE-000Nyd-5g for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 14:58:38 +0000 Received: from gollum.intra.norang.ca (gollum.intra.norang.ca [192.168.1.5]) by mail.norang.ca (8.14.3/8.14.3/Debian-5) with ESMTP id n72Ewat4009136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 2 Aug 2009 10:58:37 -0400 Received: from gollum.intra.norang.ca (localhost [127.0.0.1]) by gollum.intra.norang.ca (8.14.3/8.14.3/Debian-5) with ESMTP id n72EwaWX019017 for ; Sun, 2 Aug 2009 10:58:36 -0400 In-Reply-To: <87ab2jt6eg.fsf@gimli.intra.norang.ca> (Bernt Hansen's message of "Sat\, 01 Aug 2009 20\:18\:31 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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