aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoah Friedman1993-12-01 09:57:04 +0000
committerNoah Friedman1993-12-01 09:57:04 +0000
commita7fa60eb270a5186917f64cac994a0683f6e79e6 (patch)
treeb5567f6aba293d9d8b52b9bec0434fa123967766
parentbb1601939fa2ddb37e4792e17bb146009ce8e3b7 (diff)
downloademacs-a7fa60eb270a5186917f64cac994a0683f6e79e6.tar.gz
emacs-a7fa60eb270a5186917f64cac994a0683f6e79e6.zip
(rlogin-filter): initialize `region-begin' to (marker-position proc-mark),
not just (point), whatever random value that may be. Put bindings for `proc-mark', `region-begin', and `window' in separate setq forms. In determining whether window-start readjustment is needed, do not examine scroll-step; it is irrelevant.
-rw-r--r--lisp/rlogin.el23
1 files changed, 7 insertions, 16 deletions
diff --git a/lisp/rlogin.el b/lisp/rlogin.el
index cc8dd9c0bab..faa3f73afe4 100644
--- a/lisp/rlogin.el
+++ b/lisp/rlogin.el
@@ -23,7 +23,7 @@
23;;; Commentary: 23;;; Commentary:
24 24
25;; Support for remote logins using `rlogin'. 25;; Support for remote logins using `rlogin'.
26;; $Id: rlogin.el,v 1.12 1993/10/18 07:05:11 friedman Exp rms $ 26;; $Id: rlogin.el,v 1.13 1993/10/22 17:12:54 rms Exp friedman $
27 27
28;;; Todo: 28;;; Todo:
29 29
@@ -174,25 +174,16 @@ If `rlogin-mode-hook' is set, run it."
174 (let (proc-mark region-begin window) 174 (let (proc-mark region-begin window)
175 (save-excursion 175 (save-excursion
176 (set-buffer (process-buffer proc)) 176 (set-buffer (process-buffer proc))
177 (setq proc-mark (process-mark proc) 177 (setq proc-mark (process-mark proc))
178 region-begin (point) 178 (setq region-begin (marker-position proc-mark))
179 ;; If process mark is at window start, insert-before-markers 179 ;; If process mark is at window start, insert-before-markers will
180 ;; will insert text off-window since it's also inserting before 180 ;; insert text off-window since it's also inserting before the start
181 ;; the start window mark. Make sure we can see the most recent 181 ;; window mark. Make sure we can see the most recent text.
182 ;; text. (note: it's a buglet that this isn't necessary if 182 (setq window (and (= proc-mark (window-start))
183 ;; scroll-step is 0, but that works to our advantage since it
184 ;; makes the filter a little faster.)
185 window (and (/= 0 scroll-step)
186 (= proc-mark (window-start))
187 (get-buffer-window (current-buffer)))) 183 (get-buffer-window (current-buffer))))
188 (goto-char proc-mark) 184 (goto-char proc-mark)
189 (insert-before-markers string) 185 (insert-before-markers string)
190 (goto-char region-begin) 186 (goto-char region-begin)
191 ;; I think something fishy is going on with save-excursion and
192 ;; search-forward. If you don't make search-forward move to the end
193 ;; of the search region when it's done, then if the user switches
194 ;; buffers back and forth, it leaves point sitting behind the
195 ;; process-mark, so that text inserted later goes off-screen.
196 (while (search-forward "\C-m" proc-mark 'goto-end) 187 (while (search-forward "\C-m" proc-mark 'goto-end)
197 (delete-char -1))) 188 (delete-char -1)))
198 ;; Frob window-start outside of save-excursion so it works whether the 189 ;; Frob window-start outside of save-excursion so it works whether the