[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 641c94c: Imp[rove documentation of 'with-silent-m
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-26 641c94c: Imp[rove documentation of 'with-silent-modifications' |
Date: |
Sat, 2 Jun 2018 06:28:12 -0400 (EDT) |
branch: emacs-26
commit 641c94ce68399e89a35769cb8727c59412767faa
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Imp[rove documentation of 'with-silent-modifications'
* doc/lispref/buffers.texi (Buffer Modification): Document
'with-silent-modifications'. (Bug#31613)
* doc/lispref/text.texi (Changing Properties): Add a
cross-reference to "Buffer Modification". Improve wording.
---
doc/lispref/buffers.texi | 14 ++++++++++++++
doc/lispref/text.texi | 7 ++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index 45e9066..686b616 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -587,6 +587,20 @@ in between the calls. If @var{buffer} is @code{nil} (or
omitted), the
current buffer is used.
@end defun
+Sometimes there's a need for modifying buffer in a way that doesn't
+really change its text, like if only its text properties are changed.
+If your program needs to modify a buffer without triggering any hooks
+and features that react to buffer modifications, use the
address@hidden macro.
+
address@hidden with-silent-modifications address@hidden
+Execute @var{body} pretending it does not modify the buffer. This
+includes checking whether the buffer's file is locked (@pxref{File
+Locks}), running buffer modification hooks (@pxref{Change Hooks}),
+etc. Note that if @var{body} actually modifies the buffer text, its
+undo data may become corrupted.
address@hidden defmac
+
@node Modification Time
@section Buffer Modification Time
@cindex comparing file modification time
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 6dde4c0..477b8fc 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3037,9 +3037,10 @@ construct each part with @code{propertize} and then
combine them with
buffer but does not copy its properties.
@findex with-silent-modifications
- If you wish to add or remove text properties to a buffer without
-marking the buffer as modified, you can wrap the calls above in the
address@hidden macro.
+ If you wish to add text properties to a buffer or remove them
+without marking the buffer as modified, you can wrap the calls above
+in the @code{with-silent-modifications} macro. @xref{Buffer
+Modification}.
@node Property Search
@subsection Text Property Search Functions
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 641c94c: Imp[rove documentation of 'with-silent-modifications',
Eli Zaretskii <=