[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] Changes to auctex/multi-prompt.el,v
From: |
Ralf Angeli |
Subject: |
[AUCTeX-diffs] Changes to auctex/multi-prompt.el,v |
Date: |
Sat, 04 Apr 2009 20:10:40 +0000 |
CVSROOT: /cvsroot/auctex
Module name: auctex
Changes by: Ralf Angeli <angeli> 09/04/04 20:10:40
Index: multi-prompt.el
===================================================================
RCS file: /cvsroot/auctex/auctex/multi-prompt.el,v
retrieving revision 5.10
retrieving revision 5.11
diff -u -b -r5.10 -r5.11
--- multi-prompt.el 29 Mar 2009 19:56:22 -0000 5.10
+++ multi-prompt.el 4 Apr 2009 20:10:38 -0000 5.11
@@ -35,12 +35,6 @@
;;; Code:
-;; If `multi-prompt' (the function) is to be used as an alternative
-;; for `completing-read-multiple' in Emacsen which do not provide the
-;; latter, requiring crm.el will do no good, but we need it for
-;; `multi-prompt-key-value'.
-(require 'crm)
-
(defvar multi-prompt-found nil
"List of entries currently added during a `multi-prompt'.")
@@ -143,8 +137,6 @@
;; TODO: How to support stuff like "caption={[one]two}" or
;; "morekeywords={one,three,five}"?
-(defvar multi-prompt-separator ","
- "Single-character string separating options in a key=value list.")
(defvar multi-prompt-key-value-sep "="
"Single-character string separating key=value pairs.")
(defvar multi-prompt-completion-table nil
@@ -165,20 +157,13 @@
Reference sections on 'Programmed Completion' and 'Basic Completion
Functions'."
(let ((beg 0) (last 0) matched)
- ;; TODO: Will `string' ever contain a normal separator?
- ;; `crm--select-current-element' probably already takes care that
- ;; this does not happen. In that case it would also be senseless
- ;; to have `multi-prompt-separator'.
- (while (string-match (regexp-opt (list multi-prompt-separator
- multi-prompt-key-value-sep))
- string beg)
+ (while (string-match multi-prompt-key-value-sep string beg)
(setq matched t
last beg
beg (match-end 0)))
(completion-table-with-context
(substring string 0 beg)
- (if (or (not matched)
- (string= (match-string 0 string) multi-prompt-separator))
+ (if (not matched)
multi-prompt-completion-table
(cadr (assoc (substring string last (1- beg))
multi-prompt-completion-table)))
@@ -186,6 +171,10 @@
predicate
flag)))
+;; Silence the byte compiler.
+(defvar crm-local-must-match-map)
+(defvar crm-local-completion-map)
+
;;;###autoload
(defun multi-prompt-key-value
(prompt table &optional predicate require-match initial-input
@@ -201,6 +190,7 @@
DEF, and INHERIT-INPUT-METHOD.
The return value is the string as entered in the minibuffer."
+ (require 'crm)
(let* ((minibuffer-completion-table #'multi-prompt-key-value-collection-fn)
(minibuffer-completion-predicate predicate)
(minibuffer-completion-confirm
- [AUCTeX-diffs] Changes to auctex/multi-prompt.el,v,
Ralf Angeli <=