Explorar el Código

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.
Carsten Dominik hace 16 años
padre
commit
809fcf9d78
Se han modificado 2 ficheros con 10 adiciones y 2 borrados
  1. 6 0
      lisp/ChangeLog
  2. 4 2
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-07-20  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* 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  <carsten.dominik@gmail.com>
 
 	* org.el (org-store-link): Never store a link to an inline task.

+ 4 - 2
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))