Bladeren bron

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 16 jaren geleden
bovenliggende
commit
809fcf9d78
2 gewijzigde bestanden met toevoegingen van 10 en 2 verwijderingen
  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>
 2009-07-19  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
 	* org.el (org-store-link): Never store a link to an inline task.
 	* 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")
   (interactive "P")
   (org-load-modules-maybe)
   (org-load-modules-maybe)
   (setq org-store-link-plist nil)  ; reset
   (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)
 	link cpltxt desc description search txt custom-id)
     (cond
     (cond
 
 
@@ -8542,7 +8542,9 @@ See also `org-refile-use-outline-path' and `org-completion-use-ido'"
 			nil 'org-refile-history))
 			nil 'org-refile-history))
     (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
     (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
     (if pa
     (if pa
-	pa
+	(progn
+	  (setcar org-refile-history (car pa))
+	  pa)
       (when (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
       (when (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
 	(setq parent (match-string 1 answ)
 	(setq parent (match-string 1 answ)
 	      child (match-string 2 answ))
 	      child (match-string 2 answ))