aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRichard M. Stallman2002-02-06 15:44:48 +0000
committerRichard M. Stallman2002-02-06 15:44:48 +0000
commit108eaabb6b8fd0deb527e0b53b3d0cbf731e280a (patch)
tree5229f6c6839cece2a33f4ea8651c61bf6ee130ff /etc
parentfa5c314daad6a222fb410abfed34e8e74266cc35 (diff)
downloademacs-108eaabb6b8fd0deb527e0b53b3d0cbf731e280a.tar.gz
emacs-108eaabb6b8fd0deb527e0b53b3d0cbf731e280a.zip
*** empty log message ***
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS57
1 files changed, 57 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index da01bf3177e..8720e7941db 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -416,6 +416,63 @@ SQL buffer.
416 416
417* Lisp Changes in Emacs 21.3 417* Lisp Changes in Emacs 21.3
418 418
419** Atomic change groups.
420
421To perform some changes in the current buffer "atomically" so that
422they either all succeed or are all undone, use `atomic-change-group'
423around the code that makes changes. For instance:
424
425 (atomic-change-group
426 (insert foo)
427 (delete-region x y))
428
429If an error (or other nonlocal exit) occurs inside the body of
430`atomic-change-group', it unmakes all the changes in that buffer that
431were during the execution of the body. The change group has no effect
432on any other buffers--any such changes remain.
433
434If you need something more sophisticated, you can directly call the
435lower-level functions that `atomic-change-group' uses. Here is how.
436
437To set up a change group for one buffer, call `prepare-change-group'.
438Specify the buffer as argument; it defaults to the current buffer.
439This function returns a "handle" for the change group. You must save
440the handle to activate the change group and then finish it.
441
442Before you change the buffer again, you must activate the change
443group. Pass the handle to `activate-change-group' afterward to
444do this.
445
446After you make the changes, you must finish the change group. You can
447either accept the changes or cancel them all. Call
448`accept-change-group' to accept the changes in the group as final;
449call `cancel-change-group' to undo them all.
450
451You should use `unwind-protect' to make sure the group is always
452finished. The call to `activate-change-group' should be inside the
453`unwind-protect', in case the user types C-g just after it runs.
454(This is one reason why `prepare-change-group' and
455`activate-change-group' are separate functions.) Once you finish the
456group, don't use the handle again--don't try to finish the same group
457twice.
458
459To make a multibuffer change group, call `prepare-change-group' once
460for each buffer you want to cover, then use `nconc' to combine the
461returned values, like this:
462
463 (nconc (prepare-change-group buffer-1)
464 (prepare-change-group buffer-2))
465
466You can then activate the multibuffer change group with a single call
467to `activate-change-group', and finish it with a single call to
468`accept-change-group' or `cancel-change-group'.
469
470Nested use of several change groups for the same buffer works as you
471would expect. Non-nested use of change groups for the same buffer
472will lead to undesirable results, so don't let it happen; the first
473change group you start for any given buffer should be the last one
474finished.
475
419** New function substring-no-properties. 476** New function substring-no-properties.
420 477
421+++ 478+++