(completion-fixup-function): Variable deleted.
[bpt/emacs.git] / lisp / allout.el
index 723d305..dd39534 100644 (file)
@@ -1,12 +1,12 @@
-;;;_* allout.el - Extensive outline mode for use alone and with other modes.
+;;; allout.el --- Extensive outline mode for use alone and with other modes.
 
-;;;_* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-;; Author: Ken Manheimer <klm@nist.gov>
-;; Maintainer: Ken Manheimer <klm@nist.gov>
+;; Author: Ken Manheimer <klm@python.org>
+;; Maintainer: Ken Manheimer <klm@python.org>
 ;; Created: Dec 1991 - first release to usenet
-;; Version: $Id: allout.el,v 4.1 1994/05/05 23:52:43 klm Exp klm $||
-;; Keywords: outline mode
+;; Version: Id: allout.el,v 4.3 1994/05/12 17:43:08 klm Exp ||
+;; Keywords: outlines
 
 ;; This file is part of GNU Emacs.
 
@@ -21,8 +21,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;;_* Commentary:
 
 ;; supporting outline structuring and manipulation of syntax-
 ;; sensitive text, eg programming languages.  (For an example, see the
 ;; allout code itself, which is organized in outline structure.)
-;; 
+;;
 ;; It also includes such things as topic-oriented repositioning, cut, and
 ;; paste; integral outline exposure-layout; incremental search with
-;; dynamic exposure/conceament of concealed text; automatic topic-number
+;; dynamic exposure/concealment of concealed text; automatic topic-number
 ;; maintenance; and many other features.
-;; 
+;;
 ;; See the docstring of the variables `outline-layout' and
 ;; `outline-auto-activation' for details on automatic activation of
 ;; allout outline-mode as a minor mode.  (It has changed since allout
 ;; 3.x, for those of you that depend on the old method.)
 ;;
-;; Note - the lines beginning with ';;;_' are outline topic headers.
-;;        Just 'ESC-x eval-current-buffer' to give it a whirl.
+;; Note - the lines beginning with `;;;_' are outline topic headers.
+;;        Just `ESC-x eval-current-buffer' to give it a whirl.
 
 ;;Ken Manheimer                                           301 975-3539
 ;;ken.manheimer@nist.gov                          FAX: 301 963-9137
 (provide 'allout)
 
 ;;;_* USER CUSTOMIZATION VARIABLES:
+(defgroup allout nil
+  "Extensive outline mode for use alone and with other modes."
+  :prefix "outline-"
+  :group 'outlines)
 
 ;;;_ + Layout, Mode, and Topic Header Configuration
 
@@ -79,8 +84,8 @@ With value `t', auto-mode-activation and auto-layout are enabled.
 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, auto-
-layout is not.
+With value `activate', only auto-mode-activation is enabled,
+auto-layout is not.
 
 With value `nil', neither auto-mode-activation nor auto-layout are
 enabled.
@@ -94,9 +99,9 @@ this variable.")
 Buffer-specific.
 
 A list value specifies a default layout for the current buffer, to be
-applied upon activation of allout outline-mode.  Any non-nil value
-will automatically trigger allout outline-mode, provided `outline-
-init' has been called to enable it.
+applied upon activation of allout outline-mode.  Any non-nil value will
+automatically trigger allout outline-mode, provided `outline-init'
+has been called to enable it.
 
 See the docstring for `outline-init' for details on setting up for
 auto-mode-activation, and for `outline-expose-topic' for the format of
@@ -104,7 +109,7 @@ the layout specification.
 
 You can associate a particular outline layout with a file by setting
 this var via the file's local variables.  For example, the following
-lines at the bottom of an elisp file:
+lines at the bottom of an Emacs Lisp file:
 
 ;;;Local variables:
 ;;;outline-layout: \(0 : -1 -1 0\)
@@ -115,50 +120,55 @@ activated when the file is visited, followed by the equivalent of
 `\(outline-expose-topic 0 : -1 -1 0\)'.  \(This is the layout used for
 the allout.el, itself.)
 
-Also, allout's mode-specific provisions will make topic prefixes
-default to the comment-start string, if any, of the language of the
-file.  This is modulo the setting of `outline-use-mode-specific-
-leader', which see.") 
+Also, allout's mode-specific provisions will make topic prefixes default
+to the comment-start string, if any, of the language of the file.  This
+is modulo the setting of `outline-use-mode-specific-leader', which see.")
 (make-variable-buffer-local 'outline-layout)
 
 ;;;_  = outline-header-prefix
-(defvar outline-header-prefix "."
+(defcustom outline-header-prefix "."
   "*Leading string which helps distinguish topic headers.
 
 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 outline-primary-bullet.  Many
-outlines start at level 2 to avoid this discrepancy.")
+outlines start at level 2 to avoid this discrepancy."
+  :type 'string
+  :group 'allout)
 (make-variable-buffer-local 'outline-header-prefix)
 ;;;_  = outline-primary-bullet
-(defvar outline-primary-bullet "*"
+(defcustom outline-primary-bullet "*"
   "Bullet used for top-level outline topics.
 
 Outline topic header lines are identified by a leading topic header
 prefix, which is concluded by bullets that includes the value of this
 var and the respective outline-*-bullets-string vars.
 
-The value of an asterisk ('*') provides for backwards compatability
+The value of an asterisk (`*') provides for backwards compatibility
 with the original emacs outline mode.  See outline-plain-bullets-string
 and outline-distinctive-bullets-string for the range of available
-bullets.")
+bullets."
+  :type 'string
+  :group 'allout)
 (make-variable-buffer-local 'outline-primary-bullet)
 ;;;_  = outline-plain-bullets-string
-(defvar outline-plain-bullets-string (concat outline-primary-bullet
+(defcustom outline-plain-bullets-string (concat outline-primary-bullet
                                             "+-:.;,")
   "*The bullets normally used in outline topic prefixes.
 
-See 'outline-distinctive-bullets-string' for the other kind of
+See `outline-distinctive-bullets-string' for the other kind of
 bullets.
 
-DO NOT include the close-square-bracket, ']', as a bullet.
+DO NOT include the close-square-bracket, `]', as a bullet.
 
 Outline mode has to be reactivated in order for changes to the value
-of this var to take effect.")
+of this var to take effect."
+  :type 'string
+  :group 'allout)
 (make-variable-buffer-local 'outline-plain-bullets-string)
 ;;;_  = outline-distinctive-bullets-string
-(defvar outline-distinctive-bullets-string "=>([{}&!?#%\"X@$~\\"
+(defcustom outline-distinctive-bullets-string "=>([{}&!?#%\"X@$~\\"
   "*Persistent outline header bullets used to distinguish special topics.
 
 These bullets are not offered among the regular, level-specific
@@ -166,20 +176,22 @@ rotation, and are not altered by automatic rebulleting, as when
 shifting the level of a topic.  See `outline-plain-bullets-string' for
 the selection of alternating bullets.
 
-You must run 'set-outline-regexp' in order for changes
+You must run `set-outline-regexp' in order for changes
 to the value of this var to effect outline-mode operation.
 
-DO NOT include the close-square-bracket, ']', on either of the bullet
-strings.")
+DO NOT include the close-square-bracket, `]', on either of the bullet
+strings."
+  :type 'string
+  :group 'allout)
 (make-variable-buffer-local 'outline-distinctive-bullets-string)
 
 ;;;_  = outline-use-mode-specific-leader
-(defvar outline-use-mode-specific-leader t
+(defcustom outline-use-mode-specific-leader t
   "*When non-nil, use mode-specific topic-header prefixes.
 
 Allout outline mode will use the mode-specific `outline-mode-leaders'
 and/or comment-start string, if any, to lead the topic prefix string,
-so topic headers look like comments in the programming language. 
+so topic headers look like comments in the programming language.
 
 String values are used as they stand.
 
@@ -193,12 +205,16 @@ Set to the symbol for either of `outline-mode-leaders' or
 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
+`_' underscore is tacked on the end, to distinguish them from regular
 comment strings.  comment-start strings that do end in spaces are not
-tripled, but an underscore is substituted for the space.  \[This
+tripled, but an underscore is substituted for the space.  [This
 presumes that the space is for appearance, not comment syntax.  You
 can use `outline-mode-leaders' to override this behavior, when
-incorrect.\]")
+incorrect.]"
+  :type '(choice (const t) (const nil) string 
+                (const outline-mode-leaders)
+                (const comment-start))
+  :group 'allout)
 ;;;_  = outline-mode-leaders
 (defvar outline-mode-leaders '()
   "Specific outline-prefix leading strings per major modes.
@@ -212,24 +228,26 @@ character, like an \"_\" underscore, to distinguish the lead string
 from regular comments that start at bol.")
 
 ;;;_  = outline-old-style-prefixes
-(defvar outline-old-style-prefixes nil
-  "*When non-nil, use only old-and-crusty outline-mode '*' topic prefixes.
+(defcustom outline-old-style-prefixes nil
+  "*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.
 
 Whatever the setting of this variable, both old and new style prefixes
-are always respected by the topic maneuvering functions.")
+are always respected by the topic maneuvering functions."
+  :type 'boolean
+  :group 'allout)
 (make-variable-buffer-local 'outline-old-style-prefixes)
 ;;;_  = outline-stylish-prefixes - alternating bullets
-(defvar outline-stylish-prefixes t
+(defcustom outline-stylish-prefixes t
   "*Do fancy stuff with topic prefix bullets according to level, etc.
 
 Non-nil enables topic creation, modification, and repositioning
 functions to vary the topic bullet char (the char that marks the topic
 depth) just preceding the start of the topic text) according to level.
-Otherwise, only asterisks ('*') and distinctive bullets are used.
+Otherwise, only asterisks (`*') and distinctive bullets are used.
 
 This is how an outline can look (but sans indentation) with stylish
 prefixes:
@@ -264,56 +282,78 @@ always respected by the topic maneuvering functions, regardless of
 this variable setting.
 
 The setting of this var is not relevant when outline-old-style-prefixes
-is non-nil.")
+is non-nil."
+  :type 'boolean
+  :group 'allout)
 (make-variable-buffer-local 'outline-stylish-prefixes)
 
 ;;;_  = outline-numbered-bullet
-(defvar outline-numbered-bullet "#"
+(defcustom outline-numbered-bullet "#"
   "*String designating bullet of topics that have auto-numbering; nil for none.
 
-Topics having this bullet have automatic maintainence of a sibling
+Topics having this bullet have automatic maintenance of a sibling
 sequence-number tacked on, just after the bullet.  Conventionally set
 to \"#\", you can set it to a bullet of your choice.  A nil value
-disables numbering maintainence.")
+disables numbering maintenance."
+  :type '(choice (const nil) string)
+  :group 'allout)
 (make-variable-buffer-local 'outline-numbered-bullet)
 ;;;_  = outline-file-xref-bullet
-(defvar outline-file-xref-bullet "@"
+(defcustom outline-file-xref-bullet "@"
   "*Bullet signifying file cross-references, for `outline-resolve-xref'.
 
 Set this var to the bullet you want to use for file cross-references.
-Set it 'nil' if you want to inhibit this capability.")
+Set it to nil if you want to inhibit this capability."
+  :type '(choice (const nil) string)
+  :group 'allout)
 
 ;;;_ + LaTeX formatting
 ;;;_  - outline-number-pages
-(defvar outline-number-pages nil 
-  "*Non-nil turns on page numbering for LaTeX formatting of an outline.")
+(defcustom outline-number-pages nil
+  "*Non-nil turns on page numbering for LaTeX formatting of an outline."
+  :type 'boolean
+  :group 'allout)
 ;;;_  - outline-label-style
-(defvar outline-label-style "\\large\\bf"
-  "*Font and size of labels for LaTeX formatting of an outline.")
+(defcustom outline-label-style "\\large\\bf"
+  "*Font and size of labels for LaTeX formatting of an outline."
+  :type 'string
+  :group 'allout)
 ;;;_  - outline-head-line-style
-(defvar outline-head-line-style "\\large\\sl "
-  "*Font and size of entries for LaTeX formatting of an outline.")
+(defcustom outline-head-line-style "\\large\\sl "
+  "*Font and size of entries for LaTeX formatting of an outline."
+  :type 'string
+  :group 'allout)
 ;;;_  - outline-body-line-style
-(defvar outline-body-line-style " "
-  "*Font and size of entries for LaTeX formatting of an outline.")
+(defcustom outline-body-line-style " "
+  "*Font and size of entries for LaTeX formatting of an outline."
+  :type 'string
+  :group 'allout)
 ;;;_  - outline-title-style
-(defvar outline-title-style "\\Large\\bf"
-  "*Font and size of titles for LaTeX formatting of an outline.")
+(defcustom outline-title-style "\\Large\\bf"
+  "*Font and size of titles for LaTeX formatting of an outline."
+  :type 'string
+  :group 'allout)
 ;;;_  - outline-title
-(defvar outline-title '(or buffer-file-name (current-buffer-name))
+(defcustom outline-title '(or buffer-file-name (current-buffer-name))
   "*Expression to be evaluated to determine the title for LaTeX
-formatted copy.")
+formatted copy."
+  :type 'sexp
+  :group 'allout)
 ;;;_  - outline-line-skip
-(defvar outline-line-skip ".05cm"
-  "*Space between lines for LaTeX formatting of an outline.")
+(defcustom outline-line-skip ".05cm"
+  "*Space between lines for LaTeX formatting of an outline."
+  :type 'string
+  :group 'allout)
 ;;;_  - outline-indent
-(defvar outline-indent ".3cm"
-  "*LaTeX formatted depth-indent spacing.")
+(defcustom outline-indent ".3cm"
+  "*LaTeX formatted depth-indent spacing."
+  :type 'string
+  :group 'allout)
 
 ;;;_ + Miscellaneous customization
 
 ;;;_  = outline-keybindings-list
-;;; You have to reactivate outline-mode - '(outline-mode t)' - to
+;;; You have to reactivate outline-mode - `(outline-mode t)' - to
 ;;; institute changes to this var.
 (defvar outline-keybindings-list ()
   "*List of outline-mode key / function bindings.
@@ -349,7 +389,7 @@ will be used as is.")
         (">" outline-shift-in)
         ("<" outline-shift-out)
         ("\C-m" outline-rebullet-topic)
-        ("b" outline-rebullet-current-heading)
+        ("*" outline-rebullet-current-heading)
         ("#" outline-number-siblings)
         ("\C-k" outline-kill-line t)
         ("\C-y" outline-yank t)
@@ -361,37 +401,52 @@ will be used as is.")
         ("?c" outline-copy-exposed)))
 
 ;;;_  = outline-command-prefix
-(defvar outline-command-prefix "\C-c"
-  "*Key sequence to be used as prefix for outline mode command key bindings.")
+(defcustom outline-command-prefix "\C-c"
+  "*Key sequence to be used as prefix for outline mode command key bindings."
+  :type 'string
+  :group 'allout)
 
 ;;;_  = outline-enwrap-isearch-mode
-(defvar outline-enwrap-isearch-mode t
+(defcustom outline-enwrap-isearch-mode t
   "*Set non-nil to enable automatic exposure of concealed isearch targets.
 
 If non-nil, isearch will expose hidden text encountered in the course
-of a search, and to reconceal it if the search is continued past it.")
+of a search, and to reconceal it if the search is continued past it."
+  :type 'boolean
+  :group 'allout)
 
 ;;;_  = outline-use-hanging-indents
-(defvar outline-use-hanging-indents t
+(defcustom outline-use-hanging-indents t
   "*If non-nil, topic body text auto-indent defaults to indent of the header.
 Ie, it is indented to be just past the header prefix.  This is
 relevant mostly for use with indented-text-mode, or other situations
 where auto-fill occurs.
 
-[This feature no longer depends in any way on the 'filladapt.el'
-lisp-archive package.]")
+\[This feature no longer depends in any way on the `filladapt.el'
+lisp-archive package.\]"
+  :type 'boolean
+  :group 'allout)
 (make-variable-buffer-local 'outline-use-hanging-indents)
 
 ;;;_  = outline-reindent-bodies
-(defvar outline-reindent-bodies outline-use-hanging-indents
+(defcustom outline-reindent-bodies (if outline-use-hanging-indents
+                                   'text)
   "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts.
 
-Indented hanging bodies are adjusted to remain even with \(or
-right-indented from\) the beginning of heading text.") 
+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
+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))
+  :group 'allout)
+
 (make-variable-buffer-local 'outline-reindent-bodies)
 
 ;;;_  = outline-inhibit-protection
-(defvar outline-inhibit-protection nil
+(defcustom outline-inhibit-protection nil
   "*Non-nil disables warnings and confirmation-checks for concealed-text edits.
 
 Outline mode uses emacs change-triggered functions to detect unruly
@@ -400,7 +455,9 @@ protection, potentially increasing text-entry responsiveness a bit.
 
 This var takes effect at outline-mode activation, so you may have to
 deactivate and then reactivate the mode if you want to toggle the
-behavior.")
+behavior."
+  :type 'boolean
+  :group 'allout)
 
 ;;;_* CODE - no user customizations below.
 
@@ -408,14 +465,13 @@ behavior.")
 ;;;_  - Version
 ;;;_   = outline-version
 (defvar outline-version
-  (let ((rcs-rev "$Revision: 4.1 $"))
+  (let ((rcs-rev "Revision: 4.3"))
     (condition-case err
        (save-match-data
-         (string-match "\\$Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
+         (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
          (substring rcs-rev (match-beginning 1) (match-end 1)))
       (error rcs-rev)))
-  "Revision number of currently loaded outline package.  (Currently
-specific to allout.el.)")
+  "Revision number of currently loaded outline package.  \(allout.el)")
 ;;;_   > outline-version
 (defun outline-version (&optional here)
   "Return string describing the loaded outline version."
@@ -437,9 +493,9 @@ by set-outline-regexp.")
 (defvar outline-bullets-string ""
   "A string dictating the valid set of outline topic bullets.
 
-This var should *not* be set by the user - it is set by 'set-outline-regexp',
-and is produced from the elements of 'outline-plain-bullets-string'
-and 'outline-distinctive-bullets-string'.")
+This var should *not* be set by the user - it is set by `set-outline-regexp',
+and is produced from the elements of `outline-plain-bullets-string'
+and `outline-distinctive-bullets-string'.")
 (make-variable-buffer-local 'outline-bullets-string)
 ;;;_   = outline-bullets-string-len
 (defvar outline-bullets-string-len 0
@@ -449,14 +505,14 @@ and 'outline-distinctive-bullets-string'.")
 (defvar outline-line-boundary-regexp ()
   "Outline-regexp with outline-style beginning-of-line anchor.
 
-(Ie, C-j, *or* C-m, for prefixes of hidden topics).  This is properly
-set when outline-regexp is produced by 'set-outline-regexp', so
+\(Ie, C-j, *or* C-m, for prefixes of hidden topics).  This is properly
+set when outline-regexp is produced by `set-outline-regexp', so
 that (match-beginning 2) and (match-end 2) delimit the prefix.")
 (make-variable-buffer-local 'outline-line-boundary-regexp)
 ;;;_   = outline-bob-regexp
 (defvar outline-bob-regexp ()
   "Like outline-line-boundary-regexp, for headers at beginning of buffer.
-(match-beginning 2) and (match-end 2) delimit the prefix.")
+\(match-beginning 2) and (match-end 2) delimit the prefix.")
 (make-variable-buffer-local 'outline-bob-regexp)
 ;;;_   = outline-header-subtraction
 (defvar outline-header-subtraction (1- (length outline-header-prefix))
@@ -468,14 +524,14 @@ that (match-beginning 2) and (match-end 2) delimit the prefix.")
 (make-variable-buffer-local 'outline-plain-bullets-string-len)
 
 
-;;;_   > outline-reset-header-lead (header-lead)
+;;;_   X outline-reset-header-lead (header-lead)
 (defun outline-reset-header-lead (header-lead)
   "*Reset the leading string used to identify topic headers."
   (interactive "sNew lead string: ")
   (setq outline-header-prefix header-lead)
   (setq outline-header-subtraction (1- (length outline-header-prefix)))
   (set-outline-regexp))
-;;;_   > outline-lead-with-comment-string (header-lead)
+;;;_   X outline-lead-with-comment-string (header-lead)
 (defun outline-lead-with-comment-string (&optional header-lead)
   "*Set the topic-header leading string to specified string.
 
@@ -489,18 +545,19 @@ language comments.  Returns the leading string."
   (setq outline-reindent-bodies nil)
   (outline-reset-header-lead header-lead)
   header-lead)
-;;;_   > outline-infer-header-lead (&optional reset)
-(defun outline-infer-header-lead (&optional set)
+;;;_   > outline-infer-header-lead ()
+(defun outline-infer-header-lead ()
   "Determine appropriate `outline-header-prefix'.
 
 Works according to settings of:
 
+       `comment-start'
        `outline-header-prefix' (default)
        `outline-use-mode-specific-leader'
 and    `outline-mode-leaders'.
 
-Optional arg SET means to do the processing to establish that prefix
-for current outline processing, if it has changed from prior setting."
+Apply this via \(re\)activation of `outline-mode', rather than
+invoking it directly."
   (let* ((use-leader (and (boundp 'outline-use-mode-specific-leader)
                          (if (or (stringp outline-use-mode-specific-leader)
                                  (memq outline-use-mode-specific-leader
@@ -522,7 +579,7 @@ for current outline processing, if it has changed from prior setting."
                  (and (memq use-leader '(t comment-start))
                       comment-start
                       ;; Use comment-start, maybe tripled, and with
-                      ;; underscore: 
+                      ;; underscore:
                       (concat
                        (if (string= " "
                                     (substring comment-start
@@ -537,8 +594,18 @@ for current outline processing, if it has changed from prior setting."
       (if (string= leader outline-header-prefix)
          nil                           ; no change, nothing to do.
        (setq outline-header-prefix leader)
-       (if set (outline-reset-header-lead outline-header-prefix))
        outline-header-prefix))))
+;;;_   > outline-infer-body-reindent ()
+(defun outline-infer-body-reindent ()
+  "Determine proper setting for `outline-reindent-bodies'.
+
+Depends on default setting of `outline-reindent-bodies' \(which see)
+and presence of setting for `comment-start', to tell whether the
+file is programming code."
+  (if (and outline-reindent-bodies
+          comment-start
+          (not (eq 'force outline-reindent-bodies)))
+      (setq outline-reindent-bodies nil)))
 ;;;_   > set-outline-regexp ()
 (defun set-outline-regexp ()
   "Generate proper topic-header regexp form for outline functions.
@@ -612,12 +679,12 @@ See doc string for outline-keybindings-list for format of binding list."
            keymap-list)
     map))
 ;;;_   = outline-prior-bindings - being deprecated.
-(defvar outline-prior-bindings nil 
+(defvar outline-prior-bindings nil
   "Variable for use in V18, with outline-added-bindings, for
 resurrecting, on mode deactivation, bindings that existed before
 activation.  Being deprecated.")
 ;;;_   = outline-added-bindings - being deprecated
-(defvar outline-added-bindings nil 
+(defvar outline-added-bindings nil
   "Variable for use in V18, with outline-prior-bindings, for
 resurrecting, on mode deactivation, bindings that existed before
 activation.  Being deprecated.")
@@ -640,7 +707,7 @@ can distinguish nil vs no value), and the registration is popped
 from the list."
 
   (let ((on-list (assq name outline-mode-prior-settings))
-        prior-capsule                   ; By 'capsule' i mean a list
+        prior-capsule                   ; By `capsule' i mean a list
                                         ; containing a value, so we can
                                         ; distinguish nil from no value.
         )
@@ -697,13 +764,13 @@ functions.")
   "Used in outline-mode for regulate of concealed-text protection mechanism.
 
 Allout outline mode regulates alteration of concealed text to protect
-against inadvertant, unnoticed changes.  This is for use by specific,
+against inadvertent, unnoticed changes.  This is for use by specific,
 native outline functions to temporarily override that protection.
 It's automatically reset to nil after every buffer modification.")
 (make-variable-buffer-local 'outline-override-protect)
 ;;;_   > outline-unprotected (expr)
 (defmacro outline-unprotected (expr)
-  "Evaluate EXPRESSION with `outline-override-protect' let-bound 't'."
+  "Evaluate EXPRESSION with `outline-override-protect' let-bound to t."
   (` (let ((outline-override-protect t))
        (, expr))))
 ;;;_   = outline-undo-aggregation
@@ -722,8 +789,8 @@ to track repeats.")
 (defun outline-write-file-hook ()
   "In outline mode, run as a local-write-file-hooks activity.
 
-Currently just sets 'outline-during-write-cue', so outline-change-
-protection knows to keep inactive during file write."
+Currently just sets `outline-during-write-cue', so outline-change-protection
+knows to keep inactive during file write."
   (setq outline-during-write-cue t)
   nil)
 
@@ -737,20 +804,22 @@ protection knows to keep inactive during file write."
   'outline-mode)
 ;;;_  = outline-explicitly-deactivated
 (defvar outline-explicitly-deactivated nil
-  "Outline-mode was last deliberately deactived.
+  "Outline-mode was last deliberately deactivated.
 So outline-post-command-business should not reactivate it...")
 (make-variable-buffer-local 'outline-explicitly-deactivated)
-;;;_  > outline-init (mode)
-(defun outline-init (mode)
+;;;_  > outline-init (&optional mode)
+(defun outline-init (&optional mode)
   "Prime outline-mode to enable/disable auto-activation, wrt `outline-layout'.
 
-MODE is one of:
+MODE is one of the following symbols:
 
- - nil, for no auto-activation,
- - `activation', for auto-activation only,
- - `ask' for auto-activation and auto-layout on confirmation from user,
- - anything else, for auto-activation and auto-layout, without any
-   confirmation check.
+ - nil \(or no argument) deactivate auto-activation/layout;
+ - `activate', enable auto-activation only;
+ - `ask', enable auto-activation, and enable auto-layout but with
+   confirmation for layout operation solicited from user each time;
+ - `report', just report and return the current auto-activation state;
+ - 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
 of allout outline mode, contingent to the buffer-specific setting of
@@ -767,24 +836,52 @@ the following two lines in your emacs init file:
 \(require 'allout)
 \(outline-init t)"
 
-  (if (not mode)
+  (interactive)
+  (if (interactive-p)
       (progn
-       (setq find-file-hooks (delq 'outline-find-file-hook find-file-hooks))
-       (if (interactive-p)
-           (message "Allout outline mode auto-activation inhibited.")))
-    (add-hook 'find-file-hooks 'outline-find-file-hook)
-    (setq outline-auto-activation
-         (cond ((eq mode 'activation)
-                (message "Allout outline mode auto-activation enabled.")
-                'activate)
-               ((eq mode 'ask)
-                (message "Allout outline mode auto-activation enabled.")
-                'ask)
-               ((message
-                 "Allout outline mode auto-activation and -layout enabled.")
-                t)))
-                  
-t)))))
+       (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)))))
+  (let
+      ;; convenience aliases, for consistent ref to respective vars:
+      ((hook 'outline-find-file-hook)
+       (curr-mode 'outline-auto-activation))
+
+    (cond ((not mode)
+          (setq find-file-hooks (delq hook find-file-hooks))
+          (if (interactive-p)
+              (message "Allout outline mode auto-activation inhibited.")))
+         ((eq mode 'report)
+          (if (not (memq hook find-file-hooks))
+              (outline-init nil)
+            ;; Just punt and use the reports from each of the modes:
+            (outline-init (symbol-value curr-mode))))
+         (t (add-hook 'find-file-hooks hook)
+            (set curr-mode             ; `set', not `setq'!
+                 (cond ((eq mode 'activate)
+                        (message
+                         "Outline mode auto-activation enabled.")
+                        'activate)
+                       ((eq mode 'report)
+                        ;; Return the current mode setting:
+                        (outline-init mode))
+                       ((eq mode 'ask)
+                        (message
+                         (concat "Outline mode auto-activation and "
+                                 "-layout \(upon confirmation) enabled."))
+                        'ask)
+                       ((message
+                         "Outline mode auto-activation and -layout enabled.")
+                        'full)))))))
+
 ;;;_  > outline-mode (&optional toggle)
 ;;;_   : Defun:
 (defun outline-mode (&optional toggle)
@@ -801,7 +898,7 @@ which is organized in outline structure.\)
 
 It also includes such things as topic-oriented repositioning, cut, and
 paste; integral outline exposure-layout; incremental search with
-dynamic exposure/conceament of concealed text; automatic topic-number
+dynamic exposure/concealment of concealed text; automatic topic-number
 maintenance; and many other features.
 
 See the docstring of the variable `outline-init' for instructions on
@@ -836,10 +933,10 @@ C-c ,     outline-open-supertopic ... a sibling of the current topic's parent.
        ---------------------------------
 C-c >  outline-shift-in        Shift current topic and all offspring deeper.
 C-c <  outline-shift-out       ... less deep.
-C-c<CR>        outline-rebullet-topic  Reconcile bullets of topic and its' offspring
+C-c<CR>        outline-rebullet-topic  Reconcile bullets of topic and its offspring
                                - distinctive bullets are not changed, others
                                  alternated according to nesting depth.
-C-c b  outline-rebullet-current-heading Prompt for alternate bullet for
+C-c *  outline-rebullet-current-heading Prompt for alternate bullet for
                                         current topic.
 C-c #  outline-number-siblings Number bullets of topic and siblings - the
                                offspring are not affected.  With repeat
@@ -914,11 +1011,11 @@ CHILDREN:
        The immediate offspring of a topic.
 SIBLINGS:
        Topics having the same parent and depth.
-              
+
 Topic text constituents:
 
 HEADER:        The first line of a topic, include the topic PREFIX and header
-       text. 
+       text.
 PREFIX: The leading text of a topic which which distinguishes it from
        normal text.  It has a strict form, which consists of a
        prefix-lead string, padding, and a bullet.  The bullet may be
@@ -928,7 +1025,7 @@ PREFIX: The leading text of a topic which which distinguishes it from
        The relative length of the PREFIX determines the nesting depth
        of the topic.
 PREFIX-LEAD:
-       The string at the beginning of a topic prefix, normally a '.'.
+       The string at the beginning of a topic prefix, normally a `.'.
        It can be customized by changing the setting of
        `outline-header-prefix' and then reinitializing outline-mode.
 
@@ -941,8 +1038,8 @@ PREFIX-PADDING:
        Spaces or asterisks which separate the prefix-lead and the
        bullet, according to the depth of the topic.
 BULLET: A character at the end of the topic prefix, it must be one of
-       the characters listed on 'outline-plain-bullets-string' or
-        'outline-distinctive-bullets-string'.  (See the documentation
+       the characters listed on `outline-plain-bullets-string' or
+        `outline-distinctive-bullets-string'.  (See the documentation
         for these variables for more details.)  The default choice of
        bullet when generating varies in a cycle with the depth of the
        topic.
@@ -952,25 +1049,25 @@ BODY:    Same as ENTRY.
 
 EXPOSURE:
        The state of a topic which determines the on-screen visibility
-       of its' offspring and contained text.
+       of its offspring and contained text.
 CONCEALED:
        Topics and entry text whose display is inhibited.  Contiguous
-       units of concealed text is represented by '...' ellipses.
-       (Ref the 'selective-display' var.)
+       units of concealed text is represented by `...' ellipses.
+       (Ref the `selective-display' var.)
 
        Concealed topics are effectively collapsed within an ancestor.
 CLOSED:        A topic whose immediate offspring and body-text is concealed.
-OPEN:  A topic that is not closed, though its' offspring or body may be."
+OPEN:  A topic that is not closed, though its offspring or body may be."
 ;;;_    . Code
   (interactive "P")
 
   (let* ((active (and (not (equal major-mode 'outline))
                     (outline-mode-p)))
-                                      ; Massage universal-arg 'toggle' val:
+                                      ; Massage universal-arg `toggle' val:
         (toggle (and toggle
                     (or (and (listp toggle)(car toggle))
                         toggle)))
-                                      ; Activation specficially demanded?
+                                      ; Activation specifically demanded?
         (explicit-activation (or
                              ;;
                              (and toggle
@@ -1000,7 +1097,7 @@ OPEN:     A topic that is not closed, though its' offspring or body may be."
          (string-match "^19.1[89]"     ; Bug only known to be in v19.18 and
                        emacs-version)); 19.19.
       t)
-         
+
      ;; Deactivation:
      ((and (not explicit-activation)
          (or active toggle))
@@ -1051,6 +1148,7 @@ OPEN:     A topic that is not closed, though its' offspring or body may be."
           (outline-resumptions 'outline-old-style-prefixes '(()))))
 
       (outline-infer-header-lead)
+      (outline-infer-body-reindent)
 
       (set-outline-regexp)
 
@@ -1082,7 +1180,7 @@ OPEN:     A topic that is not closed, though its' offspring or body may be."
        (use-local-map (produce-outline-mode-map outline-keybindings-list
                                                (current-local-map)))
        )
-                
+
                                       ; selective-display is the
                                       ; emacs conditional exposure
                                       ; mechanism:
@@ -1109,11 +1207,11 @@ OPEN:   A topic that is not closed, though its' offspring or body may be."
       ;; Paragraphs are broken by topic headlines.
       (make-local-variable 'paragraph-start)
       (outline-resumptions 'paragraph-start
-                         (list (concat paragraph-start "\\|^\\("
+                         (list (concat paragraph-start "\\|\\("
                                        outline-regexp "\\)")))
       (make-local-variable 'paragraph-separate)
       (outline-resumptions 'paragraph-separate
-                         (list (concat paragraph-separate "\\|^\\("
+                         (list (concat paragraph-separate "\\|\\("
                                        outline-regexp "\\)")))
 
       (or (assq 'outline-mode minor-mode-alist)
@@ -1130,7 +1228,8 @@ OPEN:     A topic that is not closed, though its' offspring or body may be."
       (setq outline-mode t))
 
      ;; Reactivation:
-     ((setq do-layout t))
+     ((setq do-layout t)
+      (outline-infer-body-reindent))
      )                                 ; cond
 
     (if (and do-layout
@@ -1142,16 +1241,21 @@ OPEN:   A topic that is not closed, though its' offspring or body may be."
                                            (buffer-name)
                                            outline-layout))
                          t
-                       (message "Not doing %s layout.")
+                       (message "Skipped %s layout." (buffer-name))
                        nil)
                    t)))
        (save-excursion
          (message "Adjusting '%s' exposure..." (buffer-name))
          (goto-char 0)
-         (if (not (outline-goto-prefix))
-            (outline-next-heading))
-         (apply 'outline-expose-topic (list outline-layout))
-         (message "Adjusting '%s' exposure... done." (buffer-name))))
+         (outline-this-or-next-heading)
+         (condition-case err
+             (progn
+               (apply 'outline-expose-topic (list outline-layout))
+               (message "Adjusting '%s' exposure... done." (buffer-name)))
+           ;; Problem applying exposure - notify user, but don't
+           ;; interrupt, eg, file visit:
+           (error (message "%s" (car (cdr err)))
+                  (sit-for 1)))))
     outline-mode
     )                                  ; let*
   )                                    ; defun
@@ -1180,7 +1284,7 @@ OPEN:     A topic that is not closed, though its' offspring or body may be."
 (defmacro outline-prefix-data (beg end)
   "Register outline-prefix state data - BEGINNING and END of prefix.
 
-For reference by 'outline-recent' funcs.  Returns BEGINNING."
+For reference by `outline-recent' funcs.  Returns BEGINNING."
   (` (setq outline-recent-prefix-end (, end)
           outline-recent-prefix-beginning (, beg))))
 ;;;_  > outline-recent-depth ()
@@ -1311,10 +1415,16 @@ Returns the location of the heading, or nil if none found."
 
   '(if (re-search-forward outline-line-boundary-regexp nil 0)
        (progn                          ; Got valid location state - set vars:
-        (outline-prefix-data 
+        (outline-prefix-data
          (goto-char (or (match-beginning 2)
                         outline-recent-prefix-beginning))
          (or (match-end 2) outline-recent-prefix-end)))))
+;;;_   : outline-this-or-next-heading
+(defun outline-this-or-next-heading ()
+  "Position cursor on current or next heading."
+  ;; A throwaway non-macro that is defined after outline-next-heading
+  ;; and usable by outline-mode.
+  (if (not (outline-goto-prefix)) (outline-next-heading)))
 ;;;_   > outline-previous-heading ()
 (defmacro outline-previous-heading ()
   "Move to the prior \(possibly invisible) heading line.
@@ -1329,7 +1439,7 @@ Return the location of the beginning of the heading, or nil if not found."
         (or (re-search-backward outline-line-boundary-regexp nil 0)
             (looking-at outline-bob-regexp))
         (progn                         ; Got valid location state - set vars:
-          (outline-prefix-data 
+          (outline-prefix-data
            (goto-char (or (match-beginning 2)
                           outline-recent-prefix-beginning))
            (or (match-end 2) outline-recent-prefix-end))))))
@@ -1348,7 +1458,7 @@ Return the location of the beginning of the heading, or nil if not found."
 (defun outline-chart-subtree (&optional levels orig-depth prev-depth)
   "Produce a location \"chart\" of subtopics of the containing topic.
 
-Optional argument LEVELS specifies the depth \(releative to start
+Optional argument LEVELS specifies the depth \(relative to start
 depth\) for the chart.  Subsequent optional args are not for public
 use.
 
@@ -1367,7 +1477,7 @@ 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.
+  (let ((original (not orig-depth))    ; `orig-depth' set only in recursion.
        chart curr-depth)
 
     (if original                       ; Just starting?
@@ -1393,9 +1503,9 @@ starting point, and PREV-DEPTH is depth of prior topic."
                           (or (outline-next-sibling curr-depth)
                               ;; or no more siblings - proceed to
                               ;; next heading at lesser depth:
-                              (while (<= curr-depth
-                                         (outline-recent-depth))
-                                (outline-next-heading)))
+                              (while (and (<= curr-depth
+                                              (outline-recent-depth))
+                                          (outline-next-heading))))
                         (outline-next-heading)))
 
                      ((and (< prev-depth curr-depth)
@@ -1426,14 +1536,14 @@ starting point, and PREV-DEPTH is depth of prior topic."
                          '(?\n ?\^M))
                    (forward-char -1))
               (setq outline-recent-end-of-subtree (point))))
-    
+
     chart                              ; (nreverse chart) not necessary,
                                        ; and maybe not preferable.
     ))
 ;;;_   > outline-chart-siblings (&optional start end)
 (defun outline-chart-siblings (&optional start end)
   "Produce a list of locations of this and succeeding sibling topics.
-Effectively a top-level chart of siblings.  See 'outline-chart-subtree'
+Effectively a top-level chart of siblings.  See `outline-chart-subtree'
 for an explanation of charts."
   (save-excursion
     (if (outline-goto-prefix)
@@ -1486,12 +1596,12 @@ exposed reside.
    point which is the negative of the number should be opened,
    including their entries.
  - bare positive values indicate that this topic header should be
-   openned.
+   opened.
  - Lists signify the beginning and end points of regions that should
-   be flagged, and the flag to employ.  (For concealment: '\(\?r\)', and
+   be flagged, and the flag to employ.  (For concealment: `\(\?r\)', and
    exposure:"
   (while spec
-    (cond ((listp spec) 
+    (cond ((listp spec)
           )
          )
     (setq spec (cdr spec)))
@@ -1538,7 +1648,7 @@ otherwise skip white space between bullet and ensuing text."
          t
        (while (looking-at "[0-9]") (forward-char 1))
        (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1)))
-      (store-match-data match-data))
+      (set-match-data match-data))
     ;; Reestablish where we are:
     (outline-current-depth)))
 ;;;_   > outline-current-bullet-pos ()
@@ -1847,15 +1957,15 @@ Changes to concealed regions are ignored while file is being written.
 \(This is for the sake of functions that do change the file during
 writes, like crypt and zip modes.)
 
-Locally bound in outline buffers to 'before-change-function', which
+Locally bound in outline buffers to `before-change-function', which
 in emacs 19 is run before any change to the buffer.  (Has no effect
-in Emacs 18, which doesn't support before-change-function.) 
+in Emacs 18, which doesn't support before-change-function.)
 
-Any functions which set ['this-command' to 'undo', or which set]
-'outline-override-protect' non-nil (as does, eg, outline-flag-chars)
+Any functions which set [`this-command' to `undo', or which set]
+`outline-override-protect' non-nil (as does, eg, outline-flag-chars)
 are exempt from this restriction."
   (if (and (outline-mode-p)
-                                       ; outline-override-protect 
+                                       ; outline-override-protect
                                        ; set by functions that know what
                                        ; they're doing, eg outline internals:
           (not outline-override-protect)
@@ -1890,7 +2000,7 @@ are exempt from this restriction."
                (rehide-completely (save-excursion (outline-goto-prefix)
                                                   (outline-hidden-p)))
                rehide-place)
-                                      
+
            (save-excursion
              (if (condition-case err
                      ;; Condition case to catch keyboard quits during reads.
@@ -1905,7 +2015,7 @@ are exempt from this restriction."
                                        ; until they respond:
                                        ; Then interpret the response:
                        (while
-                           (progn 
+                           (progn
                              (message (concat "Change inside concealed"
                                               " region - do it? "
                                               "(n or 'y'/'r'eclose)"))
@@ -1920,7 +2030,7 @@ are exempt from this restriction."
                                      t)
                                     ((eq response ??)
                                      (message
-                                      "'r' means 'yes, then reclose")
+                                      "`r' means `yes, then reclose'")
                                      nil)
                                     (t (message "Please answer y, n, or r")
                                        (sit-for 1)
@@ -2031,7 +2141,7 @@ motion command to relocate the cursor off of a bullet char."
           outline-mode
           (eq this-command 'self-insert-command)
           (eq (point)(outline-current-bullet-pos)))
-          
+
       (let* ((this-key-num (if (numberp last-command-event)
                               last-command-event))
             mapped-binding)
@@ -2161,7 +2271,7 @@ Fourth arg SOLICIT non-nil provokes solicitation from the user of a
 choice among the valid bullets.  (This overrides other all the
 options, including, eg, a distinctive PRIOR-BULLET.)
 
-Fifth arg, NUMBER-CONTROL, matters only if 'outline-numbered-bullet'
+Fifth arg, NUMBER-CONTROL, matters only if `outline-numbered-bullet'
 is non-nil *and* soliciting was not explicitly invoked.  Then
 NUMBER-CONTROL non-nil forces prefix to either numbered or
 denumbered format, depending on the value of the sixth arg, INDEX.
@@ -2175,7 +2285,7 @@ bullet.  Non-nil NUMBER-CONTROL and non-nil, non-number INDEX means
 that the index for the numbered prefix will be derived, by counting
 siblings back to start of level.  If INDEX is a number, then that
 number is used as the index for the numbered prefix (allowing, eg,
-sequential renumbering to not requre this function counting back the
+sequential renumbering to not require this function counting back the
 index for each successive sibling)."
 ;;;_    . Code:
   ;; The options are ordered in likely frequence of use, most common
@@ -2298,7 +2408,7 @@ Nuances:
 - Creation of sibling or nested topics is with respect to the topic
   you're starting from, even when creating backwards.  This way you
   can easily create a sibling in front of the current topic without
-  having to go to its preceeding sibling, and then open forward
+  having to go to its preceding sibling, and then open forward
   from there."
 
   (let* ((depth (+ (outline-current-depth) relative-depth))
@@ -2327,12 +2437,12 @@ Nuances:
                                         ; Positioning and vertical
                                         ; padding - only if not
                                         ; opening-on-blank:
-        (progn 
+        (progn
           (goto-char ref-topic)
           (setq dbl-space               ; Determine double space action:
                 (or (and (<= relative-depth 0) ; not descending;
                          (save-excursion
-                           ;; at b-o-b or preceeded by a blank line?
+                           ;; at b-o-b or preceded by a blank line?
                            (or (> 0 (forward-line -1))
                                (looking-at "^\\s-*$")
                               (bobp)))
@@ -2424,7 +2534,7 @@ Nuances:
 ;;;_    . open-topic contingencies
 ;;;_     ; base topic - one from which open was issued
 ;;;_      , beginning char
-;;;_      , amount of space before will be used, unless openning in place
+;;;_      , amount of space before will be used, unless opening in place
 ;;;_      , end char will be used, unless opening before (and it still may)
 ;;;_     ; absolute depth of new topic
 ;;;_     ! insert in place - overrides most stuff
@@ -2434,7 +2544,7 @@ Nuances:
 ;;;_     ; buffer boundaries - special provisions for beginning and end ob
 ;;;_     ; level 1 topics have special provisions also - double space.
 ;;;_     ; location of new topic
-;;;_    . 
+;;;_    .
 ;;;_   > outline-open-subtopic (arg)
 (defun outline-open-subtopic (arg)
   "Open new topic header at deeper level than the current one.
@@ -2489,7 +2599,7 @@ Maintains outline hanging topic indentation if
   "Reindent body lines which were indented at old-depth to new-depth.
 
 Optional arg NUMBER indicates numbering is being added, and it must
-be accomodated.
+be accommodated.
 
 Note that refill of indented paragraphs is not done."
 
@@ -2502,7 +2612,7 @@ Note that refill of indented paragraphs is not done."
           ;; *before* the prefix was changed, so we infer it relative
           ;; to the new margin and the shift in depth:
           (old-margin (+ old-depth (- new-margin new-depth))))
-             
+
       ;; Process lines up to (but excluding) next topic header:
       (outline-unprotected
        (save-match-data
@@ -2511,7 +2621,7 @@ Note that refill of indented paragraphs is not done."
                                     nil
                                     t)
                  ;; Register the indent data, before we reset the
-                 ;; match data with a subsequent 'looking-at':
+                 ;; match data with a subsequent `looking-at':
                  (setq old-indent-begin (match-beginning 1)
                        old-indent-end (match-end 1))
                  (not (looking-at outline-regexp)))
@@ -2526,7 +2636,7 @@ Note that refill of indented paragraphs is not done."
             (indent-to (+ new-margin excess)))))))))
 ;;;_    > outline-rebullet-current-heading (arg)
 (defun outline-rebullet-current-heading (arg)
-  "Like non-interactive version 'outline-rebullet-heading'.
+  "Like non-interactive version `outline-rebullet-heading'.
 
 But \(only\) affects visible heading containing point.
 
@@ -2560,7 +2670,7 @@ Second arg DEPTH forces the topic prefix to that depth, regardless
 of the topics current depth.
 
 Third arg NUMBER-CONTROL can force the prefix to or away from
-numbered form.  It has effect only if 'outline-numbered-bullet' is
+numbered form.  It has effect only if `outline-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.
@@ -2576,8 +2686,8 @@ numbered prefix will be derived by outline-make-topic-prefix.
 Fifth arg DO-SUCCESSORS t means re-resolve count on succeeding
 siblings.
 
-Cf vars 'outline-stylish-prefixes', 'outline-old-style-prefixes',
-and 'outline-numbered-bullet', which all affect the behavior of
+Cf vars `outline-stylish-prefixes', `outline-old-style-prefixes',
+and `outline-numbered-bullet', which all affect the behavior of
 this function."
 
   (let* ((current-depth (outline-depth))
@@ -2861,7 +2971,7 @@ Leaves primary topic's trailing vertical whitespace, if any."
                  (and (outline-next-heading)
                       (>= (outline-recent-depth) depth))))
            (forward-char 1)))
-       
+
     (kill-region beg (point))
     (sit-for 0)
     (save-excursion
@@ -2877,7 +2987,7 @@ Does depth adjustment of yanked topics, when:
 2 it is being yanked at the end of a line which consists of only a valid
      topic prefix.
 
-Also, adjusts numbering of subsequent siblings when appropropriate.
+Also, adjusts numbering of subsequent siblings when appropriate.
 
 Depth adjustment alters the depth of all the topics being yanked
 the amount it takes to make the first topic have the depth of the
@@ -2894,12 +3004,12 @@ however, are left exactly like normal, non-outline-specific yanks."
       (exchange-point-and-mark))
   (let* ((subj-beg (point))
         (subj-end (mark-marker))
-        ;; 'resituate' if yanking an entire topic into topic header:
+        ;; `resituate' if yanking an entire topic into topic header:
         (resituate (and (outline-e-o-prefix-p)
                         (looking-at (concat "\\(" outline-regexp "\\)"))
                         (outline-prefix-data (match-beginning 1)
                                              (match-end 1))))
-        ;; 'rectify-numbering' if resituating (where several topics may
+        ;; `rectify-numbering' if resituating (where several topics may
         ;; be resituating) or yanking a topic into a topic slot (bol):
         (rectify-numbering (or resituate
                                (and (bolp) (looking-at outline-regexp)))))
@@ -2978,7 +3088,7 @@ however, are left exactly like normal, non-outline-specific yanks."
                  (if (looking-at " ") (delete-char 1))))
            (exchange-point-and-mark))))
     (if rectify-numbering
-       (progn 
+       (progn
          (save-excursion
                                         ; Give some preliminary feedback:
            (message "... reconciling numbers") (sit-for 0)
@@ -2997,7 +3107,7 @@ however, are left exactly like normal, non-outline-specific yanks."
 (defun outline-yank (&optional arg)
   "Outline-mode yank, with depth and numbering adjustment of yanked topics.
 
-Non-topic yanks work no differntly than normal yanks.
+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.
@@ -3016,7 +3126,7 @@ at the end (and vice-versa with the mark).  Non-adjusted yanks,
 however, (ones that don't qualify for adjustment) are handled
 exactly like normal yanks.
 
-Numbering of yanked topics, and the succesive siblings at the depth
+Numbering of yanked topics, and the successive siblings at the depth
 into which they're being yanked, is adjusted.
 
 Outline-yank-pop works with outline-yank just like normal yank-pop
@@ -3052,15 +3162,14 @@ by pops to non-distinctive yanks.  Bug..."
   (interactive)
   (if (not outline-file-xref-bullet)
       (error
-       "outline cross references disabled - no 'outline-file-xref-bullet'")
+       "outline cross references disabled - no `outline-file-xref-bullet'")
     (if (not (string= (outline-current-bullet) outline-file-xref-bullet))
-        (error "current heading lacks cross-reference bullet '%s'"
+        (error "current heading lacks cross-reference bullet `%s'"
                outline-file-xref-bullet)
       (let (file-name)
         (save-excursion
           (let* ((text-start outline-recent-prefix-end)
-                 (heading-end (progn (outline-pre-next-preface)
-                                     (point))))
+                 (heading-end (progn (end-of-line) (point))))
             (goto-char text-start)
             (setq file-name
                   (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t)
@@ -3068,7 +3177,7 @@ by pops to non-distinctive yanks.  Bug..."
         (setq file-name
               (if (not (= (aref file-name 0) ?:))
                   (expand-file-name file-name)
-                                        ; A registry-files ref, strip the ':'
+                                        ; A registry-files ref, strip the `:'
                                         ; and try to follow it:
                 (let ((reg-ref (reference-registered-file
                                 (substring file-name 1) nil t)))
@@ -3121,7 +3230,7 @@ See `outline-flag-region' for more details."
 
   "Produce a list representing exposed topics in current region.
 
-This list can then be used by 'outline-process-exposed' to manipulate
+This list can then be used by `outline-process-exposed' to manipulate
 the subject region.
 
 List is composed of elements that may themselves be lists representing
@@ -3129,7 +3238,7 @@ exposed components in subtopic.
 
 Each component list contains:
  - a number representing the depth of the topic,
- - a string representing the header-prefix (ref. 'outline-header-prefix'),
+ - a string representing the header-prefix (ref. `outline-header-prefix'),
  - a string representing the bullet character,
  - and a series of strings, each containing one line of the exposed
    portion of the topic entry."
@@ -3138,7 +3247,7 @@ Each component list contains:
   (save-excursion
     (let* (strings pad result depth bullet beg next done) ; State vars.
       (goto-char start)
-      (beginning-of-line)              
+      (beginning-of-line)
       (if (not (outline-goto-prefix))  ; Get initial position within a topic:
          (outline-next-visible-heading 1))
       (while (and (not done)
@@ -3204,9 +3313,8 @@ representations of topic entries produced by outline-listify-exposed."
          ;; Specified but not a buffer - get it:
          (let ((got (get-buffer frombuf)))
            (if (not got)
-               (error (concat "outline-process-exposed: source buffer "
-                              frombuf
-                              " not found."))
+               (error "outline-process-exposed: source buffer %s not found."
+                      frombuf)
              (setq frombuf got))))
     ;; not specified - default it:
     (setq frombuf (current-buffer)))
@@ -3302,7 +3410,7 @@ warn people about the change, and then deprecate this alias."
 
   (interactive "p")
   ;;(beep)
-  ;;(message (format "Use '%s' instead of '%s' (%s)."
+  ;;(message (format "Use `%s' instead of `%s' (%s)."
   ;;              "outline-show-children"
   ;;              "outline-show-current-children"
   ;;              (buffer-name (current-buffer))))
@@ -3393,7 +3501,7 @@ exposed by outline-show-entry but are within otherwise concealed regions."
 ;;;_   > outline-show-current-subtree (&optional arg)
 (defun outline-show-current-subtree (&optional arg)
   "Show everything within the current topic.  With a repeat-count,
-expose this topic and its' siblings."
+expose this topic and its siblings."
   (interactive "P")
   (save-excursion
     (if (<= (outline-current-depth) 0)
@@ -3412,7 +3520,7 @@ expose this topic and its' siblings."
   "Close the current topic, or containing topic if this one is already closed.
 
 If this topic is closed and it's a top level topic, close this topic
-and its' siblings.
+and its siblings.
 
 If optional arg JUST-CLOSE is non-nil, do not treat the parent or
 siblings, even if the target topic is already closed."
@@ -3451,7 +3559,7 @@ siblings, even if the target topic is already closed."
   (outline-show-children t))
 ;;;_   > outline-hide-current-leaves ()
 (defun outline-hide-current-leaves ()
-  "Hide the bodies of the current topic and all its' offspring."
+  "Hide the bodies of the current topic and all its offspring."
   (interactive)
   (outline-back-to-current-heading)
   (outline-hide-region-body (point) (progn (outline-end-of-current-subtree)
@@ -3506,9 +3614,9 @@ list) dictates the exposure for the corresponding topic.
 Non-null lists recursively designate exposure specs for respective
 subtopics of the current topic.
 
-The ':' repeat spec is used to specify exposure for any number of
+The `:' repeat spec is used to specify exposure for any number of
 successive siblings, up to the trailing ones for which there are
-explicit specs following the ':'.
+explicit specs following the `:'.
 
 Simple (numeric and null-list) specs are interpreted as follows:
 
@@ -3519,9 +3627,9 @@ Simple (numeric and null-list) specs are interpreted as follows:
      - positive numbers open to the relative depth indicated by the
        number, but do not force already opened subtopics to be closed.
      - 0 means to close topic - hide all offspring.
-  :  - 'repeat'
+  :  - `repeat'
        apply prior element to all siblings at current level, *up to*
-       those siblings that would be covered by specs following the ':'
+       those siblings that would be covered by specs following the `:'
        on the list.  Ie, apply to all topics at level but the last
        ones.  \(Only first of multiple colons at same level is
        respected - subsequent ones are discarded.)
@@ -3568,7 +3676,7 @@ Examples:
                ((eq curr-elem '-) (outline-show-current-entry))
                ((eq curr-elem ':)
                 (setq stay t)
-                ;; Expand the 'repeat' spec to an explicit version,
+                ;; Expand the `repeat' spec to an explicit version,
                 ;; w.r.t. remaining siblings:
                 (let ((residue    ; = # of sibs not covered by remaining spec
                        ;; Dang - could be nice to make use of the chart, sigh:
@@ -3626,9 +3734,9 @@ Simple (numeric and null-list) specs are interpreted as follows:
     absolute value of the number.
   - positive numbers just open to the relative depth indicated by the number.
   - 0 just closes
- - '*' completely opens the topic, including bodies.
- - '+' shows all the sub headers, but not the bodies
- - '-' exposes the body and immediate offspring of the corresponding topic.
+ - `*' completely opens the topic, including bodies.
+ - `+' shows all the sub headers, but not the bodies
+ - `-' exposes the body and immediate offspring of the corresponding topic.
 
 If the spec is a list, the first element must be a number, which
 dictates the exposure depth of the topic as a whole.  Subsequent
@@ -3688,7 +3796,7 @@ need not be quoted in outline-new-exposure.
 
 Cursor is left at start position.
 
-Use this instead of obsolete 'outline-exposure'.
+Use this instead of obsolete `outline-exposure'.
 
 Examples:
 \(outline-exposure (-1 () () () 1) 0)
@@ -3698,7 +3806,7 @@ Examples:
 \(outline-exposure : -1 0)
        Close all topics at current level to expose only their
        immediate children, except for the last topic at the current
-       level, in which even its' immediate children are hidden.
+       level, in which even its immediate children are hidden.
 \(outline-exposure -2 : -1 *)
         Expose children and grandchildren of first topic at current
        level, and expose children of subsequent topics at current
@@ -3710,7 +3818,7 @@ Examples:
        (list 'outline-expose-topic (list 'quote spec))))
 ;;;_   > outline-exposure '()
 (defmacro outline-exposure (&rest spec)
-  "Being deprecated - use more recent 'outline-new-exposure' instead.
+  "Being deprecated - use more recent `outline-new-exposure' instead.
 
 Literal frontend for `outline-old-expose-topic', doesn't evaluate arguments
 and retains start position."
@@ -3735,7 +3843,7 @@ if the entire topic was concealed, in a list if the entry was concealed.")
 Used by isearch-terminate/outline-provisions and
 isearch-done/outline-provisions")
 
-           
+
 ;;;_  > outline-enwrap-isearch ()
 (defun outline-enwrap-isearch ()
   "Impose outline-mode isearch-mode wrappers for dynamic exposure in isearch.
@@ -3758,7 +3866,7 @@ The function checks to ensure that the rebindings are done only once."
                                         ; Ensure load of isearch-mode:
     (if (or (and (fboundp 'isearch-mode)
                  (fboundp 'isearch-quote-char))
-            (condition-case error 
+            (condition-case error
                 (load-library outline-enwrap-isearch-mode)
               (file-error (message "Skipping isearch-mode provisions - %s '%s'"
                                    (car (cdr error))
@@ -3768,17 +3876,17 @@ The function checks to ensure that the rebindings are done only once."
                           (setq outline-enwrap-isearch-mode 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: 'isearch-quit' is pre isearch v 1.2.
+         ;; names, in their stead: `isearch-quit' is pre isearch v 1.2.
           (fset 'real-isearch-terminate
-                                        ; 'isearch-quit is pre v 1.2:
+                                        ; `isearch-quit' is pre v 1.2:
                 (or (if (fboundp 'isearch-quit)
                         (symbol-function 'isearch-quit))
                     (if (fboundp 'isearch-abort)
-                                        ; 'isearch-abort' is v 1.2 and on:
+                                        ; `isearch-abort' is v 1.2 and on:
                         (symbol-function 'isearch-abort))))
           (fset 'isearch-quit 'isearch-terminate/outline-provisions)
           (fset 'isearch-abort 'isearch-terminate/outline-provisions)
@@ -3949,7 +4057,7 @@ string across latex processing."
   "Express line for exact \(literal\) representation across latex processing.
 
 Adjust line contents so it is unaltered \(from the original line)
-across latex processing, within the context of a 'verbatim'
+across latex processing, within the context of a `verbatim'
 environment.  Leaves point at the end of the line."
   (beginning-of-line)
   (let ((beg (point))
@@ -4053,7 +4161,7 @@ BULLET string, and a list of TEXT strings for the body."
         (curr-line)
         body-content bop)
                                        ; Do the head line:
-    (insert-string (concat "\\OneHeadLine{\\verb\1 " 
+    (insert-string (concat "\\OneHeadLine{\\verb\1 "
                           (outline-latex-verb-quote bullet)
                           "\1}{"
                           depth
@@ -4137,7 +4245,7 @@ With repeat count, copy the exposed portions of entire buffer."
 ;; outlinify-sticky is correct spelling; provide this alias for sticklers:
 (defalias 'outlinify-sticky 'outlineify-sticky)
 (defun outlineify-sticky (&optional arg)
-  "Activate outline mode and establish file var so it is started subseqently.
+  "Activate outline mode and establish file var so it is started subsequently.
 
 See doc-string for `outline-layout' and `outline-init' for details on
 setup for auto-startup."
@@ -4181,7 +4289,7 @@ Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
       (message "%s" new-prompt)
 
       ;; We do our own reading here, so we can circumvent, eg, special
-      ;; treatment for '?' character.  (Might oughta change minibuffer
+      ;; treatment for `?' character.  (Might oughta change minibuffer
       ;; keymap instead, oh well.)
       (setq got
             (char-to-string (let ((cursor-in-echo-area nil)) (read-char))))
@@ -4232,7 +4340,7 @@ Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion."
 (if (not (fboundp 'add-hook))
     (defun add-hook (hook function &optional append)
       "Add to the value of HOOK the function FUNCTION unless already present.
-\(It becomes the first hook on the list unless optional APPEND is non-nil, in 
+\(It becomes the first hook on the list unless optional APPEND is non-nil, in
 which case it becomes the last).  HOOK should be a symbol, and FUNCTION may be
 any valid function.  HOOK's value should be a list of functions, not a single
 function.  If HOOK is void, it is first set to nil."
@@ -4243,7 +4351,7 @@ function.  If HOOK is void, it is first set to nil."
              (let ((tail (assoc (cdr function) (symbol-value hook))))
                (equal function tail))
            (memq function (symbol-value hook)))
-         (set hook 
+         (set hook
               (if append
                   (nconc (symbol-value hook) (list function))
                 (cons function (symbol-value hook)))))))
@@ -4257,7 +4365,7 @@ function.  If HOOK is void, it is first set to nil."
       (setq bullet (solicit-char-in-string
                    "ISearch for topic with bullet: "
                    (regexp-sans-escapes outline-bullets-string))))
-       
+
   (let ((isearch-regexp t)
        (isearch-string (concat "^"
                                outline-header-prefix
@@ -4266,7 +4374,7 @@ function.  If HOOK is void, it is first set to nil."
     (isearch-repeat 'forward)
     (isearch-mode t)))
 ;;;_  ? Re hooking up with isearch - use isearch-op-fun rather than
-;;;    wrapping the isearch functions. 
+;;;    wrapping the isearch functions.
 
 ;;;_* Local emacs vars.
 ;;; The following `outline-layout' local variable setting:
@@ -4279,4 +4387,3 @@ function.  If HOOK is void, it is first set to nil."
 ;;;End:
 
 ;; allout.el ends here
-