diff options
| author | Richard M. Stallman | 1994-08-07 18:10:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-08-07 18:10:48 +0000 |
| commit | 78b19c2c143f4c812a2dbae041e68d7a83eea46c (patch) | |
| tree | 54caf182f0b26b7a3c7dba22209d06856222bdfb | |
| parent | 02680e9b5447def52c96fdb61885affc09789f21 (diff) | |
| download | emacs-78b19c2c143f4c812a2dbae041e68d7a83eea46c.tar.gz emacs-78b19c2c143f4c812a2dbae041e68d7a83eea46c.zip | |
(PC-do-completion): Set completion-base-size.
| -rw-r--r-- | lisp/complete.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/complete.el b/lisp/complete.el index daeac1f3bfd..fea94618632 100644 --- a/lisp/complete.el +++ b/lisp/complete.el | |||
| @@ -263,6 +263,7 @@ See `PC-complete' for details." | |||
| 263 | (filename (memq table '(read-file-name-internal | 263 | (filename (memq table '(read-file-name-internal |
| 264 | read-directory-name-internal))) | 264 | read-directory-name-internal))) |
| 265 | (dirname nil) | 265 | (dirname nil) |
| 266 | dirlength | ||
| 266 | (str (buffer-substring beg end)) | 267 | (str (buffer-substring beg end)) |
| 267 | (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) | 268 | (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) |
| 268 | (ambig nil) | 269 | (ambig nil) |
| @@ -278,6 +279,13 @@ See `PC-complete' for details." | |||
| 278 | (PC-is-complete-p str table pred)) | 279 | (PC-is-complete-p str table pred)) |
| 279 | 'complete | 280 | 'complete |
| 280 | 281 | ||
| 282 | ;; Record how many characters at the beginning are not included | ||
| 283 | ;; in completion. | ||
| 284 | (setq dirlength | ||
| 285 | (if filename | ||
| 286 | (length (file-name-directory str)) | ||
| 287 | 0)) | ||
| 288 | |||
| 281 | ;; Do substitutions in directory names | 289 | ;; Do substitutions in directory names |
| 282 | (and filename | 290 | (and filename |
| 283 | (not (equal str (setq p (substitute-in-file-name str)))) | 291 | (not (equal str (setq p (substitute-in-file-name str)))) |
| @@ -524,7 +532,13 @@ See `PC-complete' for details." | |||
| 524 | (if (or completion-auto-help | 532 | (if (or completion-auto-help |
| 525 | (eq mode 'help)) | 533 | (eq mode 'help)) |
| 526 | (with-output-to-temp-buffer "*Completions*" | 534 | (with-output-to-temp-buffer "*Completions*" |
| 527 | (display-completion-list (sort helpposs 'string-lessp))) | 535 | (display-completion-list (sort helpposs 'string-lessp)) |
| 536 | (save-excursion | ||
| 537 | (set-buffer standard-output) | ||
| 538 | ;; Record which part of the buffer we are completing | ||
| 539 | ;; so that choosing a completion from the list | ||
| 540 | ;; knows how much old text to replace. | ||
| 541 | (setq completion-base-size dirlength))) | ||
| 528 | (PC-temp-minibuffer-message " (Next char not unique)")) | 542 | (PC-temp-minibuffer-message " (Next char not unique)")) |
| 529 | nil))))) | 543 | nil))))) |
| 530 | 544 | ||