diff options
| author | Stefan Monnier | 2007-03-05 19:57:10 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-03-05 19:57:10 +0000 |
| commit | eb69fe3e0ad2641090ae3222d3d07fea26df318c (patch) | |
| tree | 12624e14a4c006050d1fc96dc84a7737e734de29 | |
| parent | 86a3e45eea1176c0af1fedc38c11f2959570d5e3 (diff) | |
| download | emacs-eb69fe3e0ad2641090ae3222d3d07fea26df318c.tar.gz emacs-eb69fe3e0ad2641090ae3222d3d07fea26df318c.zip | |
(pcomplete-show-completions): Improve last change, so
as not to use an invisible window and to create a window if none exist.
| -rw-r--r-- | lisp/pcomplete.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 6caffddaa01..c4840059f64 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el | |||
| @@ -974,18 +974,20 @@ Typing SPC flushes the help buffer." | |||
| 974 | (while (with-current-buffer (get-buffer "*Completions*") | 974 | (while (with-current-buffer (get-buffer "*Completions*") |
| 975 | (setq event (pcomplete-read-event))) | 975 | (setq event (pcomplete-read-event))) |
| 976 | (cond | 976 | (cond |
| 977 | ((event-matches-key-specifier-p event ? ) | 977 | ((event-matches-key-specifier-p event ?\s) |
| 978 | (set-window-configuration pcomplete-last-window-config) | 978 | (set-window-configuration pcomplete-last-window-config) |
| 979 | (setq pcomplete-last-window-config nil) | 979 | (setq pcomplete-last-window-config nil) |
| 980 | (throw 'done nil)) | 980 | (throw 'done nil)) |
| 981 | ((or (event-matches-key-specifier-p event 'tab) | 981 | ((or (event-matches-key-specifier-p event 'tab) |
| 982 | ;; Needed on a terminal | 982 | ;; Needed on a terminal |
| 983 | (event-matches-key-specifier-p event 9)) | 983 | (event-matches-key-specifier-p event 9)) |
| 984 | (save-selected-window | 984 | (let ((win (or (get-buffer-window "*Completions*" 0) |
| 985 | (select-window (get-buffer-window "*Completions*" t)) | 985 | (display-buffer "*Completions*" |
| 986 | (if (pos-visible-in-window-p (point-max)) | 986 | 'not-this-window)))) |
| 987 | (goto-char (point-min)) | 987 | (with-selected-window win |
| 988 | (scroll-up))) | 988 | (if (pos-visible-in-window-p (point-max)) |
| 989 | (goto-char (point-min)) | ||
| 990 | (scroll-up)))) | ||
| 989 | (message "")) | 991 | (message "")) |
| 990 | (t | 992 | (t |
| 991 | (setq unread-command-events (list event)) | 993 | (setq unread-command-events (list event)) |