]> code.delx.au - gnu-emacs/blobdiff - lisp/allout.el
Change release version from 21.4 to 22.1 throughout.
[gnu-emacs] / lisp / allout.el
index f77376f871e6b1fdc0b7ebfca114a4dfa993db83..4b1c152b6b1a593686469d7b008be68bd022590f 100644 (file)
@@ -1,11 +1,10 @@
 ;;; allout.el --- extensive outline mode for use alone and with other modes
 
-;; Copyright (C) 1992, 1993, 1994, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 93, 94, 2001, 02, 2004 Free Software Foundation, Inc.
 
-;; Author: Ken Manheimer <klm@python.org>
-;; Maintainer: Ken Manheimer <klm@python.org>
+;; Author: Ken Manheimer <klm@zope.com>
+;; Maintainer: Ken Manheimer <klm@zope.com>
 ;; Created: Dec 1991 - first release to usenet
-;; Version: $Id: allout.el,v 1.34 2002/08/30 11:03:28 lektu Exp $||
 ;; Keywords: outlines mode wp languages
 
 ;; This file is part of GNU Emacs.
 ;; exposure.  It also provides for syntax-sensitive text like
 ;; programming languages.  (For an example, see the allout code
 ;; itself, which is organized in ;; an outline framework.)
-;; 
+;;
 ;; In addition to outline navigation and exposure, allout includes:
-;; 
+;;
 ;;  - topic-oriented repositioning, cut, and paste
 ;;  - integral outline exposure-layout
 ;;  - incremental search with dynamic exposure and reconcealment of hidden text
 ;;  - automatic topic-number maintenance
 ;;  - "Hot-spot" operation, for single-keystroke maneuvering and
 ;;    exposure control.  (See the `allout-mode' docstring.)
-;; 
+;;
 ;; and many other features.
-;; 
+;;
 ;; The outline menubar additions provide quick reference to many of
-;; the features, and see the docstring of the variable `allout-init'
-;; for instructions on priming your emacs session for automatic
+;; the features, and see the docstring of the function `allout-init'
+;; for instructions on priming your Emacs session for automatic
 ;; activation of `allout-mode'.
-;; 
+;;
 ;; See the docstring of the variables `allout-layout' and
 ;; `allout-auto-activation' for details on automatic activation of
 ;; allout `allout-mode' as a minor mode.  (It has changed since allout
 ;; Note - the lines beginning with `;;;_' are outline topic headers.
 ;;        Just `ESC-x eval-current-buffer' to give it a whirl.
 
-;; Ken Manheimer       klm@python.org
+;; Ken Manheimer       klm@zope.com
 
 ;;; Code:
 
 ;;;_* Provide
-(provide 'outline)
 (provide 'allout)
 
 ;;;_* USER CUSTOMIZATION VARIABLES:
 (defgroup allout nil
   "Extensive outline mode for use alone and with other modes."
   :prefix "allout-"
-  :group 'outlines)
+  :group 'editing
+  :version "22.1")
 
 ;;;_ + Layout, Mode, and Topic Header Configuration
 
@@ -83,17 +82,17 @@ outline mode is automatically activated when the buffer-specific
 variable `allout-layout' is non-nil, and whether or not the layout
 dictated by `allout-layout' should be imposed on mode activation.
 
-With value `t', auto-mode-activation and auto-layout are enabled.
-\(This also depends on `allout-find-file-hooks' being installed in
-`find-file-hooks', which is also done by `allout-init'.)
+With value t, auto-mode-activation and auto-layout are enabled.
+\(This also depends on `allout-find-file-hook' being installed in
+`find-file-hook', which is also done by `allout-init'.)
 
 With value `ask', auto-mode-activation is enabled, and endorsement for
 performing auto-layout is asked of the user each time.
 
-With value `activate', only auto-mode-activation is enabled, 
+With value `activate', only auto-mode-activation is enabled,
 auto-layout is not.
 
-With value `nil', neither auto-mode-activation nor auto-layout are
+With value nil, neither auto-mode-activation nor auto-layout are
 enabled.
 
 See the docstring for `allout-init' for the proper interface to
@@ -110,8 +109,8 @@ this variable."
 Buffer-specific.
 
 A list value specifies a default layout for the current buffer, to be
-applied upon activation of allout `allout-mode'.  Any non-nil value will
-automatically trigger allout `allout-mode', provided `allout-init'
+applied upon activation of `allout-mode'.  Any non-nil value will
+automatically trigger `allout-mode', provided `allout-init'
 has been called to enable it.
 
 See the docstring for `allout-init' for details on setting up for
@@ -150,7 +149,7 @@ just the header."
 Outline topic header lines are identified by a leading topic
 header prefix, which mostly have the value of this var at their front.
 \(Level 1 topics are exceptions.  They consist of only a single
-character, which is typically set to the allout-primary-bullet.  Many
+character, which is typically set to the `allout-primary-bullet'.  Many
 outlines start at level 2 to avoid this discrepancy."
   :type 'string
   :group 'allout)
@@ -164,8 +163,8 @@ prefix, which is concluded by bullets that includes the value of this
 var and the respective allout-*-bullets-string vars.
 
 The value of an asterisk (`*') provides for backwards compatibility
-with the original emacs outline mode.  See allout-plain-bullets-string
-and allout-distinctive-bullets-string for the range of available
+with the original Emacs outline mode.  See `allout-plain-bullets-string'
+and `allout-distinctive-bullets-string' for the range of available
 bullets."
   :type 'string
   :group 'allout)
@@ -190,7 +189,7 @@ of this var to take effect."
 
 These bullets are used to distinguish topics from the run-of-the-mill
 ones.  They are not used in the standard topic headers created by
-the topic-opening, shifting, and rebulleting \(eg, on topic shift, 
+the topic-opening, shifting, and rebulleting \(eg, on topic shift,
 topic paste, blanket rebulleting) routines, but are offered among the
 choices for rebulleting.  They are not altered by the above automatic
 rebulleting, so they can be used to characterize topics, eg:
@@ -227,14 +226,14 @@ so topic headers look like comments in the programming language.
 
 String values are used as they stand.
 
-Value `t' means to first check for assoc value in `allout-mode-leaders'
+Value t means to first check for assoc value in `allout-mode-leaders'
 alist, then use comment-start string, if any, then use default \(`.').
 \(See note about use of comment-start strings, below.)
 
 Set to the symbol for either of `allout-mode-leaders' or
 `comment-start' to use only one of them, respectively.
 
-Value `nil' means to always use the default \(`.').
+Value nil means to always use the default \(`.').
 
 comment-start strings that do not end in spaces are tripled, and an
 `_' underscore is tacked on the end, to distinguish them from regular
@@ -243,7 +242,7 @@ tripled, but an underscore is substituted for the space. [This
 presumes that the space is for appearance, not comment syntax.  You
 can use `allout-mode-leaders' to override this behavior, when
 incorrect.]"
-  :type '(choice (const t) (const nil) string 
+  :type '(choice (const t) (const nil) string
                 (const allout-mode-leaders)
                 (const comment-start))
   :group 'allout)
@@ -261,11 +260,11 @@ from regular comments that start at bol.")
 
 ;;;_  = allout-old-style-prefixes
 (defcustom allout-old-style-prefixes nil
-  "*When non-nil, use only old-and-crusty allout-mode `*' topic prefixes.
+  "*When non-nil, use only old-and-crusty `outline-mode' `*' topic prefixes.
 
 Non-nil restricts the topic creation and modification
 functions to asterix-padded prefixes, so they look exactly
-like the original emacs-outline style prefixes.
+like the original Emacs-outline style prefixes.
 
 Whatever the setting of this variable, both old and new style prefixes
 are always respected by the topic maneuvering functions."
@@ -313,7 +312,7 @@ Stylish and constant prefixes (as well as old-style prefixes) are
 always respected by the topic maneuvering functions, regardless of
 this variable setting.
 
-The setting of this var is not relevant when allout-old-style-prefixes
+The setting of this var is not relevant when `allout-old-style-prefixes'
 is non-nil."
   :type 'boolean
   :group 'allout)
@@ -409,9 +408,9 @@ formatted copy."
 ;;; You have to reactivate allout-mode - `(allout-mode t)' - to
 ;;; institute changes to this var.
 (defvar allout-keybindings-list ()
-  "*List of allout-mode key / function bindings, for allout-mode-map.
+  "*List of `allout-mode' key / function bindings, for `allout-mode-map'.
 
-String or vector key will be prefaced with allout-command-prefix,
+String or vector key will be prefaced with `allout-command-prefix',
 unless optional third, non-nil element is present.")
 (setq allout-keybindings-list
       '(
@@ -481,7 +480,7 @@ When active, topic body lines that are indented even with or beyond
 their topic header are reindented to correspond with depth shifts of
 the header.
 
-A value of `t' enables reindent in non-programming-code buffers, ie
+A value of t enables reindent in non-programming-code buffers, ie
 those that do not have the variable `comment-start' set.  A value of
 `force' enables reindent whether or not `comment-start' is set."
   :type '(choice (const nil) (const t) (const text) (const force))
@@ -493,11 +492,11 @@ those that do not have the variable `comment-start' set.  A value of
 (defcustom allout-inhibit-protection nil
   "*Non-nil disables warnings and confirmation-checks for concealed-text edits.
 
-Outline mode uses emacs change-triggered functions to detect unruly
+Outline mode uses Emacs change-triggered functions to detect unruly
 changes to concealed regions.  Set this var non-nil to disable the
 protection, potentially increasing text-entry responsiveness a bit.
 
-This var takes effect at allout-mode activation, so you may have to
+This var takes effect at `allout-mode' activation, so you may have to
 deactivate and then reactivate the mode if you want to toggle the
 behavior."
   :type 'boolean
@@ -509,7 +508,7 @@ behavior."
 ;;;_  : Version
 ;;;_   = allout-version
 (defvar allout-version
-  (let ((rcs-rev "$Revision: 1.34 $"))
+  (let ((rcs-rev "$Revision$"))
     (condition-case err
        (save-match-data
          (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
@@ -531,7 +530,7 @@ behavior."
 
 Any line whose beginning matches this regexp is considered a
 heading.  This var is set according to the user configuration vars
-by set-allout-regexp.")
+by `set-allout-regexp'.")
 (make-variable-buffer-local 'allout-regexp)
 ;;;_   = allout-bullets-string
 (defvar allout-bullets-string ""
@@ -543,19 +542,19 @@ and `allout-distinctive-bullets-string'.")
 (make-variable-buffer-local 'allout-bullets-string)
 ;;;_   = allout-bullets-string-len
 (defvar allout-bullets-string-len 0
-  "Length of current buffers' allout-plain-bullets-string.")
+  "Length of current buffers' `allout-plain-bullets-string'.")
 (make-variable-buffer-local 'allout-bullets-string-len)
 ;;;_   = allout-line-boundary-regexp
 (defvar allout-line-boundary-regexp ()
-  "Allout-regexp with allout-style beginning-of-line anchor.
+  "`allout-regexp' with outline style beginning-of-line anchor.
 
 \(Ie, C-j, *or* C-m, for prefixes of hidden topics).  This is properly
-set when allout-regexp is produced by `set-allout-regexp', so
+set when `allout-regexp' is produced by `set-allout-regexp', so
 that (match-beginning 2) and (match-end 2) delimit the prefix.")
 (make-variable-buffer-local 'allout-line-boundary-regexp)
 ;;;_   = allout-bob-regexp
 (defvar allout-bob-regexp ()
-  "Like allout-line-boundary-regexp, for headers at beginning of buffer.
+  "Like `allout-line-boundary-regexp', for headers at beginning of buffer.
 \(match-beginning 2) and \(match-end 2) delimit the prefix.")
 (make-variable-buffer-local 'allout-bob-regexp)
 ;;;_   = allout-header-subtraction
@@ -564,7 +563,7 @@ that (match-beginning 2) and (match-end 2) delimit the prefix.")
 (make-variable-buffer-local 'allout-header-subtraction)
 ;;;_   = allout-plain-bullets-string-len
 (defvar allout-plain-bullets-string-len (length allout-plain-bullets-string)
-  "Length of allout-plain-bullets-string, updated by set-allout-regexp.")
+  "Length of `allout-plain-bullets-string', updated by `set-allout-regexp'.")
 (make-variable-buffer-local 'allout-plain-bullets-string-len)
 
 
@@ -710,7 +709,7 @@ Works with respect to `allout-plain-bullets-string' and
 (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.")
 ;;;_   > produce-allout-mode-map (keymap-alist &optional base-map)
 (defun produce-allout-mode-map (keymap-list &optional base-map)
-  "Produce keymap for use as allout-mode-map, from keymap-list.
+  "Produce keymap for use as allout-mode-map, from KEYMAP-LIST.
 
 Built on top of optional BASE-MAP, or empty sparse map if none specified.
 See doc string for allout-keybindings-list for format of binding list."
@@ -728,17 +727,12 @@ See doc string for allout-keybindings-list for format of binding list."
                              (car (cdr cell)))))))
            keymap-list)
     map))
-;;;_   = allout-prior-bindings - being deprecated.
-(defvar allout-prior-bindings nil
-  "Variable for use in V18, with allout-added-bindings, for
-resurrecting, on mode deactivation, bindings that existed before
-activation.  Being deprecated.")
-;;;_   = allout-added-bindings - being deprecated
-(defvar allout-added-bindings nil
-  "Variable for use in V18, with allout-prior-bindings, for
-resurrecting, on mode deactivation, bindings that existed before
-activation.  Being deprecated.")
+
 ;;;_  : Menu bar
+(defvar allout-mode-exposure-menu)
+(defvar allout-mode-editing-menu)
+(defvar allout-mode-navigation-menu)
+(defvar allout-mode-misc-menu)
 (defun produce-allout-mode-menubar-entries ()
   (require 'easymenu)
   (easy-menu-define allout-mode-exposure-menu
@@ -790,21 +784,21 @@ activation.  Being deprecated.")
                      "----"
                      ["Duplicate Exposed" allout-copy-exposed-to-buffer t]
                      ["Duplicate Exposed, numbered"
-                      allout-flatten-exposed-to-buffer t] 
+                      allout-flatten-exposed-to-buffer t]
                      ["Duplicate Exposed, indented"
-                      allout-indented-exposed-to-buffer t] 
+                      allout-indented-exposed-to-buffer t]
                      "----"
                      ["Set Header Lead" allout-reset-header-lead t]
                      ["Set New Exposure" allout-expose-topic t])))
 ;;;_  : Mode-Specific Variable Maintenance Utilities
 ;;;_   = allout-mode-prior-settings
 (defvar allout-mode-prior-settings nil
-  "Internal outline mode use; settings to be resumed on mode deactivation.")
+  "Internal `allout-mode' use; settings to be resumed on mode deactivation.")
 (make-variable-buffer-local 'allout-mode-prior-settings)
 ;;;_   > allout-resumptions (name &optional value)
 (defun allout-resumptions (name &optional value)
 
-  "Registers or resumes settings over allout-mode activation/deactivation.
+  "Registers or resumes settings over `allout-mode' activation/deactivation.
 
 First arg is NAME of variable affected.  Optional second arg is list
 containing allout-mode-specific VALUE to be imposed on named
@@ -880,12 +874,12 @@ allout-pre- and -post-command-hooks.")
 (defvar allout-isearch-did-quit nil
   "Distinguishes isearch conclusion and cancellation.
 
-Maintained by allout-isearch-abort \(which is wrapped around the real
-isearch-abort), and monitored by allout-isearch-expose for action.")
+Maintained by `allout-isearch-abort' \(which is wrapped around the real
+isearch-abort), and monitored by `allout-isearch-expose' for action.")
 (make-variable-buffer-local 'allout-isearch-did-quit)
 ;;;_   = allout-override-protect nil
 (defvar allout-override-protect nil
-  "Used in allout-mode for regulate of concealed-text protection mechanism.
+  "Used in `allout-mode' for regulate of concealed-text protection mechanism.
 
 Allout outline mode regulates alteration of concealed text to protect
 against inadvertent, unnoticed changes.  This is for use by specific,
@@ -894,7 +888,7 @@ It's automatically reset to nil after every buffer modification.")
 (make-variable-buffer-local 'allout-override-protect)
 ;;;_   > allout-unprotected (expr)
 (defmacro allout-unprotected (expr)
-  "Evaluate EXPRESSION with `allout-override-protect' let-bound `t'."
+  "Evaluate EXPRESSION with `allout-override-protect' let-bound t."
   `(let ((allout-override-protect t))
      ,expr))
 ;;;_   = allout-undo-aggregation
@@ -907,13 +901,13 @@ the way that before-change-functions and undo interact.")
 ;;;_   = file-var-bug hack
 (defvar allout-v18/19-file-var-hack nil
   "Horrible hack used to prevent invalid multiple triggering of outline
-mode from prop-line file-var activation.  Used by allout-mode function
+mode from prop-line file-var activation.  Used by `allout-mode' function
 to track repeats.")
 ;;;_   > allout-write-file-hook ()
 (defun allout-write-file-hook ()
-  "In outline mode, run as a local-write-file-hooks activity.
+  "In `allout-mode', run as a `write-contents-functions' activity.
 
-Currently just sets `allout-during-write-cue', so allout-change-protection
+Currently just sets `allout-during-write-cue', so outline change-protection
 knows to keep inactive during file write."
   (setq allout-during-write-cue t)
   nil)
@@ -924,16 +918,17 @@ knows to keep inactive during file write."
 (make-variable-buffer-local 'allout-mode)
 ;;;_  > allout-mode-p ()
 (defmacro allout-mode-p ()
-  "Return t if allout-mode is active in current buffer."
+  "Return t if `allout-mode' is active in current buffer."
   'allout-mode)
 ;;;_  = allout-explicitly-deactivated
 (defvar allout-explicitly-deactivated nil
-  "Allout-mode was last deliberately deactivated.
-So allout-post-command-business should not reactivate it...")
+  "Non-nil if `allout-mode' was last deliberately deactivated.
+So `allout-post-command-business' should not reactivate it...")
 (make-variable-buffer-local 'allout-explicitly-deactivated)
 ;;;_  > allout-init (&optional mode)
+;;;###autoload
 (defun allout-init (&optional mode)
-  "Prime allout-mode to enable/disable auto-activation, wrt `allout-layout'.
+  "Prime `allout-mode' to enable/disable auto-activation, wrt `allout-layout'.
 
 MODE is one of the following symbols:
 
@@ -945,50 +940,47 @@ MODE is one of the following symbols:
  - anything else \(eg, t) for auto-activation and auto-layout, without
    any confirmation check.
 
-Use this function to setup your emacs session for automatic activation
+Use this function to setup your Emacs session for automatic activation
 of allout outline mode, contingent to the buffer-specific setting of
 the `allout-layout' variable.  (See `allout-layout' and
 `allout-expose-topic' docstrings for more details on auto layout).
 
-`allout-init' works by setting up (or removing) the allout-mode
-find-file-hook, and giving `allout-auto-activation' a suitable
-setting.
+`allout-init' works by setting up (or removing)
+`allout-find-file-hook' in `find-file-hook', and giving
+`allout-auto-activation' a suitable setting.
 
-To prime your emacs session for full auto-outline operation, include
-the following two lines in your emacs init file:
+To prime your Emacs session for full auto-outline operation, include
+the following two lines in your Emacs init file:
 
 \(require 'allout)
 \(allout-init t)"
 
-  (interactive)
-  (if (interactive-p)
-      (progn
-       (setq mode
-             (completing-read
-              (concat "Select outline auto setup mode "
-                      "(empty for report, ? for options) ")
-              '(("nil")("full")("activate")("deactivate")
-                ("ask") ("report") (""))
-              nil
-              t))
-       (if (string= mode "")
-           (setq mode 'report)
-         (setq mode (intern-soft mode)))))
+  (interactive
+   (let ((m (completing-read
+            (concat "Select outline auto setup mode "
+                    "(empty for report, ? for options) ")
+            '(("nil")("full")("activate")("deactivate")
+              ("ask") ("report") (""))
+            nil
+            t)))
+     (if (string= m "") 'report
+       (intern-soft m))))
   (let
       ;; convenience aliases, for consistent ref to respective vars:
       ((hook 'allout-find-file-hook)
        (curr-mode 'allout-auto-activation))
 
     (cond ((not mode)
-          (setq find-file-hooks (delq hook find-file-hooks))
+          (setq find-file-hook (delq hook find-file-hook))
           (if (interactive-p)
               (message "Allout outline mode auto-activation inhibited.")))
          ((eq mode 'report)
-          (if (not (memq hook find-file-hooks))
-              (allout-init nil)
-            ;; Just punt and use the reports from each of the modes:
-            (allout-init (symbol-value curr-mode))))
-         (t (add-hook 'find-file-hooks hook)
+          (if (memq hook find-file-hook)
+              ;; Just punt and use the reports from each of the modes:
+              (allout-init (symbol-value curr-mode))
+            (allout-init nil)
+            (message "Allout outline mode auto-activation inhibited.")))
+         (t (add-hook 'find-file-hook hook)
             (set curr-mode             ; `set', not `setq'!
                  (cond ((eq mode 'activate)
                         (message
@@ -1005,10 +997,10 @@ the following two lines in your emacs init file:
                        ((message
                          "Outline mode auto-activation and -layout enabled.")
                         'full)))))))
-                  
+
 ;;;_  > allout-setup-menubar ()
 (defun allout-setup-menubar ()
-  "Populate the current buffer's menubar with allout allout-mode stuff."
+  "Populate the current buffer's menubar with `allout-mode' stuff."
   (let ((menus (list allout-mode-exposure-menu
                     allout-mode-editing-menu
                     allout-mode-navigation-menu
@@ -1027,7 +1019,7 @@ the following two lines in your emacs init file:
 Optional arg forces mode to re-initialize iff arg is positive num or
 symbol.  Allout outline mode always runs as a minor mode.
 
-Allout outline mode provides extensive allout-oriented formatting and
+Allout outline mode provides extensive outline oriented formatting and
 manipulation.  It enables structural editing of outlines, as well as
 navigation and exposure.  It also is specifically aimed at
 accommodating syntax-sensitive text like programming languages.  \(For
@@ -1046,10 +1038,10 @@ In addition to outline navigation and exposure, allout includes:
 and many other features.
 
 Below is a description of the bindings, and then explanation of
-special allout-mode features and terminology.  See also the outline
+special `allout-mode' features and terminology.  See also the outline
 menubar additions for quick reference to many of the features, and see
-the docstring of the variable `allout-init' for instructions on
-priming your emacs session for automatic activation of allout-mode.
+the docstring of the function `allout-init' for instructions on
+priming your Emacs session for automatic activation of `allout-mode'.
 
 
 The bindings are dictated by the `allout-keybindings-list' and
@@ -1078,7 +1070,7 @@ C-c <     allout-shift-out        ... less deep.
 C-c<CR>        allout-rebullet-topic   Reconcile bullets of topic and its offspring
                                - distinctive bullets are not changed, others
                                  alternated according to nesting depth.
-C-c b  allout-rebullet-current-heading Prompt for alternate bullet for
+C-c *  allout-rebullet-current-heading Prompt for alternate bullet for
                                         current topic.
 C-c #  allout-number-siblings  Number bullets of topic and siblings - the
                                offspring are not affected.  With repeat
@@ -1107,7 +1099,7 @@ C-c = p   allout-flatten-exposed-to-buffer
                                Like above 'copy-exposed', but convert topic
                                prefixes to section.subsection... numeric
                                format.
-ESC ESC (allout-init t)        Setup emacs session for outline mode
+ESC ESC (allout-init t)        Setup Emacs session for outline mode
                                auto-activation.
 
                 HOT-SPOT Operation
@@ -1137,7 +1129,7 @@ twice in a row to get to the hot-spot.
 
 Topic hierarchy constituents - TOPICS and SUBTOPICS:
 
-TOPIC: A basic, coherent component of an emacs outline.  It can
+TOPIC: A basic, coherent component of an Emacs outline.  It can
        contain other topics, and it can be subsumed by other topics,
 CURRENT topic:
        The visible topic most immediately containing the cursor.
@@ -1173,10 +1165,10 @@ PREFIX: The leading text of a topic which which distinguishes it from
 PREFIX-LEAD:
        The string at the beginning of a topic prefix, normally a `.'.
        It can be customized by changing the setting of
-       `allout-header-prefix' and then reinitializing allout-mode.
+       `allout-header-prefix' and then reinitializing `allout-mode'.
 
        By setting the prefix-lead to the comment-string of a
-       programming language, you can embed allout-structuring in
+       programming language, you can embed outline structuring in
        program code without interfering with the language processing
        of that code.  See `allout-use-mode-specific-leader'
        docstring for more detail.
@@ -1237,7 +1229,7 @@ OPEN:     A topic that is not closed, though its offspring or body may be."
      ;; off on second invocation, so we detect it as best we can, and
      ;; skip everything.
      ((and same-complex-command                ; Still in same complex command
-                                      ; as last time allout-mode invoked.
+                                       ; as last time `allout-mode' invoked.
          active                        ; Already activated.
          (not explicit-activation)     ; Prop-line file-vars don't have args.
          (string-match "^19.1[89]"     ; Bug only known to be in v19.18 and
@@ -1252,19 +1244,6 @@ OPEN:    A topic that is not closed, though its offspring or body may be."
                                       ; active state or *de*activation
                                       ; specifically requested:
       (setq allout-explicitly-deactivated t)
-      (if (string-match "^18\." emacs-version)
-                                      ; Revoke those keys that remain
-                                      ; as we set them:
-         (let ((curr-loc (current-local-map)))
-          (mapcar (function
-                   (lambda (cell)
-                     (if (eq (lookup-key curr-loc (car cell))
-                             (car (cdr cell)))
-                         (define-key curr-loc (car cell)
-                           (assq (car cell) allout-prior-bindings)))))
-                  allout-added-bindings)
-          (allout-resumptions 'allout-added-bindings)
-          (allout-resumptions 'allout-prior-bindings)))
 
       (if allout-old-style-prefixes
          (progn
@@ -1273,9 +1252,9 @@ OPEN:     A topic that is not closed, though its offspring or body may be."
       (allout-resumptions 'selective-display)
       (if (and (boundp 'before-change-functions) before-change-functions)
          (allout-resumptions 'before-change-functions))
-      (setq local-write-file-hooks
-          (delq 'allout-write-file-hook
-                local-write-file-hooks))
+      (setq write-contents-functions
+           (delq 'allout-write-file-hook
+                 write-contents-functions))
       (allout-resumptions 'paragraph-start)
       (allout-resumptions 'paragraph-separate)
       (allout-resumptions (if (string-match "^18" emacs-version)
@@ -1315,20 +1294,13 @@ OPEN:   A topic that is not closed, though its offspring or body may be."
                     (cons '(allout-mode . allout-mode-map)
                           minor-mode-map-alist))))
 
-                                      ; V18 minor-mode key bindings:
-                                      ; Stash record of added bindings
-                                      ; for later revocation:
-       (allout-resumptions 'allout-added-bindings
-                           (list allout-keybindings-list))
-       (allout-resumptions 'allout-prior-bindings
-                           (list (current-local-map)))
                                       ; and add them:
        (use-local-map (produce-allout-mode-map allout-keybindings-list
                                                (current-local-map)))
        )
 
                                       ; selective-display is the
-                                      ; emacs conditional exposure
+                                      ; Emacs conditional exposure
                                       ; mechanism:
       (allout-resumptions 'selective-display '(t))
       (if allout-inhibit-protection
@@ -1340,7 +1312,7 @@ OPEN:     A topic that is not closed, though its offspring or body may be."
                                       ; Temporarily set by any outline
                                       ; functions that can be trusted to
                                       ; deal properly with concealed text.
-      (add-hook 'local-write-file-hooks 'allout-write-file-hook)
+      (add-hook 'write-contents-functions 'allout-write-file-hook)
                                       ; Custom auto-fill func, to support
                                       ; respect for topic headline,
                                       ; hanging-indents, etc:
@@ -1364,7 +1336,7 @@ OPEN:     A topic that is not closed, though its offspring or body may be."
 
       (or (assq 'allout-mode minor-mode-alist)
          (setq minor-mode-alist
-              (cons '(allout-mode " Outl") minor-mode-alist)))
+              (cons '(allout-mode " Allout") minor-mode-alist)))
 
       (allout-setup-menubar)
 
@@ -1432,7 +1404,7 @@ OPEN:     A topic that is not closed, though its offspring or body may be."
 (make-variable-buffer-local 'allout-recent-prefix-end)
 ;;;_  = allout-recent-end-of-subtree
 (defvar allout-recent-end-of-subtree 0
-  "Buffer point last returned by allout-end-of-current-subtree.")
+  "Buffer point last returned by `allout-end-of-current-subtree'.")
 (make-variable-buffer-local 'allout-recent-end-of-subtree)
 ;;;_  > allout-prefix-data (beg end)
 (defmacro allout-prefix-data (beg end)
@@ -1446,8 +1418,8 @@ For reference by `allout-recent' funcs.  Returns BEGINNING."
   "Return depth of last heading encountered by an outline maneuvering function.
 
 All outline functions which directly do string matches to assess
-headings set the variables allout-recent-prefix-beginning and
-allout-recent-prefix-end if successful.  This function uses those settings
+headings set the variables `allout-recent-prefix-beginning' and
+`allout-recent-prefix-end' if successful.  This function uses those settings
 to return the current depth."
 
   '(max 1 (- allout-recent-prefix-end
@@ -1455,11 +1427,11 @@ to return the current depth."
             allout-header-subtraction)))
 ;;;_  > allout-recent-prefix ()
 (defmacro allout-recent-prefix ()
-  "Like allout-recent-depth, but returns text of last encountered prefix.
+  "Like `allout-recent-depth', but returns text of last encountered prefix.
 
 All outline functions which directly do string matches to assess
-headings set the variables allout-recent-prefix-beginning and
-allout-recent-prefix-end if successful.  This function uses those settings
+headings set the variables `allout-recent-prefix-beginning' and
+`allout-recent-prefix-end' if successful.  This function uses those settings
 to return the current depth."
   '(buffer-substring allout-recent-prefix-beginning
                     allout-recent-prefix-end))
@@ -1468,8 +1440,8 @@ to return the current depth."
   "Like allout-recent-prefix, but returns bullet of last encountered prefix.
 
 All outline functions which directly do string matches to assess
-headings set the variables allout-recent-prefix-beginning and
-allout-recent-prefix-end if successful.  This function uses those settings
+headings set the variables `allout-recent-prefix-beginning' and
+`allout-recent-prefix-end' if successful.  This function uses those settings
 to return the current depth of the most recently matched topic."
   '(buffer-substring (1- allout-recent-prefix-end)
                     allout-recent-prefix-end))
@@ -1509,7 +1481,7 @@ Actually, returns prefix beginning point."
 ;;;_   : Location attributes
 ;;;_    > allout-depth ()
 (defsubst allout-depth ()
-  "Like allout-current-depth, but respects hidden as well as visible topics."
+  "Like `allout-current-depth', but respects hidden as well as visible topics."
   (save-excursion
     (if (allout-goto-prefix)
        (allout-recent-depth)
@@ -1562,7 +1534,7 @@ Actually, returns prefix beginning point."
 (defun allout-sibling-index (&optional depth)
   "Item number of this prospective topic among its siblings.
 
-If optional arg depth is greater than current depth, then we're
+If optional arg DEPTH is greater than current depth, then we're
 opening a new level, and return 0.
 
 If less than this depth, ascend to that depth and count..."
@@ -1647,10 +1619,9 @@ Return the location of the beginning of the heading, or nil if not found."
   "Produce a location \"chart\" of subtopics of the containing topic.
 
 Optional argument LEVELS specifies the depth \(relative to start
-depth) for the chart.  Subsequent optional args are not for public
-use.
+depth) for the chart.
 
-Charts are used to capture outline structure, so that allout-altering
+Charts are used to capture outline structure, so that outline altering
 routines need assess the structure only once, and then use the chart
 for their elaborate manipulations.
 
@@ -1661,9 +1632,11 @@ list containing, recursively, the charts for the respective subtopics.
 The chart for a topics' offspring precedes the entry for the topic
 itself.
 
-The other function parameters are for internal recursion, and should
-not be specified by external callers.  ORIG-DEPTH is depth of topic at
-starting point, and PREV-DEPTH is depth of prior topic."
+\(fn &optional levels)"
+
+  ;; The other function parameters are for internal recursion, and should
+  ;; not be specified by external callers.  ORIG-DEPTH is depth of topic at
+  ;; starting point, and PREV-DEPTH is depth of prior topic."
 
   (let ((original (not orig-depth))    ; `orig-depth' set only in recursion.
        chart curr-depth)
@@ -1677,7 +1650,7 @@ starting point, and PREV-DEPTH is depth of prior topic."
 
     ;; Loop over the current levels' siblings.  Besides being more
     ;; efficient than tail-recursing over a level, it avoids exceeding
-    ;; the typically quite constrained emacs max-lisp-eval-depth.
+    ;; the typically quite constrained Emacs max-lisp-eval-depth.
     ;;
     ;; Probably would speed things up to implement loop-based stack
     ;; operation rather than recursing for lower levels.  Bah.
@@ -1766,36 +1739,36 @@ start point."
        (setq chart (cdr chart))))
     result))
 ;;;_   X allout-chart-spec (chart spec &optional exposing)
-(defun allout-chart-spec (chart spec &optional exposing)
-  "Not yet \(if ever) implemented.
-
-Produce exposure directives given topic/subtree CHART and an exposure SPEC.
-
-Exposure spec indicates the locations to be exposed and the prescribed
-exposure status.  Optional arg EXPOSING is an integer, with 0
-indicating pending concealment, anything higher indicating depth to
-which subtopic headers should be exposed, and negative numbers
-indicating (negative of) the depth to which subtopic headers and
-bodies should be exposed.
-
-The produced list can have two types of entries.  Bare numbers
-indicate points in the buffer where topic headers that should be
-exposed reside.
-
- - bare negative numbers indicates that the topic starting at the
-   point which is the negative of the number should be opened,
-   including their entries.
- - bare positive values indicate that this topic header should be
-   opened.
- - Lists signify the beginning and end points of regions that should
-   be flagged, and the flag to employ.  (For concealment: `\(\?r\)', and
-   exposure:"
-  (while spec
-    (cond ((listp spec)
-          )
-         )
-    (setq spec (cdr spec)))
-  )
+;; (defun allout-chart-spec (chart spec &optional exposing)
+;;   "Not yet \(if ever) implemented.
+
+;; Produce exposure directives given topic/subtree CHART and an exposure SPEC.
+
+;; Exposure spec indicates the locations to be exposed and the prescribed
+;; exposure status.  Optional arg EXPOSING is an integer, with 0
+;; indicating pending concealment, anything higher indicating depth to
+;; which subtopic headers should be exposed, and negative numbers
+;; indicating (negative of) the depth to which subtopic headers and
+;; bodies should be exposed.
+
+;; The produced list can have two types of entries.  Bare numbers
+;; indicate points in the buffer where topic headers that should be
+;; exposed reside.
+
+;;  - bare negative numbers indicates that the topic starting at the
+;;    point which is the negative of the number should be opened,
+;;    including their entries.
+;;  - bare positive values indicate that this topic header should be
+;;    opened.
+;;  - Lists signify the beginning and end points of regions that should
+;;    be flagged, and the flag to employ.  (For concealment: `\(\?r\)', and
+;;    exposure:"
+;;   (while spec
+;;     (cond ((listp spec)
+;;        )
+;;       )
+;;     (setq spec (cdr spec)))
+;;   )
 
 ;;;_  - Within Topic
 ;;;_   > allout-goto-prefix ()
@@ -1890,7 +1863,7 @@ Returns that character position."
   "When not already there, position point at beginning of current topic's body.
 
 If already there, move cursor to bullet for hot-spot operation.
-\(See allout-mode doc string for details on hot-spot operation.)"
+\(See `allout-mode' doc string for details on hot-spot operation.)"
   (interactive)
   (let ((start-point (point)))
     (allout-end-of-prefix)
@@ -1926,16 +1899,12 @@ If already there, move cursor to bullet for hot-spot operation.
         (if (= (allout-recent-depth) depth)
             (progn (goto-char allout-recent-prefix-beginning)
                    depth)
-          (goto-char last-good)
-          nil))
-    (if (interactive-p) (allout-end-of-prefix))))
+          (goto-char last-good)))))
 ;;;_   > allout-ascend ()
 (defun allout-ascend ()
   "Ascend one level, returning t if successful, nil if not."
-  (prog1
-      (if (allout-beginning-of-level)
-         (allout-previous-heading))
-    (if (interactive-p) (allout-end-of-prefix))))
+  (if (allout-beginning-of-level)
+      (allout-previous-heading)))
 ;;;_   > allout-descend-to-depth (depth)
 (defun allout-descend-to-depth (depth)
   "Descend to depth DEPTH within current topic.
@@ -1955,13 +1924,13 @@ Returning depth if successful, nil if not."
       nil))
   )
 ;;;_   > allout-up-current-level (arg &optional dont-complain)
-(defun allout-up-current-level (arg &optional dont-complain)
+(defun allout-up-current-level (arg &optional dont-complain interactive)
   "Move out ARG levels from current visible topic.
 
 Positions on heading line of containing topic.  Error if unable to
 ascend that far, or nil if unable to ascend but optional arg
 DONT-COMPLAIN is non-nil."
-  (interactive "p")
+  (interactive "p\np")
   (allout-back-to-current-heading)
   (let ((present-level (allout-recent-depth))
        (last-good (point))
@@ -1982,18 +1951,18 @@ DONT-COMPLAIN is non-nil."
     (if (or failed
            (> arg 0))
        (progn (goto-char last-good)
-              (if (interactive-p) (allout-end-of-prefix))
+              (if interactive (allout-end-of-prefix))
               (if (not dont-complain)
                   (error "Can't ascend past outermost level")
-                (if (interactive-p) (allout-end-of-prefix))
+                (if interactive (allout-end-of-prefix))
                 nil))
-      (if (interactive-p) (allout-end-of-prefix))
+      (if interactive (allout-end-of-prefix))
       allout-recent-prefix-beginning)))
 
 ;;;_  - Linear
 ;;;_   > allout-next-sibling (&optional depth backward)
 (defun allout-next-sibling (&optional depth backward)
-  "Like allout-forward-current-level, but respects invisible topics.
+  "Like `allout-forward-current-level', but respects invisible topics.
 
 Traverse at optional DEPTH, or current depth if none specified.
 
@@ -2019,7 +1988,7 @@ Return depth if successful, nil otherwise."
         nil))))
 ;;;_   > allout-previous-sibling (&optional depth backward)
 (defun allout-previous-sibling (&optional depth backward)
-  "Like allout-forward-current-level,but backwards & respect invisible topics.
+  "Like `allout-forward-current-level', but backwards & respect invisible topics.
 
 Optional DEPTH specifies depth to traverse, default current depth.
 
@@ -2053,7 +2022,7 @@ Presumes point is at the start of a topic prefix."
   (let ((depth (allout-depth)))
     (while (allout-previous-sibling depth nil))
     (prog1 (allout-recent-depth)
-      (if (interactive-p) (allout-end-of-prefix)))))
+      (allout-end-of-prefix))))
 ;;;_   > allout-next-visible-heading (arg)
 (defun allout-next-visible-heading (arg)
   "Move to the next ARG'th visible heading line, backward if arg is negative.
@@ -2086,18 +2055,18 @@ buffer) if headings are exhausted."
   "Move to the previous heading line.
 
 With argument, repeats or can move forward if negative.
-A heading line is one that starts with a `*' (or that allout-regexp
+A heading line is one that starts with a `*' (or that `allout-regexp'
 matches)."
   (interactive "p")
   (allout-next-visible-heading (- arg)))
 ;;;_   > allout-forward-current-level (arg)
-(defun allout-forward-current-level (arg)
+(defun allout-forward-current-level (arg &optional interactive)
   "Position point at the next heading of the same level.
 
 Takes optional repeat-count, goes backward if count is negative.
 
 Returns resulting position, else nil if none found."
-  (interactive "p")
+  (interactive "p\np")
   (let ((start-depth (allout-current-depth))
        (start-point (point))
        (start-arg arg)
@@ -2125,7 +2094,7 @@ Returns resulting position, else nil if none found."
                  (= (allout-recent-depth) start-depth)))
        allout-recent-prefix-beginning
       (goto-char last-good)
-      (if (not (interactive-p))
+      (if (not interactive)
          nil
        (allout-end-of-prefix)
        (error "Hit %s level %d topic, traversed %d of %d requested"
@@ -2134,10 +2103,10 @@ Returns resulting position, else nil if none found."
               (- (abs start-arg) arg)
               (abs start-arg))))))
 ;;;_   > allout-backward-current-level (arg)
-(defun allout-backward-current-level (arg)
+(defun allout-backward-current-level (arg &optional interactive)
   "Inverse of `allout-forward-current-level'."
-  (interactive "p")
-  (if (interactive-p)
+  (interactive "p\np")
+  (if interactive
       (let ((current-prefix-arg (* -1 arg)))
        (call-interactively 'allout-forward-current-level))
     (allout-forward-current-level (* -1 arg))))
@@ -2163,7 +2132,7 @@ Changes to concealed regions are ignored while file is being written.
 writes, like crypt and zip modes.)
 
 Locally bound in outline buffers to `before-change-functions', which
-in emacs 19 is run before any change to the buffer.
+in Emacs 19 is run before any change to the buffer.
 
 Any functions which set [`this-command' to `undo', or which set]
 `allout-override-protect' non-nil (as does, eg, allout-flag-chars)
@@ -2178,7 +2147,7 @@ are exempt from this restriction."
                                        ; Both beginning and end chars must
                                        ; be exposed:
             (save-excursion (if (memq this-command '(newline open-line))
-                                ;; Compensate for stupid emacs {new,
+                                ;; Compensate for stupid Emacs {new,
                                 ;; open-}line display optimization:
                                 (setq beg (1+ beg)
                                       end (1+ end)))
@@ -2190,7 +2159,7 @@ are exempt from this restriction."
       (save-match-data
        (if (equal this-command 'undo)
                 ;; Allow undo without inhibition.
-                ;; - Undoing new and open-line hits stupid emacs redisplay
+                ;; - Undoing new and open-line hits stupid Emacs redisplay
                 ;;   optimization (em 19 cmds.c, ~ line 200).
                 ;; - Presumably, undoing what was properly protected when
                 ;;   done.
@@ -2266,23 +2235,23 @@ are exempt from this restriction."
   "Outline internal var, for `allout-pre-command-business' hot-spot operation.
 
 When set, tells post-processing to reposition on topic bullet, and
-then unset it.  Set by allout-pre-command-business when implementing
+then unset it.  Set by `allout-pre-command-business' when implementing
 hot-spot operation, where literal characters typed over a topic bullet
 are mapped to the command of the corresponding control-key on the
-allout-mode-map.")
+`allout-mode-map'.")
 (make-variable-buffer-local 'allout-post-goto-bullet)
 ;;;_   > allout-post-command-business ()
 (defun allout-post-command-business ()
-  "Outline post-command-hook function.
+  "Outline `post-command-hook' function.
 
-- Null allout-override-protect, so it's not left open.
+- Null `allout-override-protect', so it's not left open.
 
-- Implement (and clear) allout-post-goto-bullet, for hot-spot
+- Implement (and clear) `allout-post-goto-bullet', for hot-spot
   outline commands.
 
 - Massages buffer-undo-list so successive, standard character self-inserts are
   aggregated.  This kludge compensates for lack of undo bunching when
-  before-change-functions is used."
+  `before-change-functions' is used."
 
                                        ; Apply any external change func:
   (if (not (allout-mode-p))            ; In allout-mode.
@@ -2329,20 +2298,20 @@ allout-mode-map.")
     ))
 ;;;_   > allout-pre-command-business ()
 (defun allout-pre-command-business ()
-  "Outline pre-command-hook function for outline buffers.
-Implements special behavior when cursor is on bullet char.
+  "Outline `pre-command-hook' function for outline buffers.
+Implements special behavior when cursor is on bullet character.
 
-Self-insert characters are reinterpreted control-character references
-into the allout-mode-map.  The allout-mode post-command hook will
-position a cursor that has moved as a result of such reinterpretation,
-on the destination topic's bullet, when the cursor wound up in the
+When the cursor is on the bullet character, self-insert characters are
+reinterpreted as the corresponding control-character in the
+`allout-mode-map'.  The `allout-mode' `post-command-hook' insures that
+the cursor which has moved as a result of such reinterpretation is
+positioned on the bullet character of the destination topic.
 
 The upshot is that you can get easy, single (ie, unmodified) key
 outline maneuvering operations by positioning the cursor on the bullet
-char.  You stay in this mode until you use some regular
-cursor-positioning command to relocate the cursor off of a bullet
-char."
-
+char.  When in this mode you can use regular cursor-positioning
+command/keystrokes to relocate the cursor off of a bullet character to
+return to regular interpretation of self-insert characters."
   (if (not (allout-mode-p))
       ;; Shouldn't be invoked if not in allout allout-mode, but just in case:
       nil
@@ -2356,7 +2325,7 @@ char."
        (let* ((this-key-num (cond
                              ((numberp last-command-char)
                               last-command-char)
-                             ;; XXX Only xemacs has characterp.
+                             ;; XXX Only XEmacs has characterp.
                              ((and (fboundp 'characterp)
                                    (characterp last-command-char))
                               (char-to-int last-command-char))
@@ -2381,7 +2350,7 @@ char."
                      this-command mapped-binding)))))))
 ;;;_   > allout-find-file-hook ()
 (defun allout-find-file-hook ()
-  "Activate allout-mode when `allout-auto-activation' & `allout-layout' are non-nil.
+  "Activate `allout-mode' when `allout-auto-activation' & `allout-layout' are non-nil.
 
 See `allout-init' for setup instructions."
   (if (and allout-auto-activation
@@ -2392,7 +2361,7 @@ See `allout-init' for setup instructions."
 (defun allout-isearch-rectification ()
   "Rectify outline exposure before, during, or after isearch.
 
-Called as part of allout-post-command-business."
+Called as part of `allout-post-command-business'."
 
   (let ((isearching (and (boundp 'isearch-mode) isearch-mode)))
     (cond ((and isearching (not allout-pre-was-isearching))
@@ -2410,7 +2379,7 @@ Called as part of allout-post-command-business."
 
 ;;;_   > allout-flag-region (from to flag)
 (defmacro allout-flag-region (from to flag)
-  "Hide or show lines from FROM to TO, via emacs selective-display FLAG char.
+  "Hide or show lines from FROM to TO, via Emacs selective-display FLAG char.
 Ie, text following flag C-m \(carriage-return) is hidden until the
 next C-j (newline) char.
 
@@ -2423,7 +2392,7 @@ Returns the endpoint of the region."
 
 ;;;_   > allout-isearch-expose (mode)
 (defun allout-isearch-expose (mode)
-  "Mode is either 'clear, 'start, 'continue, or 'final."
+  "MODE is either 'clear, 'start, 'continue, or 'final."
   ;; allout-isearch-prior-pos encodes exposure status of prior pos:
   ;; (pos was-vis header-pos end-pos)
   ;; pos       - point of concern
@@ -2452,18 +2421,18 @@ Returns the endpoint of the region."
   (setq allout-isearch-did-quit nil))
 ;;;_   > allout-enwrap-isearch ()
 (defun allout-enwrap-isearch ()
-  "Impose allout-mode isearch-abort wrapper for dynamic exposure in isearch.
+  "Impose `allout-mode' isearch-abort wrapper for dynamic exposure in isearch.
 
 The function checks to ensure that the rebinding is done only once."
 
   (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification)
   (if (fboundp 'allout-real-isearch-abort)
-      ;; 
+      ;;
       nil
                                         ; Ensure load of isearch-mode:
     (if (or (and (fboundp 'isearch-mode)
                  (fboundp 'isearch-abort))
-            (condition-case error 
+            (condition-case error
                 (load-library "isearch-mode")
               ('file-error (message
                            "Skipping isearch-mode provisions - %s '%s'"
@@ -2474,7 +2443,7 @@ The function checks to ensure that the rebinding is done only once."
                           (setq allout-isearch-dynamic-expose nil))))
         ;; Isearch-mode loaded, encapsulate specific entry points for
         ;; outline dynamic-exposure business:
-        (progn 
+        (progn
          ;; stash crucial isearch-mode funcs under known, private
          ;; names, then register wrapper functions under the old
          ;; names, in their stead:
@@ -2482,7 +2451,7 @@ The function checks to ensure that the rebinding is done only once."
           (fset 'isearch-abort 'allout-isearch-abort)))))
 ;;;_   > allout-isearch-abort ()
 (defun allout-isearch-abort ()
-  "Wrapper for allout-real-isearch-abort \(which see), to register
+  "Wrapper for `allout-real-isearch-abort' \(which see), to register
 actual quits."
   (interactive)
   (setq allout-isearch-did-quit nil)
@@ -2494,7 +2463,7 @@ actual quits."
 ;;; Prevent unnecessary font-lock while isearching!
 (defvar isearch-was-font-locking nil)
 (defun isearch-inhibit-font-lock ()
-  "Inhibit font-lock while isearching - for use on isearch-mode-hook."
+  "Inhibit `font-lock-mode' while isearching - for use on `isearch-mode-hook'."
   (if (and (allout-mode-p) (boundp 'font-lock-mode) font-lock-mode)
       (setq isearch-was-font-locking t
            font-lock-mode nil)))
@@ -2532,7 +2501,7 @@ Offer one suitable for current depth DEPTH as default."
   )
 ;;;_   > allout-distinctive-bullet (bullet)
 (defun allout-distinctive-bullet (bullet)
-  "True if bullet is one of those on allout-distinctive-bullets-string."
+  "True if BULLET is one of those on `allout-distinctive-bullets-string'."
   (string-match (regexp-quote bullet) allout-distinctive-bullets-string))
 ;;;_   > allout-numbered-type-prefix (&optional prefix)
 (defun allout-numbered-type-prefix (&optional prefix)
@@ -2572,7 +2541,7 @@ All the arguments are optional.
 
 PRIOR-BULLET indicates the bullet of the prefix being changed, or
 nil if none.  This bullet may be preserved (other options
-notwithstanding) if it is on the allout-distinctive-bullets-string,
+notwithstanding) if it is on the `allout-distinctive-bullets-string',
 for instance.
 
 Second arg NEW indicates that a new topic is being opened after the
@@ -2704,7 +2673,7 @@ index for each successive sibling)."
   )
 ;;;_   > allout-open-topic (relative-depth &optional before use_sib_bullet)
 (defun allout-open-topic (relative-depth &optional before use_sib_bullet)
-  "Open a new topic at depth DEPTH.
+  "Open a new topic at depth RELATIVE-DEPTH.
 
 New topic is situated after current one, unless optional flag BEFORE
 is non-nil, or unless current line is complete empty (not even
@@ -2904,10 +2873,10 @@ topic prior to the current one."
 ;;;_   : Topic Modification
 ;;;_    = allout-former-auto-filler
 (defvar allout-former-auto-filler nil
-  "Name of modal fill function being wrapped by allout-auto-fill.")
+  "Name of modal fill function being wrapped by `allout-auto-fill'.")
 ;;;_    > allout-auto-fill ()
 (defun allout-auto-fill ()
-  "Allout-mode autofill function.
+  "`allout-mode' autofill function.
 
 Maintains outline hanging topic indentation if
 `allout-use-hanging-indents' is set."
@@ -2925,7 +2894,7 @@ Maintains outline hanging topic indentation if
         (do-auto-fill))))
 ;;;_    > allout-reindent-body (old-depth new-depth &optional number)
 (defun allout-reindent-body (old-depth new-depth &optional number)
-  "Reindent body lines which were indented at old-depth to new-depth.
+  "Reindent body lines which were indented at OLD-DEPTH to NEW-DEPTH.
 
 Optional arg NUMBER indicates numbering is being added, and it must
 be accommodated.
@@ -2999,30 +2968,28 @@ Note that refill of indented paragraphs is not done."
 
   "Adjust bullet of current topic prefix.
 
-All args are optional.
-
 If SOLICIT is non-nil, then the choice of bullet is solicited from
 user.  If it's a character, then that character is offered as the
 default, otherwise the one suited to the context \(according to
 distinction or depth) is offered.  If non-nil, then the
 context-specific bullet is just used.
 
-Second arg DEPTH forces the topic prefix to that depth, regardless
+Second arg NEW-DEPTH forces the topic prefix to that depth, regardless
 of the topic's current depth.
 
 Third arg NUMBER-CONTROL can force the prefix to or away from
 numbered form.  It has effect only if `allout-numbered-bullet' is
 non-nil and soliciting was not explicitly invoked (via first arg).
 Its effect, numbering or denumbering, then depends on the setting
-of the forth arg, INDEX.
+of the fourth arg, INDEX.
 
-If NUMBER-CONTROL is non-nil and forth arg INDEX is nil, then the
+If NUMBER-CONTROL is non-nil and fourth arg INDEX is nil, then the
 prefix of the topic is forced to be non-numbered.  Null index and
 non-nil NUMBER-CONTROL forces denumbering.  Non-nil INDEX (and
 non-nil NUMBER-CONTROL) forces a numbered-prefix form.  If non-nil
 INDEX is a number, then that number is used for the numbered
 prefix.  Non-nil and non-number means that the index for the
-numbered prefix will be derived by allout-make-topic-prefix.
+numbered prefix will be derived by `allout-make-topic-prefix'.
 
 Fifth arg DO-SUCCESSORS t means re-resolve count on succeeding
 siblings.
@@ -3089,7 +3056,7 @@ this function."
   ) ; defun
 ;;;_    > allout-rebullet-topic (arg)
 (defun allout-rebullet-topic (arg)
-  "Like allout-rebullet-topic-grunt, but start from topic visible at point.
+  "Like `allout-rebullet-topic-grunt', but start from topic visible at point.
 
 Descends into invisible as well as visible topics, however.
 
@@ -3117,16 +3084,16 @@ With repeat count, shift topic depth by that amount."
                                                do-successors)
 
   "Rebullet the topic at point, visible or invisible, and all
-contained subtopics.  See allout-rebullet-heading for rebulleting
+contained subtopics.  See `allout-rebullet-heading' for rebulleting
 behavior.
 
-All arguments are optional.
-
-First arg RELATIVE-DEPTH means to shift the depth of the entire
+Arg RELATIVE-DEPTH means to shift the depth of the entire
 topic that amount.
 
-The rest of the args are for internal recursive use by the function
-itself.  The are STARTING-DEPTH, STARTING-POINT, and INDEX."
+\(fn &optional RELATIVE-DEPTH)"
+
+  ;; All args except the first one are for internal recursive use by the
+  ;; function itself.
 
   (let* ((relative-depth (or relative-depth 0))
          (new-depth (allout-depth))
@@ -3322,7 +3289,7 @@ Leaves primary topic's trailing vertical whitespace, if any."
 ;;;_    > allout-yank-processing ()
 (defun allout-yank-processing (&optional arg)
 
-  "Incidental allout-specific business to be done just after text yanks.
+  "Incidental outline specific business to be done just after text yanks.
 
 Does depth adjustment of yanked topics, when:
 
@@ -3338,7 +3305,7 @@ header into which it's being yanked.
 
 The point is left in front of yanked, adjusted topics, rather than
 at the end (and vice-versa with the mark).  Non-adjusted yanks,
-however, are left exactly like normal, non-allout-specific yanks."
+however, are left exactly like normal, not outline specific yanks."
 
   (interactive "*P")
                                        ; Get to beginning, leaving
@@ -3448,14 +3415,14 @@ however, are left exactly like normal, non-allout-specific yanks."
       (exchange-point-and-mark))))
 ;;;_    > allout-yank (&optional arg)
 (defun allout-yank (&optional arg)
-  "Allout-mode yank, with depth and numbering adjustment of yanked topics.
+  "`allout-mode' yank, with depth and numbering adjustment of yanked topics.
 
 Non-topic yanks work no differently than normal yanks.
 
 If a topic is being yanked into a bare topic prefix, the depth of the
 yanked topic is adjusted to the depth of the topic prefix.
 
-  1 we're yanking in an allout-mode buffer
+  1 we're yanking in an `allout-mode' buffer
   2 the stuff being yanked starts with a valid outline header prefix, and
   3 it is being yanked at the end of a line which consists of only a valid
     topic prefix.
@@ -3472,7 +3439,7 @@ exactly like normal yanks.
 Numbering of yanked topics, and the successive siblings at the depth
 into which they're being yanked, is adjusted.
 
-Allout-yank-pop works with allout-yank just like normal yank-pop
+`allout-yank-pop' works with `allout-yank' just like normal yank-pop
 works with normal yank in non-outline buffers."
 
   (interactive "*P")
@@ -3482,7 +3449,7 @@ works with normal yank in non-outline buffers."
       (allout-yank-processing)))
 ;;;_    > allout-yank-pop (&optional arg)
 (defun allout-yank-pop (&optional arg)
-  "Yank-pop like allout-yank when popping to bare outline prefixes.
+  "Yank-pop like `allout-yank' when popping to bare outline prefixes.
 
 Adapts level of popped topics to level of fresh prefix.
 
@@ -3561,7 +3528,7 @@ See `allout-flag-region' for more details."
 
 This is a way to give restricted peek at a concealed locality without the
 expense of exposing its context, but can leave the outline with aberrant
-exposure.  allout-hide-current-entry-completely or allout-show-offshoot
+exposure.  `allout-hide-current-entry-completely' or `allout-show-to-offshoot'
 should be used after the peek to rectify the exposure."
 
   (interactive)
@@ -3583,7 +3550,7 @@ should be used after the peek to rectify the exposure."
 
   "If point is visible, show all direct subheadings of this heading.
 
-Otherwise, do allout-show-to-offshoot, and then show subheadings.
+Otherwise, do `allout-show-to-offshoot', and then show subheadings.
 
 Optional LEVEL specifies how many levels below the current level
 should be shown, or all levels if t.  Default is 1.
@@ -3633,7 +3600,7 @@ point of non-opened subtree?)"
   "Like `allout-hide-current-entry'; hides completely if within hidden region.
 
 Specifically intended for aberrant exposure states, like entries that were
-exposed by allout-show-entry but are within otherwise concealed regions."
+exposed by `allout-show-entry' but are within otherwise concealed regions."
   (interactive)
   (save-excursion
     (allout-goto-prefix)
@@ -3645,10 +3612,10 @@ exposed by allout-show-entry but are within otherwise concealed regions."
                          ?\r)))
 ;;;_   > allout-show-to-offshoot ()
 (defun allout-show-to-offshoot ()
-  "Like allout-show-entry, but reveals all concealed ancestors, as well.
+  "Like `allout-show-entry', but reveals all concealed ancestors, as well.
 
-As with allout-hide-current-entry-completely, useful for rectifying
-aberrant exposure states produced by allout-show-entry."
+As with `allout-hide-current-entry-completely', useful for rectifying
+aberrant exposure states produced by `allout-show-entry'."
 
   (interactive)
   (save-excursion
@@ -3698,10 +3665,10 @@ aberrant exposure states produced by allout-show-entry."
 ;;;_   > allout-hide-current-entry-completely ()
 ; ... allout-hide-current-entry-completely also for isearch dynamic exposure:
 (defun allout-hide-current-entry-completely ()
-  "Like allout-hide-current-entry, but conceal topic completely.
+  "Like `allout-hide-current-entry', but conceal topic completely.
 
 Specifically intended for aberrant exposure states, like entries that were
-exposed by allout-show-entry but are within otherwise concealed regions."
+exposed by `allout-show-entry' but are within otherwise concealed regions."
   (interactive)
   (save-excursion
     (allout-goto-prefix)
@@ -3925,11 +3892,7 @@ Examples:
       max-pos)))
 ;;;_   > allout-old-expose-topic (spec &rest followers)
 (defun allout-old-expose-topic (spec &rest followers)
-
-  "Deprecated.  Use allout-expose-topic \(with different schema
-format) instead.
-
-Dictate wholesale exposure scheme for current topic, according to SPEC.
+  "Dictate wholesale exposure scheme for current topic, according to SPEC.
 
 SPEC is either a number or a list.  Optional successive args
 dictate exposure for subsequent siblings of current topic.
@@ -3956,7 +3919,7 @@ dictates the exposure depth of the topic as a whole.  Subsequent
 elements of the list are nested SPECs, dictating the specific exposure
 for the corresponding offspring of the topic.
 
-Optional FOLLOWER arguments dictate exposure for succeeding siblings."
+Optional FOLLOWERS arguments dictate exposure for succeeding siblings."
 
   (interactive "xExposure spec: ")
   (let ((depth (allout-current-depth))
@@ -4001,11 +3964,14 @@ Optional FOLLOWER arguments dictate exposure for succeeding siblings."
       (allout-old-expose-topic (car followers))
       (setq followers (cdr followers)))
     max-pos))
+(make-obsolete 'allout-old-expose-topic
+               "use `allout-expose-topic' (with different schema format) instead."
+               "19.23")
 ;;;_   > allout-new-exposure '()
 (defmacro allout-new-exposure (&rest spec)
   "Literal frontend for `allout-expose-topic', doesn't evaluate arguments.
-Some arguments that would need to be quoted in allout-expose-topic
-need not be quoted in allout-new-exposure.
+Some arguments that would need to be quoted in `allout-expose-topic'
+need not be quoted in `allout-new-exposure'.
 
 Cursor is left at start position.
 
@@ -4031,9 +3997,7 @@ Examples:
        (list 'allout-expose-topic (list 'quote spec))))
 ;;;_   > allout-exposure '()
 (defmacro allout-exposure (&rest spec)
-  "Being deprecated - use more recent `allout-new-exposure' instead.
-
-Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments
+  "Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments
 and retains start position."
   (list 'save-excursion
        '(if (not (or (allout-goto-prefix)
@@ -4041,6 +4005,7 @@ and retains start position."
             (error "Can't find any outline topics"))
        (cons 'allout-old-expose-topic
              (mapcar (function (lambda (x) (list 'quote x))) spec))))
+(make-obsolete 'allout-exposure 'allout-new-exposure "19.23")
 
 ;;;_ #7 Systematic outline presentation - copying, printing, flattening
 
@@ -4052,7 +4017,7 @@ and retains start position."
 
 Optional arg CONTEXT indicates interior levels to include."
   (let ((delim ".")
-       result 
+       result
        numstr
        (context-depth (or (and context 2) 1)))
     ;; Take care of the explicit context:
@@ -4095,7 +4060,7 @@ Optional arg CONTEXT indicates interior levels to include."
 (defun allout-stringify-flat-index-indented (flat-index)
   "Convert list representing section/subsection/... to document string."
   (let ((delim ".")
-       result 
+       result
        numstr)
     ;; Take care of the explicit context:
     (setq numstr (int-to-string (car flat-index))
@@ -4248,12 +4213,10 @@ header and body.  The elements of that list are:
 ;;;_   > allout-process-exposed (&optional func from to frombuf
 ;;;                                        tobuf format)
 (defun allout-process-exposed (&optional func from to frombuf tobuf
-                                         format &optional start-num)
+                                         format start-num)
   "Map function on exposed parts of current topic; results to another buffer.
 
-All args are options; default values itemized below.
-
-Apply FUNCTION to exposed portions FROM position TO position in buffer
+Apply FUNC to exposed portions FROM position TO position in buffer
 FROMBUF to buffer TOBUF.  Sixth optional arg, FORMAT, designates an
 alternate presentation form:
 
@@ -4266,7 +4229,7 @@ alternate presentation form:
                       except for distinctive bullets.
 
 Defaults:
-  FUNCTION:    `allout-insert-listified'
+  FUNC:                `allout-insert-listified'
   FROM:                region start, if region active, else start of buffer
   TO:          region end, if region active, else end of buffer
   FROMBUF:     current buffer
@@ -4311,11 +4274,13 @@ Defaults:
 (defun allout-insert-listified (listified)
   "Insert contents of listified outline portion in current buffer.
 
-Listified is a list representing each topic header and body:
+LISTIFIED is a list representing each topic header and body:
 
  \`(depth prefix text)'
 
-or \`(depth prefix text bullet-plus)'
+or
+
+ \`(depth prefix text bullet-plus)'
 
 If `bullet-plus' is specified, it is inserted just after the entire prefix."
   (setq listified (cdr listified))
@@ -4381,14 +4346,14 @@ alternate presentation format for the outline:
 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf)
   "Present numeric outline of outline's exposed portions in another buffer.
 
-The resulting outline is not compatable with outline mode - use
+The resulting outline is not compatible with outline mode - use
 `allout-copy-exposed-to-buffer' if you want that.
 
 Use `allout-indented-exposed-to-buffer' for indented presentation.
 
 With repeat count, copy the exposed portions of only current topic.
 
-Other buffer has current buffers name with \" exposed\" appended to
+Other buffer has current buffer's name with \" exposed\" appended to
 it, unless optional second arg TOBUF is specified, in which case it is
 used verbatim."
   (interactive "P")
@@ -4397,22 +4362,22 @@ used verbatim."
 (defun allout-indented-exposed-to-buffer (&optional arg tobuf)
   "Present indented outline of outline's exposed portions in another buffer.
 
-The resulting outline is not compatable with outline mode - use
+The resulting outline is not compatible with outline mode - use
 `allout-copy-exposed-to-buffer' if you want that.
 
 Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation.
 
 With repeat count, copy the exposed portions of only current topic.
 
-Other buffer has current buffers name with \" exposed\" appended to
+Other buffer has current buffer's name with \" exposed\" appended to
 it, unless optional second arg TOBUF is specified, in which case it is
 used verbatim."
   (interactive "P")
   (allout-copy-exposed-to-buffer arg tobuf 'indent))
 
 ;;;_  - LaTeX formatting
-;;;_   > allout-latex-verb-quote (str &optional flow)
-(defun allout-latex-verb-quote (str &optional flow)
+;;;_   > allout-latex-verb-quote (string &optional flow)
+(defun allout-latex-verb-quote (string &optional flow)
   "Return copy of STRING for literal reproduction across latex processing.
 Expresses the original characters \(including carriage returns) of the
 string across latex processing."
@@ -4422,7 +4387,7 @@ string across latex processing."
                       (concat "\\char" (number-to-string char) "{}"))
                      ((= char ?\n) "\\\\")
                      (t (char-to-string char)))))
-            str
+            string
             ""))
 ;;;_   > allout-latex-verbatim-quote-curr-line ()
 (defun allout-latex-verbatim-quote-curr-line ()
@@ -4443,12 +4408,12 @@ environment.  Leaves point at the end of the line."
       (insert "\\")
       (setq end (1+ end))
       (goto-char (1+ (match-end 0))))))
-;;;_   > allout-insert-latex-header (buf)
-(defun allout-insert-latex-header (buf)
+;;;_   > allout-insert-latex-header (buffer)
+(defun allout-insert-latex-header (buffer)
   "Insert initial latex commands at point in BUFFER."
   ;; Much of this is being derived from the stuff in appendix of E in
   ;; the TeXBook, pg 421.
-  (set-buffer buf)
+  (set-buffer buffer)
   (let ((doc-style (format "\n\\documentstyle{%s}\n"
                           "report"))
        (page-numbering (if allout-number-pages
@@ -4517,10 +4482,10 @@ environment.  Leaves point at the end of the line."
                    hoffset
                    vspace)
            )))
-;;;_   > allout-insert-latex-trailer (buf)
-(defun allout-insert-latex-trailer (buf)
+;;;_   > allout-insert-latex-trailer (buffer)
+(defun allout-insert-latex-trailer (buffer)
   "Insert concluding latex commands at point in BUFFER."
-  (set-buffer buf)
+  (set-buffer buffer)
   (insert "\n\\end{document}\n"))
 ;;;_   > allout-latexify-one-item (depth prefix bullet text)
 (defun allout-latexify-one-item (depth prefix bullet text)
@@ -4533,7 +4498,7 @@ BULLET string, and a list of TEXT strings for the body."
         (curr-line)
         body-content bop)
                                        ; Do the head line:
-    (insert (concat "\\OneHeadLine{\\verb\1 " 
+    (insert (concat "\\OneHeadLine{\\verb\1 "
                    (allout-latex-verb-quote bullet)
                    "\1}{"
                    depth
@@ -4731,11 +4696,11 @@ function.  If HOOK is void, it is first set to nil."
                 (cons function (symbol-value hook)))))))
 ;;;_  : my-mark-marker to accommodate divergent emacsen:
 (defun my-mark-marker (&optional force buffer)
-  "Accommodate the different signature for mark-marker across emacsen.
+  "Accommodate the different signature for mark-marker across Emacsen.
 
-GNU XEmacs takes two optional args, while mainline GNU Emacs does not,
+XEmacs takes two optional args, while GNU Emacs does not,
 so pass them along when appropriate."
-  (if (string-match " XEmacs " emacs-version)
+  (if (featurep 'xemacs)
       (mark-marker force buffer)
     (mark-marker)))
 
@@ -4769,4 +4734,5 @@ so pass them along when appropriate."
 ;;;allout-layout: (0 : -1 -1 0)
 ;;;End:
 
+;;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c
 ;;; allout.el ends here