From d447fe879284a40905103fcffde437bb799d27fa Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 20 Jan 2012 15:44:16 +0100 Subject: [PATCH] =?utf8?q?org.el:=20Make=20=CC=80C-u=20C-c=20C-q'=20do=20t?= =?utf8?q?he=20right=20thing=20even=20when=20point=20is=20before=20the=20f?= =?utf8?q?irst=20heading.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * org.el (org-set-tags-command, org-set-tags): Make ̀C-u C-c C-q' do the right thing even when point is before the first heading. Thanks to François Pinard for mentioning this. --- lisp/org.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index c93b7b29b..87b2c3ed8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13273,7 +13273,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state." (defun org-set-tags-command (&optional arg just-align) "Call the set-tags command for the current entry." (interactive "P") - (if (org-at-heading-p) + (if (or (org-at-heading-p) (and arg (org-before-first-heading-p))) (org-set-tags arg just-align) (save-excursion (org-back-to-heading t) @@ -13327,7 +13327,7 @@ If DATA is nil or the empty string, any tags will be removed." With prefix ARG, realign all tags in headings in the current buffer." (interactive "P") (let* ((re org-outline-regexp-bol) - (current (org-get-tags-string)) + (current (unless arg (org-get-tags-string))) (col (current-column)) (org-setting-tags t) table current-tags inherited-tags ; computed below when needed -- 2.11.4.GIT