From 809fcf9d78c2073748fa2142a7e5c638203e3d72 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 20 Jul 2009 09:01:33 +0200 Subject: [PATCH] Improve refile history to contain exact matches only This was a proposal by Samuel Wales. After the user selected a refiles target, we make sure that the fully qualified target is in the history, so that next time, UP will bring back exactly this target. --- lisp/ChangeLog | 6 ++++++ lisp/org.el | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 90506b0aa..2c2f9aec6 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-07-20 Carsten Dominik + + * org.el (org-refile-get-location): Tamper with refile history o + that history contains compete matches instead of the entered + string. + 2009-07-19 Carsten Dominik * org.el (org-store-link): Never store a link to an inline task. diff --git a/lisp/org.el b/lisp/org.el index 020452301..25dc38403 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6936,7 +6936,7 @@ For file links, arg negates `org-context-in-file-links'." (interactive "P") (org-load-modules-maybe) (setq org-store-link-plist nil) ; reset - (let ((outline-regexp org-get-limited-outline-regexp) + (let ((outline-regexp (org-get-limited-outline-regexp)) link cpltxt desc description search txt custom-id) (cond @@ -8542,7 +8542,9 @@ See also `org-refile-use-outline-path' and `org-completion-use-ido'" nil 'org-refile-history)) (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl))) (if pa - pa + (progn + (setcar org-refile-history (car pa)) + pa) (when (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ) (setq parent (match-string 1 answ) child (match-string 2 answ))