diff options
| author | Markus Rost | 2002-12-16 00:20:42 +0000 |
|---|---|---|
| committer | Markus Rost | 2002-12-16 00:20:42 +0000 |
| commit | fd5359c61ba4bbef9c54239a6eff160e243de02f (patch) | |
| tree | 6743066d3e8430b8d84001356be900ef0358aedb | |
| parent | 4994a50d17db6195b0177ba0efabf7408d6b837a (diff) | |
| download | emacs-fd5359c61ba4bbef9c54239a6eff160e243de02f.tar.gz emacs-fd5359c61ba4bbef9c54239a6eff160e243de02f.zip | |
Avoid name conflicts with outline.el. Use 3 installments to keep
diffs understandable.
Change 1: Replace globally string "outline-" with string "allout-".
Replaced 1446 occurrences; there was no string "allout-" before the
change and there seems to be no dependency on outline.el.
| -rw-r--r-- | lisp/allout.el | 2760 |
1 files changed, 1380 insertions, 1380 deletions
diff --git a/lisp/allout.el b/lisp/allout.el index 491ef5171d2..f77376f871e 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Ken Manheimer <klm@python.org> | 5 | ;; Author: Ken Manheimer <klm@python.org> |
| 6 | ;; Maintainer: Ken Manheimer <klm@python.org> | 6 | ;; Maintainer: Ken Manheimer <klm@python.org> |
| 7 | ;; Created: Dec 1991 - first release to usenet | 7 | ;; Created: Dec 1991 - first release to usenet |
| 8 | ;; Version: $Id: allout.el,v 1.33 2002/07/03 13:19:13 lektu Exp $|| | 8 | ;; Version: $Id: allout.el,v 1.34 2002/08/30 11:03:28 lektu Exp $|| |
| 9 | ;; Keywords: outlines mode wp languages | 9 | ;; Keywords: outlines mode wp languages |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| @@ -41,18 +41,18 @@ | |||
| 41 | ;; - incremental search with dynamic exposure and reconcealment of hidden text | 41 | ;; - incremental search with dynamic exposure and reconcealment of hidden text |
| 42 | ;; - automatic topic-number maintenance | 42 | ;; - automatic topic-number maintenance |
| 43 | ;; - "Hot-spot" operation, for single-keystroke maneuvering and | 43 | ;; - "Hot-spot" operation, for single-keystroke maneuvering and |
| 44 | ;; exposure control. (See the `outline-mode' docstring.) | 44 | ;; exposure control. (See the `allout-mode' docstring.) |
| 45 | ;; | 45 | ;; |
| 46 | ;; and many other features. | 46 | ;; and many other features. |
| 47 | ;; | 47 | ;; |
| 48 | ;; The outline menubar additions provide quick reference to many of | 48 | ;; The outline menubar additions provide quick reference to many of |
| 49 | ;; the features, and see the docstring of the variable `outline-init' | 49 | ;; the features, and see the docstring of the variable `allout-init' |
| 50 | ;; for instructions on priming your emacs session for automatic | 50 | ;; for instructions on priming your emacs session for automatic |
| 51 | ;; activation of `outline-mode'. | 51 | ;; activation of `allout-mode'. |
| 52 | ;; | 52 | ;; |
| 53 | ;; See the docstring of the variables `outline-layout' and | 53 | ;; See the docstring of the variables `allout-layout' and |
| 54 | ;; `outline-auto-activation' for details on automatic activation of | 54 | ;; `allout-auto-activation' for details on automatic activation of |
| 55 | ;; allout `outline-mode' as a minor mode. (It has changed since allout | 55 | ;; allout `allout-mode' as a minor mode. (It has changed since allout |
| 56 | ;; 3.x, for those of you that depend on the old method.) | 56 | ;; 3.x, for those of you that depend on the old method.) |
| 57 | ;; | 57 | ;; |
| 58 | ;; Note - the lines beginning with `;;;_' are outline topic headers. | 58 | ;; Note - the lines beginning with `;;;_' are outline topic headers. |
| @@ -69,23 +69,23 @@ | |||
| 69 | ;;;_* USER CUSTOMIZATION VARIABLES: | 69 | ;;;_* USER CUSTOMIZATION VARIABLES: |
| 70 | (defgroup allout nil | 70 | (defgroup allout nil |
| 71 | "Extensive outline mode for use alone and with other modes." | 71 | "Extensive outline mode for use alone and with other modes." |
| 72 | :prefix "outline-" | 72 | :prefix "allout-" |
| 73 | :group 'outlines) | 73 | :group 'outlines) |
| 74 | 74 | ||
| 75 | ;;;_ + Layout, Mode, and Topic Header Configuration | 75 | ;;;_ + Layout, Mode, and Topic Header Configuration |
| 76 | 76 | ||
| 77 | ;;;_ = outline-auto-activation | 77 | ;;;_ = allout-auto-activation |
| 78 | (defcustom outline-auto-activation nil | 78 | (defcustom allout-auto-activation nil |
| 79 | "*Regulates auto-activation modality of allout outlines - see `outline-init'. | 79 | "*Regulates auto-activation modality of allout outlines - see `allout-init'. |
| 80 | 80 | ||
| 81 | Setq-default by `outline-init' to regulate whether or not allout | 81 | Setq-default by `allout-init' to regulate whether or not allout |
| 82 | outline mode is automatically activated when the buffer-specific | 82 | outline mode is automatically activated when the buffer-specific |
| 83 | variable `outline-layout' is non-nil, and whether or not the layout | 83 | variable `allout-layout' is non-nil, and whether or not the layout |
| 84 | dictated by `outline-layout' should be imposed on mode activation. | 84 | dictated by `allout-layout' should be imposed on mode activation. |
| 85 | 85 | ||
| 86 | With value `t', auto-mode-activation and auto-layout are enabled. | 86 | With value `t', auto-mode-activation and auto-layout are enabled. |
| 87 | \(This also depends on `outline-find-file-hooks' being installed in | 87 | \(This also depends on `allout-find-file-hooks' being installed in |
| 88 | `find-file-hooks', which is also done by `outline-init'.) | 88 | `find-file-hooks', which is also done by `allout-init'.) |
| 89 | 89 | ||
| 90 | With value `ask', auto-mode-activation is enabled, and endorsement for | 90 | With value `ask', auto-mode-activation is enabled, and endorsement for |
| 91 | performing auto-layout is asked of the user each time. | 91 | performing auto-layout is asked of the user each time. |
| @@ -96,26 +96,26 @@ auto-layout is not. | |||
| 96 | With value `nil', neither auto-mode-activation nor auto-layout are | 96 | With value `nil', neither auto-mode-activation nor auto-layout are |
| 97 | enabled. | 97 | enabled. |
| 98 | 98 | ||
| 99 | See the docstring for `outline-init' for the proper interface to | 99 | See the docstring for `allout-init' for the proper interface to |
| 100 | this variable." | 100 | this variable." |
| 101 | :type '(choice (const :tag "On" t) | 101 | :type '(choice (const :tag "On" t) |
| 102 | (const :tag "Ask about layout" "ask") | 102 | (const :tag "Ask about layout" "ask") |
| 103 | (const :tag "Mode only" "activate") | 103 | (const :tag "Mode only" "activate") |
| 104 | (const :tag "Off" nil)) | 104 | (const :tag "Off" nil)) |
| 105 | :group 'allout) | 105 | :group 'allout) |
| 106 | ;;;_ = outline-layout | 106 | ;;;_ = allout-layout |
| 107 | (defvar outline-layout nil | 107 | (defvar allout-layout nil |
| 108 | "*Layout specification and provisional mode trigger for allout outlines. | 108 | "*Layout specification and provisional mode trigger for allout outlines. |
| 109 | 109 | ||
| 110 | Buffer-specific. | 110 | Buffer-specific. |
| 111 | 111 | ||
| 112 | A list value specifies a default layout for the current buffer, to be | 112 | A list value specifies a default layout for the current buffer, to be |
| 113 | applied upon activation of allout `outline-mode'. Any non-nil value will | 113 | applied upon activation of allout `allout-mode'. Any non-nil value will |
| 114 | automatically trigger allout `outline-mode', provided `outline-init' | 114 | automatically trigger allout `allout-mode', provided `allout-init' |
| 115 | has been called to enable it. | 115 | has been called to enable it. |
| 116 | 116 | ||
| 117 | See the docstring for `outline-init' for details on setting up for | 117 | See the docstring for `allout-init' for details on setting up for |
| 118 | auto-mode-activation, and for `outline-expose-topic' for the format of | 118 | auto-mode-activation, and for `allout-expose-topic' for the format of |
| 119 | the layout specification. | 119 | the layout specification. |
| 120 | 120 | ||
| 121 | You can associate a particular outline layout with a file by setting | 121 | You can associate a particular outline layout with a file by setting |
| @@ -123,58 +123,58 @@ this var via the file's local variables. For example, the following | |||
| 123 | lines at the bottom of an Emacs Lisp file: | 123 | lines at the bottom of an Emacs Lisp file: |
| 124 | 124 | ||
| 125 | ;;;Local variables: | 125 | ;;;Local variables: |
| 126 | ;;;outline-layout: \(0 : -1 -1 0) | 126 | ;;;allout-layout: \(0 : -1 -1 0) |
| 127 | ;;;End: | 127 | ;;;End: |
| 128 | 128 | ||
| 129 | will, modulo the above-mentioned conditions, cause the mode to be | 129 | will, modulo the above-mentioned conditions, cause the mode to be |
| 130 | activated when the file is visited, followed by the equivalent of | 130 | activated when the file is visited, followed by the equivalent of |
| 131 | `\(outline-expose-topic 0 : -1 -1 0)'. \(This is the layout used for | 131 | `\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for |
| 132 | the allout.el, itself.) | 132 | the allout.el, itself.) |
| 133 | 133 | ||
| 134 | Also, allout's mode-specific provisions will make topic prefixes default | 134 | Also, allout's mode-specific provisions will make topic prefixes default |
| 135 | to the comment-start string, if any, of the language of the file. This | 135 | to the comment-start string, if any, of the language of the file. This |
| 136 | is modulo the setting of `outline-use-mode-specific-leader', which see.") | 136 | is modulo the setting of `allout-use-mode-specific-leader', which see.") |
| 137 | (make-variable-buffer-local 'outline-layout) | 137 | (make-variable-buffer-local 'allout-layout) |
| 138 | ;;;_ = outline-show-bodies | 138 | ;;;_ = allout-show-bodies |
| 139 | (defcustom outline-show-bodies nil | 139 | (defcustom allout-show-bodies nil |
| 140 | "*If non-nil, show entire body when exposing a topic, rather than | 140 | "*If non-nil, show entire body when exposing a topic, rather than |
| 141 | just the header." | 141 | just the header." |
| 142 | :type 'boolean | 142 | :type 'boolean |
| 143 | :group 'allout) | 143 | :group 'allout) |
| 144 | (make-variable-buffer-local 'outline-show-bodies) | 144 | (make-variable-buffer-local 'allout-show-bodies) |
| 145 | 145 | ||
| 146 | ;;;_ = outline-header-prefix | 146 | ;;;_ = allout-header-prefix |
| 147 | (defcustom outline-header-prefix "." | 147 | (defcustom allout-header-prefix "." |
| 148 | "*Leading string which helps distinguish topic headers. | 148 | "*Leading string which helps distinguish topic headers. |
| 149 | 149 | ||
| 150 | Outline topic header lines are identified by a leading topic | 150 | Outline topic header lines are identified by a leading topic |
| 151 | header prefix, which mostly have the value of this var at their front. | 151 | header prefix, which mostly have the value of this var at their front. |
| 152 | \(Level 1 topics are exceptions. They consist of only a single | 152 | \(Level 1 topics are exceptions. They consist of only a single |
| 153 | character, which is typically set to the outline-primary-bullet. Many | 153 | character, which is typically set to the allout-primary-bullet. Many |
| 154 | outlines start at level 2 to avoid this discrepancy." | 154 | outlines start at level 2 to avoid this discrepancy." |
| 155 | :type 'string | 155 | :type 'string |
| 156 | :group 'allout) | 156 | :group 'allout) |
| 157 | (make-variable-buffer-local 'outline-header-prefix) | 157 | (make-variable-buffer-local 'allout-header-prefix) |
| 158 | ;;;_ = outline-primary-bullet | 158 | ;;;_ = allout-primary-bullet |
| 159 | (defcustom outline-primary-bullet "*" | 159 | (defcustom allout-primary-bullet "*" |
| 160 | "Bullet used for top-level outline topics. | 160 | "Bullet used for top-level outline topics. |
| 161 | 161 | ||
| 162 | Outline topic header lines are identified by a leading topic header | 162 | Outline topic header lines are identified by a leading topic header |
| 163 | prefix, which is concluded by bullets that includes the value of this | 163 | prefix, which is concluded by bullets that includes the value of this |
| 164 | var and the respective outline-*-bullets-string vars. | 164 | var and the respective allout-*-bullets-string vars. |
| 165 | 165 | ||
| 166 | The value of an asterisk (`*') provides for backwards compatibility | 166 | The value of an asterisk (`*') provides for backwards compatibility |
| 167 | with the original emacs outline mode. See outline-plain-bullets-string | 167 | with the original emacs outline mode. See allout-plain-bullets-string |
| 168 | and outline-distinctive-bullets-string for the range of available | 168 | and allout-distinctive-bullets-string for the range of available |
| 169 | bullets." | 169 | bullets." |
| 170 | :type 'string | 170 | :type 'string |
| 171 | :group 'allout) | 171 | :group 'allout) |
| 172 | (make-variable-buffer-local 'outline-primary-bullet) | 172 | (make-variable-buffer-local 'allout-primary-bullet) |
| 173 | ;;;_ = outline-plain-bullets-string | 173 | ;;;_ = allout-plain-bullets-string |
| 174 | (defcustom outline-plain-bullets-string ".:,;" | 174 | (defcustom allout-plain-bullets-string ".:,;" |
| 175 | "*The bullets normally used in outline topic prefixes. | 175 | "*The bullets normally used in outline topic prefixes. |
| 176 | 176 | ||
| 177 | See `outline-distinctive-bullets-string' for the other kind of | 177 | See `allout-distinctive-bullets-string' for the other kind of |
| 178 | bullets. | 178 | bullets. |
| 179 | 179 | ||
| 180 | DO NOT include the close-square-bracket, `]', as a bullet. | 180 | DO NOT include the close-square-bracket, `]', as a bullet. |
| @@ -183,9 +183,9 @@ Outline mode has to be reactivated in order for changes to the value | |||
| 183 | of this var to take effect." | 183 | of this var to take effect." |
| 184 | :type 'string | 184 | :type 'string |
| 185 | :group 'allout) | 185 | :group 'allout) |
| 186 | (make-variable-buffer-local 'outline-plain-bullets-string) | 186 | (make-variable-buffer-local 'allout-plain-bullets-string) |
| 187 | ;;;_ = outline-distinctive-bullets-string | 187 | ;;;_ = allout-distinctive-bullets-string |
| 188 | (defcustom outline-distinctive-bullets-string "*+-=>([{}&!?#%\"X@$~_\\" | 188 | (defcustom allout-distinctive-bullets-string "*+-=>([{}&!?#%\"X@$~_\\" |
| 189 | "*Persistent outline header bullets used to distinguish special topics. | 189 | "*Persistent outline header bullets used to distinguish special topics. |
| 190 | 190 | ||
| 191 | These bullets are used to distinguish topics from the run-of-the-mill | 191 | These bullets are used to distinguish topics from the run-of-the-mill |
| @@ -203,35 +203,35 @@ rebulleting, so they can be used to characterize topics, eg: | |||
| 203 | `~' \"more or less\" | 203 | `~' \"more or less\" |
| 204 | 204 | ||
| 205 | ... just for example. (`#' typically has a special meaning to the | 205 | ... just for example. (`#' typically has a special meaning to the |
| 206 | software, according to the value of `outline-numbered-bullet'.) | 206 | software, according to the value of `allout-numbered-bullet'.) |
| 207 | 207 | ||
| 208 | See `outline-plain-bullets-string' for the selection of | 208 | See `allout-plain-bullets-string' for the selection of |
| 209 | alternating bullets. | 209 | alternating bullets. |
| 210 | 210 | ||
| 211 | You must run `set-outline-regexp' in order for outline mode to | 211 | You must run `set-allout-regexp' in order for outline mode to |
| 212 | reconcile to changes of this value. | 212 | reconcile to changes of this value. |
| 213 | 213 | ||
| 214 | DO NOT include the close-square-bracket, `]', on either of the bullet | 214 | DO NOT include the close-square-bracket, `]', on either of the bullet |
| 215 | strings." | 215 | strings." |
| 216 | :type 'string | 216 | :type 'string |
| 217 | :group 'allout) | 217 | :group 'allout) |
| 218 | (make-variable-buffer-local 'outline-distinctive-bullets-string) | 218 | (make-variable-buffer-local 'allout-distinctive-bullets-string) |
| 219 | 219 | ||
| 220 | ;;;_ = outline-use-mode-specific-leader | 220 | ;;;_ = allout-use-mode-specific-leader |
| 221 | (defcustom outline-use-mode-specific-leader t | 221 | (defcustom allout-use-mode-specific-leader t |
| 222 | "*When non-nil, use mode-specific topic-header prefixes. | 222 | "*When non-nil, use mode-specific topic-header prefixes. |
| 223 | 223 | ||
| 224 | Allout outline mode will use the mode-specific `outline-mode-leaders' | 224 | Allout outline mode will use the mode-specific `allout-mode-leaders' |
| 225 | and/or comment-start string, if any, to lead the topic prefix string, | 225 | and/or comment-start string, if any, to lead the topic prefix string, |
| 226 | so topic headers look like comments in the programming language. | 226 | so topic headers look like comments in the programming language. |
| 227 | 227 | ||
| 228 | String values are used as they stand. | 228 | String values are used as they stand. |
| 229 | 229 | ||
| 230 | Value `t' means to first check for assoc value in `outline-mode-leaders' | 230 | Value `t' means to first check for assoc value in `allout-mode-leaders' |
| 231 | alist, then use comment-start string, if any, then use default \(`.'). | 231 | alist, then use comment-start string, if any, then use default \(`.'). |
| 232 | \(See note about use of comment-start strings, below.) | 232 | \(See note about use of comment-start strings, below.) |
| 233 | 233 | ||
| 234 | Set to the symbol for either of `outline-mode-leaders' or | 234 | Set to the symbol for either of `allout-mode-leaders' or |
| 235 | `comment-start' to use only one of them, respectively. | 235 | `comment-start' to use only one of them, respectively. |
| 236 | 236 | ||
| 237 | Value `nil' means to always use the default \(`.'). | 237 | Value `nil' means to always use the default \(`.'). |
| @@ -241,27 +241,27 @@ comment-start strings that do not end in spaces are tripled, and an | |||
| 241 | comment strings. comment-start strings that do end in spaces are not | 241 | comment strings. comment-start strings that do end in spaces are not |
| 242 | tripled, but an underscore is substituted for the space. [This | 242 | tripled, but an underscore is substituted for the space. [This |
| 243 | presumes that the space is for appearance, not comment syntax. You | 243 | presumes that the space is for appearance, not comment syntax. You |
| 244 | can use `outline-mode-leaders' to override this behavior, when | 244 | can use `allout-mode-leaders' to override this behavior, when |
| 245 | incorrect.]" | 245 | incorrect.]" |
| 246 | :type '(choice (const t) (const nil) string | 246 | :type '(choice (const t) (const nil) string |
| 247 | (const outline-mode-leaders) | 247 | (const allout-mode-leaders) |
| 248 | (const comment-start)) | 248 | (const comment-start)) |
| 249 | :group 'allout) | 249 | :group 'allout) |
| 250 | ;;;_ = outline-mode-leaders | 250 | ;;;_ = allout-mode-leaders |
| 251 | (defvar outline-mode-leaders '() | 251 | (defvar allout-mode-leaders '() |
| 252 | "Specific outline-prefix leading strings per major modes. | 252 | "Specific allout-prefix leading strings per major modes. |
| 253 | 253 | ||
| 254 | Entries will be used instead or in lieu of mode-specific | 254 | Entries will be used instead or in lieu of mode-specific |
| 255 | comment-start strings. See also `outline-use-mode-specific-leader'. | 255 | comment-start strings. See also `allout-use-mode-specific-leader'. |
| 256 | 256 | ||
| 257 | If you're constructing a string that will comment-out outline | 257 | If you're constructing a string that will comment-out outline |
| 258 | structuring so it can be included in program code, append an extra | 258 | structuring so it can be included in program code, append an extra |
| 259 | character, like an \"_\" underscore, to distinguish the lead string | 259 | character, like an \"_\" underscore, to distinguish the lead string |
| 260 | from regular comments that start at bol.") | 260 | from regular comments that start at bol.") |
| 261 | 261 | ||
| 262 | ;;;_ = outline-old-style-prefixes | 262 | ;;;_ = allout-old-style-prefixes |
| 263 | (defcustom outline-old-style-prefixes nil | 263 | (defcustom allout-old-style-prefixes nil |
| 264 | "*When non-nil, use only old-and-crusty outline-mode `*' topic prefixes. | 264 | "*When non-nil, use only old-and-crusty allout-mode `*' topic prefixes. |
| 265 | 265 | ||
| 266 | Non-nil restricts the topic creation and modification | 266 | Non-nil restricts the topic creation and modification |
| 267 | functions to asterix-padded prefixes, so they look exactly | 267 | functions to asterix-padded prefixes, so they look exactly |
| @@ -271,9 +271,9 @@ Whatever the setting of this variable, both old and new style prefixes | |||
| 271 | are always respected by the topic maneuvering functions." | 271 | are always respected by the topic maneuvering functions." |
| 272 | :type 'boolean | 272 | :type 'boolean |
| 273 | :group 'allout) | 273 | :group 'allout) |
| 274 | (make-variable-buffer-local 'outline-old-style-prefixes) | 274 | (make-variable-buffer-local 'allout-old-style-prefixes) |
| 275 | ;;;_ = outline-stylish-prefixes - alternating bullets | 275 | ;;;_ = allout-stylish-prefixes - alternating bullets |
| 276 | (defcustom outline-stylish-prefixes t | 276 | (defcustom allout-stylish-prefixes t |
| 277 | "*Do fancy stuff with topic prefix bullets according to level, etc. | 277 | "*Do fancy stuff with topic prefix bullets according to level, etc. |
| 278 | 278 | ||
| 279 | Non-nil enables topic creation, modification, and repositioning | 279 | Non-nil enables topic creation, modification, and repositioning |
| @@ -313,14 +313,14 @@ Stylish and constant prefixes (as well as old-style prefixes) are | |||
| 313 | always respected by the topic maneuvering functions, regardless of | 313 | always respected by the topic maneuvering functions, regardless of |
| 314 | this variable setting. | 314 | this variable setting. |
| 315 | 315 | ||
| 316 | The setting of this var is not relevant when outline-old-style-prefixes | 316 | The setting of this var is not relevant when allout-old-style-prefixes |
| 317 | is non-nil." | 317 | is non-nil." |
| 318 | :type 'boolean | 318 | :type 'boolean |
| 319 | :group 'allout) | 319 | :group 'allout) |
| 320 | (make-variable-buffer-local 'outline-stylish-prefixes) | 320 | (make-variable-buffer-local 'allout-stylish-prefixes) |
| 321 | 321 | ||
| 322 | ;;;_ = outline-numbered-bullet | 322 | ;;;_ = allout-numbered-bullet |
| 323 | (defcustom outline-numbered-bullet "#" | 323 | (defcustom allout-numbered-bullet "#" |
| 324 | "*String designating bullet of topics that have auto-numbering; nil for none. | 324 | "*String designating bullet of topics that have auto-numbering; nil for none. |
| 325 | 325 | ||
| 326 | Topics having this bullet have automatic maintenance of a sibling | 326 | Topics having this bullet have automatic maintenance of a sibling |
| @@ -329,138 +329,138 @@ to \"#\", you can set it to a bullet of your choice. A nil value | |||
| 329 | disables numbering maintenance." | 329 | disables numbering maintenance." |
| 330 | :type '(choice (const nil) string) | 330 | :type '(choice (const nil) string) |
| 331 | :group 'allout) | 331 | :group 'allout) |
| 332 | (make-variable-buffer-local 'outline-numbered-bullet) | 332 | (make-variable-buffer-local 'allout-numbered-bullet) |
| 333 | ;;;_ = outline-file-xref-bullet | 333 | ;;;_ = allout-file-xref-bullet |
| 334 | (defcustom outline-file-xref-bullet "@" | 334 | (defcustom allout-file-xref-bullet "@" |
| 335 | "*Bullet signifying file cross-references, for `outline-resolve-xref'. | 335 | "*Bullet signifying file cross-references, for `allout-resolve-xref'. |
| 336 | 336 | ||
| 337 | Set this var to the bullet you want to use for file cross-references." | 337 | Set this var to the bullet you want to use for file cross-references." |
| 338 | :type '(choice (const nil) string) | 338 | :type '(choice (const nil) string) |
| 339 | :group 'allout) | 339 | :group 'allout) |
| 340 | 340 | ||
| 341 | ;;;_ = outline-presentation-padding | 341 | ;;;_ = allout-presentation-padding |
| 342 | (defcustom outline-presentation-padding 2 | 342 | (defcustom allout-presentation-padding 2 |
| 343 | "*Presentation-format white-space padding factor, for greater indent." | 343 | "*Presentation-format white-space padding factor, for greater indent." |
| 344 | :type 'integer | 344 | :type 'integer |
| 345 | :group 'allout) | 345 | :group 'allout) |
| 346 | 346 | ||
| 347 | (make-variable-buffer-local 'outline-presentation-padding) | 347 | (make-variable-buffer-local 'allout-presentation-padding) |
| 348 | 348 | ||
| 349 | ;;;_ = outline-abbreviate-flattened-numbering | 349 | ;;;_ = allout-abbreviate-flattened-numbering |
| 350 | (defcustom outline-abbreviate-flattened-numbering nil | 350 | (defcustom allout-abbreviate-flattened-numbering nil |
| 351 | "*If non-nil, `outline-flatten-exposed-to-buffer' abbreviates topic | 351 | "*If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic |
| 352 | numbers to minimal amount with some context. Otherwise, entire | 352 | numbers to minimal amount with some context. Otherwise, entire |
| 353 | numbers are always used." | 353 | numbers are always used." |
| 354 | :type 'boolean | 354 | :type 'boolean |
| 355 | :group 'allout) | 355 | :group 'allout) |
| 356 | 356 | ||
| 357 | ;;;_ + LaTeX formatting | 357 | ;;;_ + LaTeX formatting |
| 358 | ;;;_ - outline-number-pages | 358 | ;;;_ - allout-number-pages |
| 359 | (defcustom outline-number-pages nil | 359 | (defcustom allout-number-pages nil |
| 360 | "*Non-nil turns on page numbering for LaTeX formatting of an outline." | 360 | "*Non-nil turns on page numbering for LaTeX formatting of an outline." |
| 361 | :type 'boolean | 361 | :type 'boolean |
| 362 | :group 'allout) | 362 | :group 'allout) |
| 363 | ;;;_ - outline-label-style | 363 | ;;;_ - allout-label-style |
| 364 | (defcustom outline-label-style "\\large\\bf" | 364 | (defcustom allout-label-style "\\large\\bf" |
| 365 | "*Font and size of labels for LaTeX formatting of an outline." | 365 | "*Font and size of labels for LaTeX formatting of an outline." |
| 366 | :type 'string | 366 | :type 'string |
| 367 | :group 'allout) | 367 | :group 'allout) |
| 368 | ;;;_ - outline-head-line-style | 368 | ;;;_ - allout-head-line-style |
| 369 | (defcustom outline-head-line-style "\\large\\sl " | 369 | (defcustom allout-head-line-style "\\large\\sl " |
| 370 | "*Font and size of entries for LaTeX formatting of an outline." | 370 | "*Font and size of entries for LaTeX formatting of an outline." |
| 371 | :type 'string | 371 | :type 'string |
| 372 | :group 'allout) | 372 | :group 'allout) |
| 373 | ;;;_ - outline-body-line-style | 373 | ;;;_ - allout-body-line-style |
| 374 | (defcustom outline-body-line-style " " | 374 | (defcustom allout-body-line-style " " |
| 375 | "*Font and size of entries for LaTeX formatting of an outline." | 375 | "*Font and size of entries for LaTeX formatting of an outline." |
| 376 | :type 'string | 376 | :type 'string |
| 377 | :group 'allout) | 377 | :group 'allout) |
| 378 | ;;;_ - outline-title-style | 378 | ;;;_ - allout-title-style |
| 379 | (defcustom outline-title-style "\\Large\\bf" | 379 | (defcustom allout-title-style "\\Large\\bf" |
| 380 | "*Font and size of titles for LaTeX formatting of an outline." | 380 | "*Font and size of titles for LaTeX formatting of an outline." |
| 381 | :type 'string | 381 | :type 'string |
| 382 | :group 'allout) | 382 | :group 'allout) |
| 383 | ;;;_ - outline-title | 383 | ;;;_ - allout-title |
| 384 | (defcustom outline-title '(or buffer-file-name (current-buffer-name)) | 384 | (defcustom allout-title '(or buffer-file-name (current-buffer-name)) |
| 385 | "*Expression to be evaluated to determine the title for LaTeX | 385 | "*Expression to be evaluated to determine the title for LaTeX |
| 386 | formatted copy." | 386 | formatted copy." |
| 387 | :type 'sexp | 387 | :type 'sexp |
| 388 | :group 'allout) | 388 | :group 'allout) |
| 389 | ;;;_ - outline-line-skip | 389 | ;;;_ - allout-line-skip |
| 390 | (defcustom outline-line-skip ".05cm" | 390 | (defcustom allout-line-skip ".05cm" |
| 391 | "*Space between lines for LaTeX formatting of an outline." | 391 | "*Space between lines for LaTeX formatting of an outline." |
| 392 | :type 'string | 392 | :type 'string |
| 393 | :group 'allout) | 393 | :group 'allout) |
| 394 | ;;;_ - outline-indent | 394 | ;;;_ - allout-indent |
| 395 | (defcustom outline-indent ".3cm" | 395 | (defcustom allout-indent ".3cm" |
| 396 | "*LaTeX formatted depth-indent spacing." | 396 | "*LaTeX formatted depth-indent spacing." |
| 397 | :type 'string | 397 | :type 'string |
| 398 | :group 'allout) | 398 | :group 'allout) |
| 399 | 399 | ||
| 400 | ;;;_ + Miscellaneous customization | 400 | ;;;_ + Miscellaneous customization |
| 401 | 401 | ||
| 402 | ;;;_ = outline-command-prefix | 402 | ;;;_ = allout-command-prefix |
| 403 | (defcustom outline-command-prefix "\C-c" | 403 | (defcustom allout-command-prefix "\C-c" |
| 404 | "*Key sequence to be used as prefix for outline mode command key bindings." | 404 | "*Key sequence to be used as prefix for outline mode command key bindings." |
| 405 | :type 'string | 405 | :type 'string |
| 406 | :group 'allout) | 406 | :group 'allout) |
| 407 | 407 | ||
| 408 | ;;;_ = outline-keybindings-list | 408 | ;;;_ = allout-keybindings-list |
| 409 | ;;; You have to reactivate outline-mode - `(outline-mode t)' - to | 409 | ;;; You have to reactivate allout-mode - `(allout-mode t)' - to |
| 410 | ;;; institute changes to this var. | 410 | ;;; institute changes to this var. |
| 411 | (defvar outline-keybindings-list () | 411 | (defvar allout-keybindings-list () |
| 412 | "*List of outline-mode key / function bindings, for outline-mode-map. | 412 | "*List of allout-mode key / function bindings, for allout-mode-map. |
| 413 | 413 | ||
| 414 | String or vector key will be prefaced with outline-command-prefix, | 414 | String or vector key will be prefaced with allout-command-prefix, |
| 415 | unless optional third, non-nil element is present.") | 415 | unless optional third, non-nil element is present.") |
| 416 | (setq outline-keybindings-list | 416 | (setq allout-keybindings-list |
| 417 | '( | 417 | '( |
| 418 | ; Motion commands: | 418 | ; Motion commands: |
| 419 | ("\C-n" outline-next-visible-heading) | 419 | ("\C-n" allout-next-visible-heading) |
| 420 | ("\C-p" outline-previous-visible-heading) | 420 | ("\C-p" allout-previous-visible-heading) |
| 421 | ("\C-u" outline-up-current-level) | 421 | ("\C-u" allout-up-current-level) |
| 422 | ("\C-f" outline-forward-current-level) | 422 | ("\C-f" allout-forward-current-level) |
| 423 | ("\C-b" outline-backward-current-level) | 423 | ("\C-b" allout-backward-current-level) |
| 424 | ("\C-a" outline-beginning-of-current-entry) | 424 | ("\C-a" allout-beginning-of-current-entry) |
| 425 | ("\C-e" outline-end-of-current-entry) | 425 | ("\C-e" allout-end-of-current-entry) |
| 426 | ; Exposure commands: | 426 | ; Exposure commands: |
| 427 | ("\C-i" outline-show-children) | 427 | ("\C-i" allout-show-children) |
| 428 | ("\C-s" outline-show-current-subtree) | 428 | ("\C-s" allout-show-current-subtree) |
| 429 | ("\C-h" outline-hide-current-subtree) | 429 | ("\C-h" allout-hide-current-subtree) |
| 430 | ("\C-o" outline-show-current-entry) | 430 | ("\C-o" allout-show-current-entry) |
| 431 | ("!" outline-show-all) | 431 | ("!" allout-show-all) |
| 432 | ; Alteration commands: | 432 | ; Alteration commands: |
| 433 | (" " outline-open-sibtopic) | 433 | (" " allout-open-sibtopic) |
| 434 | ("." outline-open-subtopic) | 434 | ("." allout-open-subtopic) |
| 435 | ("," outline-open-supertopic) | 435 | ("," allout-open-supertopic) |
| 436 | ("'" outline-shift-in) | 436 | ("'" allout-shift-in) |
| 437 | (">" outline-shift-in) | 437 | (">" allout-shift-in) |
| 438 | ("<" outline-shift-out) | 438 | ("<" allout-shift-out) |
| 439 | ("\C-m" outline-rebullet-topic) | 439 | ("\C-m" allout-rebullet-topic) |
| 440 | ("*" outline-rebullet-current-heading) | 440 | ("*" allout-rebullet-current-heading) |
| 441 | ("#" outline-number-siblings) | 441 | ("#" allout-number-siblings) |
| 442 | ("\C-k" outline-kill-line t) | 442 | ("\C-k" allout-kill-line t) |
| 443 | ("\C-y" outline-yank t) | 443 | ("\C-y" allout-yank t) |
| 444 | ("\M-y" outline-yank-pop t) | 444 | ("\M-y" allout-yank-pop t) |
| 445 | ("\C-k" outline-kill-topic) | 445 | ("\C-k" allout-kill-topic) |
| 446 | ; Miscellaneous commands: | 446 | ; Miscellaneous commands: |
| 447 | ;([?\C-\ ] outline-mark-topic) | 447 | ;([?\C-\ ] allout-mark-topic) |
| 448 | ("@" outline-resolve-xref) | 448 | ("@" allout-resolve-xref) |
| 449 | ("=c" outline-copy-exposed-to-buffer) | 449 | ("=c" allout-copy-exposed-to-buffer) |
| 450 | ("=i" outline-indented-exposed-to-buffer) | 450 | ("=i" allout-indented-exposed-to-buffer) |
| 451 | ("=t" outline-latexify-exposed) | 451 | ("=t" allout-latexify-exposed) |
| 452 | ("=p" outline-flatten-exposed-to-buffer))) | 452 | ("=p" allout-flatten-exposed-to-buffer))) |
| 453 | 453 | ||
| 454 | ;;;_ = outline-isearch-dynamic-expose | 454 | ;;;_ = allout-isearch-dynamic-expose |
| 455 | (defcustom outline-isearch-dynamic-expose t | 455 | (defcustom allout-isearch-dynamic-expose t |
| 456 | "*Non-nil enable dynamic exposure of hidden incremental-search | 456 | "*Non-nil enable dynamic exposure of hidden incremental-search |
| 457 | targets as they're encountered." | 457 | targets as they're encountered." |
| 458 | :type 'boolean | 458 | :type 'boolean |
| 459 | :group 'allout) | 459 | :group 'allout) |
| 460 | (make-variable-buffer-local 'outline-isearch-dynamic-expose) | 460 | (make-variable-buffer-local 'allout-isearch-dynamic-expose) |
| 461 | 461 | ||
| 462 | ;;;_ = outline-use-hanging-indents | 462 | ;;;_ = allout-use-hanging-indents |
| 463 | (defcustom outline-use-hanging-indents t | 463 | (defcustom allout-use-hanging-indents t |
| 464 | "*If non-nil, topic body text auto-indent defaults to indent of the header. | 464 | "*If non-nil, topic body text auto-indent defaults to indent of the header. |
| 465 | Ie, it is indented to be just past the header prefix. This is | 465 | Ie, it is indented to be just past the header prefix. This is |
| 466 | relevant mostly for use with indented-text-mode, or other situations | 466 | relevant mostly for use with indented-text-mode, or other situations |
| @@ -470,10 +470,10 @@ where auto-fill occurs. | |||
| 470 | lisp-archive package.\]" | 470 | lisp-archive package.\]" |
| 471 | :type 'boolean | 471 | :type 'boolean |
| 472 | :group 'allout) | 472 | :group 'allout) |
| 473 | (make-variable-buffer-local 'outline-use-hanging-indents) | 473 | (make-variable-buffer-local 'allout-use-hanging-indents) |
| 474 | 474 | ||
| 475 | ;;;_ = outline-reindent-bodies | 475 | ;;;_ = allout-reindent-bodies |
| 476 | (defcustom outline-reindent-bodies (if outline-use-hanging-indents | 476 | (defcustom allout-reindent-bodies (if allout-use-hanging-indents |
| 477 | 'text) | 477 | 'text) |
| 478 | "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts. | 478 | "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts. |
| 479 | 479 | ||
| @@ -487,17 +487,17 @@ those that do not have the variable `comment-start' set. A value of | |||
| 487 | :type '(choice (const nil) (const t) (const text) (const force)) | 487 | :type '(choice (const nil) (const t) (const text) (const force)) |
| 488 | :group 'allout) | 488 | :group 'allout) |
| 489 | 489 | ||
| 490 | (make-variable-buffer-local 'outline-reindent-bodies) | 490 | (make-variable-buffer-local 'allout-reindent-bodies) |
| 491 | 491 | ||
| 492 | ;;;_ = outline-inhibit-protection | 492 | ;;;_ = allout-inhibit-protection |
| 493 | (defcustom outline-inhibit-protection nil | 493 | (defcustom allout-inhibit-protection nil |
| 494 | "*Non-nil disables warnings and confirmation-checks for concealed-text edits. | 494 | "*Non-nil disables warnings and confirmation-checks for concealed-text edits. |
| 495 | 495 | ||
| 496 | Outline mode uses emacs change-triggered functions to detect unruly | 496 | Outline mode uses emacs change-triggered functions to detect unruly |
| 497 | changes to concealed regions. Set this var non-nil to disable the | 497 | changes to concealed regions. Set this var non-nil to disable the |
| 498 | protection, potentially increasing text-entry responsiveness a bit. | 498 | protection, potentially increasing text-entry responsiveness a bit. |
| 499 | 499 | ||
| 500 | This var takes effect at outline-mode activation, so you may have to | 500 | This var takes effect at allout-mode activation, so you may have to |
| 501 | deactivate and then reactivate the mode if you want to toggle the | 501 | deactivate and then reactivate the mode if you want to toggle the |
| 502 | behavior." | 502 | behavior." |
| 503 | :type 'boolean | 503 | :type 'boolean |
| @@ -507,76 +507,76 @@ behavior." | |||
| 507 | 507 | ||
| 508 | ;;;_ #1 Internal Outline Formatting and Configuration | 508 | ;;;_ #1 Internal Outline Formatting and Configuration |
| 509 | ;;;_ : Version | 509 | ;;;_ : Version |
| 510 | ;;;_ = outline-version | 510 | ;;;_ = allout-version |
| 511 | (defvar outline-version | 511 | (defvar allout-version |
| 512 | (let ((rcs-rev "$Revision: 1.33 $")) | 512 | (let ((rcs-rev "$Revision: 1.34 $")) |
| 513 | (condition-case err | 513 | (condition-case err |
| 514 | (save-match-data | 514 | (save-match-data |
| 515 | (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev) | 515 | (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev) |
| 516 | (substring rcs-rev (match-beginning 1) (match-end 1))) | 516 | (substring rcs-rev (match-beginning 1) (match-end 1))) |
| 517 | ('error rcs-rev))) | 517 | ('error rcs-rev))) |
| 518 | "Revision number of currently loaded outline package. \(allout.el)") | 518 | "Revision number of currently loaded outline package. \(allout.el)") |
| 519 | ;;;_ > outline-version | 519 | ;;;_ > allout-version |
| 520 | (defun outline-version (&optional here) | 520 | (defun allout-version (&optional here) |
| 521 | "Return string describing the loaded outline version." | 521 | "Return string describing the loaded outline version." |
| 522 | (interactive "P") | 522 | (interactive "P") |
| 523 | (let ((msg (concat "Allout Outline Mode v " outline-version))) | 523 | (let ((msg (concat "Allout Outline Mode v " allout-version))) |
| 524 | (if here (insert msg)) | 524 | (if here (insert msg)) |
| 525 | (message "%s" msg) | 525 | (message "%s" msg) |
| 526 | msg)) | 526 | msg)) |
| 527 | ;;;_ : Topic header format | 527 | ;;;_ : Topic header format |
| 528 | ;;;_ = outline-regexp | 528 | ;;;_ = allout-regexp |
| 529 | (defvar outline-regexp "" | 529 | (defvar allout-regexp "" |
| 530 | "*Regular expression to match the beginning of a heading line. | 530 | "*Regular expression to match the beginning of a heading line. |
| 531 | 531 | ||
| 532 | Any line whose beginning matches this regexp is considered a | 532 | Any line whose beginning matches this regexp is considered a |
| 533 | heading. This var is set according to the user configuration vars | 533 | heading. This var is set according to the user configuration vars |
| 534 | by set-outline-regexp.") | 534 | by set-allout-regexp.") |
| 535 | (make-variable-buffer-local 'outline-regexp) | 535 | (make-variable-buffer-local 'allout-regexp) |
| 536 | ;;;_ = outline-bullets-string | 536 | ;;;_ = allout-bullets-string |
| 537 | (defvar outline-bullets-string "" | 537 | (defvar allout-bullets-string "" |
| 538 | "A string dictating the valid set of outline topic bullets. | 538 | "A string dictating the valid set of outline topic bullets. |
| 539 | 539 | ||
| 540 | This var should *not* be set by the user - it is set by `set-outline-regexp', | 540 | This var should *not* be set by the user - it is set by `set-allout-regexp', |
| 541 | and is produced from the elements of `outline-plain-bullets-string' | 541 | and is produced from the elements of `allout-plain-bullets-string' |
| 542 | and `outline-distinctive-bullets-string'.") | 542 | and `allout-distinctive-bullets-string'.") |
| 543 | (make-variable-buffer-local 'outline-bullets-string) | 543 | (make-variable-buffer-local 'allout-bullets-string) |
| 544 | ;;;_ = outline-bullets-string-len | 544 | ;;;_ = allout-bullets-string-len |
| 545 | (defvar outline-bullets-string-len 0 | 545 | (defvar allout-bullets-string-len 0 |
| 546 | "Length of current buffers' outline-plain-bullets-string.") | 546 | "Length of current buffers' allout-plain-bullets-string.") |
| 547 | (make-variable-buffer-local 'outline-bullets-string-len) | 547 | (make-variable-buffer-local 'allout-bullets-string-len) |
| 548 | ;;;_ = outline-line-boundary-regexp | 548 | ;;;_ = allout-line-boundary-regexp |
| 549 | (defvar outline-line-boundary-regexp () | 549 | (defvar allout-line-boundary-regexp () |
| 550 | "Outline-regexp with outline-style beginning-of-line anchor. | 550 | "Allout-regexp with allout-style beginning-of-line anchor. |
| 551 | 551 | ||
| 552 | \(Ie, C-j, *or* C-m, for prefixes of hidden topics). This is properly | 552 | \(Ie, C-j, *or* C-m, for prefixes of hidden topics). This is properly |
| 553 | set when outline-regexp is produced by `set-outline-regexp', so | 553 | set when allout-regexp is produced by `set-allout-regexp', so |
| 554 | that (match-beginning 2) and (match-end 2) delimit the prefix.") | 554 | that (match-beginning 2) and (match-end 2) delimit the prefix.") |
| 555 | (make-variable-buffer-local 'outline-line-boundary-regexp) | 555 | (make-variable-buffer-local 'allout-line-boundary-regexp) |
| 556 | ;;;_ = outline-bob-regexp | 556 | ;;;_ = allout-bob-regexp |
| 557 | (defvar outline-bob-regexp () | 557 | (defvar allout-bob-regexp () |
| 558 | "Like outline-line-boundary-regexp, for headers at beginning of buffer. | 558 | "Like allout-line-boundary-regexp, for headers at beginning of buffer. |
| 559 | \(match-beginning 2) and \(match-end 2) delimit the prefix.") | 559 | \(match-beginning 2) and \(match-end 2) delimit the prefix.") |
| 560 | (make-variable-buffer-local 'outline-bob-regexp) | 560 | (make-variable-buffer-local 'allout-bob-regexp) |
| 561 | ;;;_ = outline-header-subtraction | 561 | ;;;_ = allout-header-subtraction |
| 562 | (defvar outline-header-subtraction (1- (length outline-header-prefix)) | 562 | (defvar allout-header-subtraction (1- (length allout-header-prefix)) |
| 563 | "Outline-header prefix length to subtract when computing topic depth.") | 563 | "Allout-header prefix length to subtract when computing topic depth.") |
| 564 | (make-variable-buffer-local 'outline-header-subtraction) | 564 | (make-variable-buffer-local 'allout-header-subtraction) |
| 565 | ;;;_ = outline-plain-bullets-string-len | 565 | ;;;_ = allout-plain-bullets-string-len |
| 566 | (defvar outline-plain-bullets-string-len (length outline-plain-bullets-string) | 566 | (defvar allout-plain-bullets-string-len (length allout-plain-bullets-string) |
| 567 | "Length of outline-plain-bullets-string, updated by set-outline-regexp.") | 567 | "Length of allout-plain-bullets-string, updated by set-allout-regexp.") |
| 568 | (make-variable-buffer-local 'outline-plain-bullets-string-len) | 568 | (make-variable-buffer-local 'allout-plain-bullets-string-len) |
| 569 | 569 | ||
| 570 | 570 | ||
| 571 | ;;;_ X outline-reset-header-lead (header-lead) | 571 | ;;;_ X allout-reset-header-lead (header-lead) |
| 572 | (defun outline-reset-header-lead (header-lead) | 572 | (defun allout-reset-header-lead (header-lead) |
| 573 | "*Reset the leading string used to identify topic headers." | 573 | "*Reset the leading string used to identify topic headers." |
| 574 | (interactive "sNew lead string: ") | 574 | (interactive "sNew lead string: ") |
| 575 | (setq outline-header-prefix header-lead) | 575 | (setq allout-header-prefix header-lead) |
| 576 | (setq outline-header-subtraction (1- (length outline-header-prefix))) | 576 | (setq allout-header-subtraction (1- (length allout-header-prefix))) |
| 577 | (set-outline-regexp)) | 577 | (set-allout-regexp)) |
| 578 | ;;;_ X outline-lead-with-comment-string (header-lead) | 578 | ;;;_ X allout-lead-with-comment-string (header-lead) |
| 579 | (defun outline-lead-with-comment-string (&optional header-lead) | 579 | (defun allout-lead-with-comment-string (&optional header-lead) |
| 580 | "*Set the topic-header leading string to specified string. | 580 | "*Set the topic-header leading string to specified string. |
| 581 | 581 | ||
| 582 | Useful when for encapsulating outline structure in programming | 582 | Useful when for encapsulating outline structure in programming |
| @@ -586,29 +586,29 @@ language comments. Returns the leading string." | |||
| 586 | (if (not (stringp header-lead)) | 586 | (if (not (stringp header-lead)) |
| 587 | (setq header-lead (read-string | 587 | (setq header-lead (read-string |
| 588 | "String prefix for topic headers: "))) | 588 | "String prefix for topic headers: "))) |
| 589 | (setq outline-reindent-bodies nil) | 589 | (setq allout-reindent-bodies nil) |
| 590 | (outline-reset-header-lead header-lead) | 590 | (allout-reset-header-lead header-lead) |
| 591 | header-lead) | 591 | header-lead) |
| 592 | ;;;_ > outline-infer-header-lead () | 592 | ;;;_ > allout-infer-header-lead () |
| 593 | (defun outline-infer-header-lead () | 593 | (defun allout-infer-header-lead () |
| 594 | "Determine appropriate `outline-header-prefix'. | 594 | "Determine appropriate `allout-header-prefix'. |
| 595 | 595 | ||
| 596 | Works according to settings of: | 596 | Works according to settings of: |
| 597 | 597 | ||
| 598 | `comment-start' | 598 | `comment-start' |
| 599 | `outline-header-prefix' (default) | 599 | `allout-header-prefix' (default) |
| 600 | `outline-use-mode-specific-leader' | 600 | `allout-use-mode-specific-leader' |
| 601 | and `outline-mode-leaders'. | 601 | and `allout-mode-leaders'. |
| 602 | 602 | ||
| 603 | Apply this via \(re)activation of `outline-mode', rather than | 603 | Apply this via \(re)activation of `allout-mode', rather than |
| 604 | invoking it directly." | 604 | invoking it directly." |
| 605 | (let* ((use-leader (and (boundp 'outline-use-mode-specific-leader) | 605 | (let* ((use-leader (and (boundp 'allout-use-mode-specific-leader) |
| 606 | (if (or (stringp outline-use-mode-specific-leader) | 606 | (if (or (stringp allout-use-mode-specific-leader) |
| 607 | (memq outline-use-mode-specific-leader | 607 | (memq allout-use-mode-specific-leader |
| 608 | '(outline-mode-leaders | 608 | '(allout-mode-leaders |
| 609 | comment-start | 609 | comment-start |
| 610 | t))) | 610 | t))) |
| 611 | outline-use-mode-specific-leader | 611 | allout-use-mode-specific-leader |
| 612 | ;; Oops - garbled value, equate with effect of 't: | 612 | ;; Oops - garbled value, equate with effect of 't: |
| 613 | t))) | 613 | t))) |
| 614 | (leader | 614 | (leader |
| @@ -616,10 +616,10 @@ invoking it directly." | |||
| 616 | ((not use-leader) nil) | 616 | ((not use-leader) nil) |
| 617 | ;; Use the explicitly designated leader: | 617 | ;; Use the explicitly designated leader: |
| 618 | ((stringp use-leader) use-leader) | 618 | ((stringp use-leader) use-leader) |
| 619 | (t (or (and (memq use-leader '(t outline-mode-leaders)) | 619 | (t (or (and (memq use-leader '(t allout-mode-leaders)) |
| 620 | ;; Get it from outline mode leaders? | 620 | ;; Get it from outline mode leaders? |
| 621 | (cdr (assq major-mode outline-mode-leaders))) | 621 | (cdr (assq major-mode allout-mode-leaders))) |
| 622 | ;; ... didn't get from outline-mode-leaders... | 622 | ;; ... didn't get from allout-mode-leaders... |
| 623 | (and (memq use-leader '(t comment-start)) | 623 | (and (memq use-leader '(t comment-start)) |
| 624 | comment-start | 624 | comment-start |
| 625 | ;; Use comment-start, maybe tripled, and with | 625 | ;; Use comment-start, maybe tripled, and with |
| @@ -635,34 +635,34 @@ invoking it directly." | |||
| 635 | "_"))))))) | 635 | "_"))))))) |
| 636 | (if (not leader) | 636 | (if (not leader) |
| 637 | nil | 637 | nil |
| 638 | (if (string= leader outline-header-prefix) | 638 | (if (string= leader allout-header-prefix) |
| 639 | nil ; no change, nothing to do. | 639 | nil ; no change, nothing to do. |
| 640 | (setq outline-header-prefix leader) | 640 | (setq allout-header-prefix leader) |
| 641 | outline-header-prefix)))) | 641 | allout-header-prefix)))) |
| 642 | ;;;_ > outline-infer-body-reindent () | 642 | ;;;_ > allout-infer-body-reindent () |
| 643 | (defun outline-infer-body-reindent () | 643 | (defun allout-infer-body-reindent () |
| 644 | "Determine proper setting for `outline-reindent-bodies'. | 644 | "Determine proper setting for `allout-reindent-bodies'. |
| 645 | 645 | ||
| 646 | Depends on default setting of `outline-reindent-bodies' \(which see) | 646 | Depends on default setting of `allout-reindent-bodies' \(which see) |
| 647 | and presence of setting for `comment-start', to tell whether the | 647 | and presence of setting for `comment-start', to tell whether the |
| 648 | file is programming code." | 648 | file is programming code." |
| 649 | (if (and outline-reindent-bodies | 649 | (if (and allout-reindent-bodies |
| 650 | comment-start | 650 | comment-start |
| 651 | (not (eq 'force outline-reindent-bodies))) | 651 | (not (eq 'force allout-reindent-bodies))) |
| 652 | (setq outline-reindent-bodies nil))) | 652 | (setq allout-reindent-bodies nil))) |
| 653 | ;;;_ > set-outline-regexp () | 653 | ;;;_ > set-allout-regexp () |
| 654 | (defun set-outline-regexp () | 654 | (defun set-allout-regexp () |
| 655 | "Generate proper topic-header regexp form for outline functions. | 655 | "Generate proper topic-header regexp form for outline functions. |
| 656 | 656 | ||
| 657 | Works with respect to `outline-plain-bullets-string' and | 657 | Works with respect to `allout-plain-bullets-string' and |
| 658 | `outline-distinctive-bullets-string'." | 658 | `allout-distinctive-bullets-string'." |
| 659 | 659 | ||
| 660 | (interactive) | 660 | (interactive) |
| 661 | ;; Derive outline-bullets-string from user configured components: | 661 | ;; Derive allout-bullets-string from user configured components: |
| 662 | (setq outline-bullets-string "") | 662 | (setq allout-bullets-string "") |
| 663 | (let ((strings (list 'outline-plain-bullets-string | 663 | (let ((strings (list 'allout-plain-bullets-string |
| 664 | 'outline-distinctive-bullets-string | 664 | 'allout-distinctive-bullets-string |
| 665 | 'outline-primary-bullet)) | 665 | 'allout-primary-bullet)) |
| 666 | cur-string | 666 | cur-string |
| 667 | cur-len | 667 | cur-len |
| 668 | cur-char | 668 | cur-char |
| @@ -674,8 +674,8 @@ Works with respect to `outline-plain-bullets-string' and | |||
| 674 | (setq cur-len (length (setq cur-string (symbol-value (car strings))))) | 674 | (setq cur-len (length (setq cur-string (symbol-value (car strings))))) |
| 675 | (while (< index cur-len) | 675 | (while (< index cur-len) |
| 676 | (setq cur-char (aref cur-string index)) | 676 | (setq cur-char (aref cur-string index)) |
| 677 | (setq outline-bullets-string | 677 | (setq allout-bullets-string |
| 678 | (concat outline-bullets-string | 678 | (concat allout-bullets-string |
| 679 | (cond | 679 | (cond |
| 680 | ; Single dash would denote a | 680 | ; Single dash would denote a |
| 681 | ; sequence, repeated denotes | 681 | ; sequence, repeated denotes |
| @@ -689,33 +689,33 @@ Works with respect to `outline-plain-bullets-string' and | |||
| 689 | (setq index (1+ index))) | 689 | (setq index (1+ index))) |
| 690 | (setq strings (cdr strings))) | 690 | (setq strings (cdr strings))) |
| 691 | ) | 691 | ) |
| 692 | ;; Derive next for repeated use in outline-pending-bullet: | 692 | ;; Derive next for repeated use in allout-pending-bullet: |
| 693 | (setq outline-plain-bullets-string-len (length outline-plain-bullets-string)) | 693 | (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) |
| 694 | (setq outline-header-subtraction (1- (length outline-header-prefix))) | 694 | (setq allout-header-subtraction (1- (length allout-header-prefix))) |
| 695 | ;; Produce the new outline-regexp: | 695 | ;; Produce the new allout-regexp: |
| 696 | (setq outline-regexp (concat "\\(\\" | 696 | (setq allout-regexp (concat "\\(\\" |
| 697 | outline-header-prefix | 697 | allout-header-prefix |
| 698 | "[ \t]*[" | 698 | "[ \t]*[" |
| 699 | outline-bullets-string | 699 | allout-bullets-string |
| 700 | "]\\)\\|\\" | 700 | "]\\)\\|\\" |
| 701 | outline-primary-bullet | 701 | allout-primary-bullet |
| 702 | "+\\|\^l")) | 702 | "+\\|\^l")) |
| 703 | (setq outline-line-boundary-regexp | 703 | (setq allout-line-boundary-regexp |
| 704 | (concat "\\([\n\r]\\)\\(" outline-regexp "\\)")) | 704 | (concat "\\([\n\r]\\)\\(" allout-regexp "\\)")) |
| 705 | (setq outline-bob-regexp | 705 | (setq allout-bob-regexp |
| 706 | (concat "\\(\\`\\)\\(" outline-regexp "\\)")) | 706 | (concat "\\(\\`\\)\\(" allout-regexp "\\)")) |
| 707 | ) | 707 | ) |
| 708 | ;;;_ : Key bindings | 708 | ;;;_ : Key bindings |
| 709 | ;;;_ = outline-mode-map | 709 | ;;;_ = allout-mode-map |
| 710 | (defvar outline-mode-map nil "Keybindings for (allout) outline minor mode.") | 710 | (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.") |
| 711 | ;;;_ > produce-outline-mode-map (keymap-alist &optional base-map) | 711 | ;;;_ > produce-allout-mode-map (keymap-alist &optional base-map) |
| 712 | (defun produce-outline-mode-map (keymap-list &optional base-map) | 712 | (defun produce-allout-mode-map (keymap-list &optional base-map) |
| 713 | "Produce keymap for use as outline-mode-map, from keymap-list. | 713 | "Produce keymap for use as allout-mode-map, from keymap-list. |
| 714 | 714 | ||
| 715 | Built on top of optional BASE-MAP, or empty sparse map if none specified. | 715 | Built on top of optional BASE-MAP, or empty sparse map if none specified. |
| 716 | See doc string for outline-keybindings-list for format of binding list." | 716 | See doc string for allout-keybindings-list for format of binding list." |
| 717 | (let ((map (or base-map (make-sparse-keymap))) | 717 | (let ((map (or base-map (make-sparse-keymap))) |
| 718 | (pref (list outline-command-prefix))) | 718 | (pref (list allout-command-prefix))) |
| 719 | (mapcar (function | 719 | (mapcar (function |
| 720 | (lambda (cell) | 720 | (lambda (cell) |
| 721 | (let ((add-pref (null (cdr (cdr cell)))) | 721 | (let ((add-pref (null (cdr (cdr cell)))) |
| @@ -728,93 +728,93 @@ See doc string for outline-keybindings-list for format of binding list." | |||
| 728 | (car (cdr cell))))))) | 728 | (car (cdr cell))))))) |
| 729 | keymap-list) | 729 | keymap-list) |
| 730 | map)) | 730 | map)) |
| 731 | ;;;_ = outline-prior-bindings - being deprecated. | 731 | ;;;_ = allout-prior-bindings - being deprecated. |
| 732 | (defvar outline-prior-bindings nil | 732 | (defvar allout-prior-bindings nil |
| 733 | "Variable for use in V18, with outline-added-bindings, for | 733 | "Variable for use in V18, with allout-added-bindings, for |
| 734 | resurrecting, on mode deactivation, bindings that existed before | 734 | resurrecting, on mode deactivation, bindings that existed before |
| 735 | activation. Being deprecated.") | 735 | activation. Being deprecated.") |
| 736 | ;;;_ = outline-added-bindings - being deprecated | 736 | ;;;_ = allout-added-bindings - being deprecated |
| 737 | (defvar outline-added-bindings nil | 737 | (defvar allout-added-bindings nil |
| 738 | "Variable for use in V18, with outline-prior-bindings, for | 738 | "Variable for use in V18, with allout-prior-bindings, for |
| 739 | resurrecting, on mode deactivation, bindings that existed before | 739 | resurrecting, on mode deactivation, bindings that existed before |
| 740 | activation. Being deprecated.") | 740 | activation. Being deprecated.") |
| 741 | ;;;_ : Menu bar | 741 | ;;;_ : Menu bar |
| 742 | (defun produce-outline-mode-menubar-entries () | 742 | (defun produce-allout-mode-menubar-entries () |
| 743 | (require 'easymenu) | 743 | (require 'easymenu) |
| 744 | (easy-menu-define outline-mode-exposure-menu | 744 | (easy-menu-define allout-mode-exposure-menu |
| 745 | outline-mode-map | 745 | allout-mode-map |
| 746 | "Allout outline exposure menu." | 746 | "Allout outline exposure menu." |
| 747 | '("Exposure" | 747 | '("Exposure" |
| 748 | ["Show Entry" outline-show-current-entry t] | 748 | ["Show Entry" allout-show-current-entry t] |
| 749 | ["Show Children" outline-show-children t] | 749 | ["Show Children" allout-show-children t] |
| 750 | ["Show Subtree" outline-show-current-subtree t] | 750 | ["Show Subtree" allout-show-current-subtree t] |
| 751 | ["Hide Subtree" outline-hide-current-subtree t] | 751 | ["Hide Subtree" allout-hide-current-subtree t] |
| 752 | ["Hide Leaves" outline-hide-current-leaves t] | 752 | ["Hide Leaves" allout-hide-current-leaves t] |
| 753 | "----" | 753 | "----" |
| 754 | ["Show All" outline-show-all t])) | 754 | ["Show All" allout-show-all t])) |
| 755 | (easy-menu-define outline-mode-editing-menu | 755 | (easy-menu-define allout-mode-editing-menu |
| 756 | outline-mode-map | 756 | allout-mode-map |
| 757 | "Allout outline editing menu." | 757 | "Allout outline editing menu." |
| 758 | '("Headings" | 758 | '("Headings" |
| 759 | ["Open Sibling" outline-open-sibtopic t] | 759 | ["Open Sibling" allout-open-sibtopic t] |
| 760 | ["Open Subtopic" outline-open-subtopic t] | 760 | ["Open Subtopic" allout-open-subtopic t] |
| 761 | ["Open Supertopic" outline-open-supertopic t] | 761 | ["Open Supertopic" allout-open-supertopic t] |
| 762 | "----" | 762 | "----" |
| 763 | ["Shift Topic In" outline-shift-in t] | 763 | ["Shift Topic In" allout-shift-in t] |
| 764 | ["Shift Topic Out" outline-shift-out t] | 764 | ["Shift Topic Out" allout-shift-out t] |
| 765 | ["Rebullet Topic" outline-rebullet-topic t] | 765 | ["Rebullet Topic" allout-rebullet-topic t] |
| 766 | ["Rebullet Heading" outline-rebullet-current-heading t] | 766 | ["Rebullet Heading" allout-rebullet-current-heading t] |
| 767 | ["Number Siblings" outline-number-siblings t])) | 767 | ["Number Siblings" allout-number-siblings t])) |
| 768 | (easy-menu-define outline-mode-navigation-menu | 768 | (easy-menu-define allout-mode-navigation-menu |
| 769 | outline-mode-map | 769 | allout-mode-map |
| 770 | "Allout outline navigation menu." | 770 | "Allout outline navigation menu." |
| 771 | '("Navigation" | 771 | '("Navigation" |
| 772 | ["Next Visible Heading" outline-next-visible-heading t] | 772 | ["Next Visible Heading" allout-next-visible-heading t] |
| 773 | ["Previous Visible Heading" | 773 | ["Previous Visible Heading" |
| 774 | outline-previous-visible-heading t] | 774 | allout-previous-visible-heading t] |
| 775 | "----" | 775 | "----" |
| 776 | ["Up Level" outline-up-current-level t] | 776 | ["Up Level" allout-up-current-level t] |
| 777 | ["Forward Current Level" outline-forward-current-level t] | 777 | ["Forward Current Level" allout-forward-current-level t] |
| 778 | ["Backward Current Level" | 778 | ["Backward Current Level" |
| 779 | outline-backward-current-level t] | 779 | allout-backward-current-level t] |
| 780 | "----" | 780 | "----" |
| 781 | ["Beginning of Entry" | 781 | ["Beginning of Entry" |
| 782 | outline-beginning-of-current-entry t] | 782 | allout-beginning-of-current-entry t] |
| 783 | ["End of Entry" outline-end-of-current-entry t] | 783 | ["End of Entry" allout-end-of-current-entry t] |
| 784 | ["End of Subtree" outline-end-of-current-subtree t])) | 784 | ["End of Subtree" allout-end-of-current-subtree t])) |
| 785 | (easy-menu-define outline-mode-misc-menu | 785 | (easy-menu-define allout-mode-misc-menu |
| 786 | outline-mode-map | 786 | allout-mode-map |
| 787 | "Allout outlines miscellaneous bindings." | 787 | "Allout outlines miscellaneous bindings." |
| 788 | '("Misc" | 788 | '("Misc" |
| 789 | ["Version" outline-version t] | 789 | ["Version" allout-version t] |
| 790 | "----" | 790 | "----" |
| 791 | ["Duplicate Exposed" outline-copy-exposed-to-buffer t] | 791 | ["Duplicate Exposed" allout-copy-exposed-to-buffer t] |
| 792 | ["Duplicate Exposed, numbered" | 792 | ["Duplicate Exposed, numbered" |
| 793 | outline-flatten-exposed-to-buffer t] | 793 | allout-flatten-exposed-to-buffer t] |
| 794 | ["Duplicate Exposed, indented" | 794 | ["Duplicate Exposed, indented" |
| 795 | outline-indented-exposed-to-buffer t] | 795 | allout-indented-exposed-to-buffer t] |
| 796 | "----" | 796 | "----" |
| 797 | ["Set Header Lead" outline-reset-header-lead t] | 797 | ["Set Header Lead" allout-reset-header-lead t] |
| 798 | ["Set New Exposure" outline-expose-topic t]))) | 798 | ["Set New Exposure" allout-expose-topic t]))) |
| 799 | ;;;_ : Mode-Specific Variable Maintenance Utilities | 799 | ;;;_ : Mode-Specific Variable Maintenance Utilities |
| 800 | ;;;_ = outline-mode-prior-settings | 800 | ;;;_ = allout-mode-prior-settings |
| 801 | (defvar outline-mode-prior-settings nil | 801 | (defvar allout-mode-prior-settings nil |
| 802 | "Internal outline mode use; settings to be resumed on mode deactivation.") | 802 | "Internal outline mode use; settings to be resumed on mode deactivation.") |
| 803 | (make-variable-buffer-local 'outline-mode-prior-settings) | 803 | (make-variable-buffer-local 'allout-mode-prior-settings) |
| 804 | ;;;_ > outline-resumptions (name &optional value) | 804 | ;;;_ > allout-resumptions (name &optional value) |
| 805 | (defun outline-resumptions (name &optional value) | 805 | (defun allout-resumptions (name &optional value) |
| 806 | 806 | ||
| 807 | "Registers or resumes settings over outline-mode activation/deactivation. | 807 | "Registers or resumes settings over allout-mode activation/deactivation. |
| 808 | 808 | ||
| 809 | First arg is NAME of variable affected. Optional second arg is list | 809 | First arg is NAME of variable affected. Optional second arg is list |
| 810 | containing outline-mode-specific VALUE to be imposed on named | 810 | containing allout-mode-specific VALUE to be imposed on named |
| 811 | variable, and to be registered. (It's a list so you can specify | 811 | variable, and to be registered. (It's a list so you can specify |
| 812 | registrations of null values.) If no value is specified, the | 812 | registrations of null values.) If no value is specified, the |
| 813 | registered value is returned (encapsulated in the list, so the caller | 813 | registered value is returned (encapsulated in the list, so the caller |
| 814 | can distinguish nil vs no value), and the registration is popped | 814 | can distinguish nil vs no value), and the registration is popped |
| 815 | from the list." | 815 | from the list." |
| 816 | 816 | ||
| 817 | (let ((on-list (assq name outline-mode-prior-settings)) | 817 | (let ((on-list (assq name allout-mode-prior-settings)) |
| 818 | prior-capsule ; By `capsule' i mean a list | 818 | prior-capsule ; By `capsule' i mean a list |
| 819 | ; containing a value, so we can | 819 | ; containing a value, so we can |
| 820 | ; distinguish nil from no value. | 820 | ; distinguish nil from no value. |
| @@ -827,10 +827,10 @@ from the list." | |||
| 827 | (if on-list | 827 | (if on-list |
| 828 | nil ; Already preserved prior value - don't mess with it. | 828 | nil ; Already preserved prior value - don't mess with it. |
| 829 | ;; Register the old value, or nil if previously unbound: | 829 | ;; Register the old value, or nil if previously unbound: |
| 830 | (setq outline-mode-prior-settings | 830 | (setq allout-mode-prior-settings |
| 831 | (cons (list name | 831 | (cons (list name |
| 832 | (if (boundp name) (list (symbol-value name)))) | 832 | (if (boundp name) (list (symbol-value name)))) |
| 833 | outline-mode-prior-settings))) | 833 | allout-mode-prior-settings))) |
| 834 | ; And impose the new value, locally: | 834 | ; And impose the new value, locally: |
| 835 | (progn (make-local-variable name) | 835 | (progn (make-local-variable name) |
| 836 | (set name (car value)))) | 836 | (set name (car value)))) |
| @@ -849,91 +849,91 @@ from the list." | |||
| 849 | (makunbound name)) ; Previously unbound - demolish var. | 849 | (makunbound name)) ; Previously unbound - demolish var. |
| 850 | ; Remove registration: | 850 | ; Remove registration: |
| 851 | (let (rebuild) | 851 | (let (rebuild) |
| 852 | (while outline-mode-prior-settings | 852 | (while allout-mode-prior-settings |
| 853 | (if (not (eq (car outline-mode-prior-settings) | 853 | (if (not (eq (car allout-mode-prior-settings) |
| 854 | on-list)) | 854 | on-list)) |
| 855 | (setq rebuild | 855 | (setq rebuild |
| 856 | (cons (car outline-mode-prior-settings) | 856 | (cons (car allout-mode-prior-settings) |
| 857 | rebuild))) | 857 | rebuild))) |
| 858 | (setq outline-mode-prior-settings | 858 | (setq allout-mode-prior-settings |
| 859 | (cdr outline-mode-prior-settings))) | 859 | (cdr allout-mode-prior-settings))) |
| 860 | (setq outline-mode-prior-settings rebuild))))) | 860 | (setq allout-mode-prior-settings rebuild))))) |
| 861 | ) | 861 | ) |
| 862 | ;;;_ : Mode-specific incidentals | 862 | ;;;_ : Mode-specific incidentals |
| 863 | ;;;_ = outline-during-write-cue nil | 863 | ;;;_ = allout-during-write-cue nil |
| 864 | (defvar outline-during-write-cue nil | 864 | (defvar allout-during-write-cue nil |
| 865 | "Used to inhibit outline change-protection during file write. | 865 | "Used to inhibit outline change-protection during file write. |
| 866 | 866 | ||
| 867 | See also `outline-post-command-business', `outline-write-file-hook', | 867 | See also `allout-post-command-business', `allout-write-file-hook', |
| 868 | `outline-before-change-protect', and `outline-post-command-business' | 868 | `allout-before-change-protect', and `allout-post-command-business' |
| 869 | functions.") | 869 | functions.") |
| 870 | ;;;_ = outline-pre-was-isearching nil | 870 | ;;;_ = allout-pre-was-isearching nil |
| 871 | (defvar outline-pre-was-isearching nil | 871 | (defvar allout-pre-was-isearching nil |
| 872 | "Cue for isearch-dynamic-exposure mechanism, implemented in | 872 | "Cue for isearch-dynamic-exposure mechanism, implemented in |
| 873 | outline-pre- and -post-command-hooks.") | 873 | allout-pre- and -post-command-hooks.") |
| 874 | (make-variable-buffer-local 'outline-pre-was-isearching) | 874 | (make-variable-buffer-local 'allout-pre-was-isearching) |
| 875 | ;;;_ = outline-isearch-prior-pos nil | 875 | ;;;_ = allout-isearch-prior-pos nil |
| 876 | (defvar outline-isearch-prior-pos nil | 876 | (defvar allout-isearch-prior-pos nil |
| 877 | "Cue for isearch-dynamic-exposure tracking, used by outline-isearch-expose.") | 877 | "Cue for isearch-dynamic-exposure tracking, used by allout-isearch-expose.") |
| 878 | (make-variable-buffer-local 'outline-isearch-prior-pos) | 878 | (make-variable-buffer-local 'allout-isearch-prior-pos) |
| 879 | ;;;_ = outline-isearch-did-quit | 879 | ;;;_ = allout-isearch-did-quit |
| 880 | (defvar outline-isearch-did-quit nil | 880 | (defvar allout-isearch-did-quit nil |
| 881 | "Distinguishes isearch conclusion and cancellation. | 881 | "Distinguishes isearch conclusion and cancellation. |
| 882 | 882 | ||
| 883 | Maintained by outline-isearch-abort \(which is wrapped around the real | 883 | Maintained by allout-isearch-abort \(which is wrapped around the real |
| 884 | isearch-abort), and monitored by outline-isearch-expose for action.") | 884 | isearch-abort), and monitored by allout-isearch-expose for action.") |
| 885 | (make-variable-buffer-local 'outline-isearch-did-quit) | 885 | (make-variable-buffer-local 'allout-isearch-did-quit) |
| 886 | ;;;_ = outline-override-protect nil | 886 | ;;;_ = allout-override-protect nil |
| 887 | (defvar outline-override-protect nil | 887 | (defvar allout-override-protect nil |
| 888 | "Used in outline-mode for regulate of concealed-text protection mechanism. | 888 | "Used in allout-mode for regulate of concealed-text protection mechanism. |
| 889 | 889 | ||
| 890 | Allout outline mode regulates alteration of concealed text to protect | 890 | Allout outline mode regulates alteration of concealed text to protect |
| 891 | against inadvertent, unnoticed changes. This is for use by specific, | 891 | against inadvertent, unnoticed changes. This is for use by specific, |
| 892 | native outline functions to temporarily override that protection. | 892 | native outline functions to temporarily override that protection. |
| 893 | It's automatically reset to nil after every buffer modification.") | 893 | It's automatically reset to nil after every buffer modification.") |
| 894 | (make-variable-buffer-local 'outline-override-protect) | 894 | (make-variable-buffer-local 'allout-override-protect) |
| 895 | ;;;_ > outline-unprotected (expr) | 895 | ;;;_ > allout-unprotected (expr) |
| 896 | (defmacro outline-unprotected (expr) | 896 | (defmacro allout-unprotected (expr) |
| 897 | "Evaluate EXPRESSION with `outline-override-protect' let-bound `t'." | 897 | "Evaluate EXPRESSION with `allout-override-protect' let-bound `t'." |
| 898 | `(let ((outline-override-protect t)) | 898 | `(let ((allout-override-protect t)) |
| 899 | ,expr)) | 899 | ,expr)) |
| 900 | ;;;_ = outline-undo-aggregation | 900 | ;;;_ = allout-undo-aggregation |
| 901 | (defvar outline-undo-aggregation 30 | 901 | (defvar allout-undo-aggregation 30 |
| 902 | "Amount of successive self-insert actions to bunch together per undo. | 902 | "Amount of successive self-insert actions to bunch together per undo. |
| 903 | 903 | ||
| 904 | This is purely a kludge variable, regulating the compensation for a bug in | 904 | This is purely a kludge variable, regulating the compensation for a bug in |
| 905 | the way that before-change-functions and undo interact.") | 905 | the way that before-change-functions and undo interact.") |
| 906 | (make-variable-buffer-local 'outline-undo-aggregation) | 906 | (make-variable-buffer-local 'allout-undo-aggregation) |
| 907 | ;;;_ = file-var-bug hack | 907 | ;;;_ = file-var-bug hack |
| 908 | (defvar outline-v18/19-file-var-hack nil | 908 | (defvar allout-v18/19-file-var-hack nil |
| 909 | "Horrible hack used to prevent invalid multiple triggering of outline | 909 | "Horrible hack used to prevent invalid multiple triggering of outline |
| 910 | mode from prop-line file-var activation. Used by outline-mode function | 910 | mode from prop-line file-var activation. Used by allout-mode function |
| 911 | to track repeats.") | 911 | to track repeats.") |
| 912 | ;;;_ > outline-write-file-hook () | 912 | ;;;_ > allout-write-file-hook () |
| 913 | (defun outline-write-file-hook () | 913 | (defun allout-write-file-hook () |
| 914 | "In outline mode, run as a local-write-file-hooks activity. | 914 | "In outline mode, run as a local-write-file-hooks activity. |
| 915 | 915 | ||
| 916 | Currently just sets `outline-during-write-cue', so outline-change-protection | 916 | Currently just sets `allout-during-write-cue', so allout-change-protection |
| 917 | knows to keep inactive during file write." | 917 | knows to keep inactive during file write." |
| 918 | (setq outline-during-write-cue t) | 918 | (setq allout-during-write-cue t) |
| 919 | nil) | 919 | nil) |
| 920 | 920 | ||
| 921 | ;;;_ #2 Mode activation | 921 | ;;;_ #2 Mode activation |
| 922 | ;;;_ = outline-mode | 922 | ;;;_ = allout-mode |
| 923 | (defvar outline-mode () "Allout outline mode minor-mode flag.") | 923 | (defvar allout-mode () "Allout outline mode minor-mode flag.") |
| 924 | (make-variable-buffer-local 'outline-mode) | 924 | (make-variable-buffer-local 'allout-mode) |
| 925 | ;;;_ > outline-mode-p () | 925 | ;;;_ > allout-mode-p () |
| 926 | (defmacro outline-mode-p () | 926 | (defmacro allout-mode-p () |
| 927 | "Return t if outline-mode is active in current buffer." | 927 | "Return t if allout-mode is active in current buffer." |
| 928 | 'outline-mode) | 928 | 'allout-mode) |
| 929 | ;;;_ = outline-explicitly-deactivated | 929 | ;;;_ = allout-explicitly-deactivated |
| 930 | (defvar outline-explicitly-deactivated nil | 930 | (defvar allout-explicitly-deactivated nil |
| 931 | "Outline-mode was last deliberately deactivated. | 931 | "Allout-mode was last deliberately deactivated. |
| 932 | So outline-post-command-business should not reactivate it...") | 932 | So allout-post-command-business should not reactivate it...") |
| 933 | (make-variable-buffer-local 'outline-explicitly-deactivated) | 933 | (make-variable-buffer-local 'allout-explicitly-deactivated) |
| 934 | ;;;_ > outline-init (&optional mode) | 934 | ;;;_ > allout-init (&optional mode) |
| 935 | (defun outline-init (&optional mode) | 935 | (defun allout-init (&optional mode) |
| 936 | "Prime outline-mode to enable/disable auto-activation, wrt `outline-layout'. | 936 | "Prime allout-mode to enable/disable auto-activation, wrt `allout-layout'. |
| 937 | 937 | ||
| 938 | MODE is one of the following symbols: | 938 | MODE is one of the following symbols: |
| 939 | 939 | ||
| @@ -947,18 +947,18 @@ MODE is one of the following symbols: | |||
| 947 | 947 | ||
| 948 | Use this function to setup your emacs session for automatic activation | 948 | Use this function to setup your emacs session for automatic activation |
| 949 | of allout outline mode, contingent to the buffer-specific setting of | 949 | of allout outline mode, contingent to the buffer-specific setting of |
| 950 | the `outline-layout' variable. (See `outline-layout' and | 950 | the `allout-layout' variable. (See `allout-layout' and |
| 951 | `outline-expose-topic' docstrings for more details on auto layout). | 951 | `allout-expose-topic' docstrings for more details on auto layout). |
| 952 | 952 | ||
| 953 | `outline-init' works by setting up (or removing) the outline-mode | 953 | `allout-init' works by setting up (or removing) the allout-mode |
| 954 | find-file-hook, and giving `outline-auto-activation' a suitable | 954 | find-file-hook, and giving `allout-auto-activation' a suitable |
| 955 | setting. | 955 | setting. |
| 956 | 956 | ||
| 957 | To prime your emacs session for full auto-outline operation, include | 957 | To prime your emacs session for full auto-outline operation, include |
| 958 | the following two lines in your emacs init file: | 958 | the following two lines in your emacs init file: |
| 959 | 959 | ||
| 960 | \(require 'allout) | 960 | \(require 'allout) |
| 961 | \(outline-init t)" | 961 | \(allout-init t)" |
| 962 | 962 | ||
| 963 | (interactive) | 963 | (interactive) |
| 964 | (if (interactive-p) | 964 | (if (interactive-p) |
| @@ -976,8 +976,8 @@ the following two lines in your emacs init file: | |||
| 976 | (setq mode (intern-soft mode))))) | 976 | (setq mode (intern-soft mode))))) |
| 977 | (let | 977 | (let |
| 978 | ;; convenience aliases, for consistent ref to respective vars: | 978 | ;; convenience aliases, for consistent ref to respective vars: |
| 979 | ((hook 'outline-find-file-hook) | 979 | ((hook 'allout-find-file-hook) |
| 980 | (curr-mode 'outline-auto-activation)) | 980 | (curr-mode 'allout-auto-activation)) |
| 981 | 981 | ||
| 982 | (cond ((not mode) | 982 | (cond ((not mode) |
| 983 | (setq find-file-hooks (delq hook find-file-hooks)) | 983 | (setq find-file-hooks (delq hook find-file-hooks)) |
| @@ -985,9 +985,9 @@ the following two lines in your emacs init file: | |||
| 985 | (message "Allout outline mode auto-activation inhibited."))) | 985 | (message "Allout outline mode auto-activation inhibited."))) |
| 986 | ((eq mode 'report) | 986 | ((eq mode 'report) |
| 987 | (if (not (memq hook find-file-hooks)) | 987 | (if (not (memq hook find-file-hooks)) |
| 988 | (outline-init nil) | 988 | (allout-init nil) |
| 989 | ;; Just punt and use the reports from each of the modes: | 989 | ;; Just punt and use the reports from each of the modes: |
| 990 | (outline-init (symbol-value curr-mode)))) | 990 | (allout-init (symbol-value curr-mode)))) |
| 991 | (t (add-hook 'find-file-hooks hook) | 991 | (t (add-hook 'find-file-hooks hook) |
| 992 | (set curr-mode ; `set', not `setq'! | 992 | (set curr-mode ; `set', not `setq'! |
| 993 | (cond ((eq mode 'activate) | 993 | (cond ((eq mode 'activate) |
| @@ -996,7 +996,7 @@ the following two lines in your emacs init file: | |||
| 996 | 'activate) | 996 | 'activate) |
| 997 | ((eq mode 'report) | 997 | ((eq mode 'report) |
| 998 | ;; Return the current mode setting: | 998 | ;; Return the current mode setting: |
| 999 | (outline-init mode)) | 999 | (allout-init mode)) |
| 1000 | ((eq mode 'ask) | 1000 | ((eq mode 'ask) |
| 1001 | (message | 1001 | (message |
| 1002 | (concat "Outline mode auto-activation and " | 1002 | (concat "Outline mode auto-activation and " |
| @@ -1006,28 +1006,28 @@ the following two lines in your emacs init file: | |||
| 1006 | "Outline mode auto-activation and -layout enabled.") | 1006 | "Outline mode auto-activation and -layout enabled.") |
| 1007 | 'full))))))) | 1007 | 'full))))))) |
| 1008 | 1008 | ||
| 1009 | ;;;_ > outline-setup-menubar () | 1009 | ;;;_ > allout-setup-menubar () |
| 1010 | (defun outline-setup-menubar () | 1010 | (defun allout-setup-menubar () |
| 1011 | "Populate the current buffer's menubar with allout outline-mode stuff." | 1011 | "Populate the current buffer's menubar with allout allout-mode stuff." |
| 1012 | (let ((menus (list outline-mode-exposure-menu | 1012 | (let ((menus (list allout-mode-exposure-menu |
| 1013 | outline-mode-editing-menu | 1013 | allout-mode-editing-menu |
| 1014 | outline-mode-navigation-menu | 1014 | allout-mode-navigation-menu |
| 1015 | outline-mode-misc-menu)) | 1015 | allout-mode-misc-menu)) |
| 1016 | cur) | 1016 | cur) |
| 1017 | (while menus | 1017 | (while menus |
| 1018 | (setq cur (car menus) | 1018 | (setq cur (car menus) |
| 1019 | menus (cdr menus)) | 1019 | menus (cdr menus)) |
| 1020 | (easy-menu-add cur)))) | 1020 | (easy-menu-add cur)))) |
| 1021 | ;;;_ > outline-mode (&optional toggle) | 1021 | ;;;_ > allout-mode (&optional toggle) |
| 1022 | ;;;_ : Defun: | 1022 | ;;;_ : Defun: |
| 1023 | (defun outline-mode (&optional toggle) | 1023 | (defun allout-mode (&optional toggle) |
| 1024 | ;;;_ . Doc string: | 1024 | ;;;_ . Doc string: |
| 1025 | "Toggle minor mode for controlling exposure and editing of text outlines. | 1025 | "Toggle minor mode for controlling exposure and editing of text outlines. |
| 1026 | 1026 | ||
| 1027 | Optional arg forces mode to re-initialize iff arg is positive num or | 1027 | Optional arg forces mode to re-initialize iff arg is positive num or |
| 1028 | symbol. Allout outline mode always runs as a minor mode. | 1028 | symbol. Allout outline mode always runs as a minor mode. |
| 1029 | 1029 | ||
| 1030 | Allout outline mode provides extensive outline-oriented formatting and | 1030 | Allout outline mode provides extensive allout-oriented formatting and |
| 1031 | manipulation. It enables structural editing of outlines, as well as | 1031 | manipulation. It enables structural editing of outlines, as well as |
| 1032 | navigation and exposure. It also is specifically aimed at | 1032 | navigation and exposure. It also is specifically aimed at |
| 1033 | accommodating syntax-sensitive text like programming languages. \(For | 1033 | accommodating syntax-sensitive text like programming languages. \(For |
| @@ -1041,73 +1041,73 @@ In addition to outline navigation and exposure, allout includes: | |||
| 1041 | - incremental search with dynamic exposure and reconcealment of hidden text | 1041 | - incremental search with dynamic exposure and reconcealment of hidden text |
| 1042 | - automatic topic-number maintenance | 1042 | - automatic topic-number maintenance |
| 1043 | - \"Hot-spot\" operation, for single-keystroke maneuvering and | 1043 | - \"Hot-spot\" operation, for single-keystroke maneuvering and |
| 1044 | exposure control. \(See the outline-mode docstring.) | 1044 | exposure control. \(See the allout-mode docstring.) |
| 1045 | 1045 | ||
| 1046 | and many other features. | 1046 | and many other features. |
| 1047 | 1047 | ||
| 1048 | Below is a description of the bindings, and then explanation of | 1048 | Below is a description of the bindings, and then explanation of |
| 1049 | special outline-mode features and terminology. See also the outline | 1049 | special allout-mode features and terminology. See also the outline |
| 1050 | menubar additions for quick reference to many of the features, and see | 1050 | menubar additions for quick reference to many of the features, and see |
| 1051 | the docstring of the variable `outline-init' for instructions on | 1051 | the docstring of the variable `allout-init' for instructions on |
| 1052 | priming your emacs session for automatic activation of outline-mode. | 1052 | priming your emacs session for automatic activation of allout-mode. |
| 1053 | 1053 | ||
| 1054 | 1054 | ||
| 1055 | The bindings are dictated by the `outline-keybindings-list' and | 1055 | The bindings are dictated by the `allout-keybindings-list' and |
| 1056 | `outline-command-prefix' variables. | 1056 | `allout-command-prefix' variables. |
| 1057 | 1057 | ||
| 1058 | Navigation: Exposure Control: | 1058 | Navigation: Exposure Control: |
| 1059 | ---------- ---------------- | 1059 | ---------- ---------------- |
| 1060 | C-c C-n outline-next-visible-heading | C-c C-h outline-hide-current-subtree | 1060 | C-c C-n allout-next-visible-heading | C-c C-h allout-hide-current-subtree |
| 1061 | C-c C-p outline-previous-visible-heading | C-c C-i outline-show-children | 1061 | C-c C-p allout-previous-visible-heading | C-c C-i allout-show-children |
| 1062 | C-c C-u outline-up-current-level | C-c C-s outline-show-current-subtree | 1062 | C-c C-u allout-up-current-level | C-c C-s allout-show-current-subtree |
| 1063 | C-c C-f outline-forward-current-level | C-c C-o outline-show-current-entry | 1063 | C-c C-f allout-forward-current-level | C-c C-o allout-show-current-entry |
| 1064 | C-c C-b outline-backward-current-level | ^U C-c C-s outline-show-all | 1064 | C-c C-b allout-backward-current-level | ^U C-c C-s allout-show-all |
| 1065 | C-c C-e outline-end-of-current-entry | outline-hide-current-leaves | 1065 | C-c C-e allout-end-of-current-entry | allout-hide-current-leaves |
| 1066 | C-c C-a outline-beginning-of-current-entry, alternately, goes to hot-spot | 1066 | C-c C-a allout-beginning-of-current-entry, alternately, goes to hot-spot |
| 1067 | 1067 | ||
| 1068 | Topic Header Production: | 1068 | Topic Header Production: |
| 1069 | ----------------------- | 1069 | ----------------------- |
| 1070 | C-c<SP> outline-open-sibtopic Create a new sibling after current topic. | 1070 | C-c<SP> allout-open-sibtopic Create a new sibling after current topic. |
| 1071 | C-c . outline-open-subtopic ... an offspring of current topic. | 1071 | C-c . allout-open-subtopic ... an offspring of current topic. |
| 1072 | C-c , outline-open-supertopic ... a sibling of the current topic's parent. | 1072 | C-c , allout-open-supertopic ... a sibling of the current topic's parent. |
| 1073 | 1073 | ||
| 1074 | Topic Level and Prefix Adjustment: | 1074 | Topic Level and Prefix Adjustment: |
| 1075 | --------------------------------- | 1075 | --------------------------------- |
| 1076 | C-c > outline-shift-in Shift current topic and all offspring deeper. | 1076 | C-c > allout-shift-in Shift current topic and all offspring deeper. |
| 1077 | C-c < outline-shift-out ... less deep. | 1077 | C-c < allout-shift-out ... less deep. |
| 1078 | C-c<CR> outline-rebullet-topic Reconcile bullets of topic and its offspring | 1078 | C-c<CR> allout-rebullet-topic Reconcile bullets of topic and its offspring |
| 1079 | - distinctive bullets are not changed, others | 1079 | - distinctive bullets are not changed, others |
| 1080 | alternated according to nesting depth. | 1080 | alternated according to nesting depth. |
| 1081 | C-c b outline-rebullet-current-heading Prompt for alternate bullet for | 1081 | C-c b allout-rebullet-current-heading Prompt for alternate bullet for |
| 1082 | current topic. | 1082 | current topic. |
| 1083 | C-c # outline-number-siblings Number bullets of topic and siblings - the | 1083 | C-c # allout-number-siblings Number bullets of topic and siblings - the |
| 1084 | offspring are not affected. With repeat | 1084 | offspring are not affected. With repeat |
| 1085 | count, revoke numbering. | 1085 | count, revoke numbering. |
| 1086 | 1086 | ||
| 1087 | Topic-oriented Killing and Yanking: | 1087 | Topic-oriented Killing and Yanking: |
| 1088 | ---------------------------------- | 1088 | ---------------------------------- |
| 1089 | C-c C-k outline-kill-topic Kill current topic, including offspring. | 1089 | C-c C-k allout-kill-topic Kill current topic, including offspring. |
| 1090 | C-k outline-kill-line Like kill-line, but reconciles numbering, etc. | 1090 | C-k allout-kill-line Like kill-line, but reconciles numbering, etc. |
| 1091 | C-y outline-yank Yank, adjusting depth of yanked topic to | 1091 | C-y allout-yank Yank, adjusting depth of yanked topic to |
| 1092 | depth of heading if yanking into bare topic | 1092 | depth of heading if yanking into bare topic |
| 1093 | heading (ie, prefix sans text). | 1093 | heading (ie, prefix sans text). |
| 1094 | M-y outline-yank-pop Is to outline-yank as yank-pop is to yank | 1094 | M-y allout-yank-pop Is to allout-yank as yank-pop is to yank |
| 1095 | 1095 | ||
| 1096 | Misc commands: | 1096 | Misc commands: |
| 1097 | ------------- | 1097 | ------------- |
| 1098 | M-x outlineify-sticky Activate outline mode for current buffer, | 1098 | M-x outlineify-sticky Activate outline mode for current buffer, |
| 1099 | and establish a default file-var setting | 1099 | and establish a default file-var setting |
| 1100 | for `outline-layout'. | 1100 | for `allout-layout'. |
| 1101 | C-c C-SPC outline-mark-topic | 1101 | C-c C-SPC allout-mark-topic |
| 1102 | C-c = c outline-copy-exposed-to-buffer | 1102 | C-c = c allout-copy-exposed-to-buffer |
| 1103 | Duplicate outline, sans concealed text, to | 1103 | Duplicate outline, sans concealed text, to |
| 1104 | buffer with name derived from derived from | 1104 | buffer with name derived from derived from |
| 1105 | that of current buffer - \"*XXX exposed*\". | 1105 | that of current buffer - \"*XXX exposed*\". |
| 1106 | C-c = p outline-flatten-exposed-to-buffer | 1106 | C-c = p allout-flatten-exposed-to-buffer |
| 1107 | Like above 'copy-exposed', but convert topic | 1107 | Like above 'copy-exposed', but convert topic |
| 1108 | prefixes to section.subsection... numeric | 1108 | prefixes to section.subsection... numeric |
| 1109 | format. | 1109 | format. |
| 1110 | ESC ESC (outline-init t) Setup emacs session for outline mode | 1110 | ESC ESC (allout-init t) Setup emacs session for outline mode |
| 1111 | auto-activation. | 1111 | auto-activation. |
| 1112 | 1112 | ||
| 1113 | HOT-SPOT Operation | 1113 | HOT-SPOT Operation |
| @@ -1115,12 +1115,12 @@ ESC ESC (outline-init t) Setup emacs session for outline mode | |||
| 1115 | Hot-spot operation provides a means for easy, single-keystroke outline | 1115 | Hot-spot operation provides a means for easy, single-keystroke outline |
| 1116 | navigation and exposure control. | 1116 | navigation and exposure control. |
| 1117 | 1117 | ||
| 1118 | \\<outline-mode-map> | 1118 | \\<allout-mode-map> |
| 1119 | When the text cursor is positioned directly on the bullet character of | 1119 | When the text cursor is positioned directly on the bullet character of |
| 1120 | a topic, regular characters (a to z) invoke the commands of the | 1120 | a topic, regular characters (a to z) invoke the commands of the |
| 1121 | corresponding outline-mode keymap control chars. For example, \"f\" | 1121 | corresponding allout-mode keymap control chars. For example, \"f\" |
| 1122 | would invoke the command typically bound to \"C-c C-f\" | 1122 | would invoke the command typically bound to \"C-c C-f\" |
| 1123 | \(\\[outline-forward-current-level] `outline-forward-current-level'). | 1123 | \(\\[allout-forward-current-level] `allout-forward-current-level'). |
| 1124 | 1124 | ||
| 1125 | Thus, by positioning the cursor on a topic bullet, you can execute | 1125 | Thus, by positioning the cursor on a topic bullet, you can execute |
| 1126 | the outline navigation and manipulation commands with a single | 1126 | the outline navigation and manipulation commands with a single |
| @@ -1128,9 +1128,9 @@ keystroke. Non-literal chars never get this special translation, so | |||
| 1128 | you can use them to get away from the hot-spot, and back to normal | 1128 | you can use them to get away from the hot-spot, and back to normal |
| 1129 | operation. | 1129 | operation. |
| 1130 | 1130 | ||
| 1131 | Note that the command `outline-beginning-of-current-entry' \(\\[outline-beginning-of-current-entry]\) | 1131 | Note that the command `allout-beginning-of-current-entry' \(\\[allout-beginning-of-current-entry]\) |
| 1132 | will move to the hot-spot when the cursor is already located at the | 1132 | will move to the hot-spot when the cursor is already located at the |
| 1133 | beginning of the current entry, so you can simply hit \\[outline-beginning-of-current-entry] | 1133 | beginning of the current entry, so you can simply hit \\[allout-beginning-of-current-entry] |
| 1134 | twice in a row to get to the hot-spot. | 1134 | twice in a row to get to the hot-spot. |
| 1135 | 1135 | ||
| 1136 | Terminology | 1136 | Terminology |
| @@ -1173,19 +1173,19 @@ PREFIX: The leading text of a topic which which distinguishes it from | |||
| 1173 | PREFIX-LEAD: | 1173 | PREFIX-LEAD: |
| 1174 | The string at the beginning of a topic prefix, normally a `.'. | 1174 | The string at the beginning of a topic prefix, normally a `.'. |
| 1175 | It can be customized by changing the setting of | 1175 | It can be customized by changing the setting of |
| 1176 | `outline-header-prefix' and then reinitializing outline-mode. | 1176 | `allout-header-prefix' and then reinitializing allout-mode. |
| 1177 | 1177 | ||
| 1178 | By setting the prefix-lead to the comment-string of a | 1178 | By setting the prefix-lead to the comment-string of a |
| 1179 | programming language, you can embed outline-structuring in | 1179 | programming language, you can embed allout-structuring in |
| 1180 | program code without interfering with the language processing | 1180 | program code without interfering with the language processing |
| 1181 | of that code. See `outline-use-mode-specific-leader' | 1181 | of that code. See `allout-use-mode-specific-leader' |
| 1182 | docstring for more detail. | 1182 | docstring for more detail. |
| 1183 | PREFIX-PADDING: | 1183 | PREFIX-PADDING: |
| 1184 | Spaces or asterisks which separate the prefix-lead and the | 1184 | Spaces or asterisks which separate the prefix-lead and the |
| 1185 | bullet, according to the depth of the topic. | 1185 | bullet, according to the depth of the topic. |
| 1186 | BULLET: A character at the end of the topic prefix, it must be one of | 1186 | BULLET: A character at the end of the topic prefix, it must be one of |
| 1187 | the characters listed on `outline-plain-bullets-string' or | 1187 | the characters listed on `allout-plain-bullets-string' or |
| 1188 | `outline-distinctive-bullets-string'. (See the documentation | 1188 | `allout-distinctive-bullets-string'. (See the documentation |
| 1189 | for these variables for more details.) The default choice of | 1189 | for these variables for more details.) The default choice of |
| 1190 | bullet when generating varies in a cycle with the depth of the | 1190 | bullet when generating varies in a cycle with the depth of the |
| 1191 | topic. | 1191 | topic. |
| @@ -1208,7 +1208,7 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1208 | (interactive "P") | 1208 | (interactive "P") |
| 1209 | 1209 | ||
| 1210 | (let* ((active (and (not (equal major-mode 'outline)) | 1210 | (let* ((active (and (not (equal major-mode 'outline)) |
| 1211 | (outline-mode-p))) | 1211 | (allout-mode-p))) |
| 1212 | ; Massage universal-arg `toggle' val: | 1212 | ; Massage universal-arg `toggle' val: |
| 1213 | (toggle (and toggle | 1213 | (toggle (and toggle |
| 1214 | (or (and (listp toggle)(car toggle)) | 1214 | (or (and (listp toggle)(car toggle)) |
| @@ -1220,14 +1220,14 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1220 | (or (symbolp toggle) | 1220 | (or (symbolp toggle) |
| 1221 | (and (natnump toggle) | 1221 | (and (natnump toggle) |
| 1222 | (not (zerop toggle))))))) | 1222 | (not (zerop toggle))))))) |
| 1223 | ;; outline-mode already called once during this complex command? | 1223 | ;; allout-mode already called once during this complex command? |
| 1224 | (same-complex-command (eq outline-v18/19-file-var-hack | 1224 | (same-complex-command (eq allout-v18/19-file-var-hack |
| 1225 | (car command-history))) | 1225 | (car command-history))) |
| 1226 | do-layout | 1226 | do-layout |
| 1227 | ) | 1227 | ) |
| 1228 | 1228 | ||
| 1229 | ; See comments below re v19.18,.19 bug. | 1229 | ; See comments below re v19.18,.19 bug. |
| 1230 | (setq outline-v18/19-file-var-hack (car command-history)) | 1230 | (setq allout-v18/19-file-var-hack (car command-history)) |
| 1231 | 1231 | ||
| 1232 | (cond | 1232 | (cond |
| 1233 | 1233 | ||
| @@ -1237,7 +1237,7 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1237 | ;; off on second invocation, so we detect it as best we can, and | 1237 | ;; off on second invocation, so we detect it as best we can, and |
| 1238 | ;; skip everything. | 1238 | ;; skip everything. |
| 1239 | ((and same-complex-command ; Still in same complex command | 1239 | ((and same-complex-command ; Still in same complex command |
| 1240 | ; as last time outline-mode invoked. | 1240 | ; as last time allout-mode invoked. |
| 1241 | active ; Already activated. | 1241 | active ; Already activated. |
| 1242 | (not explicit-activation) ; Prop-line file-vars don't have args. | 1242 | (not explicit-activation) ; Prop-line file-vars don't have args. |
| 1243 | (string-match "^19.1[89]" ; Bug only known to be in v19.18 and | 1243 | (string-match "^19.1[89]" ; Bug only known to be in v19.18 and |
| @@ -1251,7 +1251,7 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1251 | ; requested, and either in | 1251 | ; requested, and either in |
| 1252 | ; active state or *de*activation | 1252 | ; active state or *de*activation |
| 1253 | ; specifically requested: | 1253 | ; specifically requested: |
| 1254 | (setq outline-explicitly-deactivated t) | 1254 | (setq allout-explicitly-deactivated t) |
| 1255 | (if (string-match "^18\." emacs-version) | 1255 | (if (string-match "^18\." emacs-version) |
| 1256 | ; Revoke those keys that remain | 1256 | ; Revoke those keys that remain |
| 1257 | ; as we set them: | 1257 | ; as we set them: |
| @@ -1261,86 +1261,86 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1261 | (if (eq (lookup-key curr-loc (car cell)) | 1261 | (if (eq (lookup-key curr-loc (car cell)) |
| 1262 | (car (cdr cell))) | 1262 | (car (cdr cell))) |
| 1263 | (define-key curr-loc (car cell) | 1263 | (define-key curr-loc (car cell) |
| 1264 | (assq (car cell) outline-prior-bindings))))) | 1264 | (assq (car cell) allout-prior-bindings))))) |
| 1265 | outline-added-bindings) | 1265 | allout-added-bindings) |
| 1266 | (outline-resumptions 'outline-added-bindings) | 1266 | (allout-resumptions 'allout-added-bindings) |
| 1267 | (outline-resumptions 'outline-prior-bindings))) | 1267 | (allout-resumptions 'allout-prior-bindings))) |
| 1268 | 1268 | ||
| 1269 | (if outline-old-style-prefixes | 1269 | (if allout-old-style-prefixes |
| 1270 | (progn | 1270 | (progn |
| 1271 | (outline-resumptions 'outline-primary-bullet) | 1271 | (allout-resumptions 'allout-primary-bullet) |
| 1272 | (outline-resumptions 'outline-old-style-prefixes))) | 1272 | (allout-resumptions 'allout-old-style-prefixes))) |
| 1273 | (outline-resumptions 'selective-display) | 1273 | (allout-resumptions 'selective-display) |
| 1274 | (if (and (boundp 'before-change-functions) before-change-functions) | 1274 | (if (and (boundp 'before-change-functions) before-change-functions) |
| 1275 | (outline-resumptions 'before-change-functions)) | 1275 | (allout-resumptions 'before-change-functions)) |
| 1276 | (setq local-write-file-hooks | 1276 | (setq local-write-file-hooks |
| 1277 | (delq 'outline-write-file-hook | 1277 | (delq 'allout-write-file-hook |
| 1278 | local-write-file-hooks)) | 1278 | local-write-file-hooks)) |
| 1279 | (outline-resumptions 'paragraph-start) | 1279 | (allout-resumptions 'paragraph-start) |
| 1280 | (outline-resumptions 'paragraph-separate) | 1280 | (allout-resumptions 'paragraph-separate) |
| 1281 | (outline-resumptions (if (string-match "^18" emacs-version) | 1281 | (allout-resumptions (if (string-match "^18" emacs-version) |
| 1282 | 'auto-fill-hook | 1282 | 'auto-fill-hook |
| 1283 | 'auto-fill-function)) | 1283 | 'auto-fill-function)) |
| 1284 | (outline-resumptions 'outline-former-auto-filler) | 1284 | (allout-resumptions 'allout-former-auto-filler) |
| 1285 | (setq outline-mode nil)) | 1285 | (setq allout-mode nil)) |
| 1286 | 1286 | ||
| 1287 | ;; Activation: | 1287 | ;; Activation: |
| 1288 | ((not active) | 1288 | ((not active) |
| 1289 | (setq outline-explicitly-deactivated nil) | 1289 | (setq allout-explicitly-deactivated nil) |
| 1290 | (if outline-old-style-prefixes | 1290 | (if allout-old-style-prefixes |
| 1291 | (progn ; Inhibit all the fancy formatting: | 1291 | (progn ; Inhibit all the fancy formatting: |
| 1292 | (outline-resumptions 'outline-primary-bullet '("*")) | 1292 | (allout-resumptions 'allout-primary-bullet '("*")) |
| 1293 | (outline-resumptions 'outline-old-style-prefixes '(())))) | 1293 | (allout-resumptions 'allout-old-style-prefixes '(())))) |
| 1294 | 1294 | ||
| 1295 | (outline-infer-header-lead) | 1295 | (allout-infer-header-lead) |
| 1296 | (outline-infer-body-reindent) | 1296 | (allout-infer-body-reindent) |
| 1297 | 1297 | ||
| 1298 | (set-outline-regexp) | 1298 | (set-allout-regexp) |
| 1299 | 1299 | ||
| 1300 | ; Produce map from current version | 1300 | ; Produce map from current version |
| 1301 | ; of outline-keybindings-list: | 1301 | ; of allout-keybindings-list: |
| 1302 | (if (boundp 'minor-mode-map-alist) | 1302 | (if (boundp 'minor-mode-map-alist) |
| 1303 | 1303 | ||
| 1304 | (progn ; V19, and maybe lucid and | 1304 | (progn ; V19, and maybe lucid and |
| 1305 | ; epoch, minor-mode key bindings: | 1305 | ; epoch, minor-mode key bindings: |
| 1306 | (setq outline-mode-map | 1306 | (setq allout-mode-map |
| 1307 | (produce-outline-mode-map outline-keybindings-list)) | 1307 | (produce-allout-mode-map allout-keybindings-list)) |
| 1308 | (produce-outline-mode-menubar-entries) | 1308 | (produce-allout-mode-menubar-entries) |
| 1309 | (fset 'outline-mode-map outline-mode-map) | 1309 | (fset 'allout-mode-map allout-mode-map) |
| 1310 | ; Include on minor-mode-map-alist, | 1310 | ; Include on minor-mode-map-alist, |
| 1311 | ; if not already there: | 1311 | ; if not already there: |
| 1312 | (if (not (member '(outline-mode . outline-mode-map) | 1312 | (if (not (member '(allout-mode . allout-mode-map) |
| 1313 | minor-mode-map-alist)) | 1313 | minor-mode-map-alist)) |
| 1314 | (setq minor-mode-map-alist | 1314 | (setq minor-mode-map-alist |
| 1315 | (cons '(outline-mode . outline-mode-map) | 1315 | (cons '(allout-mode . allout-mode-map) |
| 1316 | minor-mode-map-alist)))) | 1316 | minor-mode-map-alist)))) |
| 1317 | 1317 | ||
| 1318 | ; V18 minor-mode key bindings: | 1318 | ; V18 minor-mode key bindings: |
| 1319 | ; Stash record of added bindings | 1319 | ; Stash record of added bindings |
| 1320 | ; for later revocation: | 1320 | ; for later revocation: |
| 1321 | (outline-resumptions 'outline-added-bindings | 1321 | (allout-resumptions 'allout-added-bindings |
| 1322 | (list outline-keybindings-list)) | 1322 | (list allout-keybindings-list)) |
| 1323 | (outline-resumptions 'outline-prior-bindings | 1323 | (allout-resumptions 'allout-prior-bindings |
| 1324 | (list (current-local-map))) | 1324 | (list (current-local-map))) |
| 1325 | ; and add them: | 1325 | ; and add them: |
| 1326 | (use-local-map (produce-outline-mode-map outline-keybindings-list | 1326 | (use-local-map (produce-allout-mode-map allout-keybindings-list |
| 1327 | (current-local-map))) | 1327 | (current-local-map))) |
| 1328 | ) | 1328 | ) |
| 1329 | 1329 | ||
| 1330 | ; selective-display is the | 1330 | ; selective-display is the |
| 1331 | ; emacs conditional exposure | 1331 | ; emacs conditional exposure |
| 1332 | ; mechanism: | 1332 | ; mechanism: |
| 1333 | (outline-resumptions 'selective-display '(t)) | 1333 | (allout-resumptions 'selective-display '(t)) |
| 1334 | (if outline-inhibit-protection | 1334 | (if allout-inhibit-protection |
| 1335 | t | 1335 | t |
| 1336 | (outline-resumptions 'before-change-functions | 1336 | (allout-resumptions 'before-change-functions |
| 1337 | '(outline-before-change-protect))) | 1337 | '(allout-before-change-protect))) |
| 1338 | (add-hook 'pre-command-hook 'outline-pre-command-business) | 1338 | (add-hook 'pre-command-hook 'allout-pre-command-business) |
| 1339 | (add-hook 'post-command-hook 'outline-post-command-business) | 1339 | (add-hook 'post-command-hook 'allout-post-command-business) |
| 1340 | ; Temporarily set by any outline | 1340 | ; Temporarily set by any outline |
| 1341 | ; functions that can be trusted to | 1341 | ; functions that can be trusted to |
| 1342 | ; deal properly with concealed text. | 1342 | ; deal properly with concealed text. |
| 1343 | (add-hook 'local-write-file-hooks 'outline-write-file-hook) | 1343 | (add-hook 'local-write-file-hooks 'allout-write-file-hook) |
| 1344 | ; Custom auto-fill func, to support | 1344 | ; Custom auto-fill func, to support |
| 1345 | ; respect for topic headline, | 1345 | ; respect for topic headline, |
| 1346 | ; hanging-indents, etc: | 1346 | ; hanging-indents, etc: |
| @@ -1348,49 +1348,49 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1348 | 'auto-fill-hook | 1348 | 'auto-fill-hook |
| 1349 | 'auto-fill-function)) | 1349 | 'auto-fill-function)) |
| 1350 | (fill-func (symbol-value fill-func-var))) | 1350 | (fill-func (symbol-value fill-func-var))) |
| 1351 | ;; Register prevailing fill func for use by outline-auto-fill: | 1351 | ;; Register prevailing fill func for use by allout-auto-fill: |
| 1352 | (outline-resumptions 'outline-former-auto-filler (list fill-func)) | 1352 | (allout-resumptions 'allout-former-auto-filler (list fill-func)) |
| 1353 | ;; Register outline-auto-fill to be used if filling is active: | 1353 | ;; Register allout-auto-fill to be used if filling is active: |
| 1354 | (outline-resumptions fill-func-var '(outline-auto-fill))) | 1354 | (allout-resumptions fill-func-var '(allout-auto-fill))) |
| 1355 | ;; Paragraphs are broken by topic headlines. | 1355 | ;; Paragraphs are broken by topic headlines. |
| 1356 | (make-local-variable 'paragraph-start) | 1356 | (make-local-variable 'paragraph-start) |
| 1357 | (outline-resumptions 'paragraph-start | 1357 | (allout-resumptions 'paragraph-start |
| 1358 | (list (concat paragraph-start "\\|^\\(" | 1358 | (list (concat paragraph-start "\\|^\\(" |
| 1359 | outline-regexp "\\)"))) | 1359 | allout-regexp "\\)"))) |
| 1360 | (make-local-variable 'paragraph-separate) | 1360 | (make-local-variable 'paragraph-separate) |
| 1361 | (outline-resumptions 'paragraph-separate | 1361 | (allout-resumptions 'paragraph-separate |
| 1362 | (list (concat paragraph-separate "\\|^\\(" | 1362 | (list (concat paragraph-separate "\\|^\\(" |
| 1363 | outline-regexp "\\)"))) | 1363 | allout-regexp "\\)"))) |
| 1364 | 1364 | ||
| 1365 | (or (assq 'outline-mode minor-mode-alist) | 1365 | (or (assq 'allout-mode minor-mode-alist) |
| 1366 | (setq minor-mode-alist | 1366 | (setq minor-mode-alist |
| 1367 | (cons '(outline-mode " Outl") minor-mode-alist))) | 1367 | (cons '(allout-mode " Outl") minor-mode-alist))) |
| 1368 | 1368 | ||
| 1369 | (outline-setup-menubar) | 1369 | (allout-setup-menubar) |
| 1370 | 1370 | ||
| 1371 | (if outline-layout | 1371 | (if allout-layout |
| 1372 | (setq do-layout t)) | 1372 | (setq do-layout t)) |
| 1373 | 1373 | ||
| 1374 | (if (and outline-isearch-dynamic-expose | 1374 | (if (and allout-isearch-dynamic-expose |
| 1375 | (not (fboundp 'outline-real-isearch-abort))) | 1375 | (not (fboundp 'allout-real-isearch-abort))) |
| 1376 | (outline-enwrap-isearch)) | 1376 | (allout-enwrap-isearch)) |
| 1377 | 1377 | ||
| 1378 | (run-hooks 'outline-mode-hook) | 1378 | (run-hooks 'allout-mode-hook) |
| 1379 | (setq outline-mode t)) | 1379 | (setq allout-mode t)) |
| 1380 | 1380 | ||
| 1381 | ;; Reactivation: | 1381 | ;; Reactivation: |
| 1382 | ((setq do-layout t) | 1382 | ((setq do-layout t) |
| 1383 | (outline-infer-body-reindent)) | 1383 | (allout-infer-body-reindent)) |
| 1384 | ) ; cond | 1384 | ) ; cond |
| 1385 | 1385 | ||
| 1386 | (if (and do-layout | 1386 | (if (and do-layout |
| 1387 | outline-auto-activation | 1387 | allout-auto-activation |
| 1388 | (listp outline-layout) | 1388 | (listp allout-layout) |
| 1389 | (and (not (eq outline-auto-activation 'activate)) | 1389 | (and (not (eq allout-auto-activation 'activate)) |
| 1390 | (if (eq outline-auto-activation 'ask) | 1390 | (if (eq allout-auto-activation 'ask) |
| 1391 | (if (y-or-n-p (format "Expose %s with layout '%s'? " | 1391 | (if (y-or-n-p (format "Expose %s with layout '%s'? " |
| 1392 | (buffer-name) | 1392 | (buffer-name) |
| 1393 | outline-layout)) | 1393 | allout-layout)) |
| 1394 | t | 1394 | t |
| 1395 | (message "Skipped %s layout." (buffer-name)) | 1395 | (message "Skipped %s layout." (buffer-name)) |
| 1396 | nil) | 1396 | nil) |
| @@ -1398,168 +1398,168 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1398 | (save-excursion | 1398 | (save-excursion |
| 1399 | (message "Adjusting '%s' exposure..." (buffer-name)) | 1399 | (message "Adjusting '%s' exposure..." (buffer-name)) |
| 1400 | (goto-char 0) | 1400 | (goto-char 0) |
| 1401 | (outline-this-or-next-heading) | 1401 | (allout-this-or-next-heading) |
| 1402 | (condition-case err | 1402 | (condition-case err |
| 1403 | (progn | 1403 | (progn |
| 1404 | (apply 'outline-expose-topic (list outline-layout)) | 1404 | (apply 'allout-expose-topic (list allout-layout)) |
| 1405 | (message "Adjusting '%s' exposure... done." (buffer-name))) | 1405 | (message "Adjusting '%s' exposure... done." (buffer-name))) |
| 1406 | ;; Problem applying exposure - notify user, but don't | 1406 | ;; Problem applying exposure - notify user, but don't |
| 1407 | ;; interrupt, eg, file visit: | 1407 | ;; interrupt, eg, file visit: |
| 1408 | (error (message "%s" (car (cdr err))) | 1408 | (error (message "%s" (car (cdr err))) |
| 1409 | (sit-for 1))))) | 1409 | (sit-for 1))))) |
| 1410 | outline-mode | 1410 | allout-mode |
| 1411 | ) ; let* | 1411 | ) ; let* |
| 1412 | ) ; defun | 1412 | ) ; defun |
| 1413 | ;;;_ > outline-minor-mode | 1413 | ;;;_ > allout-minor-mode |
| 1414 | ;;; XXX released verion doesn't do this? | 1414 | ;;; XXX released verion doesn't do this? |
| 1415 | (defalias 'outline-minor-mode 'outline-mode) | 1415 | (defalias 'allout-minor-mode 'allout-mode) |
| 1416 | 1416 | ||
| 1417 | ;;;_ #3 Internal Position State-Tracking - "outline-recent-*" funcs | 1417 | ;;;_ #3 Internal Position State-Tracking - "allout-recent-*" funcs |
| 1418 | ;;; All the basic outline functions that directly do string matches to | 1418 | ;;; All the basic outline functions that directly do string matches to |
| 1419 | ;;; evaluate heading prefix location set the variables | 1419 | ;;; evaluate heading prefix location set the variables |
| 1420 | ;;; `outline-recent-prefix-beginning' and `outline-recent-prefix-end' | 1420 | ;;; `allout-recent-prefix-beginning' and `allout-recent-prefix-end' |
| 1421 | ;;; when successful. Functions starting with `outline-recent-' all | 1421 | ;;; when successful. Functions starting with `allout-recent-' all |
| 1422 | ;;; use this state, providing the means to avoid redundant searches | 1422 | ;;; use this state, providing the means to avoid redundant searches |
| 1423 | ;;; for just-established data. This optimization can provide | 1423 | ;;; for just-established data. This optimization can provide |
| 1424 | ;;; significant speed improvement, but it must be employed carefully. | 1424 | ;;; significant speed improvement, but it must be employed carefully. |
| 1425 | ;;;_ = outline-recent-prefix-beginning | 1425 | ;;;_ = allout-recent-prefix-beginning |
| 1426 | (defvar outline-recent-prefix-beginning 0 | 1426 | (defvar allout-recent-prefix-beginning 0 |
| 1427 | "Buffer point of the start of the last topic prefix encountered.") | 1427 | "Buffer point of the start of the last topic prefix encountered.") |
| 1428 | (make-variable-buffer-local 'outline-recent-prefix-beginning) | 1428 | (make-variable-buffer-local 'allout-recent-prefix-beginning) |
| 1429 | ;;;_ = outline-recent-prefix-end | 1429 | ;;;_ = allout-recent-prefix-end |
| 1430 | (defvar outline-recent-prefix-end 0 | 1430 | (defvar allout-recent-prefix-end 0 |
| 1431 | "Buffer point of the end of the last topic prefix encountered.") | 1431 | "Buffer point of the end of the last topic prefix encountered.") |
| 1432 | (make-variable-buffer-local 'outline-recent-prefix-end) | 1432 | (make-variable-buffer-local 'allout-recent-prefix-end) |
| 1433 | ;;;_ = outline-recent-end-of-subtree | 1433 | ;;;_ = allout-recent-end-of-subtree |
| 1434 | (defvar outline-recent-end-of-subtree 0 | 1434 | (defvar allout-recent-end-of-subtree 0 |
| 1435 | "Buffer point last returned by outline-end-of-current-subtree.") | 1435 | "Buffer point last returned by allout-end-of-current-subtree.") |
| 1436 | (make-variable-buffer-local 'outline-recent-end-of-subtree) | 1436 | (make-variable-buffer-local 'allout-recent-end-of-subtree) |
| 1437 | ;;;_ > outline-prefix-data (beg end) | 1437 | ;;;_ > allout-prefix-data (beg end) |
| 1438 | (defmacro outline-prefix-data (beg end) | 1438 | (defmacro allout-prefix-data (beg end) |
| 1439 | "Register outline-prefix state data - BEGINNING and END of prefix. | 1439 | "Register allout-prefix state data - BEGINNING and END of prefix. |
| 1440 | 1440 | ||
| 1441 | For reference by `outline-recent' funcs. Returns BEGINNING." | 1441 | For reference by `allout-recent' funcs. Returns BEGINNING." |
| 1442 | `(setq outline-recent-prefix-end ,end | 1442 | `(setq allout-recent-prefix-end ,end |
| 1443 | outline-recent-prefix-beginning ,beg)) | 1443 | allout-recent-prefix-beginning ,beg)) |
| 1444 | ;;;_ > outline-recent-depth () | 1444 | ;;;_ > allout-recent-depth () |
| 1445 | (defmacro outline-recent-depth () | 1445 | (defmacro allout-recent-depth () |
| 1446 | "Return depth of last heading encountered by an outline maneuvering function. | 1446 | "Return depth of last heading encountered by an outline maneuvering function. |
| 1447 | 1447 | ||
| 1448 | All outline functions which directly do string matches to assess | 1448 | All outline functions which directly do string matches to assess |
| 1449 | headings set the variables outline-recent-prefix-beginning and | 1449 | headings set the variables allout-recent-prefix-beginning and |
| 1450 | outline-recent-prefix-end if successful. This function uses those settings | 1450 | allout-recent-prefix-end if successful. This function uses those settings |
| 1451 | to return the current depth." | 1451 | to return the current depth." |
| 1452 | 1452 | ||
| 1453 | '(max 1 (- outline-recent-prefix-end | 1453 | '(max 1 (- allout-recent-prefix-end |
| 1454 | outline-recent-prefix-beginning | 1454 | allout-recent-prefix-beginning |
| 1455 | outline-header-subtraction))) | 1455 | allout-header-subtraction))) |
| 1456 | ;;;_ > outline-recent-prefix () | 1456 | ;;;_ > allout-recent-prefix () |
| 1457 | (defmacro outline-recent-prefix () | 1457 | (defmacro allout-recent-prefix () |
| 1458 | "Like outline-recent-depth, but returns text of last encountered prefix. | 1458 | "Like allout-recent-depth, but returns text of last encountered prefix. |
| 1459 | 1459 | ||
| 1460 | All outline functions which directly do string matches to assess | 1460 | All outline functions which directly do string matches to assess |
| 1461 | headings set the variables outline-recent-prefix-beginning and | 1461 | headings set the variables allout-recent-prefix-beginning and |
| 1462 | outline-recent-prefix-end if successful. This function uses those settings | 1462 | allout-recent-prefix-end if successful. This function uses those settings |
| 1463 | to return the current depth." | 1463 | to return the current depth." |
| 1464 | '(buffer-substring outline-recent-prefix-beginning | 1464 | '(buffer-substring allout-recent-prefix-beginning |
| 1465 | outline-recent-prefix-end)) | 1465 | allout-recent-prefix-end)) |
| 1466 | ;;;_ > outline-recent-bullet () | 1466 | ;;;_ > allout-recent-bullet () |
| 1467 | (defmacro outline-recent-bullet () | 1467 | (defmacro allout-recent-bullet () |
| 1468 | "Like outline-recent-prefix, but returns bullet of last encountered prefix. | 1468 | "Like allout-recent-prefix, but returns bullet of last encountered prefix. |
| 1469 | 1469 | ||
| 1470 | All outline functions which directly do string matches to assess | 1470 | All outline functions which directly do string matches to assess |
| 1471 | headings set the variables outline-recent-prefix-beginning and | 1471 | headings set the variables allout-recent-prefix-beginning and |
| 1472 | outline-recent-prefix-end if successful. This function uses those settings | 1472 | allout-recent-prefix-end if successful. This function uses those settings |
| 1473 | to return the current depth of the most recently matched topic." | 1473 | to return the current depth of the most recently matched topic." |
| 1474 | '(buffer-substring (1- outline-recent-prefix-end) | 1474 | '(buffer-substring (1- allout-recent-prefix-end) |
| 1475 | outline-recent-prefix-end)) | 1475 | allout-recent-prefix-end)) |
| 1476 | 1476 | ||
| 1477 | ;;;_ #4 Navigation | 1477 | ;;;_ #4 Navigation |
| 1478 | 1478 | ||
| 1479 | ;;;_ - Position Assessment | 1479 | ;;;_ - Position Assessment |
| 1480 | ;;;_ : Location Predicates | 1480 | ;;;_ : Location Predicates |
| 1481 | ;;;_ > outline-on-current-heading-p () | 1481 | ;;;_ > allout-on-current-heading-p () |
| 1482 | (defun outline-on-current-heading-p () | 1482 | (defun allout-on-current-heading-p () |
| 1483 | "Return non-nil if point is on current visible topics' header line. | 1483 | "Return non-nil if point is on current visible topics' header line. |
| 1484 | 1484 | ||
| 1485 | Actually, returns prefix beginning point." | 1485 | Actually, returns prefix beginning point." |
| 1486 | (save-excursion | 1486 | (save-excursion |
| 1487 | (beginning-of-line) | 1487 | (beginning-of-line) |
| 1488 | (and (looking-at outline-regexp) | 1488 | (and (looking-at allout-regexp) |
| 1489 | (outline-prefix-data (match-beginning 0) (match-end 0))))) | 1489 | (allout-prefix-data (match-beginning 0) (match-end 0))))) |
| 1490 | ;;;_ > outline-on-heading-p () | 1490 | ;;;_ > allout-on-heading-p () |
| 1491 | (defalias 'outline-on-heading-p 'outline-on-current-heading-p) | 1491 | (defalias 'allout-on-heading-p 'allout-on-current-heading-p) |
| 1492 | ;;;_ > outline-e-o-prefix-p () | 1492 | ;;;_ > allout-e-o-prefix-p () |
| 1493 | (defun outline-e-o-prefix-p () | 1493 | (defun allout-e-o-prefix-p () |
| 1494 | "True if point is located where current topic prefix ends, heading begins." | 1494 | "True if point is located where current topic prefix ends, heading begins." |
| 1495 | (and (save-excursion (beginning-of-line) | 1495 | (and (save-excursion (beginning-of-line) |
| 1496 | (looking-at outline-regexp)) | 1496 | (looking-at allout-regexp)) |
| 1497 | (= (point)(save-excursion (outline-end-of-prefix)(point))))) | 1497 | (= (point)(save-excursion (allout-end-of-prefix)(point))))) |
| 1498 | ;;;_ > outline-hidden-p () | 1498 | ;;;_ > allout-hidden-p () |
| 1499 | (defmacro outline-hidden-p () | 1499 | (defmacro allout-hidden-p () |
| 1500 | "True if point is in hidden text." | 1500 | "True if point is in hidden text." |
| 1501 | '(save-excursion | 1501 | '(save-excursion |
| 1502 | (and (re-search-backward "[\n\r]" () t) | 1502 | (and (re-search-backward "[\n\r]" () t) |
| 1503 | (= ?\r (following-char))))) | 1503 | (= ?\r (following-char))))) |
| 1504 | ;;;_ > outline-visible-p () | 1504 | ;;;_ > allout-visible-p () |
| 1505 | (defmacro outline-visible-p () | 1505 | (defmacro allout-visible-p () |
| 1506 | "True if point is not in hidden text." | 1506 | "True if point is not in hidden text." |
| 1507 | (interactive) | 1507 | (interactive) |
| 1508 | '(not (outline-hidden-p))) | 1508 | '(not (allout-hidden-p))) |
| 1509 | ;;;_ : Location attributes | 1509 | ;;;_ : Location attributes |
| 1510 | ;;;_ > outline-depth () | 1510 | ;;;_ > allout-depth () |
| 1511 | (defsubst outline-depth () | 1511 | (defsubst allout-depth () |
| 1512 | "Like outline-current-depth, but respects hidden as well as visible topics." | 1512 | "Like allout-current-depth, but respects hidden as well as visible topics." |
| 1513 | (save-excursion | 1513 | (save-excursion |
| 1514 | (if (outline-goto-prefix) | 1514 | (if (allout-goto-prefix) |
| 1515 | (outline-recent-depth) | 1515 | (allout-recent-depth) |
| 1516 | (progn | 1516 | (progn |
| 1517 | ;; Oops, no prefix, zero prefix data: | 1517 | ;; Oops, no prefix, zero prefix data: |
| 1518 | (outline-prefix-data (point)(point)) | 1518 | (allout-prefix-data (point)(point)) |
| 1519 | ;; ... and return 0: | 1519 | ;; ... and return 0: |
| 1520 | 0)))) | 1520 | 0)))) |
| 1521 | ;;;_ > outline-current-depth () | 1521 | ;;;_ > allout-current-depth () |
| 1522 | (defmacro outline-current-depth () | 1522 | (defmacro allout-current-depth () |
| 1523 | "Return nesting depth of visible topic most immediately containing point." | 1523 | "Return nesting depth of visible topic most immediately containing point." |
| 1524 | '(save-excursion | 1524 | '(save-excursion |
| 1525 | (if (outline-back-to-current-heading) | 1525 | (if (allout-back-to-current-heading) |
| 1526 | (max 1 | 1526 | (max 1 |
| 1527 | (- outline-recent-prefix-end | 1527 | (- allout-recent-prefix-end |
| 1528 | outline-recent-prefix-beginning | 1528 | allout-recent-prefix-beginning |
| 1529 | outline-header-subtraction)) | 1529 | allout-header-subtraction)) |
| 1530 | 0))) | 1530 | 0))) |
| 1531 | ;;;_ > outline-get-current-prefix () | 1531 | ;;;_ > allout-get-current-prefix () |
| 1532 | (defun outline-get-current-prefix () | 1532 | (defun allout-get-current-prefix () |
| 1533 | "Topic prefix of the current topic." | 1533 | "Topic prefix of the current topic." |
| 1534 | (save-excursion | 1534 | (save-excursion |
| 1535 | (if (outline-goto-prefix) | 1535 | (if (allout-goto-prefix) |
| 1536 | (outline-recent-prefix)))) | 1536 | (allout-recent-prefix)))) |
| 1537 | ;;;_ > outline-get-bullet () | 1537 | ;;;_ > allout-get-bullet () |
| 1538 | (defun outline-get-bullet () | 1538 | (defun allout-get-bullet () |
| 1539 | "Return bullet of containing topic (visible or not)." | 1539 | "Return bullet of containing topic (visible or not)." |
| 1540 | (save-excursion | 1540 | (save-excursion |
| 1541 | (and (outline-goto-prefix) | 1541 | (and (allout-goto-prefix) |
| 1542 | (outline-recent-bullet)))) | 1542 | (allout-recent-bullet)))) |
| 1543 | ;;;_ > outline-current-bullet () | 1543 | ;;;_ > allout-current-bullet () |
| 1544 | (defun outline-current-bullet () | 1544 | (defun allout-current-bullet () |
| 1545 | "Return bullet of current (visible) topic heading, or none if none found." | 1545 | "Return bullet of current (visible) topic heading, or none if none found." |
| 1546 | (condition-case err | 1546 | (condition-case err |
| 1547 | (save-excursion | 1547 | (save-excursion |
| 1548 | (outline-back-to-current-heading) | 1548 | (allout-back-to-current-heading) |
| 1549 | (buffer-substring (- outline-recent-prefix-end 1) | 1549 | (buffer-substring (- allout-recent-prefix-end 1) |
| 1550 | outline-recent-prefix-end)) | 1550 | allout-recent-prefix-end)) |
| 1551 | ;; Quick and dirty provision, ostensibly for missing bullet: | 1551 | ;; Quick and dirty provision, ostensibly for missing bullet: |
| 1552 | ('args-out-of-range nil)) | 1552 | ('args-out-of-range nil)) |
| 1553 | ) | 1553 | ) |
| 1554 | ;;;_ > outline-get-prefix-bullet (prefix) | 1554 | ;;;_ > allout-get-prefix-bullet (prefix) |
| 1555 | (defun outline-get-prefix-bullet (prefix) | 1555 | (defun allout-get-prefix-bullet (prefix) |
| 1556 | "Return the bullet of the header prefix string PREFIX." | 1556 | "Return the bullet of the header prefix string PREFIX." |
| 1557 | ;; Doesn't make sense if we're old-style prefixes, but this just | 1557 | ;; Doesn't make sense if we're old-style prefixes, but this just |
| 1558 | ;; oughtn't be called then, so forget about it... | 1558 | ;; oughtn't be called then, so forget about it... |
| 1559 | (if (string-match outline-regexp prefix) | 1559 | (if (string-match allout-regexp prefix) |
| 1560 | (substring prefix (1- (match-end 0)) (match-end 0)))) | 1560 | (substring prefix (1- (match-end 0)) (match-end 0)))) |
| 1561 | ;;;_ > outline-sibling-index (&optional depth) | 1561 | ;;;_ > allout-sibling-index (&optional depth) |
| 1562 | (defun outline-sibling-index (&optional depth) | 1562 | (defun allout-sibling-index (&optional depth) |
| 1563 | "Item number of this prospective topic among its siblings. | 1563 | "Item number of this prospective topic among its siblings. |
| 1564 | 1564 | ||
| 1565 | If optional arg depth is greater than current depth, then we're | 1565 | If optional arg depth is greater than current depth, then we're |
| @@ -1569,32 +1569,32 @@ If less than this depth, ascend to that depth and count..." | |||
| 1569 | 1569 | ||
| 1570 | (save-excursion | 1570 | (save-excursion |
| 1571 | (cond ((and depth (<= depth 0) 0)) | 1571 | (cond ((and depth (<= depth 0) 0)) |
| 1572 | ((or (not depth) (= depth (outline-depth))) | 1572 | ((or (not depth) (= depth (allout-depth))) |
| 1573 | (let ((index 1)) | 1573 | (let ((index 1)) |
| 1574 | (while (outline-previous-sibling (outline-recent-depth) nil) | 1574 | (while (allout-previous-sibling (allout-recent-depth) nil) |
| 1575 | (setq index (1+ index))) | 1575 | (setq index (1+ index))) |
| 1576 | index)) | 1576 | index)) |
| 1577 | ((< depth (outline-recent-depth)) | 1577 | ((< depth (allout-recent-depth)) |
| 1578 | (outline-ascend-to-depth depth) | 1578 | (allout-ascend-to-depth depth) |
| 1579 | (outline-sibling-index)) | 1579 | (allout-sibling-index)) |
| 1580 | (0)))) | 1580 | (0)))) |
| 1581 | ;;;_ > outline-topic-flat-index () | 1581 | ;;;_ > allout-topic-flat-index () |
| 1582 | (defun outline-topic-flat-index () | 1582 | (defun allout-topic-flat-index () |
| 1583 | "Return a list indicating point's numeric section.subsect.subsubsect... | 1583 | "Return a list indicating point's numeric section.subsect.subsubsect... |
| 1584 | Outermost is first." | 1584 | Outermost is first." |
| 1585 | (let* ((depth (outline-depth)) | 1585 | (let* ((depth (allout-depth)) |
| 1586 | (next-index (outline-sibling-index depth)) | 1586 | (next-index (allout-sibling-index depth)) |
| 1587 | (rev-sibls nil)) | 1587 | (rev-sibls nil)) |
| 1588 | (while (> next-index 0) | 1588 | (while (> next-index 0) |
| 1589 | (setq rev-sibls (cons next-index rev-sibls)) | 1589 | (setq rev-sibls (cons next-index rev-sibls)) |
| 1590 | (setq depth (1- depth)) | 1590 | (setq depth (1- depth)) |
| 1591 | (setq next-index (outline-sibling-index depth))) | 1591 | (setq next-index (allout-sibling-index depth))) |
| 1592 | rev-sibls) | 1592 | rev-sibls) |
| 1593 | ) | 1593 | ) |
| 1594 | 1594 | ||
| 1595 | ;;;_ - Navigation macros | 1595 | ;;;_ - Navigation macros |
| 1596 | ;;;_ > outline-next-heading () | 1596 | ;;;_ > allout-next-heading () |
| 1597 | (defsubst outline-next-heading () | 1597 | (defsubst allout-next-heading () |
| 1598 | "Move to the heading for the topic \(possibly invisible) before this one. | 1598 | "Move to the heading for the topic \(possibly invisible) before this one. |
| 1599 | 1599 | ||
| 1600 | Returns the location of the heading, or nil if none found." | 1600 | Returns the location of the heading, or nil if none found." |
| @@ -1602,35 +1602,35 @@ Returns the location of the heading, or nil if none found." | |||
| 1602 | (if (and (bobp) (not (eobp))) | 1602 | (if (and (bobp) (not (eobp))) |
| 1603 | (forward-char 1)) | 1603 | (forward-char 1)) |
| 1604 | 1604 | ||
| 1605 | (if (re-search-forward outline-line-boundary-regexp nil 0) | 1605 | (if (re-search-forward allout-line-boundary-regexp nil 0) |
| 1606 | (outline-prefix-data ; Got valid location state - set vars: | 1606 | (allout-prefix-data ; Got valid location state - set vars: |
| 1607 | (goto-char (or (match-beginning 2) | 1607 | (goto-char (or (match-beginning 2) |
| 1608 | outline-recent-prefix-beginning)) | 1608 | allout-recent-prefix-beginning)) |
| 1609 | (or (match-end 2) outline-recent-prefix-end)))) | 1609 | (or (match-end 2) allout-recent-prefix-end)))) |
| 1610 | ;;;_ : outline-this-or-next-heading | 1610 | ;;;_ : allout-this-or-next-heading |
| 1611 | (defun outline-this-or-next-heading () | 1611 | (defun allout-this-or-next-heading () |
| 1612 | "Position cursor on current or next heading." | 1612 | "Position cursor on current or next heading." |
| 1613 | ;; A throwaway non-macro that is defined after outline-next-heading | 1613 | ;; A throwaway non-macro that is defined after allout-next-heading |
| 1614 | ;; and usable by outline-mode. | 1614 | ;; and usable by allout-mode. |
| 1615 | (if (not (outline-goto-prefix)) (outline-next-heading))) | 1615 | (if (not (allout-goto-prefix)) (allout-next-heading))) |
| 1616 | ;;;_ > outline-previous-heading () | 1616 | ;;;_ > allout-previous-heading () |
| 1617 | (defmacro outline-previous-heading () | 1617 | (defmacro allout-previous-heading () |
| 1618 | "Move to the prior \(possibly invisible) heading line. | 1618 | "Move to the prior \(possibly invisible) heading line. |
| 1619 | 1619 | ||
| 1620 | Return the location of the beginning of the heading, or nil if not found." | 1620 | Return the location of the beginning of the heading, or nil if not found." |
| 1621 | 1621 | ||
| 1622 | '(if (bobp) | 1622 | '(if (bobp) |
| 1623 | nil | 1623 | nil |
| 1624 | (outline-goto-prefix) | 1624 | (allout-goto-prefix) |
| 1625 | (if | 1625 | (if |
| 1626 | ;; searches are unbounded and return nil if failed: | 1626 | ;; searches are unbounded and return nil if failed: |
| 1627 | (or (re-search-backward outline-line-boundary-regexp nil 0) | 1627 | (or (re-search-backward allout-line-boundary-regexp nil 0) |
| 1628 | (looking-at outline-bob-regexp)) | 1628 | (looking-at allout-bob-regexp)) |
| 1629 | (progn ; Got valid location state - set vars: | 1629 | (progn ; Got valid location state - set vars: |
| 1630 | (outline-prefix-data | 1630 | (allout-prefix-data |
| 1631 | (goto-char (or (match-beginning 2) | 1631 | (goto-char (or (match-beginning 2) |
| 1632 | outline-recent-prefix-beginning)) | 1632 | allout-recent-prefix-beginning)) |
| 1633 | (or (match-end 2) outline-recent-prefix-end)))))) | 1633 | (or (match-end 2) allout-recent-prefix-end)))))) |
| 1634 | 1634 | ||
| 1635 | ;;;_ - Subtree Charting | 1635 | ;;;_ - Subtree Charting |
| 1636 | ;;;_ " These routines either produce or assess charts, which are | 1636 | ;;;_ " These routines either produce or assess charts, which are |
| @@ -1642,15 +1642,15 @@ Return the location of the beginning of the heading, or nil if not found." | |||
| 1642 | ;;; for assessment or adjustment of the subtree, without redundant | 1642 | ;;; for assessment or adjustment of the subtree, without redundant |
| 1643 | ;;; traversal of the structure. | 1643 | ;;; traversal of the structure. |
| 1644 | 1644 | ||
| 1645 | ;;;_ > outline-chart-subtree (&optional levels orig-depth prev-depth) | 1645 | ;;;_ > allout-chart-subtree (&optional levels orig-depth prev-depth) |
| 1646 | (defun outline-chart-subtree (&optional levels orig-depth prev-depth) | 1646 | (defun allout-chart-subtree (&optional levels orig-depth prev-depth) |
| 1647 | "Produce a location \"chart\" of subtopics of the containing topic. | 1647 | "Produce a location \"chart\" of subtopics of the containing topic. |
| 1648 | 1648 | ||
| 1649 | Optional argument LEVELS specifies the depth \(relative to start | 1649 | Optional argument LEVELS specifies the depth \(relative to start |
| 1650 | depth) for the chart. Subsequent optional args are not for public | 1650 | depth) for the chart. Subsequent optional args are not for public |
| 1651 | use. | 1651 | use. |
| 1652 | 1652 | ||
| 1653 | Charts are used to capture outline structure, so that outline-altering | 1653 | Charts are used to capture outline structure, so that allout-altering |
| 1654 | routines need assess the structure only once, and then use the chart | 1654 | routines need assess the structure only once, and then use the chart |
| 1655 | for their elaborate manipulations. | 1655 | for their elaborate manipulations. |
| 1656 | 1656 | ||
| @@ -1671,9 +1671,9 @@ starting point, and PREV-DEPTH is depth of prior topic." | |||
| 1671 | (if original ; Just starting? | 1671 | (if original ; Just starting? |
| 1672 | ; Register initial settings and | 1672 | ; Register initial settings and |
| 1673 | ; position to first offspring: | 1673 | ; position to first offspring: |
| 1674 | (progn (setq orig-depth (outline-depth)) | 1674 | (progn (setq orig-depth (allout-depth)) |
| 1675 | (or prev-depth (setq prev-depth (1+ orig-depth))) | 1675 | (or prev-depth (setq prev-depth (1+ orig-depth))) |
| 1676 | (outline-next-heading))) | 1676 | (allout-next-heading))) |
| 1677 | 1677 | ||
| 1678 | ;; Loop over the current levels' siblings. Besides being more | 1678 | ;; Loop over the current levels' siblings. Besides being more |
| 1679 | ;; efficient than tail-recursing over a level, it avoids exceeding | 1679 | ;; efficient than tail-recursing over a level, it avoids exceeding |
| @@ -1684,26 +1684,26 @@ starting point, and PREV-DEPTH is depth of prior topic." | |||
| 1684 | 1684 | ||
| 1685 | (while (and (not (eobp)) | 1685 | (while (and (not (eobp)) |
| 1686 | ; Still within original topic? | 1686 | ; Still within original topic? |
| 1687 | (< orig-depth (setq curr-depth (outline-recent-depth))) | 1687 | (< orig-depth (setq curr-depth (allout-recent-depth))) |
| 1688 | (cond ((= prev-depth curr-depth) | 1688 | (cond ((= prev-depth curr-depth) |
| 1689 | ;; Register this one and move on: | 1689 | ;; Register this one and move on: |
| 1690 | (setq chart (cons (point) chart)) | 1690 | (setq chart (cons (point) chart)) |
| 1691 | (if (and levels (<= levels 1)) | 1691 | (if (and levels (<= levels 1)) |
| 1692 | ;; At depth limit - skip sublevels: | 1692 | ;; At depth limit - skip sublevels: |
| 1693 | (or (outline-next-sibling curr-depth) | 1693 | (or (allout-next-sibling curr-depth) |
| 1694 | ;; or no more siblings - proceed to | 1694 | ;; or no more siblings - proceed to |
| 1695 | ;; next heading at lesser depth: | 1695 | ;; next heading at lesser depth: |
| 1696 | (while (and (<= curr-depth | 1696 | (while (and (<= curr-depth |
| 1697 | (outline-recent-depth)) | 1697 | (allout-recent-depth)) |
| 1698 | (outline-next-heading)))) | 1698 | (allout-next-heading)))) |
| 1699 | (outline-next-heading))) | 1699 | (allout-next-heading))) |
| 1700 | 1700 | ||
| 1701 | ((and (< prev-depth curr-depth) | 1701 | ((and (< prev-depth curr-depth) |
| 1702 | (or (not levels) | 1702 | (or (not levels) |
| 1703 | (> levels 0))) | 1703 | (> levels 0))) |
| 1704 | ;; Recurse on deeper level of curr topic: | 1704 | ;; Recurse on deeper level of curr topic: |
| 1705 | (setq chart | 1705 | (setq chart |
| 1706 | (cons (outline-chart-subtree (and levels | 1706 | (cons (allout-chart-subtree (and levels |
| 1707 | (1- levels)) | 1707 | (1- levels)) |
| 1708 | orig-depth | 1708 | orig-depth |
| 1709 | curr-depth) | 1709 | curr-depth) |
| @@ -1725,24 +1725,24 @@ starting point, and PREV-DEPTH is depth of prior topic." | |||
| 1725 | 1) | 1725 | 1) |
| 1726 | '(?\n ?\r)) | 1726 | '(?\n ?\r)) |
| 1727 | (forward-char -1)) | 1727 | (forward-char -1)) |
| 1728 | (setq outline-recent-end-of-subtree (point)))) | 1728 | (setq allout-recent-end-of-subtree (point)))) |
| 1729 | 1729 | ||
| 1730 | chart ; (nreverse chart) not necessary, | 1730 | chart ; (nreverse chart) not necessary, |
| 1731 | ; and maybe not preferable. | 1731 | ; and maybe not preferable. |
| 1732 | )) | 1732 | )) |
| 1733 | ;;;_ > outline-chart-siblings (&optional start end) | 1733 | ;;;_ > allout-chart-siblings (&optional start end) |
| 1734 | (defun outline-chart-siblings (&optional start end) | 1734 | (defun allout-chart-siblings (&optional start end) |
| 1735 | "Produce a list of locations of this and succeeding sibling topics. | 1735 | "Produce a list of locations of this and succeeding sibling topics. |
| 1736 | Effectively a top-level chart of siblings. See `outline-chart-subtree' | 1736 | Effectively a top-level chart of siblings. See `allout-chart-subtree' |
| 1737 | for an explanation of charts." | 1737 | for an explanation of charts." |
| 1738 | (save-excursion | 1738 | (save-excursion |
| 1739 | (if (outline-goto-prefix) | 1739 | (if (allout-goto-prefix) |
| 1740 | (let ((chart (list (point)))) | 1740 | (let ((chart (list (point)))) |
| 1741 | (while (outline-next-sibling) | 1741 | (while (allout-next-sibling) |
| 1742 | (setq chart (cons (point) chart))) | 1742 | (setq chart (cons (point) chart))) |
| 1743 | (if chart (setq chart (nreverse chart))))))) | 1743 | (if chart (setq chart (nreverse chart))))))) |
| 1744 | ;;;_ > outline-chart-to-reveal (chart depth) | 1744 | ;;;_ > allout-chart-to-reveal (chart depth) |
| 1745 | (defun outline-chart-to-reveal (chart depth) | 1745 | (defun allout-chart-to-reveal (chart depth) |
| 1746 | 1746 | ||
| 1747 | "Return a flat list of hidden points in subtree CHART, up to DEPTH. | 1747 | "Return a flat list of hidden points in subtree CHART, up to DEPTH. |
| 1748 | 1748 | ||
| @@ -1754,7 +1754,7 @@ start point." | |||
| 1754 | chart) | 1754 | chart) |
| 1755 | (setq here (car chart)) | 1755 | (setq here (car chart)) |
| 1756 | (if (listp here) | 1756 | (if (listp here) |
| 1757 | (let ((further (outline-chart-to-reveal here (or (eq depth t) | 1757 | (let ((further (allout-chart-to-reveal here (or (eq depth t) |
| 1758 | (1- depth))))) | 1758 | (1- depth))))) |
| 1759 | ;; We're on the start of a subtree - recurse with it, if there's | 1759 | ;; We're on the start of a subtree - recurse with it, if there's |
| 1760 | ;; more depth to go: | 1760 | ;; more depth to go: |
| @@ -1765,8 +1765,8 @@ start point." | |||
| 1765 | (setq result (cons here result))) | 1765 | (setq result (cons here result))) |
| 1766 | (setq chart (cdr chart)))) | 1766 | (setq chart (cdr chart)))) |
| 1767 | result)) | 1767 | result)) |
| 1768 | ;;;_ X outline-chart-spec (chart spec &optional exposing) | 1768 | ;;;_ X allout-chart-spec (chart spec &optional exposing) |
| 1769 | (defun outline-chart-spec (chart spec &optional exposing) | 1769 | (defun allout-chart-spec (chart spec &optional exposing) |
| 1770 | "Not yet \(if ever) implemented. | 1770 | "Not yet \(if ever) implemented. |
| 1771 | 1771 | ||
| 1772 | Produce exposure directives given topic/subtree CHART and an exposure SPEC. | 1772 | Produce exposure directives given topic/subtree CHART and an exposure SPEC. |
| @@ -1798,8 +1798,8 @@ exposed reside. | |||
| 1798 | ) | 1798 | ) |
| 1799 | 1799 | ||
| 1800 | ;;;_ - Within Topic | 1800 | ;;;_ - Within Topic |
| 1801 | ;;;_ > outline-goto-prefix () | 1801 | ;;;_ > allout-goto-prefix () |
| 1802 | (defun outline-goto-prefix () | 1802 | (defun allout-goto-prefix () |
| 1803 | "Put point at beginning of immediately containing outline topic. | 1803 | "Put point at beginning of immediately containing outline topic. |
| 1804 | 1804 | ||
| 1805 | Goes to most immediate subsequent topic if none immediately containing. | 1805 | Goes to most immediate subsequent topic if none immediately containing. |
| @@ -1812,24 +1812,24 @@ Returns the point at the beginning of the prefix, or nil if none." | |||
| 1812 | (while (and (not done) | 1812 | (while (and (not done) |
| 1813 | (re-search-backward "[\n\r]" nil 1)) | 1813 | (re-search-backward "[\n\r]" nil 1)) |
| 1814 | (forward-char 1) | 1814 | (forward-char 1) |
| 1815 | (if (looking-at outline-regexp) | 1815 | (if (looking-at allout-regexp) |
| 1816 | (setq done (outline-prefix-data (match-beginning 0) | 1816 | (setq done (allout-prefix-data (match-beginning 0) |
| 1817 | (match-end 0))) | 1817 | (match-end 0))) |
| 1818 | (forward-char -1))) | 1818 | (forward-char -1))) |
| 1819 | (if (bobp) | 1819 | (if (bobp) |
| 1820 | (cond ((looking-at outline-regexp) | 1820 | (cond ((looking-at allout-regexp) |
| 1821 | (outline-prefix-data (match-beginning 0)(match-end 0))) | 1821 | (allout-prefix-data (match-beginning 0)(match-end 0))) |
| 1822 | ((outline-next-heading)) | 1822 | ((allout-next-heading)) |
| 1823 | (done)) | 1823 | (done)) |
| 1824 | done))) | 1824 | done))) |
| 1825 | ;;;_ > outline-end-of-prefix () | 1825 | ;;;_ > allout-end-of-prefix () |
| 1826 | (defun outline-end-of-prefix (&optional ignore-decorations) | 1826 | (defun allout-end-of-prefix (&optional ignore-decorations) |
| 1827 | "Position cursor at beginning of header text. | 1827 | "Position cursor at beginning of header text. |
| 1828 | 1828 | ||
| 1829 | If optional IGNORE-DECORATIONS is non-nil, put just after bullet, | 1829 | If optional IGNORE-DECORATIONS is non-nil, put just after bullet, |
| 1830 | otherwise skip white space between bullet and ensuing text." | 1830 | otherwise skip white space between bullet and ensuing text." |
| 1831 | 1831 | ||
| 1832 | (if (not (outline-goto-prefix)) | 1832 | (if (not (allout-goto-prefix)) |
| 1833 | nil | 1833 | nil |
| 1834 | (let ((match-data (match-data))) | 1834 | (let ((match-data (match-data))) |
| 1835 | (goto-char (match-end 0)) | 1835 | (goto-char (match-end 0)) |
| @@ -1839,161 +1839,161 @@ otherwise skip white space between bullet and ensuing text." | |||
| 1839 | (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1))) | 1839 | (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1))) |
| 1840 | (store-match-data match-data)) | 1840 | (store-match-data match-data)) |
| 1841 | ;; Reestablish where we are: | 1841 | ;; Reestablish where we are: |
| 1842 | (outline-current-depth))) | 1842 | (allout-current-depth))) |
| 1843 | ;;;_ > outline-current-bullet-pos () | 1843 | ;;;_ > allout-current-bullet-pos () |
| 1844 | (defun outline-current-bullet-pos () | 1844 | (defun allout-current-bullet-pos () |
| 1845 | "Return position of current \(visible) topic's bullet." | 1845 | "Return position of current \(visible) topic's bullet." |
| 1846 | 1846 | ||
| 1847 | (if (not (outline-current-depth)) | 1847 | (if (not (allout-current-depth)) |
| 1848 | nil | 1848 | nil |
| 1849 | (1- (match-end 0)))) | 1849 | (1- (match-end 0)))) |
| 1850 | ;;;_ > outline-back-to-current-heading () | 1850 | ;;;_ > allout-back-to-current-heading () |
| 1851 | (defun outline-back-to-current-heading () | 1851 | (defun allout-back-to-current-heading () |
| 1852 | "Move to heading line of current topic, or beginning if already on the line." | 1852 | "Move to heading line of current topic, or beginning if already on the line." |
| 1853 | 1853 | ||
| 1854 | (beginning-of-line) | 1854 | (beginning-of-line) |
| 1855 | (prog1 (or (outline-on-current-heading-p) | 1855 | (prog1 (or (allout-on-current-heading-p) |
| 1856 | (and (re-search-backward (concat "^\\(" outline-regexp "\\)") | 1856 | (and (re-search-backward (concat "^\\(" allout-regexp "\\)") |
| 1857 | nil | 1857 | nil |
| 1858 | 'move) | 1858 | 'move) |
| 1859 | (outline-prefix-data (match-beginning 1)(match-end 1)))) | 1859 | (allout-prefix-data (match-beginning 1)(match-end 1)))) |
| 1860 | (if (interactive-p) (outline-end-of-prefix)))) | 1860 | (if (interactive-p) (allout-end-of-prefix)))) |
| 1861 | ;;;_ > outline-back-to-heading () | 1861 | ;;;_ > allout-back-to-heading () |
| 1862 | (defalias 'outline-back-to-heading 'outline-back-to-current-heading) | 1862 | (defalias 'allout-back-to-heading 'allout-back-to-current-heading) |
| 1863 | ;;;_ > outline-pre-next-preface () | 1863 | ;;;_ > allout-pre-next-preface () |
| 1864 | (defun outline-pre-next-preface () | 1864 | (defun allout-pre-next-preface () |
| 1865 | "Skip forward to just before the next heading line. | 1865 | "Skip forward to just before the next heading line. |
| 1866 | 1866 | ||
| 1867 | Returns that character position." | 1867 | Returns that character position." |
| 1868 | 1868 | ||
| 1869 | (if (re-search-forward outline-line-boundary-regexp nil 'move) | 1869 | (if (re-search-forward allout-line-boundary-regexp nil 'move) |
| 1870 | (prog1 (goto-char (match-beginning 0)) | 1870 | (prog1 (goto-char (match-beginning 0)) |
| 1871 | (outline-prefix-data (match-beginning 2)(match-end 2))))) | 1871 | (allout-prefix-data (match-beginning 2)(match-end 2))))) |
| 1872 | ;;;_ > outline-end-of-current-subtree () | 1872 | ;;;_ > allout-end-of-current-subtree () |
| 1873 | (defun outline-end-of-current-subtree () | 1873 | (defun allout-end-of-current-subtree () |
| 1874 | "Put point at the end of the last leaf in the currently visible topic." | 1874 | "Put point at the end of the last leaf in the currently visible topic." |
| 1875 | (interactive) | 1875 | (interactive) |
| 1876 | (outline-back-to-current-heading) | 1876 | (allout-back-to-current-heading) |
| 1877 | (let ((level (outline-recent-depth))) | 1877 | (let ((level (allout-recent-depth))) |
| 1878 | (outline-next-heading) | 1878 | (allout-next-heading) |
| 1879 | (while (and (not (eobp)) | 1879 | (while (and (not (eobp)) |
| 1880 | (> (outline-recent-depth) level)) | 1880 | (> (allout-recent-depth) level)) |
| 1881 | (outline-next-heading)) | 1881 | (allout-next-heading)) |
| 1882 | (and (not (eobp)) (forward-char -1)) | 1882 | (and (not (eobp)) (forward-char -1)) |
| 1883 | (and (memq (preceding-char) '(?\n ?\r)) | 1883 | (and (memq (preceding-char) '(?\n ?\r)) |
| 1884 | (memq (aref (buffer-substring (max 1 (- (point) 3)) (point)) 1) | 1884 | (memq (aref (buffer-substring (max 1 (- (point) 3)) (point)) 1) |
| 1885 | '(?\n ?\r)) | 1885 | '(?\n ?\r)) |
| 1886 | (forward-char -1)) | 1886 | (forward-char -1)) |
| 1887 | (setq outline-recent-end-of-subtree (point)))) | 1887 | (setq allout-recent-end-of-subtree (point)))) |
| 1888 | ;;;_ > outline-beginning-of-current-entry () | 1888 | ;;;_ > allout-beginning-of-current-entry () |
| 1889 | (defun outline-beginning-of-current-entry () | 1889 | (defun allout-beginning-of-current-entry () |
| 1890 | "When not already there, position point at beginning of current topic's body. | 1890 | "When not already there, position point at beginning of current topic's body. |
| 1891 | 1891 | ||
| 1892 | If already there, move cursor to bullet for hot-spot operation. | 1892 | If already there, move cursor to bullet for hot-spot operation. |
| 1893 | \(See outline-mode doc string for details on hot-spot operation.)" | 1893 | \(See allout-mode doc string for details on hot-spot operation.)" |
| 1894 | (interactive) | 1894 | (interactive) |
| 1895 | (let ((start-point (point))) | 1895 | (let ((start-point (point))) |
| 1896 | (outline-end-of-prefix) | 1896 | (allout-end-of-prefix) |
| 1897 | (if (and (interactive-p) | 1897 | (if (and (interactive-p) |
| 1898 | (= (point) start-point)) | 1898 | (= (point) start-point)) |
| 1899 | (goto-char (outline-current-bullet-pos))))) | 1899 | (goto-char (allout-current-bullet-pos))))) |
| 1900 | ;;;_ > outline-end-of-current-entry () | 1900 | ;;;_ > allout-end-of-current-entry () |
| 1901 | (defun outline-end-of-current-entry () | 1901 | (defun allout-end-of-current-entry () |
| 1902 | "Position the point at the end of the current topics' entry." | 1902 | "Position the point at the end of the current topics' entry." |
| 1903 | (interactive) | 1903 | (interactive) |
| 1904 | (outline-show-entry) | 1904 | (allout-show-entry) |
| 1905 | (prog1 (outline-pre-next-preface) | 1905 | (prog1 (allout-pre-next-preface) |
| 1906 | (if (and (not (bobp))(looking-at "^$")) | 1906 | (if (and (not (bobp))(looking-at "^$")) |
| 1907 | (forward-char -1)))) | 1907 | (forward-char -1)))) |
| 1908 | ;;;_ > outline-end-of-current-heading () | 1908 | ;;;_ > allout-end-of-current-heading () |
| 1909 | (defun outline-end-of-current-heading () | 1909 | (defun allout-end-of-current-heading () |
| 1910 | (interactive) | 1910 | (interactive) |
| 1911 | (outline-beginning-of-current-entry) | 1911 | (allout-beginning-of-current-entry) |
| 1912 | (forward-line -1) | 1912 | (forward-line -1) |
| 1913 | (end-of-line)) | 1913 | (end-of-line)) |
| 1914 | (defalias 'outline-end-of-heading 'outline-end-of-current-heading) | 1914 | (defalias 'allout-end-of-heading 'allout-end-of-current-heading) |
| 1915 | 1915 | ||
| 1916 | ;;;_ - Depth-wise | 1916 | ;;;_ - Depth-wise |
| 1917 | ;;;_ > outline-ascend-to-depth (depth) | 1917 | ;;;_ > allout-ascend-to-depth (depth) |
| 1918 | (defun outline-ascend-to-depth (depth) | 1918 | (defun allout-ascend-to-depth (depth) |
| 1919 | "Ascend to depth DEPTH, returning depth if successful, nil if not." | 1919 | "Ascend to depth DEPTH, returning depth if successful, nil if not." |
| 1920 | (if (and (> depth 0)(<= depth (outline-depth))) | 1920 | (if (and (> depth 0)(<= depth (allout-depth))) |
| 1921 | (let ((last-good (point))) | 1921 | (let ((last-good (point))) |
| 1922 | (while (and (< depth (outline-depth)) | 1922 | (while (and (< depth (allout-depth)) |
| 1923 | (setq last-good (point)) | 1923 | (setq last-good (point)) |
| 1924 | (outline-beginning-of-level) | 1924 | (allout-beginning-of-level) |
| 1925 | (outline-previous-heading))) | 1925 | (allout-previous-heading))) |
| 1926 | (if (= (outline-recent-depth) depth) | 1926 | (if (= (allout-recent-depth) depth) |
| 1927 | (progn (goto-char outline-recent-prefix-beginning) | 1927 | (progn (goto-char allout-recent-prefix-beginning) |
| 1928 | depth) | 1928 | depth) |
| 1929 | (goto-char last-good) | 1929 | (goto-char last-good) |
| 1930 | nil)) | 1930 | nil)) |
| 1931 | (if (interactive-p) (outline-end-of-prefix)))) | 1931 | (if (interactive-p) (allout-end-of-prefix)))) |
| 1932 | ;;;_ > outline-ascend () | 1932 | ;;;_ > allout-ascend () |
| 1933 | (defun outline-ascend () | 1933 | (defun allout-ascend () |
| 1934 | "Ascend one level, returning t if successful, nil if not." | 1934 | "Ascend one level, returning t if successful, nil if not." |
| 1935 | (prog1 | 1935 | (prog1 |
| 1936 | (if (outline-beginning-of-level) | 1936 | (if (allout-beginning-of-level) |
| 1937 | (outline-previous-heading)) | 1937 | (allout-previous-heading)) |
| 1938 | (if (interactive-p) (outline-end-of-prefix)))) | 1938 | (if (interactive-p) (allout-end-of-prefix)))) |
| 1939 | ;;;_ > outline-descend-to-depth (depth) | 1939 | ;;;_ > allout-descend-to-depth (depth) |
| 1940 | (defun outline-descend-to-depth (depth) | 1940 | (defun allout-descend-to-depth (depth) |
| 1941 | "Descend to depth DEPTH within current topic. | 1941 | "Descend to depth DEPTH within current topic. |
| 1942 | 1942 | ||
| 1943 | Returning depth if successful, nil if not." | 1943 | Returning depth if successful, nil if not." |
| 1944 | (let ((start-point (point)) | 1944 | (let ((start-point (point)) |
| 1945 | (start-depth (outline-depth))) | 1945 | (start-depth (allout-depth))) |
| 1946 | (while | 1946 | (while |
| 1947 | (and (> (outline-depth) 0) | 1947 | (and (> (allout-depth) 0) |
| 1948 | (not (= depth (outline-recent-depth))) ; ... not there yet | 1948 | (not (= depth (allout-recent-depth))) ; ... not there yet |
| 1949 | (outline-next-heading) ; ... go further | 1949 | (allout-next-heading) ; ... go further |
| 1950 | (< start-depth (outline-recent-depth)))) ; ... still in topic | 1950 | (< start-depth (allout-recent-depth)))) ; ... still in topic |
| 1951 | (if (and (> (outline-depth) 0) | 1951 | (if (and (> (allout-depth) 0) |
| 1952 | (= (outline-recent-depth) depth)) | 1952 | (= (allout-recent-depth) depth)) |
| 1953 | depth | 1953 | depth |
| 1954 | (goto-char start-point) | 1954 | (goto-char start-point) |
| 1955 | nil)) | 1955 | nil)) |
| 1956 | ) | 1956 | ) |
| 1957 | ;;;_ > outline-up-current-level (arg &optional dont-complain) | 1957 | ;;;_ > allout-up-current-level (arg &optional dont-complain) |
| 1958 | (defun outline-up-current-level (arg &optional dont-complain) | 1958 | (defun allout-up-current-level (arg &optional dont-complain) |
| 1959 | "Move out ARG levels from current visible topic. | 1959 | "Move out ARG levels from current visible topic. |
| 1960 | 1960 | ||
| 1961 | Positions on heading line of containing topic. Error if unable to | 1961 | Positions on heading line of containing topic. Error if unable to |
| 1962 | ascend that far, or nil if unable to ascend but optional arg | 1962 | ascend that far, or nil if unable to ascend but optional arg |
| 1963 | DONT-COMPLAIN is non-nil." | 1963 | DONT-COMPLAIN is non-nil." |
| 1964 | (interactive "p") | 1964 | (interactive "p") |
| 1965 | (outline-back-to-current-heading) | 1965 | (allout-back-to-current-heading) |
| 1966 | (let ((present-level (outline-recent-depth)) | 1966 | (let ((present-level (allout-recent-depth)) |
| 1967 | (last-good (point)) | 1967 | (last-good (point)) |
| 1968 | failed | 1968 | failed |
| 1969 | return) | 1969 | return) |
| 1970 | ;; Loop for iterating arg: | 1970 | ;; Loop for iterating arg: |
| 1971 | (while (and (> (outline-recent-depth) 1) | 1971 | (while (and (> (allout-recent-depth) 1) |
| 1972 | (> arg 0) | 1972 | (> arg 0) |
| 1973 | (not (bobp)) | 1973 | (not (bobp)) |
| 1974 | (not failed)) | 1974 | (not failed)) |
| 1975 | (setq last-good (point)) | 1975 | (setq last-good (point)) |
| 1976 | ;; Loop for going back over current or greater depth: | 1976 | ;; Loop for going back over current or greater depth: |
| 1977 | (while (and (not (< (outline-recent-depth) present-level)) | 1977 | (while (and (not (< (allout-recent-depth) present-level)) |
| 1978 | (or (outline-previous-visible-heading 1) | 1978 | (or (allout-previous-visible-heading 1) |
| 1979 | (not (setq failed present-level))))) | 1979 | (not (setq failed present-level))))) |
| 1980 | (setq present-level (outline-current-depth)) | 1980 | (setq present-level (allout-current-depth)) |
| 1981 | (setq arg (- arg 1))) | 1981 | (setq arg (- arg 1))) |
| 1982 | (if (or failed | 1982 | (if (or failed |
| 1983 | (> arg 0)) | 1983 | (> arg 0)) |
| 1984 | (progn (goto-char last-good) | 1984 | (progn (goto-char last-good) |
| 1985 | (if (interactive-p) (outline-end-of-prefix)) | 1985 | (if (interactive-p) (allout-end-of-prefix)) |
| 1986 | (if (not dont-complain) | 1986 | (if (not dont-complain) |
| 1987 | (error "Can't ascend past outermost level") | 1987 | (error "Can't ascend past outermost level") |
| 1988 | (if (interactive-p) (outline-end-of-prefix)) | 1988 | (if (interactive-p) (allout-end-of-prefix)) |
| 1989 | nil)) | 1989 | nil)) |
| 1990 | (if (interactive-p) (outline-end-of-prefix)) | 1990 | (if (interactive-p) (allout-end-of-prefix)) |
| 1991 | outline-recent-prefix-beginning))) | 1991 | allout-recent-prefix-beginning))) |
| 1992 | 1992 | ||
| 1993 | ;;;_ - Linear | 1993 | ;;;_ - Linear |
| 1994 | ;;;_ > outline-next-sibling (&optional depth backward) | 1994 | ;;;_ > allout-next-sibling (&optional depth backward) |
| 1995 | (defun outline-next-sibling (&optional depth backward) | 1995 | (defun allout-next-sibling (&optional depth backward) |
| 1996 | "Like outline-forward-current-level, but respects invisible topics. | 1996 | "Like allout-forward-current-level, but respects invisible topics. |
| 1997 | 1997 | ||
| 1998 | Traverse at optional DEPTH, or current depth if none specified. | 1998 | Traverse at optional DEPTH, or current depth if none specified. |
| 1999 | 1999 | ||
| @@ -2003,33 +2003,33 @@ Return depth if successful, nil otherwise." | |||
| 2003 | 2003 | ||
| 2004 | (if (and backward (bobp)) | 2004 | (if (and backward (bobp)) |
| 2005 | nil | 2005 | nil |
| 2006 | (let ((start-depth (or depth (outline-depth))) | 2006 | (let ((start-depth (or depth (allout-depth))) |
| 2007 | (start-point (point)) | 2007 | (start-point (point)) |
| 2008 | last-depth) | 2008 | last-depth) |
| 2009 | (while (and (not (if backward (bobp) (eobp))) | 2009 | (while (and (not (if backward (bobp) (eobp))) |
| 2010 | (if backward (outline-previous-heading) | 2010 | (if backward (allout-previous-heading) |
| 2011 | (outline-next-heading)) | 2011 | (allout-next-heading)) |
| 2012 | (> (setq last-depth (outline-recent-depth)) start-depth))) | 2012 | (> (setq last-depth (allout-recent-depth)) start-depth))) |
| 2013 | (if (and (not (eobp)) | 2013 | (if (and (not (eobp)) |
| 2014 | (and (> (or last-depth (outline-depth)) 0) | 2014 | (and (> (or last-depth (allout-depth)) 0) |
| 2015 | (= (outline-recent-depth) start-depth))) | 2015 | (= (allout-recent-depth) start-depth))) |
| 2016 | outline-recent-prefix-beginning | 2016 | allout-recent-prefix-beginning |
| 2017 | (goto-char start-point) | 2017 | (goto-char start-point) |
| 2018 | (if depth (outline-depth) start-depth) | 2018 | (if depth (allout-depth) start-depth) |
| 2019 | nil)))) | 2019 | nil)))) |
| 2020 | ;;;_ > outline-previous-sibling (&optional depth backward) | 2020 | ;;;_ > allout-previous-sibling (&optional depth backward) |
| 2021 | (defun outline-previous-sibling (&optional depth backward) | 2021 | (defun allout-previous-sibling (&optional depth backward) |
| 2022 | "Like outline-forward-current-level,but backwards & respect invisible topics. | 2022 | "Like allout-forward-current-level,but backwards & respect invisible topics. |
| 2023 | 2023 | ||
| 2024 | Optional DEPTH specifies depth to traverse, default current depth. | 2024 | Optional DEPTH specifies depth to traverse, default current depth. |
| 2025 | 2025 | ||
| 2026 | Optional BACKWARD reverses direction. | 2026 | Optional BACKWARD reverses direction. |
| 2027 | 2027 | ||
| 2028 | Return depth if successful, nil otherwise." | 2028 | Return depth if successful, nil otherwise." |
| 2029 | (outline-next-sibling depth (not backward)) | 2029 | (allout-next-sibling depth (not backward)) |
| 2030 | ) | 2030 | ) |
| 2031 | ;;;_ > outline-snug-back () | 2031 | ;;;_ > allout-snug-back () |
| 2032 | (defun outline-snug-back () | 2032 | (defun allout-snug-back () |
| 2033 | "Position cursor at end of previous topic | 2033 | "Position cursor at end of previous topic |
| 2034 | 2034 | ||
| 2035 | Presumes point is at the start of a topic prefix." | 2035 | Presumes point is at the start of a topic prefix." |
| @@ -2042,20 +2042,20 @@ Presumes point is at the start of a topic prefix." | |||
| 2042 | (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r)))) | 2042 | (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r)))) |
| 2043 | (forward-char -1))) | 2043 | (forward-char -1))) |
| 2044 | (point)) | 2044 | (point)) |
| 2045 | ;;;_ > outline-beginning-of-level () | 2045 | ;;;_ > allout-beginning-of-level () |
| 2046 | (defun outline-beginning-of-level () | 2046 | (defun allout-beginning-of-level () |
| 2047 | "Go back to the first sibling at this level, visible or not." | 2047 | "Go back to the first sibling at this level, visible or not." |
| 2048 | (outline-end-of-level 'backward)) | 2048 | (allout-end-of-level 'backward)) |
| 2049 | ;;;_ > outline-end-of-level (&optional backward) | 2049 | ;;;_ > allout-end-of-level (&optional backward) |
| 2050 | (defun outline-end-of-level (&optional backward) | 2050 | (defun allout-end-of-level (&optional backward) |
| 2051 | "Go to the last sibling at this level, visible or not." | 2051 | "Go to the last sibling at this level, visible or not." |
| 2052 | 2052 | ||
| 2053 | (let ((depth (outline-depth))) | 2053 | (let ((depth (allout-depth))) |
| 2054 | (while (outline-previous-sibling depth nil)) | 2054 | (while (allout-previous-sibling depth nil)) |
| 2055 | (prog1 (outline-recent-depth) | 2055 | (prog1 (allout-recent-depth) |
| 2056 | (if (interactive-p) (outline-end-of-prefix))))) | 2056 | (if (interactive-p) (allout-end-of-prefix))))) |
| 2057 | ;;;_ > outline-next-visible-heading (arg) | 2057 | ;;;_ > allout-next-visible-heading (arg) |
| 2058 | (defun outline-next-visible-heading (arg) | 2058 | (defun allout-next-visible-heading (arg) |
| 2059 | "Move to the next ARG'th visible heading line, backward if arg is negative. | 2059 | "Move to the next ARG'th visible heading line, backward if arg is negative. |
| 2060 | 2060 | ||
| 2061 | Move as far as possible in indicated direction \(beginning or end of | 2061 | Move as far as possible in indicated direction \(beginning or end of |
| @@ -2071,34 +2071,34 @@ buffer) if headings are exhausted." | |||
| 2071 | (while (and (not (if backward (bobp)(eobp))) ; boundary condition | 2071 | (while (and (not (if backward (bobp)(eobp))) ; boundary condition |
| 2072 | ;; Move, skipping over all those concealed lines: | 2072 | ;; Move, skipping over all those concealed lines: |
| 2073 | (< -1 (forward-line step)) | 2073 | (< -1 (forward-line step)) |
| 2074 | (not (setq got (looking-at outline-regexp))))) | 2074 | (not (setq got (looking-at allout-regexp))))) |
| 2075 | ;; Register this got, it may be the last: | 2075 | ;; Register this got, it may be the last: |
| 2076 | (if got (setq prev got)) | 2076 | (if got (setq prev got)) |
| 2077 | (setq arg (1- arg))) | 2077 | (setq arg (1- arg))) |
| 2078 | (cond (got ; Last move was to a prefix: | 2078 | (cond (got ; Last move was to a prefix: |
| 2079 | (outline-prefix-data (match-beginning 0) (match-end 0)) | 2079 | (allout-prefix-data (match-beginning 0) (match-end 0)) |
| 2080 | (outline-end-of-prefix)) | 2080 | (allout-end-of-prefix)) |
| 2081 | (prev ; Last move wasn't, but prev was: | 2081 | (prev ; Last move wasn't, but prev was: |
| 2082 | (outline-prefix-data (match-beginning 0) (match-end 0))) | 2082 | (allout-prefix-data (match-beginning 0) (match-end 0))) |
| 2083 | ((not backward) (end-of-line) nil)))) | 2083 | ((not backward) (end-of-line) nil)))) |
| 2084 | ;;;_ > outline-previous-visible-heading (arg) | 2084 | ;;;_ > allout-previous-visible-heading (arg) |
| 2085 | (defun outline-previous-visible-heading (arg) | 2085 | (defun allout-previous-visible-heading (arg) |
| 2086 | "Move to the previous heading line. | 2086 | "Move to the previous heading line. |
| 2087 | 2087 | ||
| 2088 | With argument, repeats or can move forward if negative. | 2088 | With argument, repeats or can move forward if negative. |
| 2089 | A heading line is one that starts with a `*' (or that outline-regexp | 2089 | A heading line is one that starts with a `*' (or that allout-regexp |
| 2090 | matches)." | 2090 | matches)." |
| 2091 | (interactive "p") | 2091 | (interactive "p") |
| 2092 | (outline-next-visible-heading (- arg))) | 2092 | (allout-next-visible-heading (- arg))) |
| 2093 | ;;;_ > outline-forward-current-level (arg) | 2093 | ;;;_ > allout-forward-current-level (arg) |
| 2094 | (defun outline-forward-current-level (arg) | 2094 | (defun allout-forward-current-level (arg) |
| 2095 | "Position point at the next heading of the same level. | 2095 | "Position point at the next heading of the same level. |
| 2096 | 2096 | ||
| 2097 | Takes optional repeat-count, goes backward if count is negative. | 2097 | Takes optional repeat-count, goes backward if count is negative. |
| 2098 | 2098 | ||
| 2099 | Returns resulting position, else nil if none found." | 2099 | Returns resulting position, else nil if none found." |
| 2100 | (interactive "p") | 2100 | (interactive "p") |
| 2101 | (let ((start-depth (outline-current-depth)) | 2101 | (let ((start-depth (allout-current-depth)) |
| 2102 | (start-point (point)) | 2102 | (start-point (point)) |
| 2103 | (start-arg arg) | 2103 | (start-arg arg) |
| 2104 | (backward (> 0 arg)) | 2104 | (backward (> 0 arg)) |
| @@ -2111,9 +2111,9 @@ Returns resulting position, else nil if none found." | |||
| 2111 | (while (not (or (zerop arg) | 2111 | (while (not (or (zerop arg) |
| 2112 | at-boundary)) | 2112 | at-boundary)) |
| 2113 | (while (and (not (if backward (bobp) (eobp))) | 2113 | (while (and (not (if backward (bobp) (eobp))) |
| 2114 | (if backward (outline-previous-visible-heading 1) | 2114 | (if backward (allout-previous-visible-heading 1) |
| 2115 | (outline-next-visible-heading 1)) | 2115 | (allout-next-visible-heading 1)) |
| 2116 | (> (setq last-depth (outline-recent-depth)) start-depth))) | 2116 | (> (setq last-depth (allout-recent-depth)) start-depth))) |
| 2117 | (if (and last-depth (= last-depth start-depth) | 2117 | (if (and last-depth (= last-depth start-depth) |
| 2118 | (not (if backward (bobp) (eobp)))) | 2118 | (not (if backward (bobp) (eobp)))) |
| 2119 | (setq last-good (point) | 2119 | (setq last-good (point) |
| @@ -2121,32 +2121,32 @@ Returns resulting position, else nil if none found." | |||
| 2121 | (setq at-boundary t))) | 2121 | (setq at-boundary t))) |
| 2122 | (if (and (not (eobp)) | 2122 | (if (and (not (eobp)) |
| 2123 | (= arg 0) | 2123 | (= arg 0) |
| 2124 | (and (> (or last-depth (outline-depth)) 0) | 2124 | (and (> (or last-depth (allout-depth)) 0) |
| 2125 | (= (outline-recent-depth) start-depth))) | 2125 | (= (allout-recent-depth) start-depth))) |
| 2126 | outline-recent-prefix-beginning | 2126 | allout-recent-prefix-beginning |
| 2127 | (goto-char last-good) | 2127 | (goto-char last-good) |
| 2128 | (if (not (interactive-p)) | 2128 | (if (not (interactive-p)) |
| 2129 | nil | 2129 | nil |
| 2130 | (outline-end-of-prefix) | 2130 | (allout-end-of-prefix) |
| 2131 | (error "Hit %s level %d topic, traversed %d of %d requested" | 2131 | (error "Hit %s level %d topic, traversed %d of %d requested" |
| 2132 | (if backward "first" "last") | 2132 | (if backward "first" "last") |
| 2133 | (outline-recent-depth) | 2133 | (allout-recent-depth) |
| 2134 | (- (abs start-arg) arg) | 2134 | (- (abs start-arg) arg) |
| 2135 | (abs start-arg)))))) | 2135 | (abs start-arg)))))) |
| 2136 | ;;;_ > outline-backward-current-level (arg) | 2136 | ;;;_ > allout-backward-current-level (arg) |
| 2137 | (defun outline-backward-current-level (arg) | 2137 | (defun allout-backward-current-level (arg) |
| 2138 | "Inverse of `outline-forward-current-level'." | 2138 | "Inverse of `allout-forward-current-level'." |
| 2139 | (interactive "p") | 2139 | (interactive "p") |
| 2140 | (if (interactive-p) | 2140 | (if (interactive-p) |
| 2141 | (let ((current-prefix-arg (* -1 arg))) | 2141 | (let ((current-prefix-arg (* -1 arg))) |
| 2142 | (call-interactively 'outline-forward-current-level)) | 2142 | (call-interactively 'allout-forward-current-level)) |
| 2143 | (outline-forward-current-level (* -1 arg)))) | 2143 | (allout-forward-current-level (* -1 arg)))) |
| 2144 | 2144 | ||
| 2145 | ;;;_ #5 Alteration | 2145 | ;;;_ #5 Alteration |
| 2146 | 2146 | ||
| 2147 | ;;;_ - Fundamental | 2147 | ;;;_ - Fundamental |
| 2148 | ;;;_ > outline-before-change-protect (beg end) | 2148 | ;;;_ > allout-before-change-protect (beg end) |
| 2149 | (defun outline-before-change-protect (beg end) | 2149 | (defun allout-before-change-protect (beg end) |
| 2150 | "Outline before-change hook, regulates changes to concealed text. | 2150 | "Outline before-change hook, regulates changes to concealed text. |
| 2151 | 2151 | ||
| 2152 | Reveal concealed text that would be changed by current command, and | 2152 | Reveal concealed text that would be changed by current command, and |
| @@ -2166,14 +2166,14 @@ Locally bound in outline buffers to `before-change-functions', which | |||
| 2166 | in emacs 19 is run before any change to the buffer. | 2166 | in emacs 19 is run before any change to the buffer. |
| 2167 | 2167 | ||
| 2168 | Any functions which set [`this-command' to `undo', or which set] | 2168 | Any functions which set [`this-command' to `undo', or which set] |
| 2169 | `outline-override-protect' non-nil (as does, eg, outline-flag-chars) | 2169 | `allout-override-protect' non-nil (as does, eg, allout-flag-chars) |
| 2170 | are exempt from this restriction." | 2170 | are exempt from this restriction." |
| 2171 | (if (and (outline-mode-p) | 2171 | (if (and (allout-mode-p) |
| 2172 | ; outline-override-protect | 2172 | ; allout-override-protect |
| 2173 | ; set by functions that know what | 2173 | ; set by functions that know what |
| 2174 | ; they're doing, eg outline internals: | 2174 | ; they're doing, eg outline internals: |
| 2175 | (not outline-override-protect) | 2175 | (not allout-override-protect) |
| 2176 | (not outline-during-write-cue) | 2176 | (not allout-during-write-cue) |
| 2177 | (save-match-data ; Preserve operation position state. | 2177 | (save-match-data ; Preserve operation position state. |
| 2178 | ; Both beginning and end chars must | 2178 | ; Both beginning and end chars must |
| 2179 | ; be exposed: | 2179 | ; be exposed: |
| @@ -2183,10 +2183,10 @@ are exempt from this restriction." | |||
| 2183 | (setq beg (1+ beg) | 2183 | (setq beg (1+ beg) |
| 2184 | end (1+ end))) | 2184 | end (1+ end))) |
| 2185 | (goto-char beg) | 2185 | (goto-char beg) |
| 2186 | (or (outline-hidden-p) | 2186 | (or (allout-hidden-p) |
| 2187 | (and (not (= beg end)) | 2187 | (and (not (= beg end)) |
| 2188 | (goto-char end) | 2188 | (goto-char end) |
| 2189 | (outline-hidden-p)))))) | 2189 | (allout-hidden-p)))))) |
| 2190 | (save-match-data | 2190 | (save-match-data |
| 2191 | (if (equal this-command 'undo) | 2191 | (if (equal this-command 'undo) |
| 2192 | ;; Allow undo without inhibition. | 2192 | ;; Allow undo without inhibition. |
| @@ -2197,12 +2197,12 @@ are exempt from this restriction." | |||
| 2197 | ;; - Undo may be users' only recourse in protection faults. | 2197 | ;; - Undo may be users' only recourse in protection faults. |
| 2198 | ;; So, expose what getting changed: | 2198 | ;; So, expose what getting changed: |
| 2199 | (progn (message "Undo! - exposing concealed target...") | 2199 | (progn (message "Undo! - exposing concealed target...") |
| 2200 | (if (outline-hidden-p) | 2200 | (if (allout-hidden-p) |
| 2201 | (outline-show-children)) | 2201 | (allout-show-children)) |
| 2202 | (message "Undo!")) | 2202 | (message "Undo!")) |
| 2203 | (let (response | 2203 | (let (response |
| 2204 | (rehide-completely (save-excursion (outline-goto-prefix) | 2204 | (rehide-completely (save-excursion (allout-goto-prefix) |
| 2205 | (outline-hidden-p))) | 2205 | (allout-hidden-p))) |
| 2206 | rehide-place) | 2206 | rehide-place) |
| 2207 | 2207 | ||
| 2208 | (save-excursion | 2208 | (save-excursion |
| @@ -2212,8 +2212,8 @@ are exempt from this restriction." | |||
| 2212 | ; Give them a peek where | 2212 | ; Give them a peek where |
| 2213 | (save-excursion | 2213 | (save-excursion |
| 2214 | (if (eolp) (setq rehide-place | 2214 | (if (eolp) (setq rehide-place |
| 2215 | (outline-goto-prefix))) | 2215 | (allout-goto-prefix))) |
| 2216 | (outline-show-entry)) | 2216 | (allout-show-entry)) |
| 2217 | ; Present the message, but... | 2217 | ; Present the message, but... |
| 2218 | ; leave the cursor at the location | 2218 | ; leave the cursor at the location |
| 2219 | ; until they respond: | 2219 | ; until they respond: |
| @@ -2246,38 +2246,38 @@ are exempt from this restriction." | |||
| 2246 | (save-excursion | 2246 | (save-excursion |
| 2247 | (if rehide-place (goto-char rehide-place)) | 2247 | (if rehide-place (goto-char rehide-place)) |
| 2248 | (if rehide-completely | 2248 | (if rehide-completely |
| 2249 | (outline-hide-current-entry-completely) | 2249 | (allout-hide-current-entry-completely) |
| 2250 | (outline-hide-current-entry))) | 2250 | (allout-hide-current-entry))) |
| 2251 | (if (outline-ascend-to-depth (1- (outline-recent-depth))) | 2251 | (if (allout-ascend-to-depth (1- (allout-recent-depth))) |
| 2252 | (outline-show-children) | 2252 | (allout-show-children) |
| 2253 | (outline-show-to-offshoot))) | 2253 | (allout-show-to-offshoot))) |
| 2254 | ; Prevent: | 2254 | ; Prevent: |
| 2255 | (if rehide-completely | 2255 | (if rehide-completely |
| 2256 | (save-excursion | 2256 | (save-excursion |
| 2257 | (if rehide-place (goto-char rehide-place)) | 2257 | (if rehide-place (goto-char rehide-place)) |
| 2258 | (outline-hide-current-entry-completely)) | 2258 | (allout-hide-current-entry-completely)) |
| 2259 | (outline-hide-current-entry)) | 2259 | (allout-hide-current-entry)) |
| 2260 | (error (concat | 2260 | (error (concat |
| 2261 | "Change within concealed region prevented."))))))) | 2261 | "Change within concealed region prevented."))))))) |
| 2262 | ) ; if | 2262 | ) ; if |
| 2263 | ) ; defun | 2263 | ) ; defun |
| 2264 | ;;;_ = outline-post-goto-bullet | 2264 | ;;;_ = allout-post-goto-bullet |
| 2265 | (defvar outline-post-goto-bullet nil | 2265 | (defvar allout-post-goto-bullet nil |
| 2266 | "Outline internal var, for `outline-pre-command-business' hot-spot operation. | 2266 | "Outline internal var, for `allout-pre-command-business' hot-spot operation. |
| 2267 | 2267 | ||
| 2268 | When set, tells post-processing to reposition on topic bullet, and | 2268 | When set, tells post-processing to reposition on topic bullet, and |
| 2269 | then unset it. Set by outline-pre-command-business when implementing | 2269 | then unset it. Set by allout-pre-command-business when implementing |
| 2270 | hot-spot operation, where literal characters typed over a topic bullet | 2270 | hot-spot operation, where literal characters typed over a topic bullet |
| 2271 | are mapped to the command of the corresponding control-key on the | 2271 | are mapped to the command of the corresponding control-key on the |
| 2272 | outline-mode-map.") | 2272 | allout-mode-map.") |
| 2273 | (make-variable-buffer-local 'outline-post-goto-bullet) | 2273 | (make-variable-buffer-local 'allout-post-goto-bullet) |
| 2274 | ;;;_ > outline-post-command-business () | 2274 | ;;;_ > allout-post-command-business () |
| 2275 | (defun outline-post-command-business () | 2275 | (defun allout-post-command-business () |
| 2276 | "Outline post-command-hook function. | 2276 | "Outline post-command-hook function. |
| 2277 | 2277 | ||
| 2278 | - Null outline-override-protect, so it's not left open. | 2278 | - Null allout-override-protect, so it's not left open. |
| 2279 | 2279 | ||
| 2280 | - Implement (and clear) outline-post-goto-bullet, for hot-spot | 2280 | - Implement (and clear) allout-post-goto-bullet, for hot-spot |
| 2281 | outline commands. | 2281 | outline commands. |
| 2282 | 2282 | ||
| 2283 | - Massages buffer-undo-list so successive, standard character self-inserts are | 2283 | - Massages buffer-undo-list so successive, standard character self-inserts are |
| @@ -2285,14 +2285,14 @@ outline-mode-map.") | |||
| 2285 | before-change-functions is used." | 2285 | before-change-functions is used." |
| 2286 | 2286 | ||
| 2287 | ; Apply any external change func: | 2287 | ; Apply any external change func: |
| 2288 | (if (not (outline-mode-p)) ; In outline-mode. | 2288 | (if (not (allout-mode-p)) ; In allout-mode. |
| 2289 | nil | 2289 | nil |
| 2290 | (setq outline-override-protect nil) | 2290 | (setq allout-override-protect nil) |
| 2291 | (if outline-isearch-dynamic-expose | 2291 | (if allout-isearch-dynamic-expose |
| 2292 | (outline-isearch-rectification)) | 2292 | (allout-isearch-rectification)) |
| 2293 | (if outline-during-write-cue | 2293 | (if allout-during-write-cue |
| 2294 | ;; Was used by outline-before-change-protect, done with it now: | 2294 | ;; Was used by allout-before-change-protect, done with it now: |
| 2295 | (setq outline-during-write-cue nil)) | 2295 | (setq allout-during-write-cue nil)) |
| 2296 | ;; Undo bunching business: | 2296 | ;; Undo bunching business: |
| 2297 | (if (and (listp buffer-undo-list) ; Undo history being kept. | 2297 | (if (and (listp buffer-undo-list) ; Undo history being kept. |
| 2298 | (equal this-command 'self-insert-command) | 2298 | (equal this-command 'self-insert-command) |
| @@ -2317,23 +2317,23 @@ outline-mode-map.") | |||
| 2317 | (numberp (setq prev-from (car prev-cell))) | 2317 | (numberp (setq prev-from (car prev-cell))) |
| 2318 | (numberp (setq prev-to (cdr prev-cell))) | 2318 | (numberp (setq prev-to (cdr prev-cell))) |
| 2319 | ; Below threshold: | 2319 | ; Below threshold: |
| 2320 | (> outline-undo-aggregation (- prev-to prev-from))) | 2320 | (> allout-undo-aggregation (- prev-to prev-from))) |
| 2321 | (setq buffer-undo-list | 2321 | (setq buffer-undo-list |
| 2322 | (cons (cons prev-from cur-to) | 2322 | (cons (cons prev-from cur-to) |
| 2323 | (cdr (cdr (cdr buffer-undo-list)))))))) | 2323 | (cdr (cdr (cdr buffer-undo-list)))))))) |
| 2324 | ;; Implement -post-goto-bullet, if set: (must be after undo business) | 2324 | ;; Implement -post-goto-bullet, if set: (must be after undo business) |
| 2325 | (if (and outline-post-goto-bullet | 2325 | (if (and allout-post-goto-bullet |
| 2326 | (outline-current-bullet-pos)) | 2326 | (allout-current-bullet-pos)) |
| 2327 | (progn (goto-char (outline-current-bullet-pos)) | 2327 | (progn (goto-char (allout-current-bullet-pos)) |
| 2328 | (setq outline-post-goto-bullet nil))) | 2328 | (setq allout-post-goto-bullet nil))) |
| 2329 | )) | 2329 | )) |
| 2330 | ;;;_ > outline-pre-command-business () | 2330 | ;;;_ > allout-pre-command-business () |
| 2331 | (defun outline-pre-command-business () | 2331 | (defun allout-pre-command-business () |
| 2332 | "Outline pre-command-hook function for outline buffers. | 2332 | "Outline pre-command-hook function for outline buffers. |
| 2333 | Implements special behavior when cursor is on bullet char. | 2333 | Implements special behavior when cursor is on bullet char. |
| 2334 | 2334 | ||
| 2335 | Self-insert characters are reinterpreted control-character references | 2335 | Self-insert characters are reinterpreted control-character references |
| 2336 | into the outline-mode-map. The outline-mode post-command hook will | 2336 | into the allout-mode-map. The allout-mode post-command hook will |
| 2337 | position a cursor that has moved as a result of such reinterpretation, | 2337 | position a cursor that has moved as a result of such reinterpretation, |
| 2338 | on the destination topic's bullet, when the cursor wound up in the | 2338 | on the destination topic's bullet, when the cursor wound up in the |
| 2339 | 2339 | ||
| @@ -2343,16 +2343,16 @@ char. You stay in this mode until you use some regular | |||
| 2343 | cursor-positioning command to relocate the cursor off of a bullet | 2343 | cursor-positioning command to relocate the cursor off of a bullet |
| 2344 | char." | 2344 | char." |
| 2345 | 2345 | ||
| 2346 | (if (not (outline-mode-p)) | 2346 | (if (not (allout-mode-p)) |
| 2347 | ;; Shouldn't be invoked if not in allout outline-mode, but just in case: | 2347 | ;; Shouldn't be invoked if not in allout allout-mode, but just in case: |
| 2348 | nil | 2348 | nil |
| 2349 | ;; Register isearch status: | 2349 | ;; Register isearch status: |
| 2350 | (if (and (boundp 'isearch-mode) isearch-mode) | 2350 | (if (and (boundp 'isearch-mode) isearch-mode) |
| 2351 | (setq outline-pre-was-isearching t) | 2351 | (setq allout-pre-was-isearching t) |
| 2352 | (setq outline-pre-was-isearching nil)) | 2352 | (setq allout-pre-was-isearching nil)) |
| 2353 | ;; Hot-spot navigation provisions: | 2353 | ;; Hot-spot navigation provisions: |
| 2354 | (if (and (eq this-command 'self-insert-command) | 2354 | (if (and (eq this-command 'self-insert-command) |
| 2355 | (eq (point)(outline-current-bullet-pos))) | 2355 | (eq (point)(allout-current-bullet-pos))) |
| 2356 | (let* ((this-key-num (cond | 2356 | (let* ((this-key-num (cond |
| 2357 | ((numberp last-command-char) | 2357 | ((numberp last-command-char) |
| 2358 | last-command-char) | 2358 | last-command-char) |
| @@ -2372,92 +2372,92 @@ char." | |||
| 2372 | (if (and (<= 64 this-key-num) | 2372 | (if (and (<= 64 this-key-num) |
| 2373 | (>= 96 this-key-num)) | 2373 | (>= 96 this-key-num)) |
| 2374 | (setq mapped-binding | 2374 | (setq mapped-binding |
| 2375 | (lookup-key 'outline-mode-map | 2375 | (lookup-key 'allout-mode-map |
| 2376 | (concat outline-command-prefix | 2376 | (concat allout-command-prefix |
| 2377 | (char-to-string (- this-key-num | 2377 | (char-to-string (- this-key-num |
| 2378 | 64)))))) | 2378 | 64)))))) |
| 2379 | (if mapped-binding | 2379 | (if mapped-binding |
| 2380 | (setq outline-post-goto-bullet t | 2380 | (setq allout-post-goto-bullet t |
| 2381 | this-command mapped-binding))))))) | 2381 | this-command mapped-binding))))))) |
| 2382 | ;;;_ > outline-find-file-hook () | 2382 | ;;;_ > allout-find-file-hook () |
| 2383 | (defun outline-find-file-hook () | 2383 | (defun allout-find-file-hook () |
| 2384 | "Activate outline-mode when `outline-auto-activation' & `outline-layout' are non-nil. | 2384 | "Activate allout-mode when `allout-auto-activation' & `allout-layout' are non-nil. |
| 2385 | 2385 | ||
| 2386 | See `outline-init' for setup instructions." | 2386 | See `allout-init' for setup instructions." |
| 2387 | (if (and outline-auto-activation | 2387 | (if (and allout-auto-activation |
| 2388 | (not (outline-mode-p)) | 2388 | (not (allout-mode-p)) |
| 2389 | outline-layout) | 2389 | allout-layout) |
| 2390 | (outline-mode t))) | 2390 | (allout-mode t))) |
| 2391 | ;;;_ > outline-isearch-rectification | 2391 | ;;;_ > allout-isearch-rectification |
| 2392 | (defun outline-isearch-rectification () | 2392 | (defun allout-isearch-rectification () |
| 2393 | "Rectify outline exposure before, during, or after isearch. | 2393 | "Rectify outline exposure before, during, or after isearch. |
| 2394 | 2394 | ||
| 2395 | Called as part of outline-post-command-business." | 2395 | Called as part of allout-post-command-business." |
| 2396 | 2396 | ||
| 2397 | (let ((isearching (and (boundp 'isearch-mode) isearch-mode))) | 2397 | (let ((isearching (and (boundp 'isearch-mode) isearch-mode))) |
| 2398 | (cond ((and isearching (not outline-pre-was-isearching)) | 2398 | (cond ((and isearching (not allout-pre-was-isearching)) |
| 2399 | (outline-isearch-expose 'start)) | 2399 | (allout-isearch-expose 'start)) |
| 2400 | ((and isearching outline-pre-was-isearching) | 2400 | ((and isearching allout-pre-was-isearching) |
| 2401 | (outline-isearch-expose 'continue)) | 2401 | (allout-isearch-expose 'continue)) |
| 2402 | ((and (not isearching) outline-pre-was-isearching) | 2402 | ((and (not isearching) allout-pre-was-isearching) |
| 2403 | (outline-isearch-expose 'final)) | 2403 | (allout-isearch-expose 'final)) |
| 2404 | ;; Not and wasn't isearching: | 2404 | ;; Not and wasn't isearching: |
| 2405 | (t (setq outline-isearch-prior-pos nil) | 2405 | (t (setq allout-isearch-prior-pos nil) |
| 2406 | (setq outline-isearch-did-quit nil))))) | 2406 | (setq allout-isearch-did-quit nil))))) |
| 2407 | ;;;_ = outline-isearch-was-font-lock | 2407 | ;;;_ = allout-isearch-was-font-lock |
| 2408 | (defvar outline-isearch-was-font-lock | 2408 | (defvar allout-isearch-was-font-lock |
| 2409 | (and (boundp 'font-lock-mode) font-lock-mode)) | 2409 | (and (boundp 'font-lock-mode) font-lock-mode)) |
| 2410 | 2410 | ||
| 2411 | ;;;_ > outline-flag-region (from to flag) | 2411 | ;;;_ > allout-flag-region (from to flag) |
| 2412 | (defmacro outline-flag-region (from to flag) | 2412 | (defmacro allout-flag-region (from to flag) |
| 2413 | "Hide or show lines from FROM to TO, via emacs selective-display FLAG char. | 2413 | "Hide or show lines from FROM to TO, via emacs selective-display FLAG char. |
| 2414 | Ie, text following flag C-m \(carriage-return) is hidden until the | 2414 | Ie, text following flag C-m \(carriage-return) is hidden until the |
| 2415 | next C-j (newline) char. | 2415 | next C-j (newline) char. |
| 2416 | 2416 | ||
| 2417 | Returns the endpoint of the region." | 2417 | Returns the endpoint of the region." |
| 2418 | `(let ((buffer-read-only nil) | 2418 | `(let ((buffer-read-only nil) |
| 2419 | (outline-override-protect t)) | 2419 | (allout-override-protect t)) |
| 2420 | (subst-char-in-region ,from ,to | 2420 | (subst-char-in-region ,from ,to |
| 2421 | (if (= ,flag ?\n) ?\r ?\n) | 2421 | (if (= ,flag ?\n) ?\r ?\n) |
| 2422 | ,flag t))) | 2422 | ,flag t))) |
| 2423 | 2423 | ||
| 2424 | ;;;_ > outline-isearch-expose (mode) | 2424 | ;;;_ > allout-isearch-expose (mode) |
| 2425 | (defun outline-isearch-expose (mode) | 2425 | (defun allout-isearch-expose (mode) |
| 2426 | "Mode is either 'clear, 'start, 'continue, or 'final." | 2426 | "Mode is either 'clear, 'start, 'continue, or 'final." |
| 2427 | ;; outline-isearch-prior-pos encodes exposure status of prior pos: | 2427 | ;; allout-isearch-prior-pos encodes exposure status of prior pos: |
| 2428 | ;; (pos was-vis header-pos end-pos) | 2428 | ;; (pos was-vis header-pos end-pos) |
| 2429 | ;; pos - point of concern | 2429 | ;; pos - point of concern |
| 2430 | ;; was-vis - t, else 'topic if entire topic was exposed, 'entry otherwise | 2430 | ;; was-vis - t, else 'topic if entire topic was exposed, 'entry otherwise |
| 2431 | ;; Do reclosure or prior pos, as necessary: | 2431 | ;; Do reclosure or prior pos, as necessary: |
| 2432 | (if (eq mode 'start) | 2432 | (if (eq mode 'start) |
| 2433 | (setq outline-isearch-was-font-lock (and (boundp 'font-lock-mode) | 2433 | (setq allout-isearch-was-font-lock (and (boundp 'font-lock-mode) |
| 2434 | font-lock-mode) | 2434 | font-lock-mode) |
| 2435 | font-lock-mode nil) | 2435 | font-lock-mode nil) |
| 2436 | (if (eq mode 'final) | 2436 | (if (eq mode 'final) |
| 2437 | (setq font-lock-mode outline-isearch-was-font-lock)) | 2437 | (setq font-lock-mode allout-isearch-was-font-lock)) |
| 2438 | (if (and outline-isearch-prior-pos | 2438 | (if (and allout-isearch-prior-pos |
| 2439 | (listp outline-isearch-prior-pos)) | 2439 | (listp allout-isearch-prior-pos)) |
| 2440 | ;; Conceal prior peek: | 2440 | ;; Conceal prior peek: |
| 2441 | (outline-flag-region (car (cdr outline-isearch-prior-pos)) | 2441 | (allout-flag-region (car (cdr allout-isearch-prior-pos)) |
| 2442 | (car (cdr (cdr outline-isearch-prior-pos))) | 2442 | (car (cdr (cdr allout-isearch-prior-pos))) |
| 2443 | ?\r))) | 2443 | ?\r))) |
| 2444 | (if (outline-visible-p) | 2444 | (if (allout-visible-p) |
| 2445 | (setq outline-isearch-prior-pos nil) | 2445 | (setq allout-isearch-prior-pos nil) |
| 2446 | (if (not (eq mode 'final)) | 2446 | (if (not (eq mode 'final)) |
| 2447 | (setq outline-isearch-prior-pos (cons (point) (outline-show-entry))) | 2447 | (setq allout-isearch-prior-pos (cons (point) (allout-show-entry))) |
| 2448 | (if outline-isearch-did-quit | 2448 | (if allout-isearch-did-quit |
| 2449 | nil | 2449 | nil |
| 2450 | (setq outline-isearch-prior-pos nil) | 2450 | (setq allout-isearch-prior-pos nil) |
| 2451 | (outline-show-children)))) | 2451 | (allout-show-children)))) |
| 2452 | (setq outline-isearch-did-quit nil)) | 2452 | (setq allout-isearch-did-quit nil)) |
| 2453 | ;;;_ > outline-enwrap-isearch () | 2453 | ;;;_ > allout-enwrap-isearch () |
| 2454 | (defun outline-enwrap-isearch () | 2454 | (defun allout-enwrap-isearch () |
| 2455 | "Impose outline-mode isearch-abort wrapper for dynamic exposure in isearch. | 2455 | "Impose allout-mode isearch-abort wrapper for dynamic exposure in isearch. |
| 2456 | 2456 | ||
| 2457 | The function checks to ensure that the rebinding is done only once." | 2457 | The function checks to ensure that the rebinding is done only once." |
| 2458 | 2458 | ||
| 2459 | (add-hook 'isearch-mode-end-hook 'outline-isearch-rectification) | 2459 | (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification) |
| 2460 | (if (fboundp 'outline-real-isearch-abort) | 2460 | (if (fboundp 'allout-real-isearch-abort) |
| 2461 | ;; | 2461 | ;; |
| 2462 | nil | 2462 | nil |
| 2463 | ; Ensure load of isearch-mode: | 2463 | ; Ensure load of isearch-mode: |
| @@ -2471,56 +2471,56 @@ The function checks to ensure that the rebinding is done only once." | |||
| 2471 | (car (cdr (cdr error)))) | 2471 | (car (cdr (cdr error)))) |
| 2472 | (sit-for 1) | 2472 | (sit-for 1) |
| 2473 | ;; Inhibit subsequent tries and return nil: | 2473 | ;; Inhibit subsequent tries and return nil: |
| 2474 | (setq outline-isearch-dynamic-expose nil)))) | 2474 | (setq allout-isearch-dynamic-expose nil)))) |
| 2475 | ;; Isearch-mode loaded, encapsulate specific entry points for | 2475 | ;; Isearch-mode loaded, encapsulate specific entry points for |
| 2476 | ;; outline dynamic-exposure business: | 2476 | ;; outline dynamic-exposure business: |
| 2477 | (progn | 2477 | (progn |
| 2478 | ;; stash crucial isearch-mode funcs under known, private | 2478 | ;; stash crucial isearch-mode funcs under known, private |
| 2479 | ;; names, then register wrapper functions under the old | 2479 | ;; names, then register wrapper functions under the old |
| 2480 | ;; names, in their stead: | 2480 | ;; names, in their stead: |
| 2481 | (fset 'outline-real-isearch-abort (symbol-function 'isearch-abort)) | 2481 | (fset 'allout-real-isearch-abort (symbol-function 'isearch-abort)) |
| 2482 | (fset 'isearch-abort 'outline-isearch-abort))))) | 2482 | (fset 'isearch-abort 'allout-isearch-abort))))) |
| 2483 | ;;;_ > outline-isearch-abort () | 2483 | ;;;_ > allout-isearch-abort () |
| 2484 | (defun outline-isearch-abort () | 2484 | (defun allout-isearch-abort () |
| 2485 | "Wrapper for outline-real-isearch-abort \(which see), to register | 2485 | "Wrapper for allout-real-isearch-abort \(which see), to register |
| 2486 | actual quits." | 2486 | actual quits." |
| 2487 | (interactive) | 2487 | (interactive) |
| 2488 | (setq outline-isearch-did-quit nil) | 2488 | (setq allout-isearch-did-quit nil) |
| 2489 | (condition-case what | 2489 | (condition-case what |
| 2490 | (outline-real-isearch-abort) | 2490 | (allout-real-isearch-abort) |
| 2491 | ('quit (setq outline-isearch-did-quit t) | 2491 | ('quit (setq allout-isearch-did-quit t) |
| 2492 | (signal 'quit nil)))) | 2492 | (signal 'quit nil)))) |
| 2493 | 2493 | ||
| 2494 | ;;; Prevent unnecessary font-lock while isearching! | 2494 | ;;; Prevent unnecessary font-lock while isearching! |
| 2495 | (defvar isearch-was-font-locking nil) | 2495 | (defvar isearch-was-font-locking nil) |
| 2496 | (defun isearch-inhibit-font-lock () | 2496 | (defun isearch-inhibit-font-lock () |
| 2497 | "Inhibit font-lock while isearching - for use on isearch-mode-hook." | 2497 | "Inhibit font-lock while isearching - for use on isearch-mode-hook." |
| 2498 | (if (and (outline-mode-p) (boundp 'font-lock-mode) font-lock-mode) | 2498 | (if (and (allout-mode-p) (boundp 'font-lock-mode) font-lock-mode) |
| 2499 | (setq isearch-was-font-locking t | 2499 | (setq isearch-was-font-locking t |
| 2500 | font-lock-mode nil))) | 2500 | font-lock-mode nil))) |
| 2501 | (add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock) | 2501 | (add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock) |
| 2502 | (defun isearch-reenable-font-lock () | 2502 | (defun isearch-reenable-font-lock () |
| 2503 | "Reenable font-lock after isearching - for use on isearch-mode-end-hook." | 2503 | "Reenable font-lock after isearching - for use on isearch-mode-end-hook." |
| 2504 | (if (and (boundp 'font-lock-mode) font-lock-mode) | 2504 | (if (and (boundp 'font-lock-mode) font-lock-mode) |
| 2505 | (if (and (outline-mode-p) isearch-was-font-locking) | 2505 | (if (and (allout-mode-p) isearch-was-font-locking) |
| 2506 | (setq isearch-was-font-locking nil | 2506 | (setq isearch-was-font-locking nil |
| 2507 | font-lock-mode t)))) | 2507 | font-lock-mode t)))) |
| 2508 | (add-hook 'isearch-mode-end-hook 'isearch-reenable-font-lock) | 2508 | (add-hook 'isearch-mode-end-hook 'isearch-reenable-font-lock) |
| 2509 | 2509 | ||
| 2510 | ;;;_ - Topic Format Assessment | 2510 | ;;;_ - Topic Format Assessment |
| 2511 | ;;;_ > outline-solicit-alternate-bullet (depth &optional current-bullet) | 2511 | ;;;_ > allout-solicit-alternate-bullet (depth &optional current-bullet) |
| 2512 | (defun outline-solicit-alternate-bullet (depth &optional current-bullet) | 2512 | (defun allout-solicit-alternate-bullet (depth &optional current-bullet) |
| 2513 | 2513 | ||
| 2514 | "Prompt for and return a bullet char as an alternative to the current one. | 2514 | "Prompt for and return a bullet char as an alternative to the current one. |
| 2515 | 2515 | ||
| 2516 | Offer one suitable for current depth DEPTH as default." | 2516 | Offer one suitable for current depth DEPTH as default." |
| 2517 | 2517 | ||
| 2518 | (let* ((default-bullet (or (and (stringp current-bullet) current-bullet) | 2518 | (let* ((default-bullet (or (and (stringp current-bullet) current-bullet) |
| 2519 | (outline-bullet-for-depth depth))) | 2519 | (allout-bullet-for-depth depth))) |
| 2520 | (sans-escapes (regexp-sans-escapes outline-bullets-string)) | 2520 | (sans-escapes (regexp-sans-escapes allout-bullets-string)) |
| 2521 | choice) | 2521 | choice) |
| 2522 | (save-excursion | 2522 | (save-excursion |
| 2523 | (goto-char (outline-current-bullet-pos)) | 2523 | (goto-char (allout-current-bullet-pos)) |
| 2524 | (setq choice (solicit-char-in-string | 2524 | (setq choice (solicit-char-in-string |
| 2525 | (format "Select bullet: %s ('%s' default): " | 2525 | (format "Select bullet: %s ('%s' default): " |
| 2526 | sans-escapes | 2526 | sans-escapes |
| @@ -2530,32 +2530,32 @@ Offer one suitable for current depth DEPTH as default." | |||
| 2530 | (message "") | 2530 | (message "") |
| 2531 | (if (string= choice "") default-bullet choice)) | 2531 | (if (string= choice "") default-bullet choice)) |
| 2532 | ) | 2532 | ) |
| 2533 | ;;;_ > outline-distinctive-bullet (bullet) | 2533 | ;;;_ > allout-distinctive-bullet (bullet) |
| 2534 | (defun outline-distinctive-bullet (bullet) | 2534 | (defun allout-distinctive-bullet (bullet) |
| 2535 | "True if bullet is one of those on outline-distinctive-bullets-string." | 2535 | "True if bullet is one of those on allout-distinctive-bullets-string." |
| 2536 | (string-match (regexp-quote bullet) outline-distinctive-bullets-string)) | 2536 | (string-match (regexp-quote bullet) allout-distinctive-bullets-string)) |
| 2537 | ;;;_ > outline-numbered-type-prefix (&optional prefix) | 2537 | ;;;_ > allout-numbered-type-prefix (&optional prefix) |
| 2538 | (defun outline-numbered-type-prefix (&optional prefix) | 2538 | (defun allout-numbered-type-prefix (&optional prefix) |
| 2539 | "True if current header prefix bullet is numbered bullet." | 2539 | "True if current header prefix bullet is numbered bullet." |
| 2540 | (and outline-numbered-bullet | 2540 | (and allout-numbered-bullet |
| 2541 | (string= outline-numbered-bullet | 2541 | (string= allout-numbered-bullet |
| 2542 | (if prefix | 2542 | (if prefix |
| 2543 | (outline-get-prefix-bullet prefix) | 2543 | (allout-get-prefix-bullet prefix) |
| 2544 | (outline-get-bullet))))) | 2544 | (allout-get-bullet))))) |
| 2545 | ;;;_ > outline-bullet-for-depth (&optional depth) | 2545 | ;;;_ > allout-bullet-for-depth (&optional depth) |
| 2546 | (defun outline-bullet-for-depth (&optional depth) | 2546 | (defun allout-bullet-for-depth (&optional depth) |
| 2547 | "Return outline topic bullet suited to optional DEPTH, or current depth." | 2547 | "Return outline topic bullet suited to optional DEPTH, or current depth." |
| 2548 | ;; Find bullet in plain-bullets-string modulo DEPTH. | 2548 | ;; Find bullet in plain-bullets-string modulo DEPTH. |
| 2549 | (if outline-stylish-prefixes | 2549 | (if allout-stylish-prefixes |
| 2550 | (char-to-string (aref outline-plain-bullets-string | 2550 | (char-to-string (aref allout-plain-bullets-string |
| 2551 | (% (max 0 (- depth 2)) | 2551 | (% (max 0 (- depth 2)) |
| 2552 | outline-plain-bullets-string-len))) | 2552 | allout-plain-bullets-string-len))) |
| 2553 | outline-primary-bullet) | 2553 | allout-primary-bullet) |
| 2554 | ) | 2554 | ) |
| 2555 | 2555 | ||
| 2556 | ;;;_ - Topic Production | 2556 | ;;;_ - Topic Production |
| 2557 | ;;;_ > outline-make-topic-prefix (&optional prior-bullet | 2557 | ;;;_ > allout-make-topic-prefix (&optional prior-bullet |
| 2558 | (defun outline-make-topic-prefix (&optional prior-bullet | 2558 | (defun allout-make-topic-prefix (&optional prior-bullet |
| 2559 | new | 2559 | new |
| 2560 | depth | 2560 | depth |
| 2561 | solicit | 2561 | solicit |
| @@ -2572,7 +2572,7 @@ All the arguments are optional. | |||
| 2572 | 2572 | ||
| 2573 | PRIOR-BULLET indicates the bullet of the prefix being changed, or | 2573 | PRIOR-BULLET indicates the bullet of the prefix being changed, or |
| 2574 | nil if none. This bullet may be preserved (other options | 2574 | nil if none. This bullet may be preserved (other options |
| 2575 | notwithstanding) if it is on the outline-distinctive-bullets-string, | 2575 | notwithstanding) if it is on the allout-distinctive-bullets-string, |
| 2576 | for instance. | 2576 | for instance. |
| 2577 | 2577 | ||
| 2578 | Second arg NEW indicates that a new topic is being opened after the | 2578 | Second arg NEW indicates that a new topic is being opened after the |
| @@ -2592,7 +2592,7 @@ distinction or depth) is offered. \(This overrides other options, | |||
| 2592 | including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the | 2592 | including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the |
| 2593 | context-specific bullet is used. | 2593 | context-specific bullet is used. |
| 2594 | 2594 | ||
| 2595 | Fifth arg, NUMBER-CONTROL, matters only if `outline-numbered-bullet' | 2595 | Fifth arg, NUMBER-CONTROL, matters only if `allout-numbered-bullet' |
| 2596 | is non-nil *and* soliciting was not explicitly invoked. Then | 2596 | is non-nil *and* soliciting was not explicitly invoked. Then |
| 2597 | NUMBER-CONTROL non-nil forces prefix to either numbered or | 2597 | NUMBER-CONTROL non-nil forces prefix to either numbered or |
| 2598 | denumbered format, depending on the value of the sixth arg, INDEX. | 2598 | denumbered format, depending on the value of the sixth arg, INDEX. |
| @@ -2618,21 +2618,21 @@ index for each successive sibling)." | |||
| 2618 | (let* (body | 2618 | (let* (body |
| 2619 | numbering | 2619 | numbering |
| 2620 | denumbering | 2620 | denumbering |
| 2621 | (depth (or depth (outline-depth))) | 2621 | (depth (or depth (allout-depth))) |
| 2622 | (header-lead outline-header-prefix) | 2622 | (header-lead allout-header-prefix) |
| 2623 | (bullet-char | 2623 | (bullet-char |
| 2624 | 2624 | ||
| 2625 | ;; Getting value for bullet char is practically the whole job: | 2625 | ;; Getting value for bullet char is practically the whole job: |
| 2626 | 2626 | ||
| 2627 | (cond | 2627 | (cond |
| 2628 | ; Simplest situation - level 1: | 2628 | ; Simplest situation - level 1: |
| 2629 | ((<= depth 1) (setq header-lead "") outline-primary-bullet) | 2629 | ((<= depth 1) (setq header-lead "") allout-primary-bullet) |
| 2630 | ; Simple, too: all asterisks: | 2630 | ; Simple, too: all asterisks: |
| 2631 | (outline-old-style-prefixes | 2631 | (allout-old-style-prefixes |
| 2632 | ;; Cheat - make body the whole thing, null out header-lead and | 2632 | ;; Cheat - make body the whole thing, null out header-lead and |
| 2633 | ;; bullet-char: | 2633 | ;; bullet-char: |
| 2634 | (setq body (make-string depth | 2634 | (setq body (make-string depth |
| 2635 | (string-to-char outline-primary-bullet))) | 2635 | (string-to-char allout-primary-bullet))) |
| 2636 | (setq header-lead "") | 2636 | (setq header-lead "") |
| 2637 | "") | 2637 | "") |
| 2638 | 2638 | ||
| @@ -2643,67 +2643,67 @@ index for each successive sibling)." | |||
| 2643 | ((progn (setq body (make-string (- depth 2) ?\ )) | 2643 | ((progn (setq body (make-string (- depth 2) ?\ )) |
| 2644 | ;; The actual condition: | 2644 | ;; The actual condition: |
| 2645 | solicit) | 2645 | solicit) |
| 2646 | (let* ((got (outline-solicit-alternate-bullet depth solicit))) | 2646 | (let* ((got (allout-solicit-alternate-bullet depth solicit))) |
| 2647 | ;; Gotta check whether we're numbering and got a numbered bullet: | 2647 | ;; Gotta check whether we're numbering and got a numbered bullet: |
| 2648 | (setq numbering (and outline-numbered-bullet | 2648 | (setq numbering (and allout-numbered-bullet |
| 2649 | (not (and number-control (not index))) | 2649 | (not (and number-control (not index))) |
| 2650 | (string= got outline-numbered-bullet))) | 2650 | (string= got allout-numbered-bullet))) |
| 2651 | ;; Now return what we got, regardless: | 2651 | ;; Now return what we got, regardless: |
| 2652 | got)) | 2652 | got)) |
| 2653 | 2653 | ||
| 2654 | ;; Numbering invoked through args: | 2654 | ;; Numbering invoked through args: |
| 2655 | ((and outline-numbered-bullet number-control) | 2655 | ((and allout-numbered-bullet number-control) |
| 2656 | (if (setq numbering (not (setq denumbering (not index)))) | 2656 | (if (setq numbering (not (setq denumbering (not index)))) |
| 2657 | outline-numbered-bullet | 2657 | allout-numbered-bullet |
| 2658 | (if (and prior-bullet | 2658 | (if (and prior-bullet |
| 2659 | (not (string= outline-numbered-bullet | 2659 | (not (string= allout-numbered-bullet |
| 2660 | prior-bullet))) | 2660 | prior-bullet))) |
| 2661 | prior-bullet | 2661 | prior-bullet |
| 2662 | (outline-bullet-for-depth depth)))) | 2662 | (allout-bullet-for-depth depth)))) |
| 2663 | 2663 | ||
| 2664 | ;;; Neither soliciting nor controlled numbering ;;; | 2664 | ;;; Neither soliciting nor controlled numbering ;;; |
| 2665 | ;;; (may be controlled denumbering, tho) ;;; | 2665 | ;;; (may be controlled denumbering, tho) ;;; |
| 2666 | 2666 | ||
| 2667 | ;; Check wrt previous sibling: | 2667 | ;; Check wrt previous sibling: |
| 2668 | ((and new ; only check for new prefixes | 2668 | ((and new ; only check for new prefixes |
| 2669 | (<= depth (outline-depth)) | 2669 | (<= depth (allout-depth)) |
| 2670 | outline-numbered-bullet ; ... & numbering enabled | 2670 | allout-numbered-bullet ; ... & numbering enabled |
| 2671 | (not denumbering) | 2671 | (not denumbering) |
| 2672 | (let ((sibling-bullet | 2672 | (let ((sibling-bullet |
| 2673 | (save-excursion | 2673 | (save-excursion |
| 2674 | ;; Locate correct sibling: | 2674 | ;; Locate correct sibling: |
| 2675 | (or (>= depth (outline-depth)) | 2675 | (or (>= depth (allout-depth)) |
| 2676 | (outline-ascend-to-depth depth)) | 2676 | (allout-ascend-to-depth depth)) |
| 2677 | (outline-get-bullet)))) | 2677 | (allout-get-bullet)))) |
| 2678 | (if (and sibling-bullet | 2678 | (if (and sibling-bullet |
| 2679 | (string= outline-numbered-bullet sibling-bullet)) | 2679 | (string= allout-numbered-bullet sibling-bullet)) |
| 2680 | (setq numbering sibling-bullet))))) | 2680 | (setq numbering sibling-bullet))))) |
| 2681 | 2681 | ||
| 2682 | ;; Distinctive prior bullet? | 2682 | ;; Distinctive prior bullet? |
| 2683 | ((and prior-bullet | 2683 | ((and prior-bullet |
| 2684 | (outline-distinctive-bullet prior-bullet) | 2684 | (allout-distinctive-bullet prior-bullet) |
| 2685 | ;; Either non-numbered: | 2685 | ;; Either non-numbered: |
| 2686 | (or (not (and outline-numbered-bullet | 2686 | (or (not (and allout-numbered-bullet |
| 2687 | (string= prior-bullet outline-numbered-bullet))) | 2687 | (string= prior-bullet allout-numbered-bullet))) |
| 2688 | ;; or numbered, and not denumbering: | 2688 | ;; or numbered, and not denumbering: |
| 2689 | (setq numbering (not denumbering))) | 2689 | (setq numbering (not denumbering))) |
| 2690 | ;; Here 'tis: | 2690 | ;; Here 'tis: |
| 2691 | prior-bullet)) | 2691 | prior-bullet)) |
| 2692 | 2692 | ||
| 2693 | ;; Else, standard bullet per depth: | 2693 | ;; Else, standard bullet per depth: |
| 2694 | ((outline-bullet-for-depth depth))))) | 2694 | ((allout-bullet-for-depth depth))))) |
| 2695 | 2695 | ||
| 2696 | (concat header-lead | 2696 | (concat header-lead |
| 2697 | body | 2697 | body |
| 2698 | bullet-char | 2698 | bullet-char |
| 2699 | (if numbering | 2699 | (if numbering |
| 2700 | (format "%d" (cond ((and index (numberp index)) index) | 2700 | (format "%d" (cond ((and index (numberp index)) index) |
| 2701 | (new (1+ (outline-sibling-index depth))) | 2701 | (new (1+ (allout-sibling-index depth))) |
| 2702 | ((outline-sibling-index)))))) | 2702 | ((allout-sibling-index)))))) |
| 2703 | ) | 2703 | ) |
| 2704 | ) | 2704 | ) |
| 2705 | ;;;_ > outline-open-topic (relative-depth &optional before use_sib_bullet) | 2705 | ;;;_ > allout-open-topic (relative-depth &optional before use_sib_bullet) |
| 2706 | (defun outline-open-topic (relative-depth &optional before use_sib_bullet) | 2706 | (defun allout-open-topic (relative-depth &optional before use_sib_bullet) |
| 2707 | "Open a new topic at depth DEPTH. | 2707 | "Open a new topic at depth DEPTH. |
| 2708 | 2708 | ||
| 2709 | New topic is situated after current one, unless optional flag BEFORE | 2709 | New topic is situated after current one, unless optional flag BEFORE |
| @@ -2734,7 +2734,7 @@ Nuances: | |||
| 2734 | having to go to its preceding sibling, and then open forward | 2734 | having to go to its preceding sibling, and then open forward |
| 2735 | from there." | 2735 | from there." |
| 2736 | 2736 | ||
| 2737 | (let* ((depth (+ (outline-current-depth) relative-depth)) | 2737 | (let* ((depth (+ (allout-current-depth) relative-depth)) |
| 2738 | (opening-on-blank (if (looking-at "^\$") | 2738 | (opening-on-blank (if (looking-at "^\$") |
| 2739 | (not (setq before nil)))) | 2739 | (not (setq before nil)))) |
| 2740 | opening-numbered ; Will get while computing ref-topic, below | 2740 | opening-numbered ; Will get while computing ref-topic, below |
| @@ -2742,21 +2742,21 @@ Nuances: | |||
| 2742 | ref-bullet ; Will get while computing ref-topic, next | 2742 | ref-bullet ; Will get while computing ref-topic, next |
| 2743 | (ref-topic (save-excursion | 2743 | (ref-topic (save-excursion |
| 2744 | (cond ((< relative-depth 0) | 2744 | (cond ((< relative-depth 0) |
| 2745 | (outline-ascend-to-depth depth)) | 2745 | (allout-ascend-to-depth depth)) |
| 2746 | ((>= relative-depth 1) nil) | 2746 | ((>= relative-depth 1) nil) |
| 2747 | (t (outline-back-to-current-heading))) | 2747 | (t (allout-back-to-current-heading))) |
| 2748 | (setq ref-depth (outline-recent-depth)) | 2748 | (setq ref-depth (allout-recent-depth)) |
| 2749 | (setq ref-bullet | 2749 | (setq ref-bullet |
| 2750 | (if (> outline-recent-prefix-end 1) | 2750 | (if (> allout-recent-prefix-end 1) |
| 2751 | (outline-recent-bullet) | 2751 | (allout-recent-bullet) |
| 2752 | "")) | 2752 | "")) |
| 2753 | (setq opening-numbered | 2753 | (setq opening-numbered |
| 2754 | (save-excursion | 2754 | (save-excursion |
| 2755 | (and outline-numbered-bullet | 2755 | (and allout-numbered-bullet |
| 2756 | (or (<= relative-depth 0) | 2756 | (or (<= relative-depth 0) |
| 2757 | (outline-descend-to-depth depth)) | 2757 | (allout-descend-to-depth depth)) |
| 2758 | (if (outline-numbered-type-prefix) | 2758 | (if (allout-numbered-type-prefix) |
| 2759 | outline-numbered-bullet)))) | 2759 | allout-numbered-bullet)))) |
| 2760 | (point))) | 2760 | (point))) |
| 2761 | dbl-space | 2761 | dbl-space |
| 2762 | doing-beginning) | 2762 | doing-beginning) |
| @@ -2776,7 +2776,7 @@ Nuances: | |||
| 2776 | (bobp))) | 2776 | (bobp))) |
| 2777 | (save-excursion | 2777 | (save-excursion |
| 2778 | ;; succeeded by a blank line? | 2778 | ;; succeeded by a blank line? |
| 2779 | (outline-end-of-current-subtree) | 2779 | (allout-end-of-current-subtree) |
| 2780 | (bolp))) | 2780 | (bolp))) |
| 2781 | (and (= ref-depth 1) | 2781 | (and (= ref-depth 1) |
| 2782 | (or before | 2782 | (or before |
| @@ -2784,67 +2784,67 @@ Nuances: | |||
| 2784 | (save-excursion | 2784 | (save-excursion |
| 2785 | ;; Don't already have following | 2785 | ;; Don't already have following |
| 2786 | ;; vertical padding: | 2786 | ;; vertical padding: |
| 2787 | (not (outline-pre-next-preface))))))) | 2787 | (not (allout-pre-next-preface))))))) |
| 2788 | 2788 | ||
| 2789 | ; Position to prior heading, | 2789 | ; Position to prior heading, |
| 2790 | ; if inserting backwards, and | 2790 | ; if inserting backwards, and |
| 2791 | ; not going outwards: | 2791 | ; not going outwards: |
| 2792 | (if (and before (>= relative-depth 0)) | 2792 | (if (and before (>= relative-depth 0)) |
| 2793 | (progn (outline-back-to-current-heading) | 2793 | (progn (allout-back-to-current-heading) |
| 2794 | (setq doing-beginning (bobp)) | 2794 | (setq doing-beginning (bobp)) |
| 2795 | (if (not (bobp)) | 2795 | (if (not (bobp)) |
| 2796 | (outline-previous-heading))) | 2796 | (allout-previous-heading))) |
| 2797 | (if (and before (bobp)) | 2797 | (if (and before (bobp)) |
| 2798 | (outline-unprotected (open-line 1)))) | 2798 | (allout-unprotected (open-line 1)))) |
| 2799 | 2799 | ||
| 2800 | (if (<= relative-depth 0) | 2800 | (if (<= relative-depth 0) |
| 2801 | ;; Not going inwards, don't snug up: | 2801 | ;; Not going inwards, don't snug up: |
| 2802 | (if doing-beginning | 2802 | (if doing-beginning |
| 2803 | (outline-unprotected (open-line (if dbl-space 2 1))) | 2803 | (allout-unprotected (open-line (if dbl-space 2 1))) |
| 2804 | (if before | 2804 | (if before |
| 2805 | (progn (end-of-line) | 2805 | (progn (end-of-line) |
| 2806 | (outline-pre-next-preface) | 2806 | (allout-pre-next-preface) |
| 2807 | (while (= ?\r (following-char)) | 2807 | (while (= ?\r (following-char)) |
| 2808 | (forward-char 1)) | 2808 | (forward-char 1)) |
| 2809 | (if (not (looking-at "^$")) | 2809 | (if (not (looking-at "^$")) |
| 2810 | (outline-unprotected (open-line 1)))) | 2810 | (allout-unprotected (open-line 1)))) |
| 2811 | (outline-end-of-current-subtree))) | 2811 | (allout-end-of-current-subtree))) |
| 2812 | ;; Going inwards - double-space if first offspring is, | 2812 | ;; Going inwards - double-space if first offspring is, |
| 2813 | ;; otherwise snug up. | 2813 | ;; otherwise snug up. |
| 2814 | (end-of-line) ; So we skip any concealed progeny. | 2814 | (end-of-line) ; So we skip any concealed progeny. |
| 2815 | (outline-pre-next-preface) | 2815 | (allout-pre-next-preface) |
| 2816 | (if (bolp) | 2816 | (if (bolp) |
| 2817 | ;; Blank lines between current header body and next | 2817 | ;; Blank lines between current header body and next |
| 2818 | ;; header - get to last substantive (non-white-space) | 2818 | ;; header - get to last substantive (non-white-space) |
| 2819 | ;; line in body: | 2819 | ;; line in body: |
| 2820 | (re-search-backward "[^ \t\n]" nil t)) | 2820 | (re-search-backward "[^ \t\n]" nil t)) |
| 2821 | (if (save-excursion | 2821 | (if (save-excursion |
| 2822 | (outline-next-heading) | 2822 | (allout-next-heading) |
| 2823 | (if (> (outline-recent-depth) ref-depth) | 2823 | (if (> (allout-recent-depth) ref-depth) |
| 2824 | ;; This is an offspring. | 2824 | ;; This is an offspring. |
| 2825 | (progn (forward-line -1) | 2825 | (progn (forward-line -1) |
| 2826 | (looking-at "^\\s-*$")))) | 2826 | (looking-at "^\\s-*$")))) |
| 2827 | (progn (forward-line 1) | 2827 | (progn (forward-line 1) |
| 2828 | (outline-unprotected (open-line 1)))) | 2828 | (allout-unprotected (open-line 1)))) |
| 2829 | (end-of-line)) | 2829 | (end-of-line)) |
| 2830 | ;;(if doing-beginning (goto-char doing-beginning)) | 2830 | ;;(if doing-beginning (goto-char doing-beginning)) |
| 2831 | (if (not (bobp)) | 2831 | (if (not (bobp)) |
| 2832 | (progn (if (and (not (> depth ref-depth)) | 2832 | (progn (if (and (not (> depth ref-depth)) |
| 2833 | (not before)) | 2833 | (not before)) |
| 2834 | (outline-unprotected (open-line 1)) | 2834 | (allout-unprotected (open-line 1)) |
| 2835 | (if (> depth ref-depth) | 2835 | (if (> depth ref-depth) |
| 2836 | (outline-unprotected (newline 1)) | 2836 | (allout-unprotected (newline 1)) |
| 2837 | (if dbl-space | 2837 | (if dbl-space |
| 2838 | (outline-unprotected (open-line 1)) | 2838 | (allout-unprotected (open-line 1)) |
| 2839 | (if (not before) | 2839 | (if (not before) |
| 2840 | (outline-unprotected (newline 1)))))) | 2840 | (allout-unprotected (newline 1)))))) |
| 2841 | (if dbl-space | 2841 | (if dbl-space |
| 2842 | (outline-unprotected (newline 1))) | 2842 | (allout-unprotected (newline 1))) |
| 2843 | (if (and (not (eobp)) | 2843 | (if (and (not (eobp)) |
| 2844 | (not (bolp))) | 2844 | (not (bolp))) |
| 2845 | (forward-char 1)))) | 2845 | (forward-char 1)))) |
| 2846 | )) | 2846 | )) |
| 2847 | (insert (concat (outline-make-topic-prefix opening-numbered | 2847 | (insert (concat (allout-make-topic-prefix opening-numbered |
| 2848 | t | 2848 | t |
| 2849 | depth) | 2849 | depth) |
| 2850 | " ")) | 2850 | " ")) |
| @@ -2852,7 +2852,7 @@ Nuances: | |||
| 2852 | ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1)))) | 2852 | ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1)))) |
| 2853 | 2853 | ||
| 2854 | 2854 | ||
| 2855 | (outline-rebullet-heading (and use_sib_bullet ref-bullet);;; solicit | 2855 | (allout-rebullet-heading (and use_sib_bullet ref-bullet);;; solicit |
| 2856 | depth ;;; depth | 2856 | depth ;;; depth |
| 2857 | nil ;;; number-control | 2857 | nil ;;; number-control |
| 2858 | nil ;;; index | 2858 | nil ;;; index |
| @@ -2872,16 +2872,16 @@ Nuances: | |||
| 2872 | ;;;_ ; buffer boundaries - special provisions for beginning and end ob | 2872 | ;;;_ ; buffer boundaries - special provisions for beginning and end ob |
| 2873 | ;;;_ ; level 1 topics have special provisions also - double space. | 2873 | ;;;_ ; level 1 topics have special provisions also - double space. |
| 2874 | ;;;_ ; location of new topic | 2874 | ;;;_ ; location of new topic |
| 2875 | ;;;_ > outline-open-subtopic (arg) | 2875 | ;;;_ > allout-open-subtopic (arg) |
| 2876 | (defun outline-open-subtopic (arg) | 2876 | (defun allout-open-subtopic (arg) |
| 2877 | "Open new topic header at deeper level than the current one. | 2877 | "Open new topic header at deeper level than the current one. |
| 2878 | 2878 | ||
| 2879 | Negative universal arg means to open deeper, but place the new topic | 2879 | Negative universal arg means to open deeper, but place the new topic |
| 2880 | prior to the current one." | 2880 | prior to the current one." |
| 2881 | (interactive "p") | 2881 | (interactive "p") |
| 2882 | (outline-open-topic 1 (> 0 arg))) | 2882 | (allout-open-topic 1 (> 0 arg))) |
| 2883 | ;;;_ > outline-open-sibtopic (arg) | 2883 | ;;;_ > allout-open-sibtopic (arg) |
| 2884 | (defun outline-open-sibtopic (arg) | 2884 | (defun allout-open-sibtopic (arg) |
| 2885 | "Open new topic header at same level as the current one. | 2885 | "Open new topic header at same level as the current one. |
| 2886 | 2886 | ||
| 2887 | Positive universal arg means to use the bullet of the prior sibling. | 2887 | Positive universal arg means to use the bullet of the prior sibling. |
| @@ -2889,42 +2889,42 @@ Positive universal arg means to use the bullet of the prior sibling. | |||
| 2889 | Negative universal arg means to place the new topic prior to the current | 2889 | Negative universal arg means to place the new topic prior to the current |
| 2890 | one." | 2890 | one." |
| 2891 | (interactive "p") | 2891 | (interactive "p") |
| 2892 | (outline-open-topic 0 (> 0 arg) (< 1 arg))) | 2892 | (allout-open-topic 0 (> 0 arg) (< 1 arg))) |
| 2893 | ;;;_ > outline-open-supertopic (arg) | 2893 | ;;;_ > allout-open-supertopic (arg) |
| 2894 | (defun outline-open-supertopic (arg) | 2894 | (defun allout-open-supertopic (arg) |
| 2895 | "Open new topic header at shallower level than the current one. | 2895 | "Open new topic header at shallower level than the current one. |
| 2896 | 2896 | ||
| 2897 | Negative universal arg means to open shallower, but place the new | 2897 | Negative universal arg means to open shallower, but place the new |
| 2898 | topic prior to the current one." | 2898 | topic prior to the current one." |
| 2899 | 2899 | ||
| 2900 | (interactive "p") | 2900 | (interactive "p") |
| 2901 | (outline-open-topic -1 (> 0 arg))) | 2901 | (allout-open-topic -1 (> 0 arg))) |
| 2902 | 2902 | ||
| 2903 | ;;;_ - Outline Alteration | 2903 | ;;;_ - Outline Alteration |
| 2904 | ;;;_ : Topic Modification | 2904 | ;;;_ : Topic Modification |
| 2905 | ;;;_ = outline-former-auto-filler | 2905 | ;;;_ = allout-former-auto-filler |
| 2906 | (defvar outline-former-auto-filler nil | 2906 | (defvar allout-former-auto-filler nil |
| 2907 | "Name of modal fill function being wrapped by outline-auto-fill.") | 2907 | "Name of modal fill function being wrapped by allout-auto-fill.") |
| 2908 | ;;;_ > outline-auto-fill () | 2908 | ;;;_ > allout-auto-fill () |
| 2909 | (defun outline-auto-fill () | 2909 | (defun allout-auto-fill () |
| 2910 | "Outline-mode autofill function. | 2910 | "Allout-mode autofill function. |
| 2911 | 2911 | ||
| 2912 | Maintains outline hanging topic indentation if | 2912 | Maintains outline hanging topic indentation if |
| 2913 | `outline-use-hanging-indents' is set." | 2913 | `allout-use-hanging-indents' is set." |
| 2914 | (let ((fill-prefix (if outline-use-hanging-indents | 2914 | (let ((fill-prefix (if allout-use-hanging-indents |
| 2915 | ;; Check for topic header indentation: | 2915 | ;; Check for topic header indentation: |
| 2916 | (save-excursion | 2916 | (save-excursion |
| 2917 | (beginning-of-line) | 2917 | (beginning-of-line) |
| 2918 | (if (looking-at outline-regexp) | 2918 | (if (looking-at allout-regexp) |
| 2919 | ;; ... construct indentation to account for | 2919 | ;; ... construct indentation to account for |
| 2920 | ;; length of topic prefix: | 2920 | ;; length of topic prefix: |
| 2921 | (make-string (progn (outline-end-of-prefix) | 2921 | (make-string (progn (allout-end-of-prefix) |
| 2922 | (current-column)) | 2922 | (current-column)) |
| 2923 | ?\ )))))) | 2923 | ?\ )))))) |
| 2924 | (if (or outline-former-auto-filler outline-use-hanging-indents) | 2924 | (if (or allout-former-auto-filler allout-use-hanging-indents) |
| 2925 | (do-auto-fill)))) | 2925 | (do-auto-fill)))) |
| 2926 | ;;;_ > outline-reindent-body (old-depth new-depth &optional number) | 2926 | ;;;_ > allout-reindent-body (old-depth new-depth &optional number) |
| 2927 | (defun outline-reindent-body (old-depth new-depth &optional number) | 2927 | (defun allout-reindent-body (old-depth new-depth &optional number) |
| 2928 | "Reindent body lines which were indented at old-depth to new-depth. | 2928 | "Reindent body lines which were indented at old-depth to new-depth. |
| 2929 | 2929 | ||
| 2930 | Optional arg NUMBER indicates numbering is being added, and it must | 2930 | Optional arg NUMBER indicates numbering is being added, and it must |
| @@ -2933,7 +2933,7 @@ be accommodated. | |||
| 2933 | Note that refill of indented paragraphs is not done." | 2933 | Note that refill of indented paragraphs is not done." |
| 2934 | 2934 | ||
| 2935 | (save-excursion | 2935 | (save-excursion |
| 2936 | (outline-end-of-prefix) | 2936 | (allout-end-of-prefix) |
| 2937 | (let* ((new-margin (current-column)) | 2937 | (let* ((new-margin (current-column)) |
| 2938 | excess old-indent-begin old-indent-end | 2938 | excess old-indent-begin old-indent-end |
| 2939 | curr-ind | 2939 | curr-ind |
| @@ -2943,7 +2943,7 @@ Note that refill of indented paragraphs is not done." | |||
| 2943 | (old-margin (+ old-depth (- new-margin new-depth)))) | 2943 | (old-margin (+ old-depth (- new-margin new-depth)))) |
| 2944 | 2944 | ||
| 2945 | ;; Process lines up to (but excluding) next topic header: | 2945 | ;; Process lines up to (but excluding) next topic header: |
| 2946 | (outline-unprotected | 2946 | (allout-unprotected |
| 2947 | (save-match-data | 2947 | (save-match-data |
| 2948 | (while | 2948 | (while |
| 2949 | (and (re-search-forward "[\n\r]\\(\\s-*\\)" | 2949 | (and (re-search-forward "[\n\r]\\(\\s-*\\)" |
| @@ -2953,7 +2953,7 @@ Note that refill of indented paragraphs is not done." | |||
| 2953 | ;; match data with a subsequent `looking-at': | 2953 | ;; match data with a subsequent `looking-at': |
| 2954 | (setq old-indent-begin (match-beginning 1) | 2954 | (setq old-indent-begin (match-beginning 1) |
| 2955 | old-indent-end (match-end 1)) | 2955 | old-indent-end (match-end 1)) |
| 2956 | (not (looking-at outline-regexp))) | 2956 | (not (looking-at allout-regexp))) |
| 2957 | (if (> 0 (setq excess (- (current-column) | 2957 | (if (> 0 (setq excess (- (current-column) |
| 2958 | old-margin))) | 2958 | old-margin))) |
| 2959 | ;; Text starts left of old margin - don't adjust: | 2959 | ;; Text starts left of old margin - don't adjust: |
| @@ -2963,18 +2963,18 @@ Note that refill of indented paragraphs is not done." | |||
| 2963 | ;; beyond the old margin: | 2963 | ;; beyond the old margin: |
| 2964 | (delete-region old-indent-begin old-indent-end) | 2964 | (delete-region old-indent-begin old-indent-end) |
| 2965 | (indent-to (+ new-margin excess))))))))) | 2965 | (indent-to (+ new-margin excess))))))))) |
| 2966 | ;;;_ > outline-rebullet-current-heading (arg) | 2966 | ;;;_ > allout-rebullet-current-heading (arg) |
| 2967 | (defun outline-rebullet-current-heading (arg) | 2967 | (defun allout-rebullet-current-heading (arg) |
| 2968 | "Solicit new bullet for current visible heading." | 2968 | "Solicit new bullet for current visible heading." |
| 2969 | (interactive "p") | 2969 | (interactive "p") |
| 2970 | (let ((initial-col (current-column)) | 2970 | (let ((initial-col (current-column)) |
| 2971 | (on-bullet (eq (point)(outline-current-bullet-pos))) | 2971 | (on-bullet (eq (point)(allout-current-bullet-pos))) |
| 2972 | (backwards (if (< arg 0) | 2972 | (backwards (if (< arg 0) |
| 2973 | (setq arg (* arg -1))))) | 2973 | (setq arg (* arg -1))))) |
| 2974 | (while (> arg 0) | 2974 | (while (> arg 0) |
| 2975 | (save-excursion (outline-back-to-current-heading) | 2975 | (save-excursion (allout-back-to-current-heading) |
| 2976 | (outline-end-of-prefix) | 2976 | (allout-end-of-prefix) |
| 2977 | (outline-rebullet-heading t ;;; solicit | 2977 | (allout-rebullet-heading t ;;; solicit |
| 2978 | nil ;;; depth | 2978 | nil ;;; depth |
| 2979 | nil ;;; number-control | 2979 | nil ;;; number-control |
| 2980 | nil ;;; index | 2980 | nil ;;; index |
| @@ -2984,14 +2984,14 @@ Note that refill of indented paragraphs is not done." | |||
| 2984 | nil | 2984 | nil |
| 2985 | (setq initial-col nil) ; Override positioning back to init col | 2985 | (setq initial-col nil) ; Override positioning back to init col |
| 2986 | (if (not backwards) | 2986 | (if (not backwards) |
| 2987 | (outline-next-visible-heading 1) | 2987 | (allout-next-visible-heading 1) |
| 2988 | (outline-goto-prefix) | 2988 | (allout-goto-prefix) |
| 2989 | (outline-next-visible-heading -1)))) | 2989 | (allout-next-visible-heading -1)))) |
| 2990 | (message "Done.") | 2990 | (message "Done.") |
| 2991 | (cond (on-bullet (goto-char (outline-current-bullet-pos))) | 2991 | (cond (on-bullet (goto-char (allout-current-bullet-pos))) |
| 2992 | (initial-col (move-to-column initial-col))))) | 2992 | (initial-col (move-to-column initial-col))))) |
| 2993 | ;;;_ > outline-rebullet-heading (&optional solicit ...) | 2993 | ;;;_ > allout-rebullet-heading (&optional solicit ...) |
| 2994 | (defun outline-rebullet-heading (&optional solicit | 2994 | (defun allout-rebullet-heading (&optional solicit |
| 2995 | new-depth | 2995 | new-depth |
| 2996 | number-control | 2996 | number-control |
| 2997 | index | 2997 | index |
| @@ -3011,7 +3011,7 @@ Second arg DEPTH forces the topic prefix to that depth, regardless | |||
| 3011 | of the topic's current depth. | 3011 | of the topic's current depth. |
| 3012 | 3012 | ||
| 3013 | Third arg NUMBER-CONTROL can force the prefix to or away from | 3013 | Third arg NUMBER-CONTROL can force the prefix to or away from |
| 3014 | numbered form. It has effect only if `outline-numbered-bullet' is | 3014 | numbered form. It has effect only if `allout-numbered-bullet' is |
| 3015 | non-nil and soliciting was not explicitly invoked (via first arg). | 3015 | non-nil and soliciting was not explicitly invoked (via first arg). |
| 3016 | Its effect, numbering or denumbering, then depends on the setting | 3016 | Its effect, numbering or denumbering, then depends on the setting |
| 3017 | of the forth arg, INDEX. | 3017 | of the forth arg, INDEX. |
| @@ -3022,21 +3022,21 @@ non-nil NUMBER-CONTROL forces denumbering. Non-nil INDEX (and | |||
| 3022 | non-nil NUMBER-CONTROL) forces a numbered-prefix form. If non-nil | 3022 | non-nil NUMBER-CONTROL) forces a numbered-prefix form. If non-nil |
| 3023 | INDEX is a number, then that number is used for the numbered | 3023 | INDEX is a number, then that number is used for the numbered |
| 3024 | prefix. Non-nil and non-number means that the index for the | 3024 | prefix. Non-nil and non-number means that the index for the |
| 3025 | numbered prefix will be derived by outline-make-topic-prefix. | 3025 | numbered prefix will be derived by allout-make-topic-prefix. |
| 3026 | 3026 | ||
| 3027 | Fifth arg DO-SUCCESSORS t means re-resolve count on succeeding | 3027 | Fifth arg DO-SUCCESSORS t means re-resolve count on succeeding |
| 3028 | siblings. | 3028 | siblings. |
| 3029 | 3029 | ||
| 3030 | Cf vars `outline-stylish-prefixes', `outline-old-style-prefixes', | 3030 | Cf vars `allout-stylish-prefixes', `allout-old-style-prefixes', |
| 3031 | and `outline-numbered-bullet', which all affect the behavior of | 3031 | and `allout-numbered-bullet', which all affect the behavior of |
| 3032 | this function." | 3032 | this function." |
| 3033 | 3033 | ||
| 3034 | (let* ((current-depth (outline-depth)) | 3034 | (let* ((current-depth (allout-depth)) |
| 3035 | (new-depth (or new-depth current-depth)) | 3035 | (new-depth (or new-depth current-depth)) |
| 3036 | (mb outline-recent-prefix-beginning) | 3036 | (mb allout-recent-prefix-beginning) |
| 3037 | (me outline-recent-prefix-end) | 3037 | (me allout-recent-prefix-end) |
| 3038 | (current-bullet (buffer-substring (- me 1) me)) | 3038 | (current-bullet (buffer-substring (- me 1) me)) |
| 3039 | (new-prefix (outline-make-topic-prefix current-bullet | 3039 | (new-prefix (allout-make-topic-prefix current-bullet |
| 3040 | nil | 3040 | nil |
| 3041 | new-depth | 3041 | new-depth |
| 3042 | solicit | 3042 | solicit |
| @@ -3052,44 +3052,44 @@ this function." | |||
| 3052 | 3052 | ||
| 3053 | ;; New prefix probably different from old: | 3053 | ;; New prefix probably different from old: |
| 3054 | ; get rid of old one: | 3054 | ; get rid of old one: |
| 3055 | (outline-unprotected (delete-region mb me)) | 3055 | (allout-unprotected (delete-region mb me)) |
| 3056 | (goto-char mb) | 3056 | (goto-char mb) |
| 3057 | ; Dispense with number if | 3057 | ; Dispense with number if |
| 3058 | ; numbered-bullet prefix: | 3058 | ; numbered-bullet prefix: |
| 3059 | (if (and outline-numbered-bullet | 3059 | (if (and allout-numbered-bullet |
| 3060 | (string= outline-numbered-bullet current-bullet) | 3060 | (string= allout-numbered-bullet current-bullet) |
| 3061 | (looking-at "[0-9]+")) | 3061 | (looking-at "[0-9]+")) |
| 3062 | (outline-unprotected | 3062 | (allout-unprotected |
| 3063 | (delete-region (match-beginning 0)(match-end 0)))) | 3063 | (delete-region (match-beginning 0)(match-end 0)))) |
| 3064 | 3064 | ||
| 3065 | ; Put in new prefix: | 3065 | ; Put in new prefix: |
| 3066 | (outline-unprotected (insert new-prefix)) | 3066 | (allout-unprotected (insert new-prefix)) |
| 3067 | 3067 | ||
| 3068 | ;; Reindent the body if elected and margin changed: | 3068 | ;; Reindent the body if elected and margin changed: |
| 3069 | (if (and outline-reindent-bodies | 3069 | (if (and allout-reindent-bodies |
| 3070 | (not (= new-depth current-depth))) | 3070 | (not (= new-depth current-depth))) |
| 3071 | (outline-reindent-body current-depth new-depth)) | 3071 | (allout-reindent-body current-depth new-depth)) |
| 3072 | 3072 | ||
| 3073 | ;; Recursively rectify successive siblings of orig topic if | 3073 | ;; Recursively rectify successive siblings of orig topic if |
| 3074 | ;; caller elected for it: | 3074 | ;; caller elected for it: |
| 3075 | (if do-successors | 3075 | (if do-successors |
| 3076 | (save-excursion | 3076 | (save-excursion |
| 3077 | (while (outline-next-sibling new-depth nil) | 3077 | (while (allout-next-sibling new-depth nil) |
| 3078 | (setq index | 3078 | (setq index |
| 3079 | (cond ((numberp index) (1+ index)) | 3079 | (cond ((numberp index) (1+ index)) |
| 3080 | ((not number-control) (outline-sibling-index)))) | 3080 | ((not number-control) (allout-sibling-index)))) |
| 3081 | (if (outline-numbered-type-prefix) | 3081 | (if (allout-numbered-type-prefix) |
| 3082 | (outline-rebullet-heading nil ;;; solicit | 3082 | (allout-rebullet-heading nil ;;; solicit |
| 3083 | new-depth ;;; new-depth | 3083 | new-depth ;;; new-depth |
| 3084 | number-control;;; number-control | 3084 | number-control;;; number-control |
| 3085 | index ;;; index | 3085 | index ;;; index |
| 3086 | nil))))) ;;;(dont!)do-successors | 3086 | nil))))) ;;;(dont!)do-successors |
| 3087 | ) ; (if (and (= current-depth new-depth)...)) | 3087 | ) ; (if (and (= current-depth new-depth)...)) |
| 3088 | ) ; let* ((current-depth (outline-depth))...) | 3088 | ) ; let* ((current-depth (allout-depth))...) |
| 3089 | ) ; defun | 3089 | ) ; defun |
| 3090 | ;;;_ > outline-rebullet-topic (arg) | 3090 | ;;;_ > allout-rebullet-topic (arg) |
| 3091 | (defun outline-rebullet-topic (arg) | 3091 | (defun allout-rebullet-topic (arg) |
| 3092 | "Like outline-rebullet-topic-grunt, but start from topic visible at point. | 3092 | "Like allout-rebullet-topic-grunt, but start from topic visible at point. |
| 3093 | 3093 | ||
| 3094 | Descends into invisible as well as visible topics, however. | 3094 | Descends into invisible as well as visible topics, however. |
| 3095 | 3095 | ||
| @@ -3103,21 +3103,21 @@ With repeat count, shift topic depth by that amount." | |||
| 3103 | ((listp arg) (setq arg (car arg)))) | 3103 | ((listp arg) (setq arg (car arg)))) |
| 3104 | ;; Fill the user in, in case we're shifting a big topic: | 3104 | ;; Fill the user in, in case we're shifting a big topic: |
| 3105 | (if (not (zerop arg)) (message "Shifting...")) | 3105 | (if (not (zerop arg)) (message "Shifting...")) |
| 3106 | (outline-back-to-current-heading) | 3106 | (allout-back-to-current-heading) |
| 3107 | (if (<= (+ (outline-recent-depth) arg) 0) | 3107 | (if (<= (+ (allout-recent-depth) arg) 0) |
| 3108 | (error "Attempt to shift topic below level 1")) | 3108 | (error "Attempt to shift topic below level 1")) |
| 3109 | (outline-rebullet-topic-grunt arg) | 3109 | (allout-rebullet-topic-grunt arg) |
| 3110 | (if (not (zerop arg)) (message "Shifting... done."))) | 3110 | (if (not (zerop arg)) (message "Shifting... done."))) |
| 3111 | (move-to-column (max 0 (+ start-col arg))))) | 3111 | (move-to-column (max 0 (+ start-col arg))))) |
| 3112 | ;;;_ > outline-rebullet-topic-grunt (&optional relative-depth ...) | 3112 | ;;;_ > allout-rebullet-topic-grunt (&optional relative-depth ...) |
| 3113 | (defun outline-rebullet-topic-grunt (&optional relative-depth | 3113 | (defun allout-rebullet-topic-grunt (&optional relative-depth |
| 3114 | starting-depth | 3114 | starting-depth |
| 3115 | starting-point | 3115 | starting-point |
| 3116 | index | 3116 | index |
| 3117 | do-successors) | 3117 | do-successors) |
| 3118 | 3118 | ||
| 3119 | "Rebullet the topic at point, visible or invisible, and all | 3119 | "Rebullet the topic at point, visible or invisible, and all |
| 3120 | contained subtopics. See outline-rebullet-heading for rebulleting | 3120 | contained subtopics. See allout-rebullet-heading for rebulleting |
| 3121 | behavior. | 3121 | behavior. |
| 3122 | 3122 | ||
| 3123 | All arguments are optional. | 3123 | All arguments are optional. |
| @@ -3129,7 +3129,7 @@ The rest of the args are for internal recursive use by the function | |||
| 3129 | itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." | 3129 | itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." |
| 3130 | 3130 | ||
| 3131 | (let* ((relative-depth (or relative-depth 0)) | 3131 | (let* ((relative-depth (or relative-depth 0)) |
| 3132 | (new-depth (outline-depth)) | 3132 | (new-depth (allout-depth)) |
| 3133 | (starting-depth (or starting-depth new-depth)) | 3133 | (starting-depth (or starting-depth new-depth)) |
| 3134 | (on-starting-call (null starting-point)) | 3134 | (on-starting-call (null starting-point)) |
| 3135 | (index (or index | 3135 | (index (or index |
| @@ -3137,7 +3137,7 @@ itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." | |||
| 3137 | ;; calculates it at what might be new depth: | 3137 | ;; calculates it at what might be new depth: |
| 3138 | (and (or (zerop relative-depth) | 3138 | (and (or (zerop relative-depth) |
| 3139 | (not on-starting-call)) | 3139 | (not on-starting-call)) |
| 3140 | (outline-sibling-index)))) | 3140 | (allout-sibling-index)))) |
| 3141 | (moving-outwards (< 0 relative-depth)) | 3141 | (moving-outwards (< 0 relative-depth)) |
| 3142 | (starting-point (or starting-point (point)))) | 3142 | (starting-point (or starting-point (point)))) |
| 3143 | 3143 | ||
| @@ -3149,7 +3149,7 @@ itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." | |||
| 3149 | 3149 | ||
| 3150 | (cond ((= starting-depth new-depth) | 3150 | (cond ((= starting-depth new-depth) |
| 3151 | ;; We're at depth to work on this one: | 3151 | ;; We're at depth to work on this one: |
| 3152 | (outline-rebullet-heading nil ;;; solicit | 3152 | (allout-rebullet-heading nil ;;; solicit |
| 3153 | (+ starting-depth ;;; starting-depth | 3153 | (+ starting-depth ;;; starting-depth |
| 3154 | relative-depth) | 3154 | relative-depth) |
| 3155 | nil ;;; number | 3155 | nil ;;; number |
| @@ -3160,11 +3160,11 @@ itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." | |||
| 3160 | nil) ;;; do-successors | 3160 | nil) ;;; do-successors |
| 3161 | ;; ... and work on subsequent ones which are at greater depth: | 3161 | ;; ... and work on subsequent ones which are at greater depth: |
| 3162 | (setq index 0) | 3162 | (setq index 0) |
| 3163 | (outline-next-heading) | 3163 | (allout-next-heading) |
| 3164 | (while (and (not (eobp)) | 3164 | (while (and (not (eobp)) |
| 3165 | (< starting-depth (outline-recent-depth))) | 3165 | (< starting-depth (allout-recent-depth))) |
| 3166 | (setq index (1+ index)) | 3166 | (setq index (1+ index)) |
| 3167 | (outline-rebullet-topic-grunt relative-depth ;;; relative-depth | 3167 | (allout-rebullet-topic-grunt relative-depth ;;; relative-depth |
| 3168 | (1+ starting-depth);;;starting-depth | 3168 | (1+ starting-depth);;;starting-depth |
| 3169 | starting-point ;;; starting-point | 3169 | starting-point ;;; starting-point |
| 3170 | index))) ;;; index | 3170 | index))) ;;; index |
| @@ -3172,7 +3172,7 @@ itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." | |||
| 3172 | ((< starting-depth new-depth) | 3172 | ((< starting-depth new-depth) |
| 3173 | ;; Rare case - subtopic more than one level deeper than parent. | 3173 | ;; Rare case - subtopic more than one level deeper than parent. |
| 3174 | ;; Treat this one at an even deeper level: | 3174 | ;; Treat this one at an even deeper level: |
| 3175 | (outline-rebullet-topic-grunt relative-depth ;;; relative-depth | 3175 | (allout-rebullet-topic-grunt relative-depth ;;; relative-depth |
| 3176 | new-depth ;;; starting-depth | 3176 | new-depth ;;; starting-depth |
| 3177 | starting-point ;;; starting-point | 3177 | starting-point ;;; starting-point |
| 3178 | index))) ;;; index | 3178 | index))) ;;; index |
| @@ -3183,19 +3183,19 @@ itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." | |||
| 3183 | ;; if topic has changed depth | 3183 | ;; if topic has changed depth |
| 3184 | (if (or do-successors | 3184 | (if (or do-successors |
| 3185 | (and (not (zerop relative-depth)) | 3185 | (and (not (zerop relative-depth)) |
| 3186 | (or (= (outline-recent-depth) starting-depth) | 3186 | (or (= (allout-recent-depth) starting-depth) |
| 3187 | (= (outline-recent-depth) (+ starting-depth | 3187 | (= (allout-recent-depth) (+ starting-depth |
| 3188 | relative-depth))))) | 3188 | relative-depth))))) |
| 3189 | (outline-rebullet-heading nil nil nil nil t)) | 3189 | (allout-rebullet-heading nil nil nil nil t)) |
| 3190 | ;; Now rectify numbering of new siblings of the adjusted topic, | 3190 | ;; Now rectify numbering of new siblings of the adjusted topic, |
| 3191 | ;; if depth has been changed: | 3191 | ;; if depth has been changed: |
| 3192 | (progn (goto-char starting-point) | 3192 | (progn (goto-char starting-point) |
| 3193 | (if (not (zerop relative-depth)) | 3193 | (if (not (zerop relative-depth)) |
| 3194 | (outline-rebullet-heading nil nil nil nil t))))) | 3194 | (allout-rebullet-heading nil nil nil nil t))))) |
| 3195 | ) | 3195 | ) |
| 3196 | ) | 3196 | ) |
| 3197 | ;;;_ > outline-renumber-to-depth (&optional depth) | 3197 | ;;;_ > allout-renumber-to-depth (&optional depth) |
| 3198 | (defun outline-renumber-to-depth (&optional depth) | 3198 | (defun allout-renumber-to-depth (&optional depth) |
| 3199 | "Renumber siblings at current depth. | 3199 | "Renumber siblings at current depth. |
| 3200 | 3200 | ||
| 3201 | Affects superior topics if optional arg DEPTH is less than current depth. | 3201 | Affects superior topics if optional arg DEPTH is less than current depth. |
| @@ -3205,30 +3205,30 @@ Returns final depth." | |||
| 3205 | ;; Proceed by level, processing subsequent siblings on each, | 3205 | ;; Proceed by level, processing subsequent siblings on each, |
| 3206 | ;; ascending until we get shallower than the start depth: | 3206 | ;; ascending until we get shallower than the start depth: |
| 3207 | 3207 | ||
| 3208 | (let ((ascender (outline-depth)) | 3208 | (let ((ascender (allout-depth)) |
| 3209 | was-eobp) | 3209 | was-eobp) |
| 3210 | (while (and (not (eobp)) | 3210 | (while (and (not (eobp)) |
| 3211 | (outline-depth) | 3211 | (allout-depth) |
| 3212 | (>= (outline-recent-depth) depth) | 3212 | (>= (allout-recent-depth) depth) |
| 3213 | (>= ascender depth)) | 3213 | (>= ascender depth)) |
| 3214 | ; Skip over all topics at | 3214 | ; Skip over all topics at |
| 3215 | ; lesser depths, which can not | 3215 | ; lesser depths, which can not |
| 3216 | ; have been disturbed: | 3216 | ; have been disturbed: |
| 3217 | (while (and (not (setq was-eobp (eobp))) | 3217 | (while (and (not (setq was-eobp (eobp))) |
| 3218 | (> (outline-recent-depth) ascender)) | 3218 | (> (allout-recent-depth) ascender)) |
| 3219 | (outline-next-heading)) | 3219 | (allout-next-heading)) |
| 3220 | ; Prime ascender for ascension: | 3220 | ; Prime ascender for ascension: |
| 3221 | (setq ascender (1- (outline-recent-depth))) | 3221 | (setq ascender (1- (allout-recent-depth))) |
| 3222 | (if (>= (outline-recent-depth) depth) | 3222 | (if (>= (allout-recent-depth) depth) |
| 3223 | (outline-rebullet-heading nil ;;; solicit | 3223 | (allout-rebullet-heading nil ;;; solicit |
| 3224 | nil ;;; depth | 3224 | nil ;;; depth |
| 3225 | nil ;;; number-control | 3225 | nil ;;; number-control |
| 3226 | nil ;;; index | 3226 | nil ;;; index |
| 3227 | t)) ;;; do-successors | 3227 | t)) ;;; do-successors |
| 3228 | (if was-eobp (goto-char (point-max))))) | 3228 | (if was-eobp (goto-char (point-max))))) |
| 3229 | (outline-recent-depth)) | 3229 | (allout-recent-depth)) |
| 3230 | ;;;_ > outline-number-siblings (&optional denumber) | 3230 | ;;;_ > allout-number-siblings (&optional denumber) |
| 3231 | (defun outline-number-siblings (&optional denumber) | 3231 | (defun allout-number-siblings (&optional denumber) |
| 3232 | "Assign numbered topic prefix to this topic and its siblings. | 3232 | "Assign numbered topic prefix to this topic and its siblings. |
| 3233 | 3233 | ||
| 3234 | With universal argument, denumber - assign default bullet to this | 3234 | With universal argument, denumber - assign default bullet to this |
| @@ -3240,44 +3240,44 @@ rebulleting each topic at this level." | |||
| 3240 | (interactive "P") | 3240 | (interactive "P") |
| 3241 | 3241 | ||
| 3242 | (save-excursion | 3242 | (save-excursion |
| 3243 | (outline-back-to-current-heading) | 3243 | (allout-back-to-current-heading) |
| 3244 | (outline-beginning-of-level) | 3244 | (allout-beginning-of-level) |
| 3245 | (let ((depth (outline-recent-depth)) | 3245 | (let ((depth (allout-recent-depth)) |
| 3246 | (index (if (not denumber) 1)) | 3246 | (index (if (not denumber) 1)) |
| 3247 | (use-bullet (equal '(16) denumber)) | 3247 | (use-bullet (equal '(16) denumber)) |
| 3248 | (more t)) | 3248 | (more t)) |
| 3249 | (while more | 3249 | (while more |
| 3250 | (outline-rebullet-heading use-bullet ;;; solicit | 3250 | (allout-rebullet-heading use-bullet ;;; solicit |
| 3251 | depth ;;; depth | 3251 | depth ;;; depth |
| 3252 | t ;;; number-control | 3252 | t ;;; number-control |
| 3253 | index ;;; index | 3253 | index ;;; index |
| 3254 | nil) ;;; do-successors | 3254 | nil) ;;; do-successors |
| 3255 | (if index (setq index (1+ index))) | 3255 | (if index (setq index (1+ index))) |
| 3256 | (setq more (outline-next-sibling depth nil)))))) | 3256 | (setq more (allout-next-sibling depth nil)))))) |
| 3257 | ;;;_ > outline-shift-in (arg) | 3257 | ;;;_ > allout-shift-in (arg) |
| 3258 | (defun outline-shift-in (arg) | 3258 | (defun allout-shift-in (arg) |
| 3259 | "Increase depth of current heading and any topics collapsed within it." | 3259 | "Increase depth of current heading and any topics collapsed within it." |
| 3260 | (interactive "p") | 3260 | (interactive "p") |
| 3261 | (outline-rebullet-topic arg)) | 3261 | (allout-rebullet-topic arg)) |
| 3262 | ;;;_ > outline-shift-out (arg) | 3262 | ;;;_ > allout-shift-out (arg) |
| 3263 | (defun outline-shift-out (arg) | 3263 | (defun allout-shift-out (arg) |
| 3264 | "Decrease depth of current heading and any topics collapsed within it." | 3264 | "Decrease depth of current heading and any topics collapsed within it." |
| 3265 | (interactive "p") | 3265 | (interactive "p") |
| 3266 | (outline-rebullet-topic (* arg -1))) | 3266 | (allout-rebullet-topic (* arg -1))) |
| 3267 | ;;;_ : Surgery (kill-ring) functions with special provisions for outlines: | 3267 | ;;;_ : Surgery (kill-ring) functions with special provisions for outlines: |
| 3268 | ;;;_ > outline-kill-line (&optional arg) | 3268 | ;;;_ > allout-kill-line (&optional arg) |
| 3269 | (defun outline-kill-line (&optional arg) | 3269 | (defun allout-kill-line (&optional arg) |
| 3270 | "Kill line, adjusting subsequent lines suitably for outline mode." | 3270 | "Kill line, adjusting subsequent lines suitably for outline mode." |
| 3271 | 3271 | ||
| 3272 | (interactive "*P") | 3272 | (interactive "*P") |
| 3273 | (if (not (and (outline-mode-p) ; active outline mode, | 3273 | (if (not (and (allout-mode-p) ; active outline mode, |
| 3274 | outline-numbered-bullet ; numbers may need adjustment, | 3274 | allout-numbered-bullet ; numbers may need adjustment, |
| 3275 | (bolp) ; may be clipping topic head, | 3275 | (bolp) ; may be clipping topic head, |
| 3276 | (looking-at outline-regexp))) ; are clipping topic head. | 3276 | (looking-at allout-regexp))) ; are clipping topic head. |
| 3277 | ;; Above conditions do not obtain - just do a regular kill: | 3277 | ;; Above conditions do not obtain - just do a regular kill: |
| 3278 | (kill-line arg) | 3278 | (kill-line arg) |
| 3279 | ;; Ah, have to watch out for adjustments: | 3279 | ;; Ah, have to watch out for adjustments: |
| 3280 | (let* ((depth (outline-depth))) | 3280 | (let* ((depth (allout-depth))) |
| 3281 | ; Do the kill: | 3281 | ; Do the kill: |
| 3282 | (kill-line arg) | 3282 | (kill-line arg) |
| 3283 | ; Provide some feedback: | 3283 | ; Provide some feedback: |
| @@ -3285,11 +3285,11 @@ rebulleting each topic at this level." | |||
| 3285 | (save-excursion | 3285 | (save-excursion |
| 3286 | ; Start with the topic | 3286 | ; Start with the topic |
| 3287 | ; following killed line: | 3287 | ; following killed line: |
| 3288 | (if (not (looking-at outline-regexp)) | 3288 | (if (not (looking-at allout-regexp)) |
| 3289 | (outline-next-heading)) | 3289 | (allout-next-heading)) |
| 3290 | (outline-renumber-to-depth depth))))) | 3290 | (allout-renumber-to-depth depth))))) |
| 3291 | ;;;_ > outline-kill-topic () | 3291 | ;;;_ > allout-kill-topic () |
| 3292 | (defun outline-kill-topic () | 3292 | (defun allout-kill-topic () |
| 3293 | "Kill topic together with subtopics. | 3293 | "Kill topic together with subtopics. |
| 3294 | 3294 | ||
| 3295 | Leaves primary topic's trailing vertical whitespace, if any." | 3295 | Leaves primary topic's trailing vertical whitespace, if any." |
| @@ -3301,9 +3301,9 @@ Leaves primary topic's trailing vertical whitespace, if any." | |||
| 3301 | ;; a lag *after* the kill has been performed. | 3301 | ;; a lag *after* the kill has been performed. |
| 3302 | 3302 | ||
| 3303 | (interactive) | 3303 | (interactive) |
| 3304 | (let* ((beg (prog1 (outline-back-to-current-heading)(beginning-of-line))) | 3304 | (let* ((beg (prog1 (allout-back-to-current-heading)(beginning-of-line))) |
| 3305 | (depth (outline-recent-depth))) | 3305 | (depth (allout-recent-depth))) |
| 3306 | (outline-end-of-current-subtree) | 3306 | (allout-end-of-current-subtree) |
| 3307 | (if (not (eobp)) | 3307 | (if (not (eobp)) |
| 3308 | (if (or (not (looking-at "^$")) | 3308 | (if (or (not (looking-at "^$")) |
| 3309 | ;; A blank line - cut it with this topic *unless* this | 3309 | ;; A blank line - cut it with this topic *unless* this |
| @@ -3311,18 +3311,18 @@ Leaves primary topic's trailing vertical whitespace, if any." | |||
| 3311 | ;; we'll leave the blank line as part of the | 3311 | ;; we'll leave the blank line as part of the |
| 3312 | ;; containing topic: | 3312 | ;; containing topic: |
| 3313 | (save-excursion | 3313 | (save-excursion |
| 3314 | (and (outline-next-heading) | 3314 | (and (allout-next-heading) |
| 3315 | (>= (outline-recent-depth) depth)))) | 3315 | (>= (allout-recent-depth) depth)))) |
| 3316 | (forward-char 1))) | 3316 | (forward-char 1))) |
| 3317 | 3317 | ||
| 3318 | (kill-region beg (point)) | 3318 | (kill-region beg (point)) |
| 3319 | (sit-for 0) | 3319 | (sit-for 0) |
| 3320 | (save-excursion | 3320 | (save-excursion |
| 3321 | (outline-renumber-to-depth depth)))) | 3321 | (allout-renumber-to-depth depth)))) |
| 3322 | ;;;_ > outline-yank-processing () | 3322 | ;;;_ > allout-yank-processing () |
| 3323 | (defun outline-yank-processing (&optional arg) | 3323 | (defun allout-yank-processing (&optional arg) |
| 3324 | 3324 | ||
| 3325 | "Incidental outline-specific business to be done just after text yanks. | 3325 | "Incidental allout-specific business to be done just after text yanks. |
| 3326 | 3326 | ||
| 3327 | Does depth adjustment of yanked topics, when: | 3327 | Does depth adjustment of yanked topics, when: |
| 3328 | 3328 | ||
| @@ -3338,7 +3338,7 @@ header into which it's being yanked. | |||
| 3338 | 3338 | ||
| 3339 | The point is left in front of yanked, adjusted topics, rather than | 3339 | The point is left in front of yanked, adjusted topics, rather than |
| 3340 | at the end (and vice-versa with the mark). Non-adjusted yanks, | 3340 | at the end (and vice-versa with the mark). Non-adjusted yanks, |
| 3341 | however, are left exactly like normal, non-outline-specific yanks." | 3341 | however, are left exactly like normal, non-allout-specific yanks." |
| 3342 | 3342 | ||
| 3343 | (interactive "*P") | 3343 | (interactive "*P") |
| 3344 | ; Get to beginning, leaving | 3344 | ; Get to beginning, leaving |
| @@ -3348,19 +3348,19 @@ however, are left exactly like normal, non-outline-specific yanks." | |||
| 3348 | (let* ((subj-beg (point)) | 3348 | (let* ((subj-beg (point)) |
| 3349 | (subj-end (my-mark-marker t)) | 3349 | (subj-end (my-mark-marker t)) |
| 3350 | ;; 'resituate' if yanking an entire topic into topic header: | 3350 | ;; 'resituate' if yanking an entire topic into topic header: |
| 3351 | (resituate (and (outline-e-o-prefix-p) | 3351 | (resituate (and (allout-e-o-prefix-p) |
| 3352 | (looking-at (concat "\\(" outline-regexp "\\)")) | 3352 | (looking-at (concat "\\(" allout-regexp "\\)")) |
| 3353 | (outline-prefix-data (match-beginning 1) | 3353 | (allout-prefix-data (match-beginning 1) |
| 3354 | (match-end 1)))) | 3354 | (match-end 1)))) |
| 3355 | ;; `rectify-numbering' if resituating (where several topics may | 3355 | ;; `rectify-numbering' if resituating (where several topics may |
| 3356 | ;; be resituating) or yanking a topic into a topic slot (bol): | 3356 | ;; be resituating) or yanking a topic into a topic slot (bol): |
| 3357 | (rectify-numbering (or resituate | 3357 | (rectify-numbering (or resituate |
| 3358 | (and (bolp) (looking-at outline-regexp))))) | 3358 | (and (bolp) (looking-at allout-regexp))))) |
| 3359 | (if resituate | 3359 | (if resituate |
| 3360 | ; The yanked stuff is a topic: | 3360 | ; The yanked stuff is a topic: |
| 3361 | (let* ((prefix-len (- (match-end 1) subj-beg)) | 3361 | (let* ((prefix-len (- (match-end 1) subj-beg)) |
| 3362 | (subj-depth (outline-recent-depth)) | 3362 | (subj-depth (allout-recent-depth)) |
| 3363 | (prefix-bullet (outline-recent-bullet)) | 3363 | (prefix-bullet (allout-recent-bullet)) |
| 3364 | (adjust-to-depth | 3364 | (adjust-to-depth |
| 3365 | ;; Nil if adjustment unnecessary, otherwise depth to which | 3365 | ;; Nil if adjustment unnecessary, otherwise depth to which |
| 3366 | ;; adjustment should be made: | 3366 | ;; adjustment should be made: |
| @@ -3368,17 +3368,17 @@ however, are left exactly like normal, non-outline-specific yanks." | |||
| 3368 | (and (goto-char subj-end) | 3368 | (and (goto-char subj-end) |
| 3369 | (eolp) | 3369 | (eolp) |
| 3370 | (goto-char subj-beg) | 3370 | (goto-char subj-beg) |
| 3371 | (and (looking-at outline-regexp) | 3371 | (and (looking-at allout-regexp) |
| 3372 | (progn | 3372 | (progn |
| 3373 | (beginning-of-line) | 3373 | (beginning-of-line) |
| 3374 | (not (= (point) subj-beg))) | 3374 | (not (= (point) subj-beg))) |
| 3375 | (looking-at outline-regexp) | 3375 | (looking-at allout-regexp) |
| 3376 | (outline-prefix-data (match-beginning 0) | 3376 | (allout-prefix-data (match-beginning 0) |
| 3377 | (match-end 0))) | 3377 | (match-end 0))) |
| 3378 | (outline-recent-depth)))) | 3378 | (allout-recent-depth)))) |
| 3379 | done | 3379 | done |
| 3380 | (more t)) | 3380 | (more t)) |
| 3381 | (setq rectify-numbering outline-numbered-bullet) | 3381 | (setq rectify-numbering allout-numbered-bullet) |
| 3382 | (if adjust-to-depth | 3382 | (if adjust-to-depth |
| 3383 | ; Do the adjustment: | 3383 | ; Do the adjustment: |
| 3384 | (progn | 3384 | (progn |
| @@ -3389,20 +3389,20 @@ however, are left exactly like normal, non-outline-specific yanks." | |||
| 3389 | ; line at end, if any: | 3389 | ; line at end, if any: |
| 3390 | (goto-char (point-max)) | 3390 | (goto-char (point-max)) |
| 3391 | (if (looking-at "^$") | 3391 | (if (looking-at "^$") |
| 3392 | (outline-unprotected (delete-char -1))) | 3392 | (allout-unprotected (delete-char -1))) |
| 3393 | ; Work backwards, with each | 3393 | ; Work backwards, with each |
| 3394 | ; shallowest level, | 3394 | ; shallowest level, |
| 3395 | ; successively excluding the | 3395 | ; successively excluding the |
| 3396 | ; last processed topic from | 3396 | ; last processed topic from |
| 3397 | ; the narrow region: | 3397 | ; the narrow region: |
| 3398 | (while more | 3398 | (while more |
| 3399 | (outline-back-to-current-heading) | 3399 | (allout-back-to-current-heading) |
| 3400 | ; go as high as we can in each bunch: | 3400 | ; go as high as we can in each bunch: |
| 3401 | (while (outline-ascend-to-depth (1- (outline-depth)))) | 3401 | (while (allout-ascend-to-depth (1- (allout-depth)))) |
| 3402 | (save-excursion | 3402 | (save-excursion |
| 3403 | (outline-rebullet-topic-grunt (- adjust-to-depth | 3403 | (allout-rebullet-topic-grunt (- adjust-to-depth |
| 3404 | subj-depth)) | 3404 | subj-depth)) |
| 3405 | (outline-depth)) | 3405 | (allout-depth)) |
| 3406 | (if (setq more (not (bobp))) | 3406 | (if (setq more (not (bobp))) |
| 3407 | (progn (widen) | 3407 | (progn (widen) |
| 3408 | (forward-char -1) | 3408 | (forward-char -1) |
| @@ -3411,7 +3411,7 @@ however, are left exactly like normal, non-outline-specific yanks." | |||
| 3411 | ;; Preserve new bullet if it's a distinctive one, otherwise | 3411 | ;; Preserve new bullet if it's a distinctive one, otherwise |
| 3412 | ;; use old one: | 3412 | ;; use old one: |
| 3413 | (if (string-match (regexp-quote prefix-bullet) | 3413 | (if (string-match (regexp-quote prefix-bullet) |
| 3414 | outline-distinctive-bullets-string) | 3414 | allout-distinctive-bullets-string) |
| 3415 | ; Delete from bullet of old to | 3415 | ; Delete from bullet of old to |
| 3416 | ; before bullet of new: | 3416 | ; before bullet of new: |
| 3417 | (progn | 3417 | (progn |
| @@ -3419,7 +3419,7 @@ however, are left exactly like normal, non-outline-specific yanks." | |||
| 3419 | (delete-region (point) subj-beg) | 3419 | (delete-region (point) subj-beg) |
| 3420 | (set-marker (my-mark-marker t) subj-end) | 3420 | (set-marker (my-mark-marker t) subj-end) |
| 3421 | (goto-char subj-beg) | 3421 | (goto-char subj-beg) |
| 3422 | (outline-end-of-prefix)) | 3422 | (allout-end-of-prefix)) |
| 3423 | ; Delete base subj prefix, | 3423 | ; Delete base subj prefix, |
| 3424 | ; leaving old one: | 3424 | ; leaving old one: |
| 3425 | (delete-region (point) (+ (point) | 3425 | (delete-region (point) (+ (point) |
| @@ -3437,25 +3437,25 @@ however, are left exactly like normal, non-outline-specific yanks." | |||
| 3437 | (message "... reconciling numbers") (sit-for 0) | 3437 | (message "... reconciling numbers") (sit-for 0) |
| 3438 | ; ... and renumber, in case necessary: | 3438 | ; ... and renumber, in case necessary: |
| 3439 | (goto-char subj-beg) | 3439 | (goto-char subj-beg) |
| 3440 | (if (outline-goto-prefix) | 3440 | (if (allout-goto-prefix) |
| 3441 | (outline-rebullet-heading nil ;;; solicit | 3441 | (allout-rebullet-heading nil ;;; solicit |
| 3442 | (outline-depth) ;;; depth | 3442 | (allout-depth) ;;; depth |
| 3443 | nil ;;; number-control | 3443 | nil ;;; number-control |
| 3444 | nil ;;; index | 3444 | nil ;;; index |
| 3445 | t)) | 3445 | t)) |
| 3446 | (message "")))) | 3446 | (message "")))) |
| 3447 | (if (not resituate) | 3447 | (if (not resituate) |
| 3448 | (exchange-point-and-mark)))) | 3448 | (exchange-point-and-mark)))) |
| 3449 | ;;;_ > outline-yank (&optional arg) | 3449 | ;;;_ > allout-yank (&optional arg) |
| 3450 | (defun outline-yank (&optional arg) | 3450 | (defun allout-yank (&optional arg) |
| 3451 | "Outline-mode yank, with depth and numbering adjustment of yanked topics. | 3451 | "Allout-mode yank, with depth and numbering adjustment of yanked topics. |
| 3452 | 3452 | ||
| 3453 | Non-topic yanks work no differently than normal yanks. | 3453 | Non-topic yanks work no differently than normal yanks. |
| 3454 | 3454 | ||
| 3455 | If a topic is being yanked into a bare topic prefix, the depth of the | 3455 | If a topic is being yanked into a bare topic prefix, the depth of the |
| 3456 | yanked topic is adjusted to the depth of the topic prefix. | 3456 | yanked topic is adjusted to the depth of the topic prefix. |
| 3457 | 3457 | ||
| 3458 | 1 we're yanking in an outline-mode buffer | 3458 | 1 we're yanking in an allout-mode buffer |
| 3459 | 2 the stuff being yanked starts with a valid outline header prefix, and | 3459 | 2 the stuff being yanked starts with a valid outline header prefix, and |
| 3460 | 3 it is being yanked at the end of a line which consists of only a valid | 3460 | 3 it is being yanked at the end of a line which consists of only a valid |
| 3461 | topic prefix. | 3461 | topic prefix. |
| @@ -3472,17 +3472,17 @@ exactly like normal yanks. | |||
| 3472 | Numbering of yanked topics, and the successive siblings at the depth | 3472 | Numbering of yanked topics, and the successive siblings at the depth |
| 3473 | into which they're being yanked, is adjusted. | 3473 | into which they're being yanked, is adjusted. |
| 3474 | 3474 | ||
| 3475 | Outline-yank-pop works with outline-yank just like normal yank-pop | 3475 | Allout-yank-pop works with allout-yank just like normal yank-pop |
| 3476 | works with normal yank in non-outline buffers." | 3476 | works with normal yank in non-outline buffers." |
| 3477 | 3477 | ||
| 3478 | (interactive "*P") | 3478 | (interactive "*P") |
| 3479 | (setq this-command 'yank) | 3479 | (setq this-command 'yank) |
| 3480 | (yank arg) | 3480 | (yank arg) |
| 3481 | (if (outline-mode-p) | 3481 | (if (allout-mode-p) |
| 3482 | (outline-yank-processing))) | 3482 | (allout-yank-processing))) |
| 3483 | ;;;_ > outline-yank-pop (&optional arg) | 3483 | ;;;_ > allout-yank-pop (&optional arg) |
| 3484 | (defun outline-yank-pop (&optional arg) | 3484 | (defun allout-yank-pop (&optional arg) |
| 3485 | "Yank-pop like outline-yank when popping to bare outline prefixes. | 3485 | "Yank-pop like allout-yank when popping to bare outline prefixes. |
| 3486 | 3486 | ||
| 3487 | Adapts level of popped topics to level of fresh prefix. | 3487 | Adapts level of popped topics to level of fresh prefix. |
| 3488 | 3488 | ||
| @@ -3492,26 +3492,26 @@ by pops to non-distinctive yanks. Bug..." | |||
| 3492 | (interactive "*p") | 3492 | (interactive "*p") |
| 3493 | (setq this-command 'yank) | 3493 | (setq this-command 'yank) |
| 3494 | (yank-pop arg) | 3494 | (yank-pop arg) |
| 3495 | (if (outline-mode-p) | 3495 | (if (allout-mode-p) |
| 3496 | (outline-yank-processing))) | 3496 | (allout-yank-processing))) |
| 3497 | 3497 | ||
| 3498 | ;;;_ - Specialty bullet functions | 3498 | ;;;_ - Specialty bullet functions |
| 3499 | ;;;_ : File Cross references | 3499 | ;;;_ : File Cross references |
| 3500 | ;;;_ > outline-resolve-xref () | 3500 | ;;;_ > allout-resolve-xref () |
| 3501 | (defun outline-resolve-xref () | 3501 | (defun allout-resolve-xref () |
| 3502 | "Pop to file associated with current heading, if it has an xref bullet. | 3502 | "Pop to file associated with current heading, if it has an xref bullet. |
| 3503 | 3503 | ||
| 3504 | \(Works according to setting of `outline-file-xref-bullet')." | 3504 | \(Works according to setting of `allout-file-xref-bullet')." |
| 3505 | (interactive) | 3505 | (interactive) |
| 3506 | (if (not outline-file-xref-bullet) | 3506 | (if (not allout-file-xref-bullet) |
| 3507 | (error | 3507 | (error |
| 3508 | "outline cross references disabled - no `outline-file-xref-bullet'") | 3508 | "outline cross references disabled - no `allout-file-xref-bullet'") |
| 3509 | (if (not (string= (outline-current-bullet) outline-file-xref-bullet)) | 3509 | (if (not (string= (allout-current-bullet) allout-file-xref-bullet)) |
| 3510 | (error "current heading lacks cross-reference bullet `%s'" | 3510 | (error "current heading lacks cross-reference bullet `%s'" |
| 3511 | outline-file-xref-bullet) | 3511 | allout-file-xref-bullet) |
| 3512 | (let (file-name) | 3512 | (let (file-name) |
| 3513 | (save-excursion | 3513 | (save-excursion |
| 3514 | (let* ((text-start outline-recent-prefix-end) | 3514 | (let* ((text-start allout-recent-prefix-end) |
| 3515 | (heading-end (progn (end-of-line) (point)))) | 3515 | (heading-end (progn (end-of-line) (point)))) |
| 3516 | (goto-char text-start) | 3516 | (goto-char text-start) |
| 3517 | (setq file-name | 3517 | (setq file-name |
| @@ -3542,48 +3542,48 @@ by pops to non-distinctive yanks. Bug..." | |||
| 3542 | ;;;_ #6 Exposure Control | 3542 | ;;;_ #6 Exposure Control |
| 3543 | 3543 | ||
| 3544 | ;;;_ - Fundamental | 3544 | ;;;_ - Fundamental |
| 3545 | ;;;_ > outline-flag-current-subtree (flag) | 3545 | ;;;_ > allout-flag-current-subtree (flag) |
| 3546 | (defun outline-flag-current-subtree (flag) | 3546 | (defun allout-flag-current-subtree (flag) |
| 3547 | "Hide or show subtree of currently-visible topic. | 3547 | "Hide or show subtree of currently-visible topic. |
| 3548 | 3548 | ||
| 3549 | See `outline-flag-region' for more details." | 3549 | See `allout-flag-region' for more details." |
| 3550 | 3550 | ||
| 3551 | (save-excursion | 3551 | (save-excursion |
| 3552 | (outline-back-to-current-heading) | 3552 | (allout-back-to-current-heading) |
| 3553 | (outline-flag-region (point) | 3553 | (allout-flag-region (point) |
| 3554 | (progn (outline-end-of-current-subtree) (1- (point))) | 3554 | (progn (allout-end-of-current-subtree) (1- (point))) |
| 3555 | flag))) | 3555 | flag))) |
| 3556 | 3556 | ||
| 3557 | ;;;_ - Topic-specific | 3557 | ;;;_ - Topic-specific |
| 3558 | ;;;_ > outline-show-entry () | 3558 | ;;;_ > allout-show-entry () |
| 3559 | (defun outline-show-entry () | 3559 | (defun allout-show-entry () |
| 3560 | "Like `outline-show-current-entry', reveals entries nested in hidden topics. | 3560 | "Like `allout-show-current-entry', reveals entries nested in hidden topics. |
| 3561 | 3561 | ||
| 3562 | This is a way to give restricted peek at a concealed locality without the | 3562 | This is a way to give restricted peek at a concealed locality without the |
| 3563 | expense of exposing its context, but can leave the outline with aberrant | 3563 | expense of exposing its context, but can leave the outline with aberrant |
| 3564 | exposure. outline-hide-current-entry-completely or outline-show-offshoot | 3564 | exposure. allout-hide-current-entry-completely or allout-show-offshoot |
| 3565 | should be used after the peek to rectify the exposure." | 3565 | should be used after the peek to rectify the exposure." |
| 3566 | 3566 | ||
| 3567 | (interactive) | 3567 | (interactive) |
| 3568 | (save-excursion | 3568 | (save-excursion |
| 3569 | (let ((at (point)) | 3569 | (let ((at (point)) |
| 3570 | beg end) | 3570 | beg end) |
| 3571 | (outline-goto-prefix) | 3571 | (allout-goto-prefix) |
| 3572 | (setq beg (if (= (preceding-char) ?\r) (1- (point)) (point))) | 3572 | (setq beg (if (= (preceding-char) ?\r) (1- (point)) (point))) |
| 3573 | (re-search-forward "[\n\r]" nil t) | 3573 | (re-search-forward "[\n\r]" nil t) |
| 3574 | (setq end (1- (if (< at (point)) | 3574 | (setq end (1- (if (< at (point)) |
| 3575 | ;; We're on topic head line - show only it: | 3575 | ;; We're on topic head line - show only it: |
| 3576 | (point) | 3576 | (point) |
| 3577 | ;; or we're in body - include it: | 3577 | ;; or we're in body - include it: |
| 3578 | (max beg (or (outline-pre-next-preface) (point)))))) | 3578 | (max beg (or (allout-pre-next-preface) (point)))))) |
| 3579 | (outline-flag-region beg end ?\n) | 3579 | (allout-flag-region beg end ?\n) |
| 3580 | (list beg end)))) | 3580 | (list beg end)))) |
| 3581 | ;;;_ > outline-show-children (&optional level strict) | 3581 | ;;;_ > allout-show-children (&optional level strict) |
| 3582 | (defun outline-show-children (&optional level strict) | 3582 | (defun allout-show-children (&optional level strict) |
| 3583 | 3583 | ||
| 3584 | "If point is visible, show all direct subheadings of this heading. | 3584 | "If point is visible, show all direct subheadings of this heading. |
| 3585 | 3585 | ||
| 3586 | Otherwise, do outline-show-to-offshoot, and then show subheadings. | 3586 | Otherwise, do allout-show-to-offshoot, and then show subheadings. |
| 3587 | 3587 | ||
| 3588 | Optional LEVEL specifies how many levels below the current level | 3588 | Optional LEVEL specifies how many levels below the current level |
| 3589 | should be shown, or all levels if t. Default is 1. | 3589 | should be shown, or all levels if t. Default is 1. |
| @@ -3599,61 +3599,61 @@ point of non-opened subtree?)" | |||
| 3599 | (interactive "p") | 3599 | (interactive "p") |
| 3600 | (let (max-pos) | 3600 | (let (max-pos) |
| 3601 | (if (and (not strict) | 3601 | (if (and (not strict) |
| 3602 | (outline-hidden-p)) | 3602 | (allout-hidden-p)) |
| 3603 | 3603 | ||
| 3604 | (progn (outline-show-to-offshoot) ; Point's concealed, open to | 3604 | (progn (allout-show-to-offshoot) ; Point's concealed, open to |
| 3605 | ; expose it. | 3605 | ; expose it. |
| 3606 | ;; Then recurse, but with "strict" set so we don't | 3606 | ;; Then recurse, but with "strict" set so we don't |
| 3607 | ;; infinite regress: | 3607 | ;; infinite regress: |
| 3608 | (setq max-pos (outline-show-children level t))) | 3608 | (setq max-pos (allout-show-children level t))) |
| 3609 | 3609 | ||
| 3610 | (save-excursion | 3610 | (save-excursion |
| 3611 | (save-restriction | 3611 | (save-restriction |
| 3612 | (let* ((start-pt (point)) | 3612 | (let* ((start-pt (point)) |
| 3613 | (chart (outline-chart-subtree (or level 1))) | 3613 | (chart (allout-chart-subtree (or level 1))) |
| 3614 | (to-reveal (outline-chart-to-reveal chart (or level 1)))) | 3614 | (to-reveal (allout-chart-to-reveal chart (or level 1)))) |
| 3615 | (goto-char start-pt) | 3615 | (goto-char start-pt) |
| 3616 | (if (and strict (= (preceding-char) ?\r)) | 3616 | (if (and strict (= (preceding-char) ?\r)) |
| 3617 | ;; Concealed root would already have been taken care of, | 3617 | ;; Concealed root would already have been taken care of, |
| 3618 | ;; unless strict was set. | 3618 | ;; unless strict was set. |
| 3619 | (progn | 3619 | (progn |
| 3620 | (outline-flag-region (point) (outline-snug-back) ?\n) | 3620 | (allout-flag-region (point) (allout-snug-back) ?\n) |
| 3621 | (if outline-show-bodies | 3621 | (if allout-show-bodies |
| 3622 | (progn (goto-char (car to-reveal)) | 3622 | (progn (goto-char (car to-reveal)) |
| 3623 | (outline-show-current-entry))))) | 3623 | (allout-show-current-entry))))) |
| 3624 | (while to-reveal | 3624 | (while to-reveal |
| 3625 | (goto-char (car to-reveal)) | 3625 | (goto-char (car to-reveal)) |
| 3626 | (outline-flag-region (point) (outline-snug-back) ?\n) | 3626 | (allout-flag-region (point) (allout-snug-back) ?\n) |
| 3627 | (if outline-show-bodies | 3627 | (if allout-show-bodies |
| 3628 | (progn (goto-char (car to-reveal)) | 3628 | (progn (goto-char (car to-reveal)) |
| 3629 | (outline-show-current-entry))) | 3629 | (allout-show-current-entry))) |
| 3630 | (setq to-reveal (cdr to-reveal))))))))) | 3630 | (setq to-reveal (cdr to-reveal))))))))) |
| 3631 | ;;;_ > outline-hide-point-reconcile () | 3631 | ;;;_ > allout-hide-point-reconcile () |
| 3632 | (defun outline-hide-reconcile () | 3632 | (defun allout-hide-reconcile () |
| 3633 | "Like `outline-hide-current-entry'; hides completely if within hidden region. | 3633 | "Like `allout-hide-current-entry'; hides completely if within hidden region. |
| 3634 | 3634 | ||
| 3635 | Specifically intended for aberrant exposure states, like entries that were | 3635 | Specifically intended for aberrant exposure states, like entries that were |
| 3636 | exposed by outline-show-entry but are within otherwise concealed regions." | 3636 | exposed by allout-show-entry but are within otherwise concealed regions." |
| 3637 | (interactive) | 3637 | (interactive) |
| 3638 | (save-excursion | 3638 | (save-excursion |
| 3639 | (outline-goto-prefix) | 3639 | (allout-goto-prefix) |
| 3640 | (outline-flag-region (if (not (bobp)) (1- (point)) (point)) | 3640 | (allout-flag-region (if (not (bobp)) (1- (point)) (point)) |
| 3641 | (progn (outline-pre-next-preface) | 3641 | (progn (allout-pre-next-preface) |
| 3642 | (if (= ?\r (following-char)) | 3642 | (if (= ?\r (following-char)) |
| 3643 | (point) | 3643 | (point) |
| 3644 | (1- (point)))) | 3644 | (1- (point)))) |
| 3645 | ?\r))) | 3645 | ?\r))) |
| 3646 | ;;;_ > outline-show-to-offshoot () | 3646 | ;;;_ > allout-show-to-offshoot () |
| 3647 | (defun outline-show-to-offshoot () | 3647 | (defun allout-show-to-offshoot () |
| 3648 | "Like outline-show-entry, but reveals all concealed ancestors, as well. | 3648 | "Like allout-show-entry, but reveals all concealed ancestors, as well. |
| 3649 | 3649 | ||
| 3650 | As with outline-hide-current-entry-completely, useful for rectifying | 3650 | As with allout-hide-current-entry-completely, useful for rectifying |
| 3651 | aberrant exposure states produced by outline-show-entry." | 3651 | aberrant exposure states produced by allout-show-entry." |
| 3652 | 3652 | ||
| 3653 | (interactive) | 3653 | (interactive) |
| 3654 | (save-excursion | 3654 | (save-excursion |
| 3655 | (let ((orig-pt (point)) | 3655 | (let ((orig-pt (point)) |
| 3656 | (orig-pref (outline-goto-prefix)) | 3656 | (orig-pref (allout-goto-prefix)) |
| 3657 | (last-at (point)) | 3657 | (last-at (point)) |
| 3658 | bag-it) | 3658 | bag-it) |
| 3659 | (while (or bag-it (= (preceding-char) ?\r)) | 3659 | (while (or bag-it (= (preceding-char) ?\r)) |
| @@ -3662,74 +3662,74 @@ aberrant exposure states produced by outline-show-entry." | |||
| 3662 | ;; Oops, we're not making any progress! Show the current | 3662 | ;; Oops, we're not making any progress! Show the current |
| 3663 | ;; topic completely, and bag this try. | 3663 | ;; topic completely, and bag this try. |
| 3664 | (progn (beginning-of-line) | 3664 | (progn (beginning-of-line) |
| 3665 | (outline-show-current-subtree) | 3665 | (allout-show-current-subtree) |
| 3666 | (goto-char orig-pt) | 3666 | (goto-char orig-pt) |
| 3667 | (setq bag-it t) | 3667 | (setq bag-it t) |
| 3668 | (beep) | 3668 | (beep) |
| 3669 | (message "%s: %s" | 3669 | (message "%s: %s" |
| 3670 | "outline-show-to-offshoot: " | 3670 | "allout-show-to-offshoot: " |
| 3671 | "Aberrant nesting encountered."))) | 3671 | "Aberrant nesting encountered."))) |
| 3672 | (outline-show-children) | 3672 | (allout-show-children) |
| 3673 | (goto-char orig-pref)) | 3673 | (goto-char orig-pref)) |
| 3674 | (goto-char orig-pt))) | 3674 | (goto-char orig-pt))) |
| 3675 | (if (outline-hidden-p) | 3675 | (if (allout-hidden-p) |
| 3676 | (outline-show-entry))) | 3676 | (allout-show-entry))) |
| 3677 | ;;;_ > outline-hide-current-entry () | 3677 | ;;;_ > allout-hide-current-entry () |
| 3678 | (defun outline-hide-current-entry () | 3678 | (defun allout-hide-current-entry () |
| 3679 | "Hide the body directly following this heading." | 3679 | "Hide the body directly following this heading." |
| 3680 | (interactive) | 3680 | (interactive) |
| 3681 | (outline-back-to-current-heading) | 3681 | (allout-back-to-current-heading) |
| 3682 | (save-excursion | 3682 | (save-excursion |
| 3683 | (outline-flag-region (point) | 3683 | (allout-flag-region (point) |
| 3684 | (progn (outline-end-of-current-entry) (point)) | 3684 | (progn (allout-end-of-current-entry) (point)) |
| 3685 | ?\r))) | 3685 | ?\r))) |
| 3686 | ;;;_ > outline-show-current-entry (&optional arg) | 3686 | ;;;_ > allout-show-current-entry (&optional arg) |
| 3687 | (defun outline-show-current-entry (&optional arg) | 3687 | (defun allout-show-current-entry (&optional arg) |
| 3688 | 3688 | ||
| 3689 | "Show body following current heading, or hide the entry if repeat count." | 3689 | "Show body following current heading, or hide the entry if repeat count." |
| 3690 | 3690 | ||
| 3691 | (interactive "P") | 3691 | (interactive "P") |
| 3692 | (if arg | 3692 | (if arg |
| 3693 | (outline-hide-current-entry) | 3693 | (allout-hide-current-entry) |
| 3694 | (save-excursion | 3694 | (save-excursion |
| 3695 | (outline-flag-region (point) | 3695 | (allout-flag-region (point) |
| 3696 | (progn (outline-end-of-current-entry) (point)) | 3696 | (progn (allout-end-of-current-entry) (point)) |
| 3697 | ?\n)))) | 3697 | ?\n)))) |
| 3698 | ;;;_ > outline-hide-current-entry-completely () | 3698 | ;;;_ > allout-hide-current-entry-completely () |
| 3699 | ; ... outline-hide-current-entry-completely also for isearch dynamic exposure: | 3699 | ; ... allout-hide-current-entry-completely also for isearch dynamic exposure: |
| 3700 | (defun outline-hide-current-entry-completely () | 3700 | (defun allout-hide-current-entry-completely () |
| 3701 | "Like outline-hide-current-entry, but conceal topic completely. | 3701 | "Like allout-hide-current-entry, but conceal topic completely. |
| 3702 | 3702 | ||
| 3703 | Specifically intended for aberrant exposure states, like entries that were | 3703 | Specifically intended for aberrant exposure states, like entries that were |
| 3704 | exposed by outline-show-entry but are within otherwise concealed regions." | 3704 | exposed by allout-show-entry but are within otherwise concealed regions." |
| 3705 | (interactive) | 3705 | (interactive) |
| 3706 | (save-excursion | 3706 | (save-excursion |
| 3707 | (outline-goto-prefix) | 3707 | (allout-goto-prefix) |
| 3708 | (outline-flag-region (if (not (bobp)) (1- (point)) (point)) | 3708 | (allout-flag-region (if (not (bobp)) (1- (point)) (point)) |
| 3709 | (progn (outline-pre-next-preface) | 3709 | (progn (allout-pre-next-preface) |
| 3710 | (if (= ?\r (following-char)) | 3710 | (if (= ?\r (following-char)) |
| 3711 | (point) | 3711 | (point) |
| 3712 | (1- (point)))) | 3712 | (1- (point)))) |
| 3713 | ?\r))) | 3713 | ?\r))) |
| 3714 | ;;;_ > outline-show-current-subtree (&optional arg) | 3714 | ;;;_ > allout-show-current-subtree (&optional arg) |
| 3715 | (defun outline-show-current-subtree (&optional arg) | 3715 | (defun allout-show-current-subtree (&optional arg) |
| 3716 | "Show everything within the current topic. With a repeat-count, | 3716 | "Show everything within the current topic. With a repeat-count, |
| 3717 | expose this topic and its siblings." | 3717 | expose this topic and its siblings." |
| 3718 | (interactive "P") | 3718 | (interactive "P") |
| 3719 | (save-excursion | 3719 | (save-excursion |
| 3720 | (if (<= (outline-current-depth) 0) | 3720 | (if (<= (allout-current-depth) 0) |
| 3721 | ;; Outside any topics - try to get to the first: | 3721 | ;; Outside any topics - try to get to the first: |
| 3722 | (if (not (outline-next-heading)) | 3722 | (if (not (allout-next-heading)) |
| 3723 | (error "No topics") | 3723 | (error "No topics") |
| 3724 | ;; got to first, outermost topic - set to expose it and siblings: | 3724 | ;; got to first, outermost topic - set to expose it and siblings: |
| 3725 | (message "Above outermost topic - exposing all.") | 3725 | (message "Above outermost topic - exposing all.") |
| 3726 | (outline-flag-region (point-min)(point-max) ?\n)) | 3726 | (allout-flag-region (point-min)(point-max) ?\n)) |
| 3727 | (if (not arg) | 3727 | (if (not arg) |
| 3728 | (outline-flag-current-subtree ?\n) | 3728 | (allout-flag-current-subtree ?\n) |
| 3729 | (outline-beginning-of-level) | 3729 | (allout-beginning-of-level) |
| 3730 | (outline-expose-topic '(* :)))))) | 3730 | (allout-expose-topic '(* :)))))) |
| 3731 | ;;;_ > outline-hide-current-subtree (&optional just-close) | 3731 | ;;;_ > allout-hide-current-subtree (&optional just-close) |
| 3732 | (defun outline-hide-current-subtree (&optional just-close) | 3732 | (defun allout-hide-current-subtree (&optional just-close) |
| 3733 | "Close the current topic, or containing topic if this one is already closed. | 3733 | "Close the current topic, or containing topic if this one is already closed. |
| 3734 | 3734 | ||
| 3735 | If this topic is closed and it's a top level topic, close this topic | 3735 | If this topic is closed and it's a top level topic, close this topic |
| @@ -3741,10 +3741,10 @@ siblings, even if the target topic is already closed." | |||
| 3741 | (interactive) | 3741 | (interactive) |
| 3742 | (let ((from (point)) | 3742 | (let ((from (point)) |
| 3743 | (orig-eol (progn (end-of-line) | 3743 | (orig-eol (progn (end-of-line) |
| 3744 | (if (not (outline-goto-prefix)) | 3744 | (if (not (allout-goto-prefix)) |
| 3745 | (error "No topics found") | 3745 | (error "No topics found") |
| 3746 | (end-of-line)(point))))) | 3746 | (end-of-line)(point))))) |
| 3747 | (outline-flag-current-subtree ?\r) | 3747 | (allout-flag-current-subtree ?\r) |
| 3748 | (goto-char from) | 3748 | (goto-char from) |
| 3749 | (if (and (= orig-eol (progn (goto-char orig-eol) | 3749 | (if (and (= orig-eol (progn (goto-char orig-eol) |
| 3750 | (end-of-line) | 3750 | (end-of-line) |
| @@ -3752,66 +3752,66 @@ siblings, even if the target topic is already closed." | |||
| 3752 | (not just-close) | 3752 | (not just-close) |
| 3753 | ;; Structure didn't change - try hiding current level: | 3753 | ;; Structure didn't change - try hiding current level: |
| 3754 | (goto-char from) | 3754 | (goto-char from) |
| 3755 | (if (outline-up-current-level 1 t) | 3755 | (if (allout-up-current-level 1 t) |
| 3756 | t | 3756 | t |
| 3757 | (goto-char 0) | 3757 | (goto-char 0) |
| 3758 | (let ((msg | 3758 | (let ((msg |
| 3759 | "Top-level topic already closed - closing siblings...")) | 3759 | "Top-level topic already closed - closing siblings...")) |
| 3760 | (message msg) | 3760 | (message msg) |
| 3761 | (outline-expose-topic '(0 :)) | 3761 | (allout-expose-topic '(0 :)) |
| 3762 | (message (concat msg " Done."))) | 3762 | (message (concat msg " Done."))) |
| 3763 | nil) | 3763 | nil) |
| 3764 | (/= (outline-recent-depth) 0)) | 3764 | (/= (allout-recent-depth) 0)) |
| 3765 | (outline-hide-current-subtree)) | 3765 | (allout-hide-current-subtree)) |
| 3766 | (goto-char from))) | 3766 | (goto-char from))) |
| 3767 | ;;;_ > outline-show-current-branches () | 3767 | ;;;_ > allout-show-current-branches () |
| 3768 | (defun outline-show-current-branches () | 3768 | (defun allout-show-current-branches () |
| 3769 | "Show all subheadings of this heading, but not their bodies." | 3769 | "Show all subheadings of this heading, but not their bodies." |
| 3770 | (interactive) | 3770 | (interactive) |
| 3771 | (beginning-of-line) | 3771 | (beginning-of-line) |
| 3772 | (outline-show-children t)) | 3772 | (allout-show-children t)) |
| 3773 | ;;;_ > outline-hide-current-leaves () | 3773 | ;;;_ > allout-hide-current-leaves () |
| 3774 | (defun outline-hide-current-leaves () | 3774 | (defun allout-hide-current-leaves () |
| 3775 | "Hide the bodies of the current topic and all its offspring." | 3775 | "Hide the bodies of the current topic and all its offspring." |
| 3776 | (interactive) | 3776 | (interactive) |
| 3777 | (outline-back-to-current-heading) | 3777 | (allout-back-to-current-heading) |
| 3778 | (outline-hide-region-body (point) (progn (outline-end-of-current-subtree) | 3778 | (allout-hide-region-body (point) (progn (allout-end-of-current-subtree) |
| 3779 | (point)))) | 3779 | (point)))) |
| 3780 | 3780 | ||
| 3781 | ;;;_ - Region and beyond | 3781 | ;;;_ - Region and beyond |
| 3782 | ;;;_ > outline-show-all () | 3782 | ;;;_ > allout-show-all () |
| 3783 | (defun outline-show-all () | 3783 | (defun allout-show-all () |
| 3784 | "Show all of the text in the buffer." | 3784 | "Show all of the text in the buffer." |
| 3785 | (interactive) | 3785 | (interactive) |
| 3786 | (message "Exposing entire buffer...") | 3786 | (message "Exposing entire buffer...") |
| 3787 | (outline-flag-region (point-min) (point-max) ?\n) | 3787 | (allout-flag-region (point-min) (point-max) ?\n) |
| 3788 | (message "Exposing entire buffer... Done.")) | 3788 | (message "Exposing entire buffer... Done.")) |
| 3789 | ;;;_ > outline-hide-bodies () | 3789 | ;;;_ > allout-hide-bodies () |
| 3790 | (defun outline-hide-bodies () | 3790 | (defun allout-hide-bodies () |
| 3791 | "Hide all of buffer except headings." | 3791 | "Hide all of buffer except headings." |
| 3792 | (interactive) | 3792 | (interactive) |
| 3793 | (outline-hide-region-body (point-min) (point-max))) | 3793 | (allout-hide-region-body (point-min) (point-max))) |
| 3794 | ;;;_ > outline-hide-region-body (start end) | 3794 | ;;;_ > allout-hide-region-body (start end) |
| 3795 | (defun outline-hide-region-body (start end) | 3795 | (defun allout-hide-region-body (start end) |
| 3796 | "Hide all body lines in the region, but not headings." | 3796 | "Hide all body lines in the region, but not headings." |
| 3797 | (save-excursion | 3797 | (save-excursion |
| 3798 | (save-restriction | 3798 | (save-restriction |
| 3799 | (narrow-to-region start end) | 3799 | (narrow-to-region start end) |
| 3800 | (goto-char (point-min)) | 3800 | (goto-char (point-min)) |
| 3801 | (while (not (eobp)) | 3801 | (while (not (eobp)) |
| 3802 | (outline-flag-region (point) | 3802 | (allout-flag-region (point) |
| 3803 | (progn (outline-pre-next-preface) (point)) ?\r) | 3803 | (progn (allout-pre-next-preface) (point)) ?\r) |
| 3804 | (if (not (eobp)) | 3804 | (if (not (eobp)) |
| 3805 | (forward-char | 3805 | (forward-char |
| 3806 | (if (looking-at "[\n\r][\n\r]") | 3806 | (if (looking-at "[\n\r][\n\r]") |
| 3807 | 2 1))))))) | 3807 | 2 1))))))) |
| 3808 | 3808 | ||
| 3809 | ;;;_ > outline-expose-topic (spec) | 3809 | ;;;_ > allout-expose-topic (spec) |
| 3810 | (defun outline-expose-topic (spec) | 3810 | (defun allout-expose-topic (spec) |
| 3811 | "Apply exposure specs to successive outline topic items. | 3811 | "Apply exposure specs to successive outline topic items. |
| 3812 | 3812 | ||
| 3813 | Use the more convenient frontend, `outline-new-exposure', if you don't | 3813 | Use the more convenient frontend, `allout-new-exposure', if you don't |
| 3814 | need evaluation of the arguments, or even better, the `outline-layout' | 3814 | need evaluation of the arguments, or even better, the `allout-layout' |
| 3815 | variable-keyed mode-activation/auto-exposure feature of allout outline | 3815 | variable-keyed mode-activation/auto-exposure feature of allout outline |
| 3816 | mode. See the respective documentation strings for more details. | 3816 | mode. See the respective documentation strings for more details. |
| 3817 | 3817 | ||
| @@ -3851,15 +3851,15 @@ Simple (numeric and null-list) specs are interpreted as follows: | |||
| 3851 | - - exposes the body of the corresponding topic. | 3851 | - - exposes the body of the corresponding topic. |
| 3852 | 3852 | ||
| 3853 | Examples: | 3853 | Examples: |
| 3854 | \(outline-expose-topic '(-1 : 0)) | 3854 | \(allout-expose-topic '(-1 : 0)) |
| 3855 | Close this and all following topics at current level, exposing | 3855 | Close this and all following topics at current level, exposing |
| 3856 | only their immediate children, but close down the last topic | 3856 | only their immediate children, but close down the last topic |
| 3857 | at this current level completely. | 3857 | at this current level completely. |
| 3858 | \(outline-expose-topic '(-1 () : 1 0)) | 3858 | \(allout-expose-topic '(-1 () : 1 0)) |
| 3859 | Close current topic so only the immediate subtopics are shown; | 3859 | Close current topic so only the immediate subtopics are shown; |
| 3860 | show the children in the second to last topic, and completely | 3860 | show the children in the second to last topic, and completely |
| 3861 | close the last one. | 3861 | close the last one. |
| 3862 | \(outline-expose-topic '(-2 : -1 *)) | 3862 | \(allout-expose-topic '(-2 : -1 *)) |
| 3863 | Expose children and grandchildren of all topics at current | 3863 | Expose children and grandchildren of all topics at current |
| 3864 | level except the last two; expose children of the second to | 3864 | level except the last two; expose children of the second to |
| 3865 | last and completely open the last one." | 3865 | last and completely open the last one." |
| @@ -3867,7 +3867,7 @@ Examples: | |||
| 3867 | (interactive "xExposure spec: ") | 3867 | (interactive "xExposure spec: ") |
| 3868 | (if (not (listp spec)) | 3868 | (if (not (listp spec)) |
| 3869 | nil | 3869 | nil |
| 3870 | (let ((depth (outline-depth)) | 3870 | (let ((depth (allout-depth)) |
| 3871 | (max-pos 0) | 3871 | (max-pos 0) |
| 3872 | prev-elem curr-elem | 3872 | prev-elem curr-elem |
| 3873 | stay done | 3873 | stay done |
| @@ -3880,53 +3880,53 @@ Examples: | |||
| 3880 | (cond ; Do current element: | 3880 | (cond ; Do current element: |
| 3881 | ((null curr-elem) nil) | 3881 | ((null curr-elem) nil) |
| 3882 | ((symbolp curr-elem) | 3882 | ((symbolp curr-elem) |
| 3883 | (cond ((eq curr-elem '*) (outline-show-current-subtree) | 3883 | (cond ((eq curr-elem '*) (allout-show-current-subtree) |
| 3884 | (if (> outline-recent-end-of-subtree max-pos) | 3884 | (if (> allout-recent-end-of-subtree max-pos) |
| 3885 | (setq max-pos outline-recent-end-of-subtree))) | 3885 | (setq max-pos allout-recent-end-of-subtree))) |
| 3886 | ((eq curr-elem '+) (outline-show-current-branches) | 3886 | ((eq curr-elem '+) (allout-show-current-branches) |
| 3887 | (if (> outline-recent-end-of-subtree max-pos) | 3887 | (if (> allout-recent-end-of-subtree max-pos) |
| 3888 | (setq max-pos outline-recent-end-of-subtree))) | 3888 | (setq max-pos allout-recent-end-of-subtree))) |
| 3889 | ((eq curr-elem '-) (outline-show-current-entry)) | 3889 | ((eq curr-elem '-) (allout-show-current-entry)) |
| 3890 | ((eq curr-elem ':) | 3890 | ((eq curr-elem ':) |
| 3891 | (setq stay t) | 3891 | (setq stay t) |
| 3892 | ;; Expand the `repeat' spec to an explicit version, | 3892 | ;; Expand the `repeat' spec to an explicit version, |
| 3893 | ;; w.r.t. remaining siblings: | 3893 | ;; w.r.t. remaining siblings: |
| 3894 | (let ((residue ; = # of sibs not covered by remaining spec | 3894 | (let ((residue ; = # of sibs not covered by remaining spec |
| 3895 | ;; Dang - could be nice to make use of the chart, sigh: | 3895 | ;; Dang - could be nice to make use of the chart, sigh: |
| 3896 | (- (length (outline-chart-siblings)) | 3896 | (- (length (allout-chart-siblings)) |
| 3897 | (length spec)))) | 3897 | (length spec)))) |
| 3898 | (if (< 0 residue) | 3898 | (if (< 0 residue) |
| 3899 | ;; Some residue - cover it with prev-elem: | 3899 | ;; Some residue - cover it with prev-elem: |
| 3900 | (setq spec (append (make-list residue prev-elem) | 3900 | (setq spec (append (make-list residue prev-elem) |
| 3901 | spec))))))) | 3901 | spec))))))) |
| 3902 | ((numberp curr-elem) | 3902 | ((numberp curr-elem) |
| 3903 | (if (and (>= 0 curr-elem) (outline-visible-p)) | 3903 | (if (and (>= 0 curr-elem) (allout-visible-p)) |
| 3904 | (save-excursion (outline-hide-current-subtree t) | 3904 | (save-excursion (allout-hide-current-subtree t) |
| 3905 | (if (> 0 curr-elem) | 3905 | (if (> 0 curr-elem) |
| 3906 | nil | 3906 | nil |
| 3907 | (if (> outline-recent-end-of-subtree max-pos) | 3907 | (if (> allout-recent-end-of-subtree max-pos) |
| 3908 | (setq max-pos | 3908 | (setq max-pos |
| 3909 | outline-recent-end-of-subtree))))) | 3909 | allout-recent-end-of-subtree))))) |
| 3910 | (if (> (abs curr-elem) 0) | 3910 | (if (> (abs curr-elem) 0) |
| 3911 | (progn (outline-show-children (abs curr-elem)) | 3911 | (progn (allout-show-children (abs curr-elem)) |
| 3912 | (if (> outline-recent-end-of-subtree max-pos) | 3912 | (if (> allout-recent-end-of-subtree max-pos) |
| 3913 | (setq max-pos outline-recent-end-of-subtree))))) | 3913 | (setq max-pos allout-recent-end-of-subtree))))) |
| 3914 | ((listp curr-elem) | 3914 | ((listp curr-elem) |
| 3915 | (if (outline-descend-to-depth (1+ depth)) | 3915 | (if (allout-descend-to-depth (1+ depth)) |
| 3916 | (let ((got (outline-expose-topic curr-elem))) | 3916 | (let ((got (allout-expose-topic curr-elem))) |
| 3917 | (if (and got (> got max-pos)) (setq max-pos got)))))) | 3917 | (if (and got (> got max-pos)) (setq max-pos got)))))) |
| 3918 | (cond (stay (setq stay nil)) | 3918 | (cond (stay (setq stay nil)) |
| 3919 | ((listp (car spec)) nil) | 3919 | ((listp (car spec)) nil) |
| 3920 | ((> max-pos (point)) | 3920 | ((> max-pos (point)) |
| 3921 | ;; Capitalize on max-pos state to get us nearer next sibling: | 3921 | ;; Capitalize on max-pos state to get us nearer next sibling: |
| 3922 | (progn (goto-char (min (point-max) max-pos)) | 3922 | (progn (goto-char (min (point-max) max-pos)) |
| 3923 | (outline-next-heading))) | 3923 | (allout-next-heading))) |
| 3924 | ((outline-next-sibling depth)))) | 3924 | ((allout-next-sibling depth)))) |
| 3925 | max-pos))) | 3925 | max-pos))) |
| 3926 | ;;;_ > outline-old-expose-topic (spec &rest followers) | 3926 | ;;;_ > allout-old-expose-topic (spec &rest followers) |
| 3927 | (defun outline-old-expose-topic (spec &rest followers) | 3927 | (defun allout-old-expose-topic (spec &rest followers) |
| 3928 | 3928 | ||
| 3929 | "Deprecated. Use outline-expose-topic \(with different schema | 3929 | "Deprecated. Use allout-expose-topic \(with different schema |
| 3930 | format) instead. | 3930 | format) instead. |
| 3931 | 3931 | ||
| 3932 | Dictate wholesale exposure scheme for current topic, according to SPEC. | 3932 | Dictate wholesale exposure scheme for current topic, according to SPEC. |
| @@ -3959,17 +3959,17 @@ for the corresponding offspring of the topic. | |||
| 3959 | Optional FOLLOWER arguments dictate exposure for succeeding siblings." | 3959 | Optional FOLLOWER arguments dictate exposure for succeeding siblings." |
| 3960 | 3960 | ||
| 3961 | (interactive "xExposure spec: ") | 3961 | (interactive "xExposure spec: ") |
| 3962 | (let ((depth (outline-current-depth)) | 3962 | (let ((depth (allout-current-depth)) |
| 3963 | done | 3963 | done |
| 3964 | max-pos) | 3964 | max-pos) |
| 3965 | (cond ((null spec) nil) | 3965 | (cond ((null spec) nil) |
| 3966 | ((symbolp spec) | 3966 | ((symbolp spec) |
| 3967 | (if (eq spec '*) (outline-show-current-subtree)) | 3967 | (if (eq spec '*) (allout-show-current-subtree)) |
| 3968 | (if (eq spec '+) (outline-show-current-branches)) | 3968 | (if (eq spec '+) (allout-show-current-branches)) |
| 3969 | (if (eq spec '-) (outline-show-current-entry))) | 3969 | (if (eq spec '-) (allout-show-current-entry))) |
| 3970 | ((numberp spec) | 3970 | ((numberp spec) |
| 3971 | (if (>= 0 spec) | 3971 | (if (>= 0 spec) |
| 3972 | (save-excursion (outline-hide-current-subtree t) | 3972 | (save-excursion (allout-hide-current-subtree t) |
| 3973 | (end-of-line) | 3973 | (end-of-line) |
| 3974 | (if (or (not max-pos) | 3974 | (if (or (not max-pos) |
| 3975 | (> (point) max-pos)) | 3975 | (> (point) max-pos)) |
| @@ -3977,19 +3977,19 @@ Optional FOLLOWER arguments dictate exposure for succeeding siblings." | |||
| 3977 | (if (> 0 spec) | 3977 | (if (> 0 spec) |
| 3978 | (setq spec (* -1 spec))))) | 3978 | (setq spec (* -1 spec))))) |
| 3979 | (if (> spec 0) | 3979 | (if (> spec 0) |
| 3980 | (outline-show-children spec))) | 3980 | (allout-show-children spec))) |
| 3981 | ((listp spec) | 3981 | ((listp spec) |
| 3982 | ;(let ((got (outline-old-expose-topic (car spec)))) | 3982 | ;(let ((got (allout-old-expose-topic (car spec)))) |
| 3983 | ; (if (and got (or (not max-pos) (> got max-pos))) | 3983 | ; (if (and got (or (not max-pos) (> got max-pos))) |
| 3984 | ; (setq max-pos got))) | 3984 | ; (setq max-pos got))) |
| 3985 | (let ((new-depth (+ (outline-current-depth) 1)) | 3985 | (let ((new-depth (+ (allout-current-depth) 1)) |
| 3986 | got) | 3986 | got) |
| 3987 | (setq max-pos (outline-old-expose-topic (car spec))) | 3987 | (setq max-pos (allout-old-expose-topic (car spec))) |
| 3988 | (setq spec (cdr spec)) | 3988 | (setq spec (cdr spec)) |
| 3989 | (if (and spec | 3989 | (if (and spec |
| 3990 | (outline-descend-to-depth new-depth) | 3990 | (allout-descend-to-depth new-depth) |
| 3991 | (not (outline-hidden-p))) | 3991 | (not (allout-hidden-p))) |
| 3992 | (progn (setq got (apply 'outline-old-expose-topic spec)) | 3992 | (progn (setq got (apply 'allout-old-expose-topic spec)) |
| 3993 | (if (and got (or (not max-pos) (> got max-pos))) | 3993 | (if (and got (or (not max-pos) (> got max-pos))) |
| 3994 | (setq max-pos got))))))) | 3994 | (setq max-pos got))))))) |
| 3995 | (while (and followers | 3995 | (while (and followers |
| @@ -3997,57 +3997,57 @@ Optional FOLLOWER arguments dictate exposure for succeeding siblings." | |||
| 3997 | (progn (goto-char max-pos) | 3997 | (progn (goto-char max-pos) |
| 3998 | (setq max-pos nil))) | 3998 | (setq max-pos nil))) |
| 3999 | (end-of-line) | 3999 | (end-of-line) |
| 4000 | (outline-next-sibling depth))) | 4000 | (allout-next-sibling depth))) |
| 4001 | (outline-old-expose-topic (car followers)) | 4001 | (allout-old-expose-topic (car followers)) |
| 4002 | (setq followers (cdr followers))) | 4002 | (setq followers (cdr followers))) |
| 4003 | max-pos)) | 4003 | max-pos)) |
| 4004 | ;;;_ > outline-new-exposure '() | 4004 | ;;;_ > allout-new-exposure '() |
| 4005 | (defmacro outline-new-exposure (&rest spec) | 4005 | (defmacro allout-new-exposure (&rest spec) |
| 4006 | "Literal frontend for `outline-expose-topic', doesn't evaluate arguments. | 4006 | "Literal frontend for `allout-expose-topic', doesn't evaluate arguments. |
| 4007 | Some arguments that would need to be quoted in outline-expose-topic | 4007 | Some arguments that would need to be quoted in allout-expose-topic |
| 4008 | need not be quoted in outline-new-exposure. | 4008 | need not be quoted in allout-new-exposure. |
| 4009 | 4009 | ||
| 4010 | Cursor is left at start position. | 4010 | Cursor is left at start position. |
| 4011 | 4011 | ||
| 4012 | Use this instead of obsolete `outline-exposure'. | 4012 | Use this instead of obsolete `allout-exposure'. |
| 4013 | 4013 | ||
| 4014 | Examples: | 4014 | Examples: |
| 4015 | \(outline-exposure (-1 () () () 1) 0) | 4015 | \(allout-exposure (-1 () () () 1) 0) |
| 4016 | Close current topic at current level so only the immediate | 4016 | Close current topic at current level so only the immediate |
| 4017 | subtopics are shown, except also show the children of the | 4017 | subtopics are shown, except also show the children of the |
| 4018 | third subtopic; and close the next topic at the current level. | 4018 | third subtopic; and close the next topic at the current level. |
| 4019 | \(outline-exposure : -1 0) | 4019 | \(allout-exposure : -1 0) |
| 4020 | Close all topics at current level to expose only their | 4020 | Close all topics at current level to expose only their |
| 4021 | immediate children, except for the last topic at the current | 4021 | immediate children, except for the last topic at the current |
| 4022 | level, in which even its immediate children are hidden. | 4022 | level, in which even its immediate children are hidden. |
| 4023 | \(outline-exposure -2 : -1 *) | 4023 | \(allout-exposure -2 : -1 *) |
| 4024 | Expose children and grandchildren of first topic at current | 4024 | Expose children and grandchildren of first topic at current |
| 4025 | level, and expose children of subsequent topics at current | 4025 | level, and expose children of subsequent topics at current |
| 4026 | level *except* for the last, which should be opened completely." | 4026 | level *except* for the last, which should be opened completely." |
| 4027 | (list 'save-excursion | 4027 | (list 'save-excursion |
| 4028 | '(if (not (or (outline-goto-prefix) | 4028 | '(if (not (or (allout-goto-prefix) |
| 4029 | (outline-next-heading))) | 4029 | (allout-next-heading))) |
| 4030 | (error "outline-new-exposure: Can't find any outline topics")) | 4030 | (error "allout-new-exposure: Can't find any outline topics")) |
| 4031 | (list 'outline-expose-topic (list 'quote spec)))) | 4031 | (list 'allout-expose-topic (list 'quote spec)))) |
| 4032 | ;;;_ > outline-exposure '() | 4032 | ;;;_ > allout-exposure '() |
| 4033 | (defmacro outline-exposure (&rest spec) | 4033 | (defmacro allout-exposure (&rest spec) |
| 4034 | "Being deprecated - use more recent `outline-new-exposure' instead. | 4034 | "Being deprecated - use more recent `allout-new-exposure' instead. |
| 4035 | 4035 | ||
| 4036 | Literal frontend for `outline-old-expose-topic', doesn't evaluate arguments | 4036 | Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments |
| 4037 | and retains start position." | 4037 | and retains start position." |
| 4038 | (list 'save-excursion | 4038 | (list 'save-excursion |
| 4039 | '(if (not (or (outline-goto-prefix) | 4039 | '(if (not (or (allout-goto-prefix) |
| 4040 | (outline-next-heading))) | 4040 | (allout-next-heading))) |
| 4041 | (error "Can't find any outline topics")) | 4041 | (error "Can't find any outline topics")) |
| 4042 | (cons 'outline-old-expose-topic | 4042 | (cons 'allout-old-expose-topic |
| 4043 | (mapcar (function (lambda (x) (list 'quote x))) spec)))) | 4043 | (mapcar (function (lambda (x) (list 'quote x))) spec)))) |
| 4044 | 4044 | ||
| 4045 | ;;;_ #7 Systematic outline presentation - copying, printing, flattening | 4045 | ;;;_ #7 Systematic outline presentation - copying, printing, flattening |
| 4046 | 4046 | ||
| 4047 | ;;;_ - Mapping and processing of topics | 4047 | ;;;_ - Mapping and processing of topics |
| 4048 | ;;;_ ( See also Subtree Charting, in Navigation code.) | 4048 | ;;;_ ( See also Subtree Charting, in Navigation code.) |
| 4049 | ;;;_ > outline-stringify-flat-index (flat-index) | 4049 | ;;;_ > allout-stringify-flat-index (flat-index) |
| 4050 | (defun outline-stringify-flat-index (flat-index &optional context) | 4050 | (defun allout-stringify-flat-index (flat-index &optional context) |
| 4051 | "Convert list representing section/subsection/... to document string. | 4051 | "Convert list representing section/subsection/... to document string. |
| 4052 | 4052 | ||
| 4053 | Optional arg CONTEXT indicates interior levels to include." | 4053 | Optional arg CONTEXT indicates interior levels to include." |
| @@ -4080,8 +4080,8 @@ Optional arg CONTEXT indicates interior levels to include." | |||
| 4080 | ;; Dispose of single extra delim: | 4080 | ;; Dispose of single extra delim: |
| 4081 | (setq result (cdr result)))) | 4081 | (setq result (cdr result)))) |
| 4082 | (apply 'concat result))) | 4082 | (apply 'concat result))) |
| 4083 | ;;;_ > outline-stringify-flat-index-plain (flat-index) | 4083 | ;;;_ > allout-stringify-flat-index-plain (flat-index) |
| 4084 | (defun outline-stringify-flat-index-plain (flat-index) | 4084 | (defun allout-stringify-flat-index-plain (flat-index) |
| 4085 | "Convert list representing section/subsection/... to document string." | 4085 | "Convert list representing section/subsection/... to document string." |
| 4086 | (let ((delim ".") | 4086 | (let ((delim ".") |
| 4087 | result) | 4087 | result) |
| @@ -4091,8 +4091,8 @@ Optional arg CONTEXT indicates interior levels to include." | |||
| 4091 | (cons delim result)))) | 4091 | (cons delim result)))) |
| 4092 | (setq flat-index (cdr flat-index))) | 4092 | (setq flat-index (cdr flat-index))) |
| 4093 | (apply 'concat result))) | 4093 | (apply 'concat result))) |
| 4094 | ;;;_ > outline-stringify-flat-index-indented (flat-index) | 4094 | ;;;_ > allout-stringify-flat-index-indented (flat-index) |
| 4095 | (defun outline-stringify-flat-index-indented (flat-index) | 4095 | (defun allout-stringify-flat-index-indented (flat-index) |
| 4096 | "Convert list representing section/subsection/... to document string." | 4096 | "Convert list representing section/subsection/... to document string." |
| 4097 | (let ((delim ".") | 4097 | (let ((delim ".") |
| 4098 | result | 4098 | result |
| @@ -4120,12 +4120,12 @@ Optional arg CONTEXT indicates interior levels to include." | |||
| 4120 | ;; Dispose of single extra delim: | 4120 | ;; Dispose of single extra delim: |
| 4121 | (setq result (cdr result)))) | 4121 | (setq result (cdr result)))) |
| 4122 | (apply 'concat result))) | 4122 | (apply 'concat result))) |
| 4123 | ;;;_ > outline-listify-exposed (&optional start end format) | 4123 | ;;;_ > allout-listify-exposed (&optional start end format) |
| 4124 | (defun outline-listify-exposed (&optional start end format) | 4124 | (defun allout-listify-exposed (&optional start end format) |
| 4125 | 4125 | ||
| 4126 | "Produce a list representing exposed topics in current region. | 4126 | "Produce a list representing exposed topics in current region. |
| 4127 | 4127 | ||
| 4128 | This list can then be used by `outline-process-exposed' to manipulate | 4128 | This list can then be used by `allout-process-exposed' to manipulate |
| 4129 | the subject region. | 4129 | the subject region. |
| 4130 | 4130 | ||
| 4131 | Optional START and END indicate bounds of region. | 4131 | Optional START and END indicate bounds of region. |
| @@ -4158,20 +4158,20 @@ header and body. The elements of that list are: | |||
| 4158 | (goto-char start) | 4158 | (goto-char start) |
| 4159 | (beginning-of-line) | 4159 | (beginning-of-line) |
| 4160 | ;; Goto initial topic, and register preceeding stuff, if any: | 4160 | ;; Goto initial topic, and register preceeding stuff, if any: |
| 4161 | (if (> (outline-goto-prefix) start) | 4161 | (if (> (allout-goto-prefix) start) |
| 4162 | ;; First topic follows beginning point - register preliminary stuff: | 4162 | ;; First topic follows beginning point - register preliminary stuff: |
| 4163 | (setq result (list (list 0 "" nil | 4163 | (setq result (list (list 0 "" nil |
| 4164 | (buffer-substring start (1- (point))))))) | 4164 | (buffer-substring start (1- (point))))))) |
| 4165 | (while (and (not done) | 4165 | (while (and (not done) |
| 4166 | (not (eobp)) ; Loop until we've covered the region. | 4166 | (not (eobp)) ; Loop until we've covered the region. |
| 4167 | (not (> (point) end))) | 4167 | (not (> (point) end))) |
| 4168 | (setq depth (outline-recent-depth) ; Current topics depth, | 4168 | (setq depth (allout-recent-depth) ; Current topics depth, |
| 4169 | bullet (outline-recent-bullet) ; ... bullet, | 4169 | bullet (allout-recent-bullet) ; ... bullet, |
| 4170 | prefix (outline-recent-prefix) | 4170 | prefix (allout-recent-prefix) |
| 4171 | beg (progn (outline-end-of-prefix t) (point))) ; and beginning. | 4171 | beg (progn (allout-end-of-prefix t) (point))) ; and beginning. |
| 4172 | (setq done ; The boundary for the current topic: | 4172 | (setq done ; The boundary for the current topic: |
| 4173 | (not (outline-next-visible-heading 1))) | 4173 | (not (allout-next-visible-heading 1))) |
| 4174 | (setq new-depth (outline-recent-depth)) | 4174 | (setq new-depth (allout-recent-depth)) |
| 4175 | (setq gone-out out | 4175 | (setq gone-out out |
| 4176 | out (< new-depth depth)) | 4176 | out (< new-depth depth)) |
| 4177 | (beginning-of-line) | 4177 | (beginning-of-line) |
| @@ -4202,14 +4202,14 @@ header and body. The elements of that list are: | |||
| 4202 | (if format | 4202 | (if format |
| 4203 | (let ((special (if (string-match | 4203 | (let ((special (if (string-match |
| 4204 | (regexp-quote bullet) | 4204 | (regexp-quote bullet) |
| 4205 | outline-distinctive-bullets-string) | 4205 | allout-distinctive-bullets-string) |
| 4206 | bullet))) | 4206 | bullet))) |
| 4207 | (cond ((listp format) | 4207 | (cond ((listp format) |
| 4208 | (list depth | 4208 | (list depth |
| 4209 | (if outline-abbreviate-flattened-numbering | 4209 | (if allout-abbreviate-flattened-numbering |
| 4210 | (outline-stringify-flat-index format | 4210 | (allout-stringify-flat-index format |
| 4211 | gone-out) | 4211 | gone-out) |
| 4212 | (outline-stringify-flat-index-plain | 4212 | (allout-stringify-flat-index-plain |
| 4213 | format)) | 4213 | format)) |
| 4214 | strings | 4214 | strings |
| 4215 | special)) | 4215 | special)) |
| @@ -4222,7 +4222,7 @@ header and body. The elements of that list are: | |||
| 4222 | (list depth | 4222 | (list depth |
| 4223 | (make-string depth ? ) | 4223 | (make-string depth ? ) |
| 4224 | strings))) | 4224 | strings))) |
| 4225 | (t (error "outline-listify-exposed: %s %s" | 4225 | (t (error "allout-listify-exposed: %s %s" |
| 4226 | "invalid format" format)))) | 4226 | "invalid format" format)))) |
| 4227 | (list depth prefix strings)) | 4227 | (list depth prefix strings)) |
| 4228 | result)) | 4228 | result)) |
| @@ -4245,9 +4245,9 @@ header and body. The elements of that list are: | |||
| 4245 | (cdr format))))))) | 4245 | (cdr format))))))) |
| 4246 | ;; Put the list with first at front, to last at back: | 4246 | ;; Put the list with first at front, to last at back: |
| 4247 | (nreverse result)))) | 4247 | (nreverse result)))) |
| 4248 | ;;;_ > outline-process-exposed (&optional func from to frombuf | 4248 | ;;;_ > allout-process-exposed (&optional func from to frombuf |
| 4249 | ;;; tobuf format) | 4249 | ;;; tobuf format) |
| 4250 | (defun outline-process-exposed (&optional func from to frombuf tobuf | 4250 | (defun allout-process-exposed (&optional func from to frombuf tobuf |
| 4251 | format &optional start-num) | 4251 | format &optional start-num) |
| 4252 | "Map function on exposed parts of current topic; results to another buffer. | 4252 | "Map function on exposed parts of current topic; results to another buffer. |
| 4253 | 4253 | ||
| @@ -4266,7 +4266,7 @@ alternate presentation form: | |||
| 4266 | except for distinctive bullets. | 4266 | except for distinctive bullets. |
| 4267 | 4267 | ||
| 4268 | Defaults: | 4268 | Defaults: |
| 4269 | FUNCTION: `outline-insert-listified' | 4269 | FUNCTION: `allout-insert-listified' |
| 4270 | FROM: region start, if region active, else start of buffer | 4270 | FROM: region start, if region active, else start of buffer |
| 4271 | TO: region end, if region active, else end of buffer | 4271 | TO: region end, if region active, else end of buffer |
| 4272 | FROMBUF: current buffer | 4272 | FROMBUF: current buffer |
| @@ -4275,7 +4275,7 @@ Defaults: | |||
| 4275 | 4275 | ||
| 4276 | ; Resolve arguments, | 4276 | ; Resolve arguments, |
| 4277 | ; defaulting if necessary: | 4277 | ; defaulting if necessary: |
| 4278 | (if (not func) (setq func 'outline-insert-listified)) | 4278 | (if (not func) (setq func 'allout-insert-listified)) |
| 4279 | (if (not (and from to)) | 4279 | (if (not (and from to)) |
| 4280 | (if (my-region-active-p) | 4280 | (if (my-region-active-p) |
| 4281 | (setq from (region-beginning) to (region-end)) | 4281 | (setq from (region-beginning) to (region-end)) |
| @@ -4285,7 +4285,7 @@ Defaults: | |||
| 4285 | ;; Specified but not a buffer - get it: | 4285 | ;; Specified but not a buffer - get it: |
| 4286 | (let ((got (get-buffer frombuf))) | 4286 | (let ((got (get-buffer frombuf))) |
| 4287 | (if (not got) | 4287 | (if (not got) |
| 4288 | (error (concat "outline-process-exposed: source buffer " | 4288 | (error (concat "allout-process-exposed: source buffer " |
| 4289 | frombuf | 4289 | frombuf |
| 4290 | " not found.")) | 4290 | " not found.")) |
| 4291 | (setq frombuf got)))) | 4291 | (setq frombuf got)))) |
| @@ -4301,14 +4301,14 @@ Defaults: | |||
| 4301 | 4301 | ||
| 4302 | (let* ((listified | 4302 | (let* ((listified |
| 4303 | (progn (set-buffer frombuf) | 4303 | (progn (set-buffer frombuf) |
| 4304 | (outline-listify-exposed from to format)))) | 4304 | (allout-listify-exposed from to format)))) |
| 4305 | (set-buffer tobuf) | 4305 | (set-buffer tobuf) |
| 4306 | (mapcar func listified) | 4306 | (mapcar func listified) |
| 4307 | (pop-to-buffer tobuf))) | 4307 | (pop-to-buffer tobuf))) |
| 4308 | 4308 | ||
| 4309 | ;;;_ - Copy exposed | 4309 | ;;;_ - Copy exposed |
| 4310 | ;;;_ > outline-insert-listified (listified) | 4310 | ;;;_ > allout-insert-listified (listified) |
| 4311 | (defun outline-insert-listified (listified) | 4311 | (defun allout-insert-listified (listified) |
| 4312 | "Insert contents of listified outline portion in current buffer. | 4312 | "Insert contents of listified outline portion in current buffer. |
| 4313 | 4313 | ||
| 4314 | Listified is a list representing each topic header and body: | 4314 | Listified is a list representing each topic header and body: |
| @@ -4333,8 +4333,8 @@ If `bullet-plus' is specified, it is inserted just after the entire prefix." | |||
| 4333 | (if (setq text (cdr text)) | 4333 | (if (setq text (cdr text)) |
| 4334 | (insert "\n"))) | 4334 | (insert "\n"))) |
| 4335 | (insert "\n"))) | 4335 | (insert "\n"))) |
| 4336 | ;;;_ > outline-copy-exposed-to-buffer (&optional arg tobuf format) | 4336 | ;;;_ > allout-copy-exposed-to-buffer (&optional arg tobuf format) |
| 4337 | (defun outline-copy-exposed-to-buffer (&optional arg tobuf format) | 4337 | (defun allout-copy-exposed-to-buffer (&optional arg tobuf format) |
| 4338 | "Duplicate exposed portions of current outline to another buffer. | 4338 | "Duplicate exposed portions of current outline to another buffer. |
| 4339 | 4339 | ||
| 4340 | Other buffer has current buffers name with \" exposed\" appended to it. | 4340 | Other buffer has current buffers name with \" exposed\" appended to it. |
| @@ -4358,17 +4358,17 @@ alternate presentation format for the outline: | |||
| 4358 | (if (not tobuf) | 4358 | (if (not tobuf) |
| 4359 | (setq tobuf (get-buffer-create (concat "*" (buffer-name) " exposed*")))) | 4359 | (setq tobuf (get-buffer-create (concat "*" (buffer-name) " exposed*")))) |
| 4360 | (let* ((start-pt (point)) | 4360 | (let* ((start-pt (point)) |
| 4361 | (beg (if arg (outline-back-to-current-heading) (point-min))) | 4361 | (beg (if arg (allout-back-to-current-heading) (point-min))) |
| 4362 | (end (if arg (outline-end-of-current-subtree) (point-max))) | 4362 | (end (if arg (allout-end-of-current-subtree) (point-max))) |
| 4363 | (buf (current-buffer)) | 4363 | (buf (current-buffer)) |
| 4364 | (start-list ())) | 4364 | (start-list ())) |
| 4365 | (if (eq format 'flat) | 4365 | (if (eq format 'flat) |
| 4366 | (setq format (if arg (save-excursion | 4366 | (setq format (if arg (save-excursion |
| 4367 | (goto-char beg) | 4367 | (goto-char beg) |
| 4368 | (outline-topic-flat-index)) | 4368 | (allout-topic-flat-index)) |
| 4369 | '(1)))) | 4369 | '(1)))) |
| 4370 | (save-excursion (set-buffer tobuf)(erase-buffer)) | 4370 | (save-excursion (set-buffer tobuf)(erase-buffer)) |
| 4371 | (outline-process-exposed 'outline-insert-listified | 4371 | (allout-process-exposed 'allout-insert-listified |
| 4372 | beg | 4372 | beg |
| 4373 | end | 4373 | end |
| 4374 | (current-buffer) | 4374 | (current-buffer) |
| @@ -4377,14 +4377,14 @@ alternate presentation format for the outline: | |||
| 4377 | (goto-char (point-min)) | 4377 | (goto-char (point-min)) |
| 4378 | (pop-to-buffer buf) | 4378 | (pop-to-buffer buf) |
| 4379 | (goto-char start-pt))) | 4379 | (goto-char start-pt))) |
| 4380 | ;;;_ > outline-flatten-exposed-to-buffer (&optional arg tobuf) | 4380 | ;;;_ > allout-flatten-exposed-to-buffer (&optional arg tobuf) |
| 4381 | (defun outline-flatten-exposed-to-buffer (&optional arg tobuf) | 4381 | (defun allout-flatten-exposed-to-buffer (&optional arg tobuf) |
| 4382 | "Present numeric outline of outline's exposed portions in another buffer. | 4382 | "Present numeric outline of outline's exposed portions in another buffer. |
| 4383 | 4383 | ||
| 4384 | The resulting outline is not compatable with outline mode - use | 4384 | The resulting outline is not compatable with outline mode - use |
| 4385 | `outline-copy-exposed-to-buffer' if you want that. | 4385 | `allout-copy-exposed-to-buffer' if you want that. |
| 4386 | 4386 | ||
| 4387 | Use `outline-indented-exposed-to-buffer' for indented presentation. | 4387 | Use `allout-indented-exposed-to-buffer' for indented presentation. |
| 4388 | 4388 | ||
| 4389 | With repeat count, copy the exposed portions of only current topic. | 4389 | With repeat count, copy the exposed portions of only current topic. |
| 4390 | 4390 | ||
| @@ -4392,15 +4392,15 @@ Other buffer has current buffers name with \" exposed\" appended to | |||
| 4392 | it, unless optional second arg TOBUF is specified, in which case it is | 4392 | it, unless optional second arg TOBUF is specified, in which case it is |
| 4393 | used verbatim." | 4393 | used verbatim." |
| 4394 | (interactive "P") | 4394 | (interactive "P") |
| 4395 | (outline-copy-exposed-to-buffer arg tobuf 'flat)) | 4395 | (allout-copy-exposed-to-buffer arg tobuf 'flat)) |
| 4396 | ;;;_ > outline-indented-exposed-to-buffer (&optional arg tobuf) | 4396 | ;;;_ > allout-indented-exposed-to-buffer (&optional arg tobuf) |
| 4397 | (defun outline-indented-exposed-to-buffer (&optional arg tobuf) | 4397 | (defun allout-indented-exposed-to-buffer (&optional arg tobuf) |
| 4398 | "Present indented outline of outline's exposed portions in another buffer. | 4398 | "Present indented outline of outline's exposed portions in another buffer. |
| 4399 | 4399 | ||
| 4400 | The resulting outline is not compatable with outline mode - use | 4400 | The resulting outline is not compatable with outline mode - use |
| 4401 | `outline-copy-exposed-to-buffer' if you want that. | 4401 | `allout-copy-exposed-to-buffer' if you want that. |
| 4402 | 4402 | ||
| 4403 | Use `outline-flatten-exposed-to-buffer' for numeric sectional presentation. | 4403 | Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. |
| 4404 | 4404 | ||
| 4405 | With repeat count, copy the exposed portions of only current topic. | 4405 | With repeat count, copy the exposed portions of only current topic. |
| 4406 | 4406 | ||
| @@ -4408,11 +4408,11 @@ Other buffer has current buffers name with \" exposed\" appended to | |||
| 4408 | it, unless optional second arg TOBUF is specified, in which case it is | 4408 | it, unless optional second arg TOBUF is specified, in which case it is |
| 4409 | used verbatim." | 4409 | used verbatim." |
| 4410 | (interactive "P") | 4410 | (interactive "P") |
| 4411 | (outline-copy-exposed-to-buffer arg tobuf 'indent)) | 4411 | (allout-copy-exposed-to-buffer arg tobuf 'indent)) |
| 4412 | 4412 | ||
| 4413 | ;;;_ - LaTeX formatting | 4413 | ;;;_ - LaTeX formatting |
| 4414 | ;;;_ > outline-latex-verb-quote (str &optional flow) | 4414 | ;;;_ > allout-latex-verb-quote (str &optional flow) |
| 4415 | (defun outline-latex-verb-quote (str &optional flow) | 4415 | (defun allout-latex-verb-quote (str &optional flow) |
| 4416 | "Return copy of STRING for literal reproduction across latex processing. | 4416 | "Return copy of STRING for literal reproduction across latex processing. |
| 4417 | Expresses the original characters \(including carriage returns) of the | 4417 | Expresses the original characters \(including carriage returns) of the |
| 4418 | string across latex processing." | 4418 | string across latex processing." |
| @@ -4424,8 +4424,8 @@ string across latex processing." | |||
| 4424 | (t (char-to-string char))))) | 4424 | (t (char-to-string char))))) |
| 4425 | str | 4425 | str |
| 4426 | "")) | 4426 | "")) |
| 4427 | ;;;_ > outline-latex-verbatim-quote-curr-line () | 4427 | ;;;_ > allout-latex-verbatim-quote-curr-line () |
| 4428 | (defun outline-latex-verbatim-quote-curr-line () | 4428 | (defun allout-latex-verbatim-quote-curr-line () |
| 4429 | "Express line for exact \(literal) representation across latex processing. | 4429 | "Express line for exact \(literal) representation across latex processing. |
| 4430 | 4430 | ||
| 4431 | Adjust line contents so it is unaltered \(from the original line) | 4431 | Adjust line contents so it is unaltered \(from the original line) |
| @@ -4443,15 +4443,15 @@ environment. Leaves point at the end of the line." | |||
| 4443 | (insert "\\") | 4443 | (insert "\\") |
| 4444 | (setq end (1+ end)) | 4444 | (setq end (1+ end)) |
| 4445 | (goto-char (1+ (match-end 0)))))) | 4445 | (goto-char (1+ (match-end 0)))))) |
| 4446 | ;;;_ > outline-insert-latex-header (buf) | 4446 | ;;;_ > allout-insert-latex-header (buf) |
| 4447 | (defun outline-insert-latex-header (buf) | 4447 | (defun allout-insert-latex-header (buf) |
| 4448 | "Insert initial latex commands at point in BUFFER." | 4448 | "Insert initial latex commands at point in BUFFER." |
| 4449 | ;; Much of this is being derived from the stuff in appendix of E in | 4449 | ;; Much of this is being derived from the stuff in appendix of E in |
| 4450 | ;; the TeXBook, pg 421. | 4450 | ;; the TeXBook, pg 421. |
| 4451 | (set-buffer buf) | 4451 | (set-buffer buf) |
| 4452 | (let ((doc-style (format "\n\\documentstyle{%s}\n" | 4452 | (let ((doc-style (format "\n\\documentstyle{%s}\n" |
| 4453 | "report")) | 4453 | "report")) |
| 4454 | (page-numbering (if outline-number-pages | 4454 | (page-numbering (if allout-number-pages |
| 4455 | "\\pagestyle{empty}\n" | 4455 | "\\pagestyle{empty}\n" |
| 4456 | "")) | 4456 | "")) |
| 4457 | (linesdef (concat "\\def\\beginlines{" | 4457 | (linesdef (concat "\\def\\beginlines{" |
| @@ -4462,17 +4462,17 @@ environment. Leaves point at the end of the line." | |||
| 4462 | "\\def\\endlines{" | 4462 | "\\def\\endlines{" |
| 4463 | "\\kern1pt\\endgroup\\medbreak\\noindent}\n")) | 4463 | "\\kern1pt\\endgroup\\medbreak\\noindent}\n")) |
| 4464 | (titlecmd (format "\\newcommand{\\titlecmd}[1]{{%s #1}}\n" | 4464 | (titlecmd (format "\\newcommand{\\titlecmd}[1]{{%s #1}}\n" |
| 4465 | outline-title-style)) | 4465 | allout-title-style)) |
| 4466 | (labelcmd (format "\\newcommand{\\labelcmd}[1]{{%s #1}}\n" | 4466 | (labelcmd (format "\\newcommand{\\labelcmd}[1]{{%s #1}}\n" |
| 4467 | outline-label-style)) | 4467 | allout-label-style)) |
| 4468 | (headlinecmd (format "\\newcommand{\\headlinecmd}[1]{{%s #1}}\n" | 4468 | (headlinecmd (format "\\newcommand{\\headlinecmd}[1]{{%s #1}}\n" |
| 4469 | outline-head-line-style)) | 4469 | allout-head-line-style)) |
| 4470 | (bodylinecmd (format "\\newcommand{\\bodylinecmd}[1]{{%s #1}}\n" | 4470 | (bodylinecmd (format "\\newcommand{\\bodylinecmd}[1]{{%s #1}}\n" |
| 4471 | outline-body-line-style)) | 4471 | allout-body-line-style)) |
| 4472 | (setlength (format "%s%s%s%s" | 4472 | (setlength (format "%s%s%s%s" |
| 4473 | "\\newlength{\\stepsize}\n" | 4473 | "\\newlength{\\stepsize}\n" |
| 4474 | "\\setlength{\\stepsize}{" | 4474 | "\\setlength{\\stepsize}{" |
| 4475 | outline-indent | 4475 | allout-indent |
| 4476 | "}\n")) | 4476 | "}\n")) |
| 4477 | (oneheadline (format "%s%s%s%s%s%s%s" | 4477 | (oneheadline (format "%s%s%s%s%s%s%s" |
| 4478 | "\\newcommand{\\OneHeadLine}[3]{%\n" | 4478 | "\\newcommand{\\OneHeadLine}[3]{%\n" |
| @@ -4480,21 +4480,21 @@ environment. Leaves point at the end of the line." | |||
| 4480 | "\\hspace*{#2\\stepsize}%\n" | 4480 | "\\hspace*{#2\\stepsize}%\n" |
| 4481 | "\\labelcmd{#1}\\hspace*{.2cm}" | 4481 | "\\labelcmd{#1}\\hspace*{.2cm}" |
| 4482 | "\\headlinecmd{#3}\\\\[" | 4482 | "\\headlinecmd{#3}\\\\[" |
| 4483 | outline-line-skip | 4483 | allout-line-skip |
| 4484 | "]\n}\n")) | 4484 | "]\n}\n")) |
| 4485 | (onebodyline (format "%s%s%s%s%s%s" | 4485 | (onebodyline (format "%s%s%s%s%s%s" |
| 4486 | "\\newcommand{\\OneBodyLine}[2]{%\n" | 4486 | "\\newcommand{\\OneBodyLine}[2]{%\n" |
| 4487 | "\\noindent%\n" | 4487 | "\\noindent%\n" |
| 4488 | "\\hspace*{#1\\stepsize}%\n" | 4488 | "\\hspace*{#1\\stepsize}%\n" |
| 4489 | "\\bodylinecmd{#2}\\\\[" | 4489 | "\\bodylinecmd{#2}\\\\[" |
| 4490 | outline-line-skip | 4490 | allout-line-skip |
| 4491 | "]\n}\n")) | 4491 | "]\n}\n")) |
| 4492 | (begindoc "\\begin{document}\n\\begin{center}\n") | 4492 | (begindoc "\\begin{document}\n\\begin{center}\n") |
| 4493 | (title (format "%s%s%s%s" | 4493 | (title (format "%s%s%s%s" |
| 4494 | "\\titlecmd{" | 4494 | "\\titlecmd{" |
| 4495 | (outline-latex-verb-quote (if outline-title | 4495 | (allout-latex-verb-quote (if allout-title |
| 4496 | (condition-case err | 4496 | (condition-case err |
| 4497 | (eval outline-title) | 4497 | (eval allout-title) |
| 4498 | ('error "<unnamed buffer>")) | 4498 | ('error "<unnamed buffer>")) |
| 4499 | "Unnamed Outline")) | 4499 | "Unnamed Outline")) |
| 4500 | "}\n" | 4500 | "}\n" |
| @@ -4517,13 +4517,13 @@ environment. Leaves point at the end of the line." | |||
| 4517 | hoffset | 4517 | hoffset |
| 4518 | vspace) | 4518 | vspace) |
| 4519 | ))) | 4519 | ))) |
| 4520 | ;;;_ > outline-insert-latex-trailer (buf) | 4520 | ;;;_ > allout-insert-latex-trailer (buf) |
| 4521 | (defun outline-insert-latex-trailer (buf) | 4521 | (defun allout-insert-latex-trailer (buf) |
| 4522 | "Insert concluding latex commands at point in BUFFER." | 4522 | "Insert concluding latex commands at point in BUFFER." |
| 4523 | (set-buffer buf) | 4523 | (set-buffer buf) |
| 4524 | (insert "\n\\end{document}\n")) | 4524 | (insert "\n\\end{document}\n")) |
| 4525 | ;;;_ > outline-latexify-one-item (depth prefix bullet text) | 4525 | ;;;_ > allout-latexify-one-item (depth prefix bullet text) |
| 4526 | (defun outline-latexify-one-item (depth prefix bullet text) | 4526 | (defun allout-latexify-one-item (depth prefix bullet text) |
| 4527 | "Insert LaTeX commands for formatting one outline item. | 4527 | "Insert LaTeX commands for formatting one outline item. |
| 4528 | 4528 | ||
| 4529 | Args are the topics numeric DEPTH, the header PREFIX lead string, the | 4529 | Args are the topics numeric DEPTH, the header PREFIX lead string, the |
| @@ -4534,12 +4534,12 @@ BULLET string, and a list of TEXT strings for the body." | |||
| 4534 | body-content bop) | 4534 | body-content bop) |
| 4535 | ; Do the head line: | 4535 | ; Do the head line: |
| 4536 | (insert (concat "\\OneHeadLine{\\verb\1 " | 4536 | (insert (concat "\\OneHeadLine{\\verb\1 " |
| 4537 | (outline-latex-verb-quote bullet) | 4537 | (allout-latex-verb-quote bullet) |
| 4538 | "\1}{" | 4538 | "\1}{" |
| 4539 | depth | 4539 | depth |
| 4540 | "}{\\verb\1 " | 4540 | "}{\\verb\1 " |
| 4541 | (if head-line | 4541 | (if head-line |
| 4542 | (outline-latex-verb-quote head-line) | 4542 | (allout-latex-verb-quote head-line) |
| 4543 | "") | 4543 | "") |
| 4544 | "\1}\n")) | 4544 | "\1}\n")) |
| 4545 | (if (not body-lines) | 4545 | (if (not body-lines) |
| @@ -4561,7 +4561,7 @@ BULLET string, and a list of TEXT strings for the body." | |||
| 4561 | (substring curr-line bop)))) | 4561 | (substring curr-line bop)))) |
| 4562 | ;;(insert "|" (car body-lines) "|") | 4562 | ;;(insert "|" (car body-lines) "|") |
| 4563 | (insert curr-line) | 4563 | (insert curr-line) |
| 4564 | (outline-latex-verbatim-quote-curr-line) | 4564 | (allout-latex-verbatim-quote-curr-line) |
| 4565 | (insert "\n") | 4565 | (insert "\n") |
| 4566 | (setq body-lines (cdr body-lines))) | 4566 | (setq body-lines (cdr body-lines))) |
| 4567 | (if body-content | 4567 | (if body-content |
| @@ -4572,8 +4572,8 @@ BULLET string, and a list of TEXT strings for the body." | |||
| 4572 | ;;(insert "\\endlines\n") | 4572 | ;;(insert "\\endlines\n") |
| 4573 | (insert "\\end{verbatim}\n") | 4573 | (insert "\\end{verbatim}\n") |
| 4574 | ))) | 4574 | ))) |
| 4575 | ;;;_ > outline-latexify-exposed (arg &optional tobuf) | 4575 | ;;;_ > allout-latexify-exposed (arg &optional tobuf) |
| 4576 | (defun outline-latexify-exposed (arg &optional tobuf) | 4576 | (defun allout-latexify-exposed (arg &optional tobuf) |
| 4577 | "Format current topics exposed portions to TOBUF for latex processing. | 4577 | "Format current topics exposed portions to TOBUF for latex processing. |
| 4578 | TOBUF defaults to a buffer named the same as the current buffer, but | 4578 | TOBUF defaults to a buffer named the same as the current buffer, but |
| 4579 | with \"*\" prepended and \" latex-formed*\" appended. | 4579 | with \"*\" prepended and \" latex-formed*\" appended. |
| @@ -4585,33 +4585,33 @@ With repeat count, copy the exposed portions of entire buffer." | |||
| 4585 | (setq tobuf | 4585 | (setq tobuf |
| 4586 | (get-buffer-create (concat "*" (buffer-name) " latexified*")))) | 4586 | (get-buffer-create (concat "*" (buffer-name) " latexified*")))) |
| 4587 | (let* ((start-pt (point)) | 4587 | (let* ((start-pt (point)) |
| 4588 | (beg (if arg (point-min) (outline-back-to-current-heading))) | 4588 | (beg (if arg (point-min) (allout-back-to-current-heading))) |
| 4589 | (end (if arg (point-max) (outline-end-of-current-subtree))) | 4589 | (end (if arg (point-max) (allout-end-of-current-subtree))) |
| 4590 | (buf (current-buffer))) | 4590 | (buf (current-buffer))) |
| 4591 | (set-buffer tobuf) | 4591 | (set-buffer tobuf) |
| 4592 | (erase-buffer) | 4592 | (erase-buffer) |
| 4593 | (outline-insert-latex-header tobuf) | 4593 | (allout-insert-latex-header tobuf) |
| 4594 | (goto-char (point-max)) | 4594 | (goto-char (point-max)) |
| 4595 | (outline-process-exposed 'outline-latexify-one-item | 4595 | (allout-process-exposed 'allout-latexify-one-item |
| 4596 | beg | 4596 | beg |
| 4597 | end | 4597 | end |
| 4598 | buf | 4598 | buf |
| 4599 | tobuf) | 4599 | tobuf) |
| 4600 | (goto-char (point-max)) | 4600 | (goto-char (point-max)) |
| 4601 | (outline-insert-latex-trailer tobuf) | 4601 | (allout-insert-latex-trailer tobuf) |
| 4602 | (goto-char (point-min)) | 4602 | (goto-char (point-min)) |
| 4603 | (pop-to-buffer buf) | 4603 | (pop-to-buffer buf) |
| 4604 | (goto-char start-pt))) | 4604 | (goto-char start-pt))) |
| 4605 | 4605 | ||
| 4606 | ;;;_ #8 miscellaneous | 4606 | ;;;_ #8 miscellaneous |
| 4607 | ;;;_ > outline-mark-topic () | 4607 | ;;;_ > allout-mark-topic () |
| 4608 | (defun outline-mark-topic () | 4608 | (defun allout-mark-topic () |
| 4609 | "Put the region around topic currently containing point." | 4609 | "Put the region around topic currently containing point." |
| 4610 | (interactive) | 4610 | (interactive) |
| 4611 | (beginning-of-line) | 4611 | (beginning-of-line) |
| 4612 | (outline-goto-prefix) | 4612 | (allout-goto-prefix) |
| 4613 | (push-mark (point)) | 4613 | (push-mark (point)) |
| 4614 | (outline-end-of-current-subtree) | 4614 | (allout-end-of-current-subtree) |
| 4615 | (exchange-point-and-mark)) | 4615 | (exchange-point-and-mark)) |
| 4616 | ;;;_ > outlineify-sticky () | 4616 | ;;;_ > outlineify-sticky () |
| 4617 | ;; outlinify-sticky is correct spelling; provide this alias for sticklers: | 4617 | ;; outlinify-sticky is correct spelling; provide this alias for sticklers: |
| @@ -4619,34 +4619,34 @@ With repeat count, copy the exposed portions of entire buffer." | |||
| 4619 | (defun outlineify-sticky (&optional arg) | 4619 | (defun outlineify-sticky (&optional arg) |
| 4620 | "Activate outline mode and establish file var so it is started subsequently. | 4620 | "Activate outline mode and establish file var so it is started subsequently. |
| 4621 | 4621 | ||
| 4622 | See doc-string for `outline-layout' and `outline-init' for details on | 4622 | See doc-string for `allout-layout' and `allout-init' for details on |
| 4623 | setup for auto-startup." | 4623 | setup for auto-startup." |
| 4624 | 4624 | ||
| 4625 | (interactive "P") | 4625 | (interactive "P") |
| 4626 | 4626 | ||
| 4627 | (outline-mode t) | 4627 | (allout-mode t) |
| 4628 | 4628 | ||
| 4629 | (save-excursion | 4629 | (save-excursion |
| 4630 | (goto-char (point-min)) | 4630 | (goto-char (point-min)) |
| 4631 | (if (looking-at outline-regexp) | 4631 | (if (looking-at allout-regexp) |
| 4632 | t | 4632 | t |
| 4633 | (outline-open-topic 2) | 4633 | (allout-open-topic 2) |
| 4634 | (insert (concat "Dummy outline topic header - see" | 4634 | (insert (concat "Dummy outline topic header - see" |
| 4635 | "`outline-mode' docstring: `^Hm'.")) | 4635 | "`allout-mode' docstring: `^Hm'.")) |
| 4636 | (forward-line 1) | 4636 | (forward-line 1) |
| 4637 | (goto-char (point-max)) | 4637 | (goto-char (point-max)) |
| 4638 | (open-line 1) | 4638 | (open-line 1) |
| 4639 | (outline-open-topic 0) | 4639 | (allout-open-topic 0) |
| 4640 | (insert "Local emacs vars.\n") | 4640 | (insert "Local emacs vars.\n") |
| 4641 | (outline-open-topic 1) | 4641 | (allout-open-topic 1) |
| 4642 | (insert "(`outline-layout' is for allout.el outline-mode)\n") | 4642 | (insert "(`allout-layout' is for allout.el allout-mode)\n") |
| 4643 | (outline-open-topic 0) | 4643 | (allout-open-topic 0) |
| 4644 | (insert "Local variables:\n") | 4644 | (insert "Local variables:\n") |
| 4645 | (outline-open-topic 0) | 4645 | (allout-open-topic 0) |
| 4646 | (insert (format "outline-layout: %s\n" | 4646 | (insert (format "allout-layout: %s\n" |
| 4647 | (or outline-layout | 4647 | (or allout-layout |
| 4648 | '(-1 : 0)))) | 4648 | '(-1 : 0)))) |
| 4649 | (outline-open-topic 0) | 4649 | (allout-open-topic 0) |
| 4650 | (insert "End:\n")))) | 4650 | (insert "End:\n")))) |
| 4651 | ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting) | 4651 | ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting) |
| 4652 | (defun solicit-char-in-string (prompt string &optional do-defaulting) | 4652 | (defun solicit-char-in-string (prompt string &optional do-defaulting) |
| @@ -4740,18 +4740,18 @@ so pass them along when appropriate." | |||
| 4740 | (mark-marker))) | 4740 | (mark-marker))) |
| 4741 | 4741 | ||
| 4742 | ;;;_ #9 Under development | 4742 | ;;;_ #9 Under development |
| 4743 | ;;;_ > outline-bullet-isearch (&optional bullet) | 4743 | ;;;_ > allout-bullet-isearch (&optional bullet) |
| 4744 | (defun outline-bullet-isearch (&optional bullet) | 4744 | (defun allout-bullet-isearch (&optional bullet) |
| 4745 | "Isearch \(regexp) for topic with bullet BULLET." | 4745 | "Isearch \(regexp) for topic with bullet BULLET." |
| 4746 | (interactive) | 4746 | (interactive) |
| 4747 | (if (not bullet) | 4747 | (if (not bullet) |
| 4748 | (setq bullet (solicit-char-in-string | 4748 | (setq bullet (solicit-char-in-string |
| 4749 | "ISearch for topic with bullet: " | 4749 | "ISearch for topic with bullet: " |
| 4750 | (regexp-sans-escapes outline-bullets-string)))) | 4750 | (regexp-sans-escapes allout-bullets-string)))) |
| 4751 | 4751 | ||
| 4752 | (let ((isearch-regexp t) | 4752 | (let ((isearch-regexp t) |
| 4753 | (isearch-string (concat "^" | 4753 | (isearch-string (concat "^" |
| 4754 | outline-header-prefix | 4754 | allout-header-prefix |
| 4755 | "[ \t]*" | 4755 | "[ \t]*" |
| 4756 | bullet))) | 4756 | bullet))) |
| 4757 | (isearch-repeat 'forward) | 4757 | (isearch-repeat 'forward) |
| @@ -4760,13 +4760,13 @@ so pass them along when appropriate." | |||
| 4760 | ;;; wrapping the isearch functions. | 4760 | ;;; wrapping the isearch functions. |
| 4761 | 4761 | ||
| 4762 | ;;;_* Local emacs vars. | 4762 | ;;;_* Local emacs vars. |
| 4763 | ;;; The following `outline-layout' local variable setting: | 4763 | ;;; The following `allout-layout' local variable setting: |
| 4764 | ;;; - closes all topics from the first topic to just before the third-to-last, | 4764 | ;;; - closes all topics from the first topic to just before the third-to-last, |
| 4765 | ;;; - shows the children of the third to last (config vars) | 4765 | ;;; - shows the children of the third to last (config vars) |
| 4766 | ;;; - and the second to last (code section), | 4766 | ;;; - and the second to last (code section), |
| 4767 | ;;; - and closes the last topic (this local-variables section). | 4767 | ;;; - and closes the last topic (this local-variables section). |
| 4768 | ;;;Local variables: | 4768 | ;;;Local variables: |
| 4769 | ;;;outline-layout: (0 : -1 -1 0) | 4769 | ;;;allout-layout: (0 : -1 -1 0) |
| 4770 | ;;;End: | 4770 | ;;;End: |
| 4771 | 4771 | ||
| 4772 | ;;; allout.el ends here | 4772 | ;;; allout.el ends here |