emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105909: * allout.el (allout-this-com


From: Ken Manheimer
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105909: * allout.el (allout-this-command-hid-stuff): Buffer-local variable that's
Date: Sat, 24 Sep 2011 16:58:23 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105909
committer: Ken Manheimer <address@hidden>
branch nick: trunk
timestamp: Sat 2011-09-24 16:58:23 -0400
message:
  * allout.el (allout-this-command-hid-stuff): Buffer-local variable that's
  true if the current command involved collapsing of text.  It's reset to
  false at the beginning of the next command.
  (allout-post-command-business): Move the cursor to the beginning of entry
  if the cursor is hidden and collapsing activity just happened.
modified:
  lisp/ChangeLog
  lisp/allout.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-24 18:38:20 +0000
+++ b/lisp/ChangeLog    2011-09-24 20:58:23 +0000
@@ -1,3 +1,12 @@
+2011-09-22  Ken Manheimer  <address@hidden>
+
+       * allout.el (allout-this-command-hid-stuff): Buffer-local variable
+       that's true if the current command involved collapsing of text.
+       It's reset to false at the beginning of the next command.
+       (allout-post-command-business): Move the cursor to the beginning
+       of entry if the cursor is hidden and collapsing activity just
+       happened.
+
 2011-09-24  Chong Yidong  <address@hidden>
 
        * mouse.el (mouse-drag-track): Set scroll-margin to 0 while

=== modified file 'lisp/allout.el'
--- a/lisp/allout.el    2011-07-05 18:54:08 +0000
+++ b/lisp/allout.el    2011-09-24 20:58:23 +0000
@@ -3304,6 +3304,10 @@
 Set by `allout-pre-command-business', to support allout addons in
 coordinating with allout activity.")
 (make-variable-buffer-local 'allout-command-counter)
+;;;_   = allout-this-command-hid-text
+(defvar allout-this-command-hid-text nil
+  "True if the most recent allout-mode command hid any text.")
+(make-variable-buffer-local 'allout-this-command-hid-text)
 ;;;_   > allout-post-command-business ()
 (defun allout-post-command-business ()
   "Outline `post-command-hook' function.
@@ -3311,6 +3315,9 @@
 - Implement (and clear) `allout-post-goto-bullet', for hot-spot
   outline commands.
 
+- Move the cursor to the beginning of the entry if it is hidden
+  and collapsing activity just happened.
+
 - If the command we're following was an undo, check for change in
   the status of encrypted items and adjust auto-save inhibitions
   accordingly.
@@ -3343,8 +3350,9 @@
     (if (and allout-post-goto-bullet
             (allout-current-bullet-pos))
        (progn (goto-char (allout-current-bullet-pos))
-              (setq allout-post-goto-bullet nil)))
-    ))
+              (setq allout-post-goto-bullet nil))
+      (when (and (allout-hidden-p) allout-this-command-hid-text)
+        (allout-beginning-of-current-entry)))))
 ;;;_   > allout-pre-command-business ()
 (defun allout-pre-command-business ()
   "Outline `pre-command-hook' function for outline buffers.
@@ -3367,8 +3375,8 @@
 
   (if (not (allout-mode-p))
       nil
-    ;; Increment allout-command-counter
     (setq allout-command-counter (1+ allout-command-counter))
+    (setq allout-this-command-hid-text nil)
     ;; Do hot-spot navigation.
     (if (and (eq this-command 'self-insert-command)
             (eq (point)(allout-current-bullet-pos)))
@@ -4767,7 +4775,8 @@
             (condition-case nil
                 ;; as of 2008-02-27, xemacs lacks modification-hooks
                 (overlay-put o (pop props) (pop props))
-              (error nil)))))))
+              (error nil))))))
+    (setq allout-this-command-hid-text t))
   (run-hook-with-args 'allout-exposure-change-hook from to flag))
 ;;;_   > allout-flag-current-subtree (flag)
 (defun allout-flag-current-subtree (flag)


reply via email to

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