[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/coterm 9184a46 34/80: Always synchronize pmark at the e
From: |
ELPA Syncer |
Subject: |
[elpa] externals/coterm 9184a46 34/80: Always synchronize pmark at the end |
Date: |
Wed, 13 Oct 2021 18:57:31 -0400 (EDT) |
branch: externals/coterm
commit 9184a462b715eba0692b27065868317d6ca293e6
Author: m <>
Commit: m <>
Always synchronize pmark at the end
---
coterm.el | 61 ++++++++++++++++++++++++++-----------------------------------
1 file changed, 26 insertions(+), 35 deletions(-)
diff --git a/coterm.el b/coterm.el
index 877a7eb..5ce98eb 100644
--- a/coterm.el
+++ b/coterm.el
@@ -262,31 +262,28 @@ buffer and the scrolling region must cover the whole
screen."
(setq coterm--t-col (min column (1- coterm--t-width))))))
(defun coterm--t-maybe-adjust-from-pmark (pos)
- "If `coterm--t-row' and col are nil, point them to POS.
-`coterm--t-home-marker' may also be nil, in which case,
-initialize it sensibly."
+ "Point `coterm--t-row' and `coterm--t-col' POS.
+If `coterm--t-home-marker' is nil, initialize it sensibly."
(unless coterm--t-home-marker
(setq coterm--t-home-marker (point-min-marker))
(setq coterm--t-home-offset 0))
- (unless coterm--t-row
- (save-excursion
- (goto-char pos)
- (setq coterm--t-col (current-column))
- (coterm--t-normalize-home-offset)
- (forward-line 0)
- (if (> (point) coterm--t-home-marker)
- ;; Here, `coterm--t-home-offset' is guaranteed to be 0
- (save-restriction
- (narrow-to-region coterm--t-home-marker (point))
- (let ((lines-left (forward-line (- 1 coterm--t-height))))
- (when (= 0 lines-left)
- (set-marker coterm--t-home-marker (point)))
- (setq coterm--t-row (+ -1 coterm--t-height lines-left))))
- (progn
- (set-marker coterm--t-home-marker (point))
- (setq coterm--t-home-offset 0)
- (setq coterm--t-row 0))))
- (setq coterm--t-pmark-in-sync t)))
+ (save-excursion
+ (goto-char pos)
+ (setq coterm--t-col (current-column))
+ (coterm--t-normalize-home-offset)
+ (forward-line 0)
+ (if (> (point) coterm--t-home-marker)
+ ;; Here, `coterm--t-home-offset' is guaranteed to be 0
+ (save-restriction
+ (narrow-to-region coterm--t-home-marker (point))
+ (let ((lines-left (forward-line (- 1 coterm--t-height))))
+ (when (= 0 lines-left)
+ (set-marker coterm--t-home-marker (point)))
+ (setq coterm--t-row (+ -1 coterm--t-height lines-left))))
+ (progn
+ (set-marker coterm--t-home-marker (point))
+ (setq coterm--t-home-offset 0)
+ (setq coterm--t-row 0)))))
(defun coterm--t-emulate-terminal (proc-filt process string)
(when-let ((fragment coterm--t-unhandled-fragment))
@@ -530,19 +527,13 @@ initialize it sensibly."
(t
(ins)))
- ;; Here, we are at the end of process filtering. `coterm--t-row'
- ;; and `coterm--t-col' may point to a not yet existent location
- ;; after (point-max). First, we move `pmark' as close to this
- ;; position as possible.
- (if (coterm--t-approximate-pmark pmark)
- ;; If we succeed, clear `coterm--t-row' and col. On next
- ;; output, we will initialize them to point to `pmark'.
- (setq coterm--t-row nil
- coterm--t-col nil
- coterm--t-pmark-in-sync nil)
- ;; If we don't succeed, leave the variables unchanged. They will
- ;; be used to handle next output.
- (ignore)))
+ ;; Synchronize pmark and remove all trailing whitespace after it.
+ (coterm--t-adjust-pmark proc-filt process)
+ (widen)
+ (goto-char pmark)
+ (skip-chars-forward " \n")
+ (when (eobp)
+ (delete-region pmark (point))))
(goto-char restore-point)
(unless (eq restore-point pmark)
- [elpa] externals/coterm 71d2dc1 30/80: Implement user-facing variables and minor mode, (continued)
- [elpa] externals/coterm 71d2dc1 30/80: Implement user-facing variables and minor mode, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm dfebb62 46/80: Add comint output filter function buffer locally, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm bd103f9 56/80: [auto-char] Fix searching in less, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm d5042f6 65/80: Inhibit Emacs from automatically decoding \r\n into \n, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 90823af 77/80: Revert "Inhibit Emacs from automatically decoding \r\n into \n", ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 066cd45 70/80: Explain how coterm does/doesn't do line-wrapping, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 08208f3 33/80: Handle \r\n sequence properly, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm f334168 24/80: Rename function, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 8b2836e 28/80: Fix incorrect handling of incomplete escape sequences, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 1ec97d2 29/80: \n doesn't go to column 0, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 9184a46 34/80: Always synchronize pmark at the end,
ELPA Syncer <=
- [elpa] externals/coterm e64027a 43/80: Restore 'window-point' of non-selected windows, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 8f0a13b 44/80: Refactor scroll snapping, snap in all windows, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm dc5f8db 38/80: Improve doc string, add autoload cookie, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm ee37b4b 39/80: Initial support for char-mode and scroll snapping, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 6f42ba6 45/80: Initialize home marker properly, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm 5e40af4 47/80: Prevent modification of user input harder, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm dc9466e 57/80: Implement \t (move cursor to tab stop), needed for "emacs -nw", ELPA Syncer, 2021/10/13
- [elpa] externals/coterm db17a99 62/80: Describe terminal emulation, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm c52f413 67/80: Keep char mode in less after pressing a digit, ELPA Syncer, 2021/10/13
- [elpa] externals/coterm c717c84 75/80: Bind inhibit-read-only to t for terminal emulation, ELPA Syncer, 2021/10/13