]> code.delx.au - gnu-emacs/blobdiff - lisp/allout.el
* lisp/progmodes/compile.el: Avoid an N² behavior in grep.
[gnu-emacs] / lisp / allout.el
index 49a7454b1e0b2d8a617ee9a9584c2872753d384d..d965ac353380eaa895ffd27e747516b52e01ebaf 100644 (file)
@@ -1,7 +1,6 @@
 ;;; allout.el --- extensive outline mode for use alone and with other modes
 
-;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
-;;   2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 1992-1994, 2001-2011  Free Software Foundation, Inc.
 
 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
@@ -169,10 +168,11 @@ respective allout-mode keybinding variables, `allout-command-prefix',
   ;; used in minor-mode-map-alist to indirect to the actual
   ;; allout-mode-map-var value, which can be adjusted and reassigned.
 
+  ;; allout-mode-map-value for keymap reference in various places:
   (setq allout-mode-map-value map)
-  ;; The defalias reexecution is necessary when allout-mode-map-value is
-  ;; changing from nil, and it doesn't hurt to do it every time, so:
-  (defalias 'allout-mode-map allout-mode-map-value))
+  ;; the function value keymap of allout-mode-map is used in
+  ;; minor-mode-map-alist - update it:
+  (fset allout-mode-map allout-mode-map-value))
 ;;;_  * intialize the mode map:
 ;; ensure that allout-mode-map has some setting even if allout-mode hasn't
 ;; been invoked:
@@ -203,7 +203,6 @@ willing to let allout use a bunch of \C-c keybindings."
     ("[(control ?a)]" allout-beginning-of-current-entry)
     ("[(control ?e)]" allout-end-of-entry)
     ("[(control ?i)]" allout-show-children)
-    ("[(control ?i)]" allout-show-children)
     ("[(control ?s)]" allout-show-current-subtree)
     ("[(control ?t)]" allout-toggle-current-subtree-exposure)
 ;; Let user customize if they want to preempt describe-prefix-bindings ^h use.
@@ -220,7 +219,7 @@ willing to let allout use a bunch of \C-c keybindings."
     ("[?<]" allout-shift-out)
     ("[(control ?m)]" allout-rebullet-topic)
     ("[?*]" allout-rebullet-current-heading)
-    ("[?']" allout-number-siblings)
+    ("[?#]" allout-number-siblings)
     ("[(control ?k)]" allout-kill-topic)
     ("[(meta ?k)]" allout-copy-topic-as-kill)
     ("[?@]" allout-resolve-xref)
@@ -1411,9 +1410,6 @@ Functions on the hook should take two arguments:
  - NEW-START -- integer indicating position of start of the first new item.
  - NEW-END -- integer indicating position of end of the last new item.
 
-Some edits that introduce new items may missed by this hook:
-specifically edits that native allout routines do not control.
-
 This hook might be invoked multiple times by a single command.")
 ;;;_   = allout-structure-deleted-hook
 (defvar allout-structure-deleted-hook nil
@@ -2191,8 +2187,8 @@ internal functions use this feature cohesively bunch changes."
 
 See `allout-overlay-interior-modification-handler' for details."
 
-  (if (and (allout-mode-p) undo-in-progress (allout-hidden-p))
-      (allout-show-to-offshoot))
+  (when (and (allout-mode-p) undo-in-progress (allout-hidden-p))
+    (allout-show-children))
 
   ;; allout-overlay-interior-modification-handler on an overlay handles
   ;; this in other emacs, via `allout-exposure-category's 'modification-hooks.
@@ -3416,13 +3412,18 @@ Returns the qualifying command, if any, else nil."
            (not modified)
            (<= 33 key-num)
            (setq mapped-binding
-                 ;; translate as a keybinding:
-                 (key-binding (vconcat allout-command-prefix
-                                       (vector
-                                        (if (and (<= 97 key-num) ; "a"
-                                                 (>= 122 key-num)) ; "z"
-                                            (- key-num 96) key-num)))
-                              t)))
+                 (or
+                  ;; try control-modified versions of keys:
+                  (key-binding (vconcat allout-command-prefix
+                                        (vector
+                                         (if (and (<= 97 key-num) ; "a"
+                                                  (>= 122 key-num)) ; "z"
+                                             (- key-num 96) key-num)))
+                               t)
+                  ;; try non-modified versions of keys:
+                  (key-binding (vconcat allout-command-prefix
+                                        (vector key-num))
+                               t))))
           ;; Qualified as an allout command -- do hot-spot operation.
           (setq allout-post-goto-bullet t)
         ;; accept-defaults nil, or else we get allout-item-icon-key-handler.