Mercurial > emacs
comparison lisp/complete.el @ 26341:6063383b77d5
(PC-do-completion): Use minibuffer-prompt-end to
find the start of the text. Use field-string to read the user
input.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 03 Nov 1999 23:49:57 +0000 |
parents | e62d2121822f |
children | 8548cb8ad6e2 |
comparison
equal
deleted
inserted
replaced
26340:f1ae5b57d9db | 26341:6063383b77d5 |
---|---|
368 "A function testing whether a minibuffer completion now will work filename-style. | 368 "A function testing whether a minibuffer completion now will work filename-style. |
369 The function takes no arguments, and typically looks at the value | 369 The function takes no arguments, and typically looks at the value |
370 of `minibuffer-completion-table' and the minibuffer contents.") | 370 of `minibuffer-completion-table' and the minibuffer contents.") |
371 | 371 |
372 (defun PC-do-completion (&optional mode beg end) | 372 (defun PC-do-completion (&optional mode beg end) |
373 (or beg (setq beg (point-min))) | 373 (or beg (setq beg (minibuffer-prompt-end))) |
374 (or end (setq end (point-max))) | 374 (or end (setq end (point-max))) |
375 (let* ((table minibuffer-completion-table) | 375 (let* ((table minibuffer-completion-table) |
376 (pred minibuffer-completion-predicate) | 376 (pred minibuffer-completion-predicate) |
377 (filename (funcall PC-completion-as-file-name-predicate)) | 377 (filename (funcall PC-completion-as-file-name-predicate)) |
378 (dirname nil) | 378 (dirname nil) |
644 | 644 |
645 (if improved | 645 (if improved |
646 | 646 |
647 ;; We changed it... enough to be complete? | 647 ;; We changed it... enough to be complete? |
648 (and (eq mode 'exit) | 648 (and (eq mode 'exit) |
649 (PC-is-complete-p (buffer-string) table pred)) | 649 (PC-is-complete-p (field-string) table pred)) |
650 | 650 |
651 ;; If totally ambiguous, display a list of completions | 651 ;; If totally ambiguous, display a list of completions |
652 (if (or completion-auto-help | 652 (if (or completion-auto-help |
653 (eq mode 'help)) | 653 (eq mode 'help)) |
654 (with-output-to-temp-buffer "*Completions*" | 654 (with-output-to-temp-buffer "*Completions*" |