emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104971: * allout.el (allout-post-und


From: Ken Manheimer
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104971: * allout.el (allout-post-undo-hook): New allout outline-change event hook
Date: Tue, 05 Jul 2011 14:54:08 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104971
committer: Ken Manheimer <address@hidden>
branch nick: trunk
timestamp: Tue 2011-07-05 14:54:08 -0400
message:
  * 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.
modified:
  lisp/ChangeLog
  lisp/allout-widgets.el
  lisp/allout.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-05 18:26:33 +0000
+++ b/lisp/ChangeLog    2011-07-05 18:54:08 +0000
@@ -1,3 +1,18 @@
+2011-07-05  Ken Manheimer  <address@hidden>
+
+       * 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.
+
+
 2011-07-05  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/lisp-mode.el (lisp-interaction-mode-abbrev-table):

=== modified file 'lisp/allout-widgets.el'
--- a/lisp/allout-widgets.el    2011-07-01 00:11:50 +0000
+++ b/lisp/allout-widgets.el    2011-07-05 18:54:08 +0000
@@ -561,6 +561,8 @@
                   'allout-widgets-shifts-recorder nil 'local)
         (add-hook 'allout-after-copy-or-kill-hook
                   'allout-widgets-after-copy-or-kill-function nil 'local)
+        (add-hook 'allout-post-undo-hook
+                  'allout-widgets-after-undo-function nil 'local)
 
         (add-hook 'before-change-functions 
'allout-widgets-before-change-handler
                   nil 'local)
@@ -1130,6 +1132,14 @@
 Intended for use on allout-after-copy-or-kill-hook."
   (if (car kill-ring)
       (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring)))))
+;;;_   > allout-widgets-after-undo-function ()
+(defun allout-widgets-after-undo-function ()
+  "Do allout-widgets processing of text after an undo.
+
+Intended for use on allout-post-undo-hook."
+  (save-excursion
+    (if (allout-goto-prefix)
+        (allout-redecorate-item (allout-get-or-create-item-widget)))))
 
 ;;;_   > allout-widgets-exposure-undo-recorder (widget from-state)
 (defun allout-widgets-exposure-undo-recorder (widget)

=== modified file 'lisp/allout.el'
--- a/lisp/allout.el    2011-07-04 22:16:10 +0000
+++ b/lisp/allout.el    2011-07-05 18:54:08 +0000
@@ -1461,7 +1461,15 @@
 (defvar allout-after-copy-or-kill-hook nil
   "*Hook that's run after copying outline text.
 
-Functions on the hook should not take any arguments.")
+Functions on the hook should not require any arguments.")
+;;;_   = allout-post-undo-hook
+(defvar allout-post-undo-hook nil
+  "*Hook that's run after undo activity.
+
+The item that's current when the hook is run *may* be the one
+that was affected by the undo.
+
+Functions on the hook should not require any arguments.")
 ;;;_   = allout-outside-normal-auto-fill-function
 (defvar allout-outside-normal-auto-fill-function nil
   "Value of normal-auto-fill-function outside of allout mode.
@@ -1874,6 +1882,7 @@
 `allout-structure-deleted-hook'
 `allout-structure-shifted-hook'
 `allout-after-copy-or-kill-hook'
+`allout-post-undo-hook'
 
                             Terminology
 
@@ -3313,6 +3322,7 @@
 
     (when allout-just-did-undo
       (setq allout-just-did-undo nil)
+      (run-hooks 'allout-post-undo-hook)
       (cond ((and (= buffer-saved-size -1)
                   allout-auto-save-temporarily-disabled)
              ;; user possibly undid a decryption, deinhibit auto-save:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]