Commit 56b6cb04 authored by Linus Tolke's avatar Linus Tolke
Browse files

Fixed completing for complete but not unique (and emacs-18)

parent f5c43851
No preview for this file type
...@@ -90,12 +90,17 @@ Returns the name." ...@@ -90,12 +90,17 @@ Returns the name."
lyskom-minibuffer-local-completion-map) lyskom-minibuffer-local-completion-map)
(minibuffer-local-must-match-map (minibuffer-local-must-match-map
lyskom-minibuffer-local-must-match-map)) lyskom-minibuffer-local-must-match-map))
(completing-read prompt (condition-case error
'lyskom-read-conf-name-internal (completing-read prompt
type 'lyskom-read-conf-name-internal
mustmatch type
initial mustmatch
'lyskom-name-hist))) initial
(wrong-number-of-arguments ; This is for emacs 18.
(completing-read prompt 'lyskom-read-conf-name-internal
type mustmatch)))
(defun lyskom-read-conf-name-internal (string predicate all) (defun lyskom-read-conf-name-internal (string predicate all)
...@@ -163,9 +168,28 @@ to conf-no translator." ...@@ -163,9 +168,28 @@ to conf-no translator."
res))))) res)))))
(cond (cond
((eq all 'conf-no) ((eq all 'conf-no)
(car mappedlist)) (cond
((= (length mappedlist) 1)
(car mappedlist))
(t (let ((found nil))
(while (and (not found) mappedlist)
(if (string= string
(conf-stat->name (blocking-do 'get-conf-stat
(car mappedlist))))
(setq found (car mappedlist)))
(setq mappedlist (cdr mappedlist)))
((eq all 'lambda) ((eq all 'lambda)
(= (length mappedlist) 1)) (or (= (length mappedlist) 1)
(let ((found nil))
(while (and (not found)
(if (string= string
(conf-stat->name (blocking-do 'get-conf-stat
(car mappedlist))))
(setq found t))
(setq mappedlist (cdr mappedlist)))
(all (all
(mapcar (function (lambda (no) (mapcar (function (lambda (no)
(conf-stat->name (conf-stat->name
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment