comparison lisp/comint.el @ 45826:ffa13f09e36d

(comint-snapshot-last-prompt): Bind `inhibit-read-only' to t to support read-only prompts. (comint-output-filter): Likewise.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 14 Jun 2002 09:41:20 +0000
parents 552d3de9e9ed
children e4a48b5ab2fb
comparison
equal deleted inserted replaced
45825:35938e94ade9 45826:ffa13f09e36d
1533 ;; `snapshot' any current comint-last-prompt-overlay, freezing its 1533 ;; `snapshot' any current comint-last-prompt-overlay, freezing its
1534 ;; attributes in place, even when more input comes a long and moves the 1534 ;; attributes in place, even when more input comes a long and moves the
1535 ;; prompt overlay. 1535 ;; prompt overlay.
1536 (defun comint-snapshot-last-prompt () 1536 (defun comint-snapshot-last-prompt ()
1537 (when comint-last-prompt-overlay 1537 (when comint-last-prompt-overlay
1538 (add-text-properties (overlay-start comint-last-prompt-overlay) 1538 (let ((inhibit-read-only t))
1539 (overlay-end comint-last-prompt-overlay) 1539 (add-text-properties (overlay-start comint-last-prompt-overlay)
1540 (overlay-properties comint-last-prompt-overlay)))) 1540 (overlay-end comint-last-prompt-overlay)
1541 (overlay-properties comint-last-prompt-overlay)))))
1541 1542
1542 (defun comint-carriage-motion (string) 1543 (defun comint-carriage-motion (string)
1543 "Handle carriage control characters in comint output. 1544 "Handle carriage control characters in comint output.
1544 Translate carriage return/linefeed sequences to linefeeds. 1545 Translate carriage return/linefeed sequences to linefeeds.
1545 Make single carriage returns delete to the beginning of the line. 1546 Make single carriage returns delete to the beginning of the line.
1659 1660
1660 ;; Advance process-mark 1661 ;; Advance process-mark
1661 (set-marker (process-mark process) (point)) 1662 (set-marker (process-mark process) (point))
1662 1663
1663 (unless comint-use-prompt-regexp-instead-of-fields 1664 (unless comint-use-prompt-regexp-instead-of-fields
1664 (add-text-properties comint-last-output-start (point) 1665 (let ((inhibit-read-only t))
1665 '(rear-nonsticky t 1666 (add-text-properties comint-last-output-start (point)
1666 field output 1667 '(rear-nonsticky t
1667 inhibit-line-move-field-capture t))) 1668 field output
1669 inhibit-line-move-field-capture t))))
1668 1670
1669 ;; Highlight the prompt, where we define `prompt' to mean 1671 ;; Highlight the prompt, where we define `prompt' to mean
1670 ;; the most recent output that doesn't end with a newline. 1672 ;; the most recent output that doesn't end with a newline.
1671 (unless (and (bolp) (null comint-last-prompt-overlay)) 1673 (unless (and (bolp) (null comint-last-prompt-overlay))
1672 ;; Need to create or move the prompt overlay (in the case 1674 ;; Need to create or move the prompt overlay (in the case