summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-08-06 11:37:11 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-08-06 11:56:14 +0200
commit795b7c5ca0d6c4cc810c891e2ca783ba58bde658 (patch)
tree165d1b1f2c40f0760323b11ff64ecea0e2669fea
parenta41541c033008336001d6f01b45e85502e04ecff (diff)
downloadorg-mode-795b7c5ca0d6c4cc810c891e2ca783ba58bde658.tar.gz
org-footnote: add speedups when prompted for a label
* lisp/org-footnote.el (org-footnote-new): use ido or iswitchb when available when prompted for a label. Also rename a local variable to avoid confusion with an existing function.
-rw-r--r--lisp/org-footnote.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 4e1f7a1..b566ef7 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -424,9 +424,9 @@ or new, let the user edit the definition of the footnote."
(interactive)
(unless (and (not (bolp)) (org-footnote-in-valid-context-p))
(error "Cannot insert a footnote here"))
- (let* ((labels (and (not (equal org-footnote-auto-label 'random))
- (org-footnote-all-labels)))
- (propose (org-footnote-unique-label labels))
+ (let* ((lbls (and (not (equal org-footnote-auto-label 'random))
+ (org-footnote-all-labels)))
+ (propose (org-footnote-unique-label lbls))
(label
(org-footnote-normalize-label
(cond
@@ -436,15 +436,15 @@ or new, let the user edit the definition of the footnote."
(require 'org-id)
(substring (org-id-uuid) 0 8))
(t
- (completing-read
+ (org-icompleting-read
"Label (leave empty for anonymous): "
- (mapcar 'list labels) nil nil
+ (mapcar 'list lbls) nil nil
(if (eq org-footnote-auto-label 'confirm) propose nil)))))))
(cond
((not label)
(insert "[fn:: ]")
(backward-char 1))
- ((member label labels)
+ ((member label lbls)
(insert "[" label "]")
(message "New reference to existing note"))
(org-footnote-define-inline