Mercurial > emacs
comparison etc/NEWS @ 43139:22ff542d67ee
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 06 Feb 2002 15:44:48 +0000 |
parents | b31f95ef830a |
children | 240dadbd3381 |
comparison
equal
deleted
inserted
replaced
43138:a3df29430166 | 43139:22ff542d67ee |
---|---|
413 (function (lambda () | 413 (function (lambda () |
414 (master-set-slave sql-buffer)))) | 414 (master-set-slave sql-buffer)))) |
415 | 415 |
416 | 416 |
417 * Lisp Changes in Emacs 21.3 | 417 * Lisp Changes in Emacs 21.3 |
418 | |
419 ** Atomic change groups. | |
420 | |
421 To perform some changes in the current buffer "atomically" so that | |
422 they either all succeed or are all undone, use `atomic-change-group' | |
423 around the code that makes changes. For instance: | |
424 | |
425 (atomic-change-group | |
426 (insert foo) | |
427 (delete-region x y)) | |
428 | |
429 If an error (or other nonlocal exit) occurs inside the body of | |
430 `atomic-change-group', it unmakes all the changes in that buffer that | |
431 were during the execution of the body. The change group has no effect | |
432 on any other buffers--any such changes remain. | |
433 | |
434 If you need something more sophisticated, you can directly call the | |
435 lower-level functions that `atomic-change-group' uses. Here is how. | |
436 | |
437 To set up a change group for one buffer, call `prepare-change-group'. | |
438 Specify the buffer as argument; it defaults to the current buffer. | |
439 This function returns a "handle" for the change group. You must save | |
440 the handle to activate the change group and then finish it. | |
441 | |
442 Before you change the buffer again, you must activate the change | |
443 group. Pass the handle to `activate-change-group' afterward to | |
444 do this. | |
445 | |
446 After you make the changes, you must finish the change group. You can | |
447 either accept the changes or cancel them all. Call | |
448 `accept-change-group' to accept the changes in the group as final; | |
449 call `cancel-change-group' to undo them all. | |
450 | |
451 You should use `unwind-protect' to make sure the group is always | |
452 finished. 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 | |
456 group, don't use the handle again--don't try to finish the same group | |
457 twice. | |
458 | |
459 To make a multibuffer change group, call `prepare-change-group' once | |
460 for each buffer you want to cover, then use `nconc' to combine the | |
461 returned values, like this: | |
462 | |
463 (nconc (prepare-change-group buffer-1) | |
464 (prepare-change-group buffer-2)) | |
465 | |
466 You can then activate the multibuffer change group with a single call | |
467 to `activate-change-group', and finish it with a single call to | |
468 `accept-change-group' or `cancel-change-group'. | |
469 | |
470 Nested use of several change groups for the same buffer works as you | |
471 would expect. Non-nested use of change groups for the same buffer | |
472 will lead to undesirable results, so don't let it happen; the first | |
473 change group you start for any given buffer should be the last one | |
474 finished. | |
418 | 475 |
419 ** New function substring-no-properties. | 476 ** New function substring-no-properties. |
420 | 477 |
421 +++ | 478 +++ |
422 ** The new primitive `tty-display-color-cells' returns the number of | 479 ** The new primitive `tty-display-color-cells' returns the number of |