comparison lisp/comint.el @ 76767:3f12f4633f63

(comint-proc-query, comint-dynamic-list-completions): Fix calls to get-buffer-window to find windows in other frames. Reported by David Hansen <david.hansen@gmx.net>.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 28 Mar 2007 00:51:08 +0000
parents 2c6f34a88eaf
children 56f63de10254
comparison
equal deleted inserted replaced
76766:a05e2047bdb8 76767:3f12f4633f63
2591 its response can be seen." 2591 its response can be seen."
2592 (let* ((proc-buf (process-buffer proc)) 2592 (let* ((proc-buf (process-buffer proc))
2593 (proc-mark (process-mark proc))) 2593 (proc-mark (process-mark proc)))
2594 (display-buffer proc-buf) 2594 (display-buffer proc-buf)
2595 (set-buffer proc-buf) ; but it's not the selected *window* 2595 (set-buffer proc-buf) ; but it's not the selected *window*
2596 (let ((proc-win (get-buffer-window proc-buf)) 2596 (let ((proc-win (get-buffer-window proc-buf 0))
2597 (proc-pt (marker-position proc-mark))) 2597 (proc-pt (marker-position proc-mark)))
2598 (comint-send-string proc str) ; send the query 2598 (comint-send-string proc str) ; send the query
2599 (accept-process-output proc) ; wait for some output 2599 (accept-process-output proc) ; wait for some output
2600 ;; Try to position the proc window so you can see the answer. 2600 ;; Try to position the proc window so you can see the answer.
2601 ;; This is bogus code. If you delete the (sit-for 0), it breaks. 2601 ;; This is bogus code. If you delete the (sit-for 0), it breaks.
2957 (defvar comint-dynamic-list-completions-config nil) 2957 (defvar comint-dynamic-list-completions-config nil)
2958 2958
2959 (defun comint-dynamic-list-completions (completions) 2959 (defun comint-dynamic-list-completions (completions)
2960 "List in help buffer sorted COMPLETIONS. 2960 "List in help buffer sorted COMPLETIONS.
2961 Typing SPC flushes the help buffer." 2961 Typing SPC flushes the help buffer."
2962 (let ((window (get-buffer-window "*Completions*"))) 2962 (let ((window (get-buffer-window "*Completions*" 0)))
2963 (setq completions (sort completions 'string-lessp)) 2963 (setq completions (sort completions 'string-lessp))
2964 (if (and (eq last-command this-command) 2964 (if (and (eq last-command this-command)
2965 window (window-live-p window) (window-buffer window) 2965 window (window-live-p window) (window-buffer window)
2966 (buffer-name (window-buffer window)) 2966 (buffer-name (window-buffer window))
2967 ;; The above tests are not sufficient to detect the case where we 2967 ;; The above tests are not sufficient to detect the case where we