From 13deb41a3a2b2e7f52a89fda0e29d284903f02a3 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 13 Apr 2013 10:21:16 +0200 Subject: [PATCH] org-clock.el (org-clock-select-task): Remove successive duplicates in the clock history to consider MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * org-clock.el (org-clock-select-task): Remove successive duplicates in the clock history to consider. Thanks to Sébastien Vauban for pointing at this. --- lisp/org-clock.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 62ddc5e2a..d96e034c3 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -516,7 +516,11 @@ of a different task.") (defun org-clock-select-task (&optional prompt) "Select a task that was recently associated with clocking." (interactive) - (let ((chl (length org-clock-history)) sel-list rpl (i 0) s) + (let (och chl sel-list rpl (i 0) s) + ;; Remove successive dups from the clock history to consider + (mapc (lambda (c) (if (not (equal c (car och))) (push c och))) + org-clock-history) + (setq och (reverse och) chl (length och)) (if (zerop chl) (user-error "No recent clock") (save-window-excursion @@ -546,7 +550,7 @@ of a different task.") (+ i (- ?A 10))) m)) (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s)))) (push s sel-list))) - org-clock-history) + och) (run-hooks 'org-clock-before-select-task-hook) (goto-char (point-min)) ;; Set min-height relatively to circumvent a possible but in -- 2.11.4.GIT