aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2022-06-29 13:41:59 -0400
committerStefan Monnier2022-06-29 13:41:59 -0400
commit6f22631a63e95c8264c5eda269e12400a1bcb9ca (patch)
tree003e33284fa7791d1edb0eec32608df5592c31de
parentf1de6c0e28fdd34227b24efbd7a0eebff90dd33f (diff)
downloademacs-6f22631a63e95c8264c5eda269e12400a1bcb9ca.tar.gz
emacs-6f22631a63e95c8264c5eda269e12400a1bcb9ca.zip
* doc/emacs/buffers.texi (Indirect Buffers): Mention modification hook quirk
-rw-r--r--doc/emacs/buffers.texi13
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 8a8584689fc..a1ad4926be7 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -616,10 +616,11 @@ select it in another window (@code{clone-indirect-buffer-other-window}).
616 616
617 The text of the indirect buffer is always identical to the text of its 617 The text of the indirect buffer is always identical to the text of its
618base buffer; changes made by editing either one are visible immediately 618base buffer; changes made by editing either one are visible immediately
619in the other. But in all other respects, the indirect buffer and its 619in the other. ``Text'' here includes both the characters and their text
620properties. But in all other respects, the indirect buffer and its
620base buffer are completely separate. They can have different names, 621base buffer are completely separate. They can have different names,
621different values of point, different narrowing, different markers, 622different values of point, different narrowing, different markers,
622different major modes, and different local variables. 623different overlays, different major modes, and different local variables.
623 624
624 An indirect buffer cannot visit a file, but its base buffer can. If 625 An indirect buffer cannot visit a file, but its base buffer can. If
625you try to save the indirect buffer, that actually works by saving the 626you try to save the indirect buffer, that actually works by saving the
@@ -645,6 +646,14 @@ buffer in another window. These functions run the hook
645named @var{indirect-name} from a buffer @var{base-buffer}, prompting for 646named @var{indirect-name} from a buffer @var{base-buffer}, prompting for
646both using the minibuffer. 647both using the minibuffer.
647 648
649Note: When a modification is made to the text of a buffer, the
650modification hooks are run only in the base buffer, because most of
651the functions on those hooks are not prepared to work correctly in
652indirect buffers. So if you need a modification hook function in an
653indirect buffer, you need to manually add that function to the hook
654@emph{in the base buffer} and then make the function operate in the
655desired indirect buffer.
656
648@node Buffer Convenience 657@node Buffer Convenience
649@section Convenience Features and Customization of Buffer Handling 658@section Convenience Features and Customization of Buffer Handling
650 659