diff options
| -rw-r--r-- | lisp/comint.el | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index ec115ba2c79..b76aacfc57e 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -302,6 +302,7 @@ This is to work around a bug in Emacs process signalling.") | |||
| 302 | (defvar comint-input-ring nil) | 302 | (defvar comint-input-ring nil) |
| 303 | (defvar comint-last-input-start) | 303 | (defvar comint-last-input-start) |
| 304 | (defvar comint-last-input-end) | 304 | (defvar comint-last-input-end) |
| 305 | (defvar comint-last-output-start) | ||
| 305 | (defvar comint-input-ring-index nil | 306 | (defvar comint-input-ring-index nil |
| 306 | "Index of last matched history element.") | 307 | "Index of last matched history element.") |
| 307 | (defvar comint-matching-input-from-input-string "" | 308 | (defvar comint-matching-input-from-input-string "" |
| @@ -1838,6 +1839,8 @@ Completion is dependent on the value of `comint-completion-addsuffix' and | |||
| 1838 | dependent on the value of `comint-completion-autolist'." | 1839 | dependent on the value of `comint-completion-autolist'." |
| 1839 | (interactive) | 1840 | (interactive) |
| 1840 | (let* ((completion-ignore-case nil) | 1841 | (let* ((completion-ignore-case nil) |
| 1842 | ;; For shell completion, treat all files as equally interesting. | ||
| 1843 | (completion-ignored-extensions nil) | ||
| 1841 | (filename (comint-match-partial-filename)) | 1844 | (filename (comint-match-partial-filename)) |
| 1842 | (pathdir (file-name-directory filename)) | 1845 | (pathdir (file-name-directory filename)) |
| 1843 | (pathnondir (file-name-nondirectory filename)) | 1846 | (pathnondir (file-name-nondirectory filename)) |
| @@ -1990,6 +1993,8 @@ See also `comint-dynamic-complete-filename'." | |||
| 1990 | "List in help buffer possible completions of the filename at point." | 1993 | "List in help buffer possible completions of the filename at point." |
| 1991 | (interactive) | 1994 | (interactive) |
| 1992 | (let* ((completion-ignore-case nil) | 1995 | (let* ((completion-ignore-case nil) |
| 1996 | ;; For shell completion, treat all files as equally interesting. | ||
| 1997 | (completion-ignored-extensions nil) | ||
| 1993 | (filename (comint-match-partial-filename)) | 1998 | (filename (comint-match-partial-filename)) |
| 1994 | (pathdir (file-name-directory filename)) | 1999 | (pathdir (file-name-directory filename)) |
| 1995 | (pathnondir (file-name-nondirectory filename)) | 2000 | (pathnondir (file-name-nondirectory filename)) |
| @@ -2007,12 +2012,24 @@ Typing SPC flushes the help buffer." | |||
| 2007 | (let ((conf (current-window-configuration))) | 2012 | (let ((conf (current-window-configuration))) |
| 2008 | (with-output-to-temp-buffer " *Completions*" | 2013 | (with-output-to-temp-buffer " *Completions*" |
| 2009 | (display-completion-list (sort completions 'string-lessp))) | 2014 | (display-completion-list (sort completions 'string-lessp))) |
| 2010 | (sit-for 0) | ||
| 2011 | (message "Hit space to flush") | 2015 | (message "Hit space to flush") |
| 2012 | (let ((ch (read-event))) | 2016 | (let (key first) |
| 2013 | (if (eq ch ?\ ) | 2017 | (if (save-excursion |
| 2014 | (set-window-configuration conf) | 2018 | (set-buffer (get-buffer " *Completions*")) |
| 2015 | (setq unread-command-events (list ch)))))) | 2019 | (setq key (read-key-sequence nil) |
| 2020 | first (aref key 0)) | ||
| 2021 | (and (consp first) | ||
| 2022 | (eq (window-buffer (posn-window (event-start first))) | ||
| 2023 | (get-buffer " *Completions*")) | ||
| 2024 | (eq (key-binding key) 'mouse-choose-completion))) | ||
| 2025 | ;; If the user does mouse-choose-completion with the mouse, | ||
| 2026 | ;; execute the command, then delete the completion window. | ||
| 2027 | (progn | ||
| 2028 | (mouse-choose-completion first) | ||
| 2029 | (set-window-configuration conf)) | ||
| 2030 | (if (eq first ?\ ) | ||
| 2031 | (set-window-configuration conf) | ||
| 2032 | (setq unread-command-events (append key nil))))))) | ||
| 2016 | 2033 | ||
| 2017 | ;;; Converting process modes to use comint mode | 2034 | ;;; Converting process modes to use comint mode |
| 2018 | ;;; =========================================================================== | 2035 | ;;; =========================================================================== |