diff options
| author | Ken Manheimer | 2011-07-05 14:54:08 -0400 |
|---|---|---|
| committer | Ken Manheimer | 2011-07-05 14:54:08 -0400 |
| commit | 919d884a6dc860fc4268a5c4ec44e2e80a42836f (patch) | |
| tree | 8ac1d25a18a5c635d76627d2c6b6bee0245b5f3a | |
| parent | 450a0f09279df347a10d6c1e4b809a5082daf9c8 (diff) | |
| download | emacs-919d884a6dc860fc4268a5c4ec44e2e80a42836f.tar.gz emacs-919d884a6dc860fc4268a5c4ec44e2e80a42836f.zip | |
* allout.el (allout-post-undo-hook): New allout outline-change event hook
to signal undo activity.
(allout-post-command-business): Run allout-post-undo-hook if an undo just
occurred.
(allout-after-copy-or-kill-hook), (allout-mode): Minor docstring changes.
* allout-widgets.el (allout-widgets-after-undo-function): Ensure the
integrity of the current item's decoration after it has been in the
vicinity of an undo.
(allout-widgets-mode): Include allout-widgets-after-undo-function on the
new allout-post-undo-hook.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/allout-widgets.el | 10 | ||||
| -rw-r--r-- | lisp/allout.el | 12 |
3 files changed, 36 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66215266bdb..20679038120 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2011-07-05 Ken Manheimer <ken.manheimer@gmail.com> | ||
| 2 | |||
| 3 | * allout.el (allout-post-undo-hook): New allout outline-change | ||
| 4 | event hook to signal undo activity. | ||
| 5 | (allout-post-command-business): Run allout-post-undo-hook if an | ||
| 6 | undo just occurred. | ||
| 7 | (allout-after-copy-or-kill-hook), (allout-mode): Minor docstring | ||
| 8 | changes. | ||
| 9 | * allout-widgets.el (allout-widgets-after-undo-function): Ensure | ||
| 10 | the integrity of the current item's decoration after it has been | ||
| 11 | in the vicinity of an undo. | ||
| 12 | (allout-widgets-mode): Include allout-widgets-after-undo-function | ||
| 13 | on the new allout-post-undo-hook. | ||
| 14 | |||
| 15 | |||
| 1 | 2011-07-05 Stefan Monnier <monnier@iro.umontreal.ca> | 16 | 2011-07-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 17 | ||
| 3 | * emacs-lisp/lisp-mode.el (lisp-interaction-mode-abbrev-table): | 18 | * emacs-lisp/lisp-mode.el (lisp-interaction-mode-abbrev-table): |
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 8dab7411750..ef75e7157e6 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el | |||
| @@ -561,6 +561,8 @@ outline hot-spot navigation \(see `allout-mode')." | |||
| 561 | 'allout-widgets-shifts-recorder nil 'local) | 561 | 'allout-widgets-shifts-recorder nil 'local) |
| 562 | (add-hook 'allout-after-copy-or-kill-hook | 562 | (add-hook 'allout-after-copy-or-kill-hook |
| 563 | 'allout-widgets-after-copy-or-kill-function nil 'local) | 563 | 'allout-widgets-after-copy-or-kill-function nil 'local) |
| 564 | (add-hook 'allout-post-undo-hook | ||
| 565 | 'allout-widgets-after-undo-function nil 'local) | ||
| 564 | 566 | ||
| 565 | (add-hook 'before-change-functions 'allout-widgets-before-change-handler | 567 | (add-hook 'before-change-functions 'allout-widgets-before-change-handler |
| 566 | nil 'local) | 568 | nil 'local) |
| @@ -1130,6 +1132,14 @@ Dispatched by `allout-widgets-post-command-business' in response to | |||
| 1130 | Intended for use on allout-after-copy-or-kill-hook." | 1132 | Intended for use on allout-after-copy-or-kill-hook." |
| 1131 | (if (car kill-ring) | 1133 | (if (car kill-ring) |
| 1132 | (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring))))) | 1134 | (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring))))) |
| 1135 | ;;;_ > allout-widgets-after-undo-function () | ||
| 1136 | (defun allout-widgets-after-undo-function () | ||
| 1137 | "Do allout-widgets processing of text after an undo. | ||
| 1138 | |||
| 1139 | Intended for use on allout-post-undo-hook." | ||
| 1140 | (save-excursion | ||
| 1141 | (if (allout-goto-prefix) | ||
| 1142 | (allout-redecorate-item (allout-get-or-create-item-widget))))) | ||
| 1133 | 1143 | ||
| 1134 | ;;;_ > allout-widgets-exposure-undo-recorder (widget from-state) | 1144 | ;;;_ > allout-widgets-exposure-undo-recorder (widget from-state) |
| 1135 | (defun allout-widgets-exposure-undo-recorder (widget) | 1145 | (defun allout-widgets-exposure-undo-recorder (widget) |
diff --git a/lisp/allout.el b/lisp/allout.el index 5b8a7a7de1a..592a64c647a 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -1461,7 +1461,15 @@ This hook might be invoked multiple times by a single command.") | |||
| 1461 | (defvar allout-after-copy-or-kill-hook nil | 1461 | (defvar allout-after-copy-or-kill-hook nil |
| 1462 | "*Hook that's run after copying outline text. | 1462 | "*Hook that's run after copying outline text. |
| 1463 | 1463 | ||
| 1464 | Functions on the hook should not take any arguments.") | 1464 | Functions on the hook should not require any arguments.") |
| 1465 | ;;;_ = allout-post-undo-hook | ||
| 1466 | (defvar allout-post-undo-hook nil | ||
| 1467 | "*Hook that's run after undo activity. | ||
| 1468 | |||
| 1469 | The item that's current when the hook is run *may* be the one | ||
| 1470 | that was affected by the undo. | ||
| 1471 | |||
| 1472 | Functions on the hook should not require any arguments.") | ||
| 1465 | ;;;_ = allout-outside-normal-auto-fill-function | 1473 | ;;;_ = allout-outside-normal-auto-fill-function |
| 1466 | (defvar allout-outside-normal-auto-fill-function nil | 1474 | (defvar allout-outside-normal-auto-fill-function nil |
| 1467 | "Value of normal-auto-fill-function outside of allout mode. | 1475 | "Value of normal-auto-fill-function outside of allout mode. |
| @@ -1874,6 +1882,7 @@ without changes to the allout core. Here are key ones: | |||
| 1874 | `allout-structure-deleted-hook' | 1882 | `allout-structure-deleted-hook' |
| 1875 | `allout-structure-shifted-hook' | 1883 | `allout-structure-shifted-hook' |
| 1876 | `allout-after-copy-or-kill-hook' | 1884 | `allout-after-copy-or-kill-hook' |
| 1885 | `allout-post-undo-hook' | ||
| 1877 | 1886 | ||
| 1878 | Terminology | 1887 | Terminology |
| 1879 | 1888 | ||
| @@ -3313,6 +3322,7 @@ coordinating with allout activity.") | |||
| 3313 | 3322 | ||
| 3314 | (when allout-just-did-undo | 3323 | (when allout-just-did-undo |
| 3315 | (setq allout-just-did-undo nil) | 3324 | (setq allout-just-did-undo nil) |
| 3325 | (run-hooks 'allout-post-undo-hook) | ||
| 3316 | (cond ((and (= buffer-saved-size -1) | 3326 | (cond ((and (= buffer-saved-size -1) |
| 3317 | allout-auto-save-temporarily-disabled) | 3327 | allout-auto-save-temporarily-disabled) |
| 3318 | ;; user possibly undid a decryption, deinhibit auto-save: | 3328 | ;; user possibly undid a decryption, deinhibit auto-save: |