Mercurial > emacs
comparison lisp/comint.el @ 51421:79dc5a8eacfe
(comint-move-point-for-output): Renamed from
comint-scroll-to-bottom-on-output. Old name is alias.
Doc fix. All uses changed.
(comint-scroll-show-maximum-output): Doc fix.
(comint-exec-1): Don't use directory-sep-char.
(comint-dynamic-complete-as-filename): Likewise.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 03 Jun 2003 11:06:42 +0000 |
parents | 379cf00d7016 |
children | 5468f0e299c4 |
comparison
equal
deleted
inserted
replaced
51420:22c87cfe7fe4 | 51421:79dc5a8eacfe |
---|---|
242 (const t) | 242 (const t) |
243 (const all) | 243 (const all) |
244 (const this)) | 244 (const this)) |
245 :group 'comint) | 245 :group 'comint) |
246 | 246 |
247 (defcustom comint-scroll-to-bottom-on-output nil | 247 (defcustom comint-move-point-for-output nil |
248 "*Controls whether interpreter output causes window to scroll. | 248 "*Controls whether interpreter output moves point to the end of the output. |
249 If nil, then do not scroll. If t or `all', scroll all windows showing buffer. | 249 If nil, then output never moves point to the output. |
250 If `this', scroll only the selected window. | 250 (If the output occurs at point, it is inserted before point.) |
251 If `others', scroll only those that are not the selected window. | 251 If t or `all', move point in all windows showing the buffer. |
252 If `this', move point only the selected window. | |
253 If `others', move point only in other windows, not in the selected window. | |
252 | 254 |
253 The default is nil. | 255 The default is nil. |
254 | 256 |
255 See variable `comint-scroll-show-maximum-output' and function | 257 See the variable `comint-scroll-show-maximum-output' and the function |
256 `comint-postoutput-scroll-to-bottom'. This variable is buffer-local." | 258 `comint-postoutput-scroll-to-bottom'. |
259 This variable is buffer-local in all comint buffers." | |
257 :type '(choice (const :tag "off" nil) | 260 :type '(choice (const :tag "off" nil) |
258 (const t) | 261 (const t) |
259 (const all) | 262 (const all) |
260 (const this) | 263 (const this) |
261 (const others)) | 264 (const others)) |
262 :group 'comint) | 265 :group 'comint) |
263 | 266 |
267 (defvaralias 'comint-scroll-to-bottom-on-output 'comint-move-point-for-output) | |
268 | |
264 (defcustom comint-scroll-show-maximum-output t | 269 (defcustom comint-scroll-show-maximum-output t |
265 "*Controls how interpreter output causes window to scroll. | 270 "*Controls how to scroll due to interpreter output. |
266 If non-nil, then show the maximum output when the window is scrolled. | 271 This variable applies when point is at the end of the buffer |
267 | 272 \(either because it was originally there, or because |
268 See variable `comint-scroll-to-bottom-on-output' and function | 273 `comint-move-point-for-output' said to move it there) |
269 `comint-postoutput-scroll-to-bottom'. This variable is buffer-local." | 274 and output from the subprocess is inserted. |
275 | |
276 Non-nil means scroll so that the window is full of text | |
277 and point is on the last line. A value of nil | |
278 means don't do anyting special--scroll normally. | |
279 | |
280 See also the variable `comint-move-point-for-output' and the function | |
281 `comint-postoutput-scroll-to-bottom'. | |
282 This variable is buffer-local in all comint buffers." | |
270 :type 'boolean | 283 :type 'boolean |
271 :group 'comint) | 284 :group 'comint) |
272 | 285 |
273 (defcustom comint-buffer-maximum-size 1024 | 286 (defcustom comint-buffer-maximum-size 1024 |
274 "*The maximum size in lines for comint buffers. | 287 "*The maximum size in lines for comint buffers. |
428 (put 'comint-input-autoexpand 'permanent-local t) | 441 (put 'comint-input-autoexpand 'permanent-local t) |
429 (put 'comint-input-filter-functions 'permanent-local t) | 442 (put 'comint-input-filter-functions 'permanent-local t) |
430 (put 'comint-output-filter-functions 'permanent-local t) | 443 (put 'comint-output-filter-functions 'permanent-local t) |
431 (put 'comint-preoutput-filter-functions 'permanent-local t) | 444 (put 'comint-preoutput-filter-functions 'permanent-local t) |
432 (put 'comint-scroll-to-bottom-on-input 'permanent-local t) | 445 (put 'comint-scroll-to-bottom-on-input 'permanent-local t) |
433 (put 'comint-scroll-to-bottom-on-output 'permanent-local t) | 446 (put 'comint-move-point-for-output 'permanent-local t) |
434 (put 'comint-scroll-show-maximum-output 'permanent-local t) | 447 (put 'comint-scroll-show-maximum-output 'permanent-local t) |
435 (put 'comint-ptyp 'permanent-local t) | 448 (put 'comint-ptyp 'permanent-local t) |
436 | 449 |
437 (put 'comint-mode 'mode-class 'special) | 450 (put 'comint-mode 'mode-class 'special) |
438 | 451 |
462 `comint-magic-space'. | 475 `comint-magic-space'. |
463 | 476 |
464 Input to, and output from, the subprocess can cause the window to scroll to | 477 Input to, and output from, the subprocess can cause the window to scroll to |
465 the end of the buffer. See variables `comint-output-filter-functions', | 478 the end of the buffer. See variables `comint-output-filter-functions', |
466 `comint-preoutput-filter-functions', `comint-scroll-to-bottom-on-input', | 479 `comint-preoutput-filter-functions', `comint-scroll-to-bottom-on-input', |
467 and `comint-scroll-to-bottom-on-output'. | 480 and `comint-move-point-for-output'. |
468 | 481 |
469 If you accidentally suspend your process, use \\[comint-continue-subjob] | 482 If you accidentally suspend your process, use \\[comint-continue-subjob] |
470 to continue it. | 483 to continue it. |
471 | 484 |
472 \\{comint-mode-map} | 485 \\{comint-mode-map} |
497 (make-local-variable 'comint-get-old-input) | 510 (make-local-variable 'comint-get-old-input) |
498 (make-local-variable 'comint-input-filter) | 511 (make-local-variable 'comint-input-filter) |
499 (make-local-variable 'comint-input-sender) | 512 (make-local-variable 'comint-input-sender) |
500 (make-local-variable 'comint-eol-on-send) | 513 (make-local-variable 'comint-eol-on-send) |
501 (make-local-variable 'comint-scroll-to-bottom-on-input) | 514 (make-local-variable 'comint-scroll-to-bottom-on-input) |
502 (make-local-variable 'comint-scroll-to-bottom-on-output) | 515 (make-local-variable 'comint-move-point-for-output) |
503 (make-local-variable 'comint-scroll-show-maximum-output) | 516 (make-local-variable 'comint-scroll-show-maximum-output) |
504 ;; This makes it really work to keep point at the bottom. | 517 ;; This makes it really work to keep point at the bottom. |
505 (make-local-variable 'scroll-conservatively) | 518 (make-local-variable 'scroll-conservatively) |
506 (setq scroll-conservatively 10000) | 519 (setq scroll-conservatively 10000) |
507 (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t) | 520 (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t) |
734 (if (getenv "EMACS") nil (list "EMACS=t")) | 747 (if (getenv "EMACS") nil (list "EMACS=t")) |
735 process-environment)) | 748 process-environment)) |
736 (default-directory | 749 (default-directory |
737 (if (file-accessible-directory-p default-directory) | 750 (if (file-accessible-directory-p default-directory) |
738 default-directory | 751 default-directory |
739 (char-to-string directory-sep-char))) | 752 "/")) |
740 proc decoding encoding changed) | 753 proc decoding encoding changed) |
741 (let ((exec-path (if (file-name-directory command) | 754 (let ((exec-path (if (file-name-directory command) |
742 ;; If the command has slashes, make sure we | 755 ;; If the command has slashes, make sure we |
743 ;; first look relative to the current directory. | 756 ;; first look relative to the current directory. |
744 (cons default-directory exec-path) exec-path))) | 757 (cons default-directory exec-path) exec-path))) |
1724 (goto-char (point-max)) | 1737 (goto-char (point-max)) |
1725 (select-window selected))))) | 1738 (select-window selected))))) |
1726 nil t)))))) | 1739 nil t)))))) |
1727 | 1740 |
1728 (defun comint-postoutput-scroll-to-bottom (string) | 1741 (defun comint-postoutput-scroll-to-bottom (string) |
1729 "Go to the end of buffer in all windows showing it. | 1742 "Go to the end of buffer in some or all windows showing it. |
1730 Does not scroll if the current line is the last line in the buffer. | 1743 Does not scroll if the current line is the last line in the buffer. |
1731 Depends on the value of `comint-scroll-to-bottom-on-output' and | 1744 Depends on the value of `comint-move-point-for-output' and |
1732 `comint-scroll-show-maximum-output'. | 1745 `comint-scroll-show-maximum-output'. |
1733 | 1746 |
1734 This function should be in the list `comint-output-filter-functions'." | 1747 This function should be in the list `comint-output-filter-functions'." |
1735 (let* ((selected (selected-window)) | 1748 (let* ((selected (selected-window)) |
1736 (current (current-buffer)) | 1749 (current (current-buffer)) |
1737 (process (get-buffer-process current)) | 1750 (process (get-buffer-process current)) |
1738 (scroll comint-scroll-to-bottom-on-output)) | 1751 (scroll comint-move-point-for-output)) |
1739 (unwind-protect | 1752 (unwind-protect |
1740 (if process | 1753 (if process |
1741 (walk-windows | 1754 (walk-windows |
1742 (function (lambda (window) | 1755 (function (lambda (window) |
1743 (if (eq (window-buffer window) current) | 1756 (if (eq (window-buffer window) current) |
2067 "Interrupt the current subjob. | 2080 "Interrupt the current subjob. |
2068 This command also kills the pending input | 2081 This command also kills the pending input |
2069 between the process-mark and point." | 2082 between the process-mark and point." |
2070 (interactive) | 2083 (interactive) |
2071 (comint-skip-input) | 2084 (comint-skip-input) |
2072 (interrupt-process nil comint-ptyp)) | 2085 (interrupt-process nil comint-ptyp) |
2086 ;; (process-send-string nil "\n") | |
2087 ) | |
2073 | 2088 |
2074 (defun comint-kill-subjob () | 2089 (defun comint-kill-subjob () |
2075 "Send kill signal to the current subjob. | 2090 "Send kill signal to the current subjob. |
2076 This command also kills the pending input | 2091 This command also kills the pending input |
2077 between the process-mark and point." | 2092 between the process-mark and point." |
2670 (minibuffer-p (window-minibuffer-p (selected-window))) | 2685 (minibuffer-p (window-minibuffer-p (selected-window))) |
2671 (success t) | 2686 (success t) |
2672 (dirsuffix (cond ((not comint-completion-addsuffix) | 2687 (dirsuffix (cond ((not comint-completion-addsuffix) |
2673 "") | 2688 "") |
2674 ((not (consp comint-completion-addsuffix)) | 2689 ((not (consp comint-completion-addsuffix)) |
2675 (char-to-string directory-sep-char)) | 2690 "/") |
2676 (t | 2691 (t |
2677 (car comint-completion-addsuffix)))) | 2692 (car comint-completion-addsuffix)))) |
2678 (filesuffix (cond ((not comint-completion-addsuffix) | 2693 (filesuffix (cond ((not comint-completion-addsuffix) |
2679 "") | 2694 "") |
2680 ((not (consp comint-completion-addsuffix)) | 2695 ((not (consp comint-completion-addsuffix)) |