From 9cfebf084266267d0c78bbd9097b16c0cd8fbae3 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 13 Apr 2010 09:05:00 +0200 Subject: [PATCH] New command to align all tags --- lisp/ChangeLog | 4 ++++ lisp/org.el | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f040004e..a4aba1376 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-04-13 Carsten Dominik + + * org.el (org-align-all-tags): New command. + 2010-04-13 David Maus * org-wl.el (org-wl-link-remove-filter): New customizable diff --git a/lisp/org.el b/lisp/org.el index 69b9b3f0f..fd4711919 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12171,6 +12171,16 @@ If DATA is nil or the empty string, any tags will be removed." (if (looking-at ".*?\\([ \t]+\\)$") (delete-region (match-beginning 1) (match-end 1)))))) +(defun org-align-all-tags () + "Align the tags i all headings." + (interactive) + (save-excursion + (or (ignore-errors (org-back-to-heading t)) + (outline-next-heading)) + (if (org-on-heading-p) + (org-set-tags t) + (message "No headings")))) + (defun org-set-tags (&optional arg just-align) "Set the tags for the current headline. With prefix ARG, realign all tags in headings in the current buffer."