Commit a7fa60eb authored by Noah Friedman's avatar Noah Friedman

(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.
parent bb160193
......@@ -23,7 +23,7 @@
;;; Commentary:
;; Support for remote logins using `rlogin'.
;; $Id: rlogin.el,v 1.12 1993/10/18 07:05:11 friedman Exp rms $
;; $Id: rlogin.el,v 1.13 1993/10/22 17:12:54 rms Exp friedman $
;;; Todo:
......@@ -174,25 +174,16 @@ If `rlogin-mode-hook' is set, run it."
(let (proc-mark region-begin window)
(save-excursion
(set-buffer (process-buffer proc))
(setq proc-mark (process-mark proc)
region-begin (point)
;; If process mark is at window start, insert-before-markers
;; will insert text off-window since it's also inserting before
;; the start window mark. Make sure we can see the most recent
;; text. (note: it's a buglet that this isn't necessary if
;; scroll-step is 0, but that works to our advantage since it
;; makes the filter a little faster.)
window (and (/= 0 scroll-step)
(= proc-mark (window-start))
(setq proc-mark (process-mark proc))
(setq region-begin (marker-position proc-mark))
;; If process mark is at window start, insert-before-markers will
;; insert text off-window since it's also inserting before the start
;; window mark. Make sure we can see the most recent text.
(setq window (and (= proc-mark (window-start))
(get-buffer-window (current-buffer))))
(goto-char proc-mark)
(insert-before-markers string)
(goto-char region-begin)
;; I think something fishy is going on with save-excursion and
;; search-forward. If you don't make search-forward move to the end
;; of the search region when it's done, then if the user switches
;; buffers back and forth, it leaves point sitting behind the
;; process-mark, so that text inserted later goes off-screen.
(while (search-forward "\C-m" proc-mark 'goto-end)
(delete-char -1)))
;; Frob window-start outside of save-excursion so it works whether the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment