summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2009-07-19 19:45:06 +0200
committerBastien Guerry <bzg@altern.org>2009-07-19 19:45:06 +0200
commite17368ca762c92948c15b2493faa8ce945b13beb (patch)
treeaf0e68d8bb0c81b7998c0c0cfebfb61aba728a35
parentffa046d38b7467e2dafc013b3db9a6d76ec6c6f6 (diff)
downloadorg-mode-e17368ca762c92948c15b2493faa8ce945b13beb.tar.gz
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.
-rwxr-xr-xlisp/ChangeLog2
-rw-r--r--lisp/org.el10
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4c63675..21ce5ed 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,8 @@
2009-07-19 Bastien Guerry <bzg@altern.org>
* 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 <bzg@altern.org>
diff --git a/lisp/org.el b/lisp/org.el
index e2d1cfc..545bb35 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)