[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 fb314ba 3/3: Don't recommend insert-before-marker
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-26 fb314ba 3/3: Don't recommend insert-before-markers in process filters |
Date: |
Sat, 1 Jun 2019 17:50:24 -0400 (EDT) |
branch: emacs-26
commit fb314ba3ad3619123b3d41b1dd65dcc569ad1e51
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Don't recommend insert-before-markers in process filters
See <https://lists.gnu.org/r/emacs-devel/2019-05/msg00062.html> and
Bug#35334.
* doc/lispref/processes.texi (Filter Functions): Go back to using
plain insert in the example filter. Add note about updating window
point.
---
doc/lispref/processes.texi | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 38ad907..a93f4db 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1643,7 +1643,7 @@ how to do these things:
(save-excursion
;; @r{Insert the text, advancing the process marker.}
(goto-char (process-mark proc))
- (insert-before-markers string)
+ (insert string)
(set-marker (process-mark proc) (point)))
(if moving (goto-char (process-mark proc)))))))
@end group
@@ -1659,7 +1659,12 @@ text arrives, you could insert a line like the following
just before the
To force point to the end of the new output, no matter where it was
previously, eliminate the variable @code{moving} from the example and
-call @code{goto-char} unconditionally.
+call @code{goto-char} unconditionally. Note that this doesn't
+necessarily move the window point. The default filter actually uses
address@hidden which moves all markers, including the
+window point. This may move unrelated markers, so it's generally
+better to move the window point explicitly, or set its insertion type
+to @code{t} (@pxref{Window Point}).
@ignore
In earlier Emacs versions, every filter function that did regular