Commit 62618567 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(crm-do-completion): Handle minibuffer prompt.

(crm-find-current-element): Likewise.
parent 01bf52cb
...@@ -197,9 +197,10 @@ If an element is found, bind: ...@@ -197,9 +197,10 @@ If an element is found, bind:
respectively, respectively,
and return t." and return t."
(let* ((minibuffer-string (buffer-string)) (let* ((prompt-end (minibuffer-prompt-end))
(end-index (or (string-match "," minibuffer-string (1- (point))) (minibuffer-string (buffer-substring prompt-end (point-max)))
(1- (point-max)))) (end-index (or (string-match "," minibuffer-string (- (point) prompt-end))
(- (point-max) prompt-end)))
(target-string (substring minibuffer-string 0 end-index)) (target-string (substring minibuffer-string 0 end-index))
(index (or (string-match (index (or (string-match
(concat crm-separator "\\([^" crm-separator "]*\\)$") (concat crm-separator "\\([^" crm-separator "]*\\)$")
...@@ -215,7 +216,8 @@ and return t." ...@@ -215,7 +216,8 @@ and return t."
(setq crm-beginning-of-element (match-beginning 1)) (setq crm-beginning-of-element (match-beginning 1))
(setq crm-end-of-element end-index) (setq crm-end-of-element end-index)
;; string to the left of the current element ;; string to the left of the current element
(setq crm-left-of-element (substring target-string 0 (match-beginning 1))) (setq crm-left-of-element
(substring target-string 0 (match-beginning 1)))
;; the current element ;; the current element
(setq crm-current-element (match-string 1 target-string)) (setq crm-current-element (match-string 1 target-string))
;; string to the right of the current element ;; string to the right of the current element
...@@ -287,7 +289,7 @@ The meanings of the return values are: ...@@ -287,7 +289,7 @@ The meanings of the return values are:
(if completedp (if completedp
(progn (progn
(erase-buffer) (delete-region (minibuffer-prompt-end) (point-max))
(insert crm-left-of-element completion) (insert crm-left-of-element completion)
;; (if crm-complete-up-to-point ;; (if crm-complete-up-to-point
;; (insert crm-separator)) ;; (insert crm-separator))
......
Markdown is supported
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