diff options
| author | Eli Zaretskii | 2018-06-02 13:27:22 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-06-02 13:27:22 +0300 |
| commit | 641c94ce68399e89a35769cb8727c59412767faa (patch) | |
| tree | f1dd14db6bc1783a522b99cfe7dcdc6487c0f662 | |
| parent | 6e0ff4cc1f261def00f9f9dd581ba6ef72703f0c (diff) | |
| download | emacs-641c94ce68399e89a35769cb8727c59412767faa.tar.gz emacs-641c94ce68399e89a35769cb8727c59412767faa.zip | |
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.
| -rw-r--r-- | doc/lispref/buffers.texi | 14 | ||||
| -rw-r--r-- | 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 45e90669b7e..686b6162a55 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 | |||
| 587 | current buffer is used. | 587 | current buffer is used. |
| 588 | @end defun | 588 | @end defun |
| 589 | 589 | ||
| 590 | Sometimes there's a need for modifying buffer in a way that doesn't | ||
| 591 | really change its text, like if only its text properties are changed. | ||
| 592 | If your program needs to modify a buffer without triggering any hooks | ||
| 593 | and features that react to buffer modifications, use the | ||
| 594 | @code{with-silent-modifications} macro. | ||
| 595 | |||
| 596 | @defmac with-silent-modifications body@dots{} | ||
| 597 | Execute @var{body} pretending it does not modify the buffer. This | ||
| 598 | includes checking whether the buffer's file is locked (@pxref{File | ||
| 599 | Locks}), running buffer modification hooks (@pxref{Change Hooks}), | ||
| 600 | etc. Note that if @var{body} actually modifies the buffer text, its | ||
| 601 | undo data may become corrupted. | ||
| 602 | @end defmac | ||
| 603 | |||
| 590 | @node Modification Time | 604 | @node Modification Time |
| 591 | @section Buffer Modification Time | 605 | @section Buffer Modification Time |
| 592 | @cindex comparing file modification time | 606 | @cindex comparing file modification time |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 6dde4c00f85..477b8fce719 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 | |||
| 3037 | buffer but does not copy its properties. | 3037 | buffer but does not copy its properties. |
| 3038 | 3038 | ||
| 3039 | @findex with-silent-modifications | 3039 | @findex with-silent-modifications |
| 3040 | If you wish to add or remove text properties to a buffer without | 3040 | If you wish to add text properties to a buffer or remove them |
| 3041 | marking the buffer as modified, you can wrap the calls above in the | 3041 | without marking the buffer as modified, you can wrap the calls above |
| 3042 | @code{with-silent-modifications} macro. | 3042 | in the @code{with-silent-modifications} macro. @xref{Buffer |
| 3043 | Modification}. | ||
| 3043 | 3044 | ||
| 3044 | @node Property Search | 3045 | @node Property Search |
| 3045 | @subsection Text Property Search Functions | 3046 | @subsection Text Property Search Functions |