[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] [misc-new-features 3/5] Add an option to sort tags automat
From: |
Bastien |
Subject: |
Re: [Orgmode] [misc-new-features 3/5] Add an option to sort tags automatically. |
Date: |
Fri, 17 Jul 2009 18:38:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
I applied this patch, thanks a lot.
James TD Smith <address@hidden> writes:
> ---
> lisp/ChangeLog | 3 +++
> lisp/org.el | 17 ++++++++++++++++-
> 2 files changed, 19 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/ChangeLog b/lisp/ChangeLog
> index 348ade3..9ce7a17 100755
> --- a/lisp/ChangeLog
> +++ b/lisp/ChangeLog
> @@ -11,6 +11,9 @@
> SINCE_IA. These give the time since any active or inactive
> timestamp in an entry.
> (org-special-properties): Add SINCE, SINCE_IA.
> + (org-tags-sort-function): Add custom declaration for tags
> + sorting function.
> + (org-set-tags): Sort tags if org-tags-sort-function is set
>
> 2009-07-08 Carsten Dominik <address@hidden>
>
> diff --git a/lisp/org.el b/lisp/org.el
> index d08155a..854d09c 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -2337,6 +2337,15 @@ is better to limit inheritance to certain tags using
> the variables
> (const :tag "Yes, do list them" t)
> (const :tag "List them, indented with leading dots" indented)))
>
> +(defcustom org-tags-sort-function nil
> + "When set, tags are sorted using this function as a comparator"
> + :group 'org-tags
> + :type '(choice
> + (const :tag "No sorting" nil)
> + (const :tag "Alphabetical" string<)
> + (const :tag "Reverse alphabetical" string>)
> + (function :tag "Custom function" nil)))
> +
> (defvar org-tags-history nil
> "History of minibuffer reads for tags.")
> (defvar org-last-tags-completion-table nil
> @@ -10840,11 +10849,17 @@ With prefix ARG, realign all tags in headings in
> the current buffer."
> ;; No boolean logic, just a list
> (setq tags (replace-match ":" t t tags))))
>
> + (if org-tags-sort-function
> + (setq tags (mapconcat 'identity
> + (sort (org-split-string tags (org-re
> "[^[:alnum:address@hidden"))
> + org-tags-sort-function) ":")))
> +
> (if (string-match "\\`[\t ]*\\'" tags)
> - (setq tags "")
> + (setq tags "")
> (unless (string-match ":$" tags) (setq tags (concat tags ":")))
> (unless (string-match "^:" tags) (setq tags (concat ":" tags))))
>
> +
> ;; Insert new tags at the correct column
> (beginning-of-line 1)
> (cond
--
Bastien
- Re: [Orgmode] [misc-new-features 5/5] Fix a problem I was having with plots using a script. Org-plot was deleting the data file before gnuplot read it in. I've moved the deletion of the temporary data file to an idle timer, which has fixed the problem., (continued)
- Re: [Orgmode] [misc-new-features 5/5] Fix a problem I was having with plots using a script. Org-plot was deleting the data file before gnuplot read it in. I've moved the deletion of the temporary data file to an idle timer, which has fixed the problem., Bastien, 2009/07/14
- Re: [Orgmode] [misc-new-features 5/5] Fix a problem I was having with plots using a script. Org-plot was deleting the data file before gnuplot read it in. I've moved the deletion of the temporary data file to an idle timer, which has fixed the problem., Bastien, 2009/07/17
- [Orgmode] Re: [misc-new-features 4/5] Allow org-insert-link to check the X clipboard and the Emacs kill-ring for links, as well as the stored links. This makes getting URLs into org from a browser much easier, as you don't have to paste the URL into the minibuffer to insert a link., Bernt Hansen, 2009/07/13
- [Orgmode] Re: [misc-new-features 4/5] extra long subject lines, James TD Smith, 2009/07/13
- [Orgmode] Re: [misc-new-features 4/5] extra long subject lines, Bernt Hansen, 2009/07/13
- Re: [Orgmode] [misc-new-features 4/5] Allow org-insert-link to check the X clipboard and the Emacs kill-ring for links, as well as the stored links. This makes getting URLs into org from a browser much easier, as you don't have to paste the URL into the minibuffer to insert a link., Bastien, 2009/07/14
- Re: [Orgmode] [misc-new-features 4/5] Allow org-insert-link to check the X clipboard and the Emacs kill-ring for links, as well as the stored links. This makes getting URLs into org from a browser much easier, as you don't have to paste the URL into the minibuffer to insert a link., Bastien, 2009/07/17
- Re: [Orgmode] [misc-new-features 3/5] Add an option to sort tags automatically., Bastien, 2009/07/14
- Re: [Orgmode] [misc-new-features 3/5] Add an option to sort tags automatically., James TD Smith, 2009/07/14
- Re: [Orgmode] [misc-new-features 3/5] Add an option to sort tags automatically., Bastien, 2009/07/17
- Re: [Orgmode] [misc-new-features 3/5] Add an option to sort tags automatically.,
Bastien <=
- Re: [Orgmode] [misc-new-features 2/5] Bugfixes, documentation and custom options for org-checklist., Bastien, 2009/07/14
- Re: [Orgmode] [misc-new-features 2/5] Bugfixes, documentation and custom options for org-checklist., James TD Smith, 2009/07/14
- Re: [Orgmode] [misc-new-features 1/5] Add two new special properties, SINCE and SINCE_IA., Bastien, 2009/07/14
- Re: [Orgmode] [misc-new-features 1/5] Add two new special properties, SINCE and SINCE_IA., Bastien, 2009/07/17