From df9e196edb7a250d12bfadf8385feb0a0aa7f303 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 12 Jan 2012 16:13:33 +0100 Subject: [PATCH 1/2] Docfix: using `org-sort' with a double prefix doesn't delete duplicates. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Paweł Menich for spotting this. --- doc/org.texi | 3 +-- lisp/org.el | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 677b5876d..b96e0f721 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -1435,8 +1435,7 @@ creation time, scheduled time, deadline time), by priority, by TODO keyword (in the sequence the keywords have been defined in the setup) or by the value of a property. Reverse sorting is possible as well. You can also supply your own function to extract the sorting key. With a @kbd{C-u} prefix, -sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate -entries will also be removed. +sorting will be case-sensitive. @orgcmd{C-x n s,org-narrow-to-subtree} Narrow buffer to current subtree. @orgcmd{C-x n b,org-narrow-to-block} diff --git a/lisp/org.el b/lisp/org.el index fcfc35ceb..b6d31cfbf 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7959,8 +7959,7 @@ and still retain the repeater to cover future instances of the task." (defun org-sort (with-case) "Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'. -Optional argument WITH-CASE means sort case-sensitively. -With a double prefix argument, also remove duplicate entries." +Optional argument WITH-CASE means sort case-sensitively." (interactive "P") (cond ((org-at-table-p) (org-call-with-arg 'org-table-sort-lines with-case)) From 8c2f226b4d7cadc4fea2941e1bd3795f6adf8c2e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 12 Jan 2012 18:37:08 +0100 Subject: [PATCH 2/2] C-c C-c renumbers ordered lists again * lisp/org.el (org-ctrl-c-ctrl-c): Fix a naive structure backup. Those must be done with `copy-tree'. Thanks to Anthony Lander for reporting it. --- lisp/org.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b6d31cfbf..50ee688b7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18424,22 +18424,22 @@ This command does many different things, depending on context: ;; only if function was called with an argument. Send list only ;; if at top item. (let* ((struct (org-list-struct)) - (new-struct struct) - (firstp (= (org-list-get-top-point struct) (point-at-bol)))) + (firstp (= (org-list-get-top-point struct) (point-at-bol))) + old-struct) (when arg - (setq new-struct (copy-tree struct)) + (setq old-struct (copy-tree struct)) (if firstp ;; If at first item of sub-list, add check-box to every ;; item at the same level. (mapc (lambda (pos) - (unless (org-list-get-checkbox pos new-struct) - (org-list-set-checkbox pos new-struct "[ ]"))) + (unless (org-list-get-checkbox pos struct) + (org-list-set-checkbox pos struct "[ ]"))) (org-list-get-all-items - (point-at-bol) new-struct (org-list-prevs-alist new-struct))) - (org-list-set-checkbox (point-at-bol) new-struct "[ ]"))) + (point-at-bol) struct (org-list-prevs-alist struct))) + (org-list-set-checkbox (point-at-bol) struct "[ ]"))) (org-list-write-struct - new-struct (org-list-parents-alist new-struct) struct) + struct (org-list-parents-alist struct) old-struct) (when arg (org-update-checkbox-count-maybe)) (when firstp (org-list-send-list 'maybe)))) ((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re))