diff options
| author | Miles Bader | 2000-09-13 12:08:32 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-09-13 12:08:32 +0000 |
| commit | bdf08678dbf670680cbfaa7a7af7079931c1b38c (patch) | |
| tree | 0eff274b0c0974f158fbf67e0e2092b10b6d687e | |
| parent | 8c907a5633c31e6a297b0535804bbc929a672f18 (diff) | |
| download | emacs-bdf08678dbf670680cbfaa7a7af7079931c1b38c.tar.gz emacs-bdf08678dbf670680cbfaa7a7af7079931c1b38c.zip | |
(comint-output-filter):
Revert to using `insert-before-markers'.
Add bletcherous hack to undo damage caused by `insert-before-markers'.
Put `front-sticky' property on overlays created here so that the field code
understands how the overlay works.
Use a let when making comint-last-prompt-overlay, so that the code is
easier to read.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/comint.el | 56 |
2 files changed, 56 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3276d946d8b..8b0fba5209b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2000-09-13 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * comint.el (comint-output-filter): Revert to using | ||
| 4 | `insert-before-markers'. Add bletcherous hack to undo damage | ||
| 5 | caused by `insert-before-markers'. Put `front-sticky' property on | ||
| 6 | overlays created here so that the field code understands how the | ||
| 7 | overlay works. Use a let when making comint-last-prompt-overlay, | ||
| 8 | so that the code is easier to read. | ||
| 9 | |||
| 1 | 2000-09-12 Dave Love <fx@gnu.org> | 10 | 2000-09-12 Dave Love <fx@gnu.org> |
| 2 | 11 | ||
| 3 | * simple.el (read-mail-command): Doc fix. | 12 | * simple.el (read-mail-command): Doc fix. |
diff --git a/lisp/comint.el b/lisp/comint.el index e86c019a9d5..4fc8f67402e 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1510,8 +1510,46 @@ This variable is permanent-local.") | |||
| 1510 | (goto-char (process-mark process)) | 1510 | (goto-char (process-mark process)) |
| 1511 | (set-marker comint-last-output-start (point)) | 1511 | (set-marker comint-last-output-start (point)) |
| 1512 | 1512 | ||
| 1513 | (insert string) | 1513 | ;; insert-before-markers is a bad thing. XXX |
| 1514 | 1514 | ;; | |
| 1515 | ;; It is used here to force window-point markers (used to | ||
| 1516 | ;; store the value of point in non-selected windows) to | ||
| 1517 | ;; advance, but it also screws up any other markers that we | ||
| 1518 | ;; don't _want_ to advance, such as the start-marker of some | ||
| 1519 | ;; of the overlays we create. | ||
| 1520 | ;; | ||
| 1521 | ;; We work around the problem with the overlays by | ||
| 1522 | ;; explicitly adjusting them after we do the insertion, but | ||
| 1523 | ;; in the future this problem should be solved correctly, by | ||
| 1524 | ;; using `insert', and making the insertion-type of | ||
| 1525 | ;; window-point markers settable (via a buffer-local | ||
| 1526 | ;; variable). In comint buffers, this variable would be set | ||
| 1527 | ;; to `t', to cause point in non-select windows to advance. | ||
| 1528 | (insert-before-markers string) | ||
| 1529 | ;; Fixup markers and overlays that got screwed up because we | ||
| 1530 | ;; used `insert-before-markers'. | ||
| 1531 | (let ((old-point (- (point) (length string)))) | ||
| 1532 | ;; comint-last-output-start marker | ||
| 1533 | (set-marker comint-last-output-start old-point) | ||
| 1534 | ;; No overlays we create are set to advance upon insertion | ||
| 1535 | ;; (at the start/end), so we assume that any overlay which | ||
| 1536 | ;; is at the current point was incorrectly advanced by | ||
| 1537 | ;; insert-before-markers. First fixup overlays that might | ||
| 1538 | ;; start at point: | ||
| 1539 | (dolist (over (overlays-at (point))) | ||
| 1540 | (when (= (overlay-start over) (point)) | ||
| 1541 | (let ((end (overlay-end over))) | ||
| 1542 | (move-overlay over | ||
| 1543 | old-point | ||
| 1544 | (if (= end (point)) old-point end))))) | ||
| 1545 | ;; Then do overlays that might end at point: | ||
| 1546 | (dolist (over (overlays-at (1- (point)))) | ||
| 1547 | (when (= (overlay-end over) (point)) | ||
| 1548 | (move-overlay over | ||
| 1549 | (min (overlay-start over) old-point) | ||
| 1550 | old-point)))) | ||
| 1551 | |||
| 1552 | ;; Advance process-mark | ||
| 1515 | (set-marker (process-mark process) (point)) | 1553 | (set-marker (process-mark process) (point)) |
| 1516 | 1554 | ||
| 1517 | (unless comint-use-prompt-regexp-instead-of-fields | 1555 | (unless comint-use-prompt-regexp-instead-of-fields |
| @@ -1528,8 +1566,9 @@ This variable is permanent-local.") | |||
| 1528 | ;; Create a new overlay | 1566 | ;; Create a new overlay |
| 1529 | (let ((over (make-overlay comint-last-output-start (point)))) | 1567 | (let ((over (make-overlay comint-last-output-start (point)))) |
| 1530 | (overlay-put over 'field 'output) | 1568 | (overlay-put over 'field 'output) |
| 1531 | (overlay-put over 'rear-nonsticky t) | ||
| 1532 | (overlay-put over 'inhibit-line-move-field-capture t) | 1569 | (overlay-put over 'inhibit-line-move-field-capture t) |
| 1570 | (overlay-put over 'front-sticky t) | ||
| 1571 | (overlay-put over 'rear-nonsticky t) | ||
| 1533 | (overlay-put over 'evaporate t) | 1572 | (overlay-put over 'evaporate t) |
| 1534 | (setq comint-last-output-overlay over)))) | 1573 | (setq comint-last-output-overlay over)))) |
| 1535 | 1574 | ||
| @@ -1546,12 +1585,11 @@ This variable is permanent-local.") | |||
| 1546 | (move-overlay comint-last-prompt-overlay | 1585 | (move-overlay comint-last-prompt-overlay |
| 1547 | prompt-start (point)) | 1586 | prompt-start (point)) |
| 1548 | ;; Need to create the overlay | 1587 | ;; Need to create the overlay |
| 1549 | (setq comint-last-prompt-overlay | 1588 | (let ((over (make-overlay prompt-start (point)))) |
| 1550 | (make-overlay prompt-start (point))) | 1589 | (overlay-put over 'face 'comint-highlight-prompt-face) |
| 1551 | (overlay-put comint-last-prompt-overlay | 1590 | (overlay-put over 'front-sticky t) |
| 1552 | 'rear-nonsticky t) | 1591 | (overlay-put over 'rear-nonsticky t) |
| 1553 | (overlay-put comint-last-prompt-overlay | 1592 | (setq comint-last-prompt-overlay over)))))) |
| 1554 | 'face 'comint-highlight-prompt-face))))) | ||
| 1555 | 1593 | ||
| 1556 | ;;(force-mode-line-update) | 1594 | ;;(force-mode-line-update) |
| 1557 | 1595 | ||