From e17368ca762c92948c15b2493faa8ce945b13beb Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 19 Jul 2009 19:45:06 +0200 Subject: [PATCH] Also use TAB for completion with org-insert-link. Before this patch the completion mechanism was this: TAB let's you complete through link prefixes (gnus: file: bbdb: ...) then RET allows completion if a completion mechanism is available for the chosen prefix. Navigating through the history of stored links was a separate process, available through the up/down M-n/M-p keys. Now TAB not only completes through link prefixes but also through stored links. This behavior matches other Emacs completion mechanisms a bit more closely. --- lisp/ChangeLog | 2 ++ lisp/org.el | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c63675d9..21ce5edc4 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,8 @@ 2009-07-19 Bastien Guerry * org.el (orgstruct++-mode): Fix typo in docstring. + (org-insert-link): Clean up: (or (...)) => (...) + (org-insert-link): Use TAB for stored links completion. 2009-07-18 Bastien Guerry diff --git a/lisp/org.el b/lisp/org.el index e2d1cfc63..545bb35d8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7370,11 +7370,13 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (let ((org-completion-use-ido nil)) (org-completing-read "Link: " - (mapcar (lambda (x) (list (concat x ":"))) - all-prefixes) + (append + (mapcar (lambda (x) (list (concat x ":"))) + all-prefixes) + (mapcar 'car org-stored-links)) nil nil nil 'tmphist - (or (car (car org-stored-links)))))) + (car (car org-stored-links))))) (if (or (member link all-prefixes) (and (equal ":" (substring link -1)) (member (substring link 0 -1) all-prefixes) @@ -7442,7 +7444,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (insert (org-make-link-string link desc)))) (defun org-link-try-special-completion (type) - "If there is completion support for link type TAPE, offer it." + "If there is completion support for link type TYPE, offer it." (let ((fun (intern (concat "org-" type "-complete-link")))) (if (functionp fun) (funcall fun)