Skip to content

Commit 7a0834c

Browse files
committed
Use window-point-insertion-type
Use window-point-insertion-type instead of manual code.
1 parent ded887b commit 7a0834c

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

haskell-process.el

+4-16
Original file line numberDiff line numberDiff line change
@@ -164,23 +164,11 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
164164
(windows (get-buffer-window-list append-to t t))
165165
move-point-in-windows)
166166
(with-current-buffer append-to
167+
;; point should follow insertion so that it stays at the end
168+
;; of the buffer
169+
(setq-local window-point-insertion-type t)
167170
(let ((buffer-read-only nil))
168-
;; record in which windows we should keep point at eob.
169-
(dolist (window windows)
170-
(when (= (window-point window) (point-max))
171-
(push window move-point-in-windows)))
172-
(let (return-to-position)
173-
;; decide whether we should reset point to return-to-position
174-
;; or leave it at eob.
175-
(unless (= (point) (point-max))
176-
(setq return-to-position (point))
177-
(goto-char (point-max)))
178-
(insert msg "\n")
179-
(when return-to-position
180-
(goto-char return-to-position)))
181-
;; advance to point-max in windows where it is needed
182-
(dolist (window move-point-in-windows)
183-
(set-window-point window (point-max))))))))
171+
(insert msg "\n"))))))
184172

185173
(defun haskell-process-project-by-proc (proc)
186174
"Find project by process."

0 commit comments

Comments
 (0)