annotate lisp/allout.el @ 64400:e169c8755108

(allout-isearch-did-quit): Variable deleted. (allout-real-isearch-abort): Function name no longer used. (allout-mode): Do allout-enwrap-isearch whenever feature is wanted. (allout-isearch-rectification): isearch-mode always exists. Don't set allout-isearch-did-quit. (allout-isearch-expose): Check isearch-mode-end-hook-error, not allout-isearch-did-quit. (allout-enwrap-isearch): Just add the hook. (allout-isearch-abort): Function deleted. (allout-pre-command-business): Avoid warning.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Jul 2005 19:15:06 +0000
parents d57ad48e7901
children e55dd693f95b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
1 ;;; allout.el --- extensive outline mode for use alone and with other modes
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3 ;; Copyright (C) 1992, 93, 94, 2001, 02, 2004 Free Software Foundation, Inc.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4
49966
4a0a4a66f5b1 Really fix maintainer's e-mail address.
Juanma Barranquero <lekktu@gmail.com>
parents: 49964
diff changeset
5 ;; Author: Ken Manheimer <klm@zope.com>
4a0a4a66f5b1 Really fix maintainer's e-mail address.
Juanma Barranquero <lekktu@gmail.com>
parents: 49964
diff changeset
6 ;; Maintainer: Ken Manheimer <klm@zope.com>
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
7 ;; Created: Dec 1991 - first release to usenet
41905
90c1cb5c072c Fix Keywords header.
Pavel Janík <Pavel@Janik.cz>
parents: 41571
diff changeset
8 ;; Keywords: outlines mode wp languages
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
15 ;; any later version.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
20 ;; GNU General Public License for more details.
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
21
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
22 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13964
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64091
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61969
diff changeset
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61969
diff changeset
25 ;; Boston, MA 02110-1301, USA.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
27 ;;; Commentary:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
28
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
29 ;; Allout outline mode provides extensive outline formatting and
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
30 ;; and manipulation beyond standard emacs outline mode. It provides
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
31 ;; for structured editing of outlines, as well as navigation and
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
32 ;; exposure. It also provides for syntax-sensitive text like
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
33 ;; programming languages. (For an example, see the allout code
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
34 ;; itself, which is organized in ;; an outline framework.)
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
35 ;;
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
36 ;; In addition to outline navigation and exposure, allout includes:
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
37 ;;
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
38 ;; - topic-oriented repositioning, cut, and paste
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
39 ;; - integral outline exposure-layout
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
40 ;; - incremental search with dynamic exposure and reconcealment of hidden text
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
41 ;; - automatic topic-number maintenance
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
42 ;; - "Hot-spot" operation, for single-keystroke maneuvering and
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
43 ;; exposure control. (See the `allout-mode' docstring.)
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
44 ;;
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
45 ;; and many other features.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
46 ;;
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
47 ;; The outline menubar additions provide quick reference to many of
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
48 ;; the features, and see the docstring of the function `allout-init'
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
49 ;; for instructions on priming your Emacs session for automatic
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
50 ;; activation of `allout-mode'.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
51 ;;
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
52 ;; See the docstring of the variables `allout-layout' and
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
53 ;; `allout-auto-activation' for details on automatic activation of
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
54 ;; allout `allout-mode' as a minor mode. (It has changed since allout
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
55 ;; 3.x, for those of you that depend on the old method.)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
56 ;;
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
57 ;; Note - the lines beginning with `;;;_' are outline topic headers.
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
58 ;; Just `ESC-x eval-current-buffer' to give it a whirl.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
59
49966
4a0a4a66f5b1 Really fix maintainer's e-mail address.
Juanma Barranquero <lekktu@gmail.com>
parents: 49964
diff changeset
60 ;; Ken Manheimer klm@zope.com
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
61
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
62 ;;; Code:
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
63
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
64 ;;;_* Provide
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
65 (provide 'allout)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
66
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
67 ;;;_* USER CUSTOMIZATION VARIABLES:
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
68 (defgroup allout nil
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
69 "Extensive outline mode for use alone and with other modes."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
70 :prefix "allout-"
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
71 :group 'editing
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 57818
diff changeset
72 :version "22.1")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
73
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
74 ;;;_ + Layout, Mode, and Topic Header Configuration
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
75
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
76 ;;;_ = allout-auto-activation
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
77 (defcustom allout-auto-activation nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
78 "*Regulates auto-activation modality of allout outlines - see `allout-init'.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
79
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
80 Setq-default by `allout-init' to regulate whether or not allout
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
81 outline mode is automatically activated when the buffer-specific
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
82 variable `allout-layout' is non-nil, and whether or not the layout
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
83 dictated by `allout-layout' should be imposed on mode activation.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
84
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
85 With value t, auto-mode-activation and auto-layout are enabled.
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
86 \(This also depends on `allout-find-file-hook' being installed in
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
87 `find-file-hook', which is also done by `allout-init'.)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
88
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
89 With value `ask', auto-mode-activation is enabled, and endorsement for
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
90 performing auto-layout is asked of the user each time.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
91
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
92 With value `activate', only auto-mode-activation is enabled,
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
93 auto-layout is not.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
94
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
95 With value nil, neither auto-mode-activation nor auto-layout are
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
96 enabled.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
97
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
98 See the docstring for `allout-init' for the proper interface to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
99 this variable."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
100 :type '(choice (const :tag "On" t)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
101 (const :tag "Ask about layout" "ask")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
102 (const :tag "Mode only" "activate")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
103 (const :tag "Off" nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
104 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
105 ;;;_ = allout-layout
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
106 (defvar allout-layout nil
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
107 "*Layout specification and provisional mode trigger for allout outlines.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
108
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
109 Buffer-specific.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
110
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
111 A list value specifies a default layout for the current buffer, to be
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
112 applied upon activation of `allout-mode'. Any non-nil value will
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
113 automatically trigger `allout-mode', provided `allout-init'
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
114 has been called to enable it.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
115
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
116 See the docstring for `allout-init' for details on setting up for
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
117 auto-mode-activation, and for `allout-expose-topic' for the format of
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
118 the layout specification.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
119
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
120 You can associate a particular outline layout with a file by setting
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
121 this var via the file's local variables. For example, the following
11034
27df51bcb4b0 (outline-layout): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10867
diff changeset
122 lines at the bottom of an Emacs Lisp file:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
123
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
124 ;;;Local variables:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
125 ;;;allout-layout: \(0 : -1 -1 0)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
126 ;;;End:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
127
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
128 will, modulo the above-mentioned conditions, cause the mode to be
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
129 activated when the file is visited, followed by the equivalent of
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
130 `\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
131 the allout.el, itself.)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
132
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
133 Also, allout's mode-specific provisions will make topic prefixes default
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
134 to the comment-start string, if any, of the language of the file. This
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
135 is modulo the setting of `allout-use-mode-specific-leader', which see.")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
136 (make-variable-buffer-local 'allout-layout)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
137 ;;;_ = allout-show-bodies
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
138 (defcustom allout-show-bodies nil
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
139 "*If non-nil, show entire body when exposing a topic, rather than
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
140 just the header."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
141 :type 'boolean
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
142 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
143 (make-variable-buffer-local 'allout-show-bodies)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
144
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
145 ;;;_ = allout-header-prefix
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
146 (defcustom allout-header-prefix "."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
147 "*Leading string which helps distinguish topic headers.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
148
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
149 Outline topic header lines are identified by a leading topic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
150 header prefix, which mostly have the value of this var at their front.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
151 \(Level 1 topics are exceptions. They consist of only a single
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
152 character, which is typically set to the `allout-primary-bullet'. Many
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
153 outlines start at level 2 to avoid this discrepancy."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
154 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
155 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
156 (make-variable-buffer-local 'allout-header-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
157 ;;;_ = allout-primary-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
158 (defcustom allout-primary-bullet "*"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
159 "Bullet used for top-level outline topics.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
160
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
161 Outline topic header lines are identified by a leading topic header
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
162 prefix, which is concluded by bullets that includes the value of this
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
163 var and the respective allout-*-bullets-string vars.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
164
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
165 The value of an asterisk (`*') provides for backwards compatibility
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
166 with the original Emacs outline mode. See `allout-plain-bullets-string'
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
167 and `allout-distinctive-bullets-string' for the range of available
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
168 bullets."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
169 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
170 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
171 (make-variable-buffer-local 'allout-primary-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
172 ;;;_ = allout-plain-bullets-string
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
173 (defcustom allout-plain-bullets-string ".:,;"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
174 "*The bullets normally used in outline topic prefixes.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
175
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
176 See `allout-distinctive-bullets-string' for the other kind of
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
177 bullets.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
178
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
179 DO NOT include the close-square-bracket, `]', as a bullet.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
180
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
181 Outline mode has to be reactivated in order for changes to the value
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
182 of this var to take effect."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
183 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
184 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
185 (make-variable-buffer-local 'allout-plain-bullets-string)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
186 ;;;_ = allout-distinctive-bullets-string
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
187 (defcustom allout-distinctive-bullets-string "*+-=>([{}&!?#%\"X@$~_\\"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
188 "*Persistent outline header bullets used to distinguish special topics.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
189
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
190 These bullets are used to distinguish topics from the run-of-the-mill
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
191 ones. They are not used in the standard topic headers created by
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
192 the topic-opening, shifting, and rebulleting \(eg, on topic shift,
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
193 topic paste, blanket rebulleting) routines, but are offered among the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
194 choices for rebulleting. They are not altered by the above automatic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
195 rebulleting, so they can be used to characterize topics, eg:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
196
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
197 `?' question topics
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
198 `\(' parenthetic comment \(with a matching close paren inside)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
199 `[' meta-note \(with a matching close ] inside)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
200 `\"' a quote
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
201 `=' value settings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
202 `~' \"more or less\"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
203
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
204 ... just for example. (`#' typically has a special meaning to the
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
205 software, according to the value of `allout-numbered-bullet'.)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
206
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
207 See `allout-plain-bullets-string' for the selection of
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
208 alternating bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
209
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
210 You must run `set-allout-regexp' in order for outline mode to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
211 reconcile to changes of this value.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
212
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
213 DO NOT include the close-square-bracket, `]', on either of the bullet
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
214 strings."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
215 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
216 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
217 (make-variable-buffer-local 'allout-distinctive-bullets-string)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
218
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
219 ;;;_ = allout-use-mode-specific-leader
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
220 (defcustom allout-use-mode-specific-leader t
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
221 "*When non-nil, use mode-specific topic-header prefixes.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
222
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
223 Allout outline mode will use the mode-specific `allout-mode-leaders'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
224 and/or comment-start string, if any, to lead the topic prefix string,
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
225 so topic headers look like comments in the programming language.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
226
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
227 String values are used as they stand.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
228
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
229 Value t means to first check for assoc value in `allout-mode-leaders'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
230 alist, then use comment-start string, if any, then use default \(`.').
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
231 \(See note about use of comment-start strings, below.)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
232
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
233 Set to the symbol for either of `allout-mode-leaders' or
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
234 `comment-start' to use only one of them, respectively.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
235
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
236 Value nil means to always use the default \(`.').
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
237
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
238 comment-start strings that do not end in spaces are tripled, and an
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
239 `_' underscore is tacked on the end, to distinguish them from regular
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
240 comment strings. comment-start strings that do end in spaces are not
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
241 tripled, but an underscore is substituted for the space. [This
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
242 presumes that the space is for appearance, not comment syntax. You
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
243 can use `allout-mode-leaders' to override this behavior, when
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
244 incorrect.]"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
245 :type '(choice (const t) (const nil) string
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
246 (const allout-mode-leaders)
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
247 (const comment-start))
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
248 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
249 ;;;_ = allout-mode-leaders
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
250 (defvar allout-mode-leaders '()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
251 "Specific allout-prefix leading strings per major modes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
252
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
253 Entries will be used instead or in lieu of mode-specific
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
254 comment-start strings. See also `allout-use-mode-specific-leader'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
255
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
256 If you're constructing a string that will comment-out outline
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
257 structuring so it can be included in program code, append an extra
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
258 character, like an \"_\" underscore, to distinguish the lead string
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
259 from regular comments that start at bol.")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
260
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
261 ;;;_ = allout-old-style-prefixes
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
262 (defcustom allout-old-style-prefixes nil
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
263 "*When non-nil, use only old-and-crusty `outline-mode' `*' topic prefixes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
264
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
265 Non-nil restricts the topic creation and modification
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
266 functions to asterix-padded prefixes, so they look exactly
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
267 like the original Emacs-outline style prefixes.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
268
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
269 Whatever the setting of this variable, both old and new style prefixes
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
270 are always respected by the topic maneuvering functions."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
271 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
272 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
273 (make-variable-buffer-local 'allout-old-style-prefixes)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
274 ;;;_ = allout-stylish-prefixes - alternating bullets
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
275 (defcustom allout-stylish-prefixes t
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
276 "*Do fancy stuff with topic prefix bullets according to level, etc.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
277
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
278 Non-nil enables topic creation, modification, and repositioning
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
279 functions to vary the topic bullet char (the char that marks the topic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
280 depth) just preceding the start of the topic text) according to level.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
281 Otherwise, only asterisks (`*') and distinctive bullets are used.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
282
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
283 This is how an outline can look (but sans indentation) with stylish
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
284 prefixes:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
285
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
286 * Top level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
287 .* A topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
288 . + One level 3 subtopic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
289 . . One level 4 subtopic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
290 . . A second 4 subtopic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
291 . + Another level 3 subtopic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
292 . #1 A numbered level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
293 . #2 Another
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
294 . ! Another level 4 subtopic with a different distinctive bullet
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
295 . #4 And another numbered level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
296
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
297 This would be an outline with stylish prefixes inhibited (but the
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
298 numbered and other distinctive bullets retained):
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
299
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
300 * Top level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
301 .* A topic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
302 . * One level 3 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
303 . * One level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
304 . * A second 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
305 . * Another level 3 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
306 . #1 A numbered level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
307 . #2 Another
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
308 . ! Another level 4 subtopic with a different distinctive bullet
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
309 . #4 And another numbered level 4 subtopic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
310
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
311 Stylish and constant prefixes (as well as old-style prefixes) are
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
312 always respected by the topic maneuvering functions, regardless of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
313 this variable setting.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
314
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
315 The setting of this var is not relevant when `allout-old-style-prefixes'
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
316 is non-nil."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
317 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
318 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
319 (make-variable-buffer-local 'allout-stylish-prefixes)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
320
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
321 ;;;_ = allout-numbered-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
322 (defcustom allout-numbered-bullet "#"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
323 "*String designating bullet of topics that have auto-numbering; nil for none.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
324
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
325 Topics having this bullet have automatic maintenance of a sibling
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
326 sequence-number tacked on, just after the bullet. Conventionally set
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
327 to \"#\", you can set it to a bullet of your choice. A nil value
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
328 disables numbering maintenance."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
329 :type '(choice (const nil) string)
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
330 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
331 (make-variable-buffer-local 'allout-numbered-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
332 ;;;_ = allout-file-xref-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
333 (defcustom allout-file-xref-bullet "@"
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
334 "*Bullet signifying file cross-references, for `allout-resolve-xref'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
335
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
336 Set this var to the bullet you want to use for file cross-references."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
337 :type '(choice (const nil) string)
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
338 :group 'allout)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
339
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
340 ;;;_ = allout-presentation-padding
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
341 (defcustom allout-presentation-padding 2
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
342 "*Presentation-format white-space padding factor, for greater indent."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
343 :type 'integer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
344 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
345
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
346 (make-variable-buffer-local 'allout-presentation-padding)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
347
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
348 ;;;_ = allout-abbreviate-flattened-numbering
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
349 (defcustom allout-abbreviate-flattened-numbering nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
350 "*If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
351 numbers to minimal amount with some context. Otherwise, entire
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
352 numbers are always used."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
353 :type 'boolean
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
354 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
355
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
356 ;;;_ + LaTeX formatting
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
357 ;;;_ - allout-number-pages
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
358 (defcustom allout-number-pages nil
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
359 "*Non-nil turns on page numbering for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
360 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
361 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
362 ;;;_ - allout-label-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
363 (defcustom allout-label-style "\\large\\bf"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
364 "*Font and size of labels for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
365 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
366 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
367 ;;;_ - allout-head-line-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
368 (defcustom allout-head-line-style "\\large\\sl "
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
369 "*Font and size of entries for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
370 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
371 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
372 ;;;_ - allout-body-line-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
373 (defcustom allout-body-line-style " "
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
374 "*Font and size of entries for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
375 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
376 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
377 ;;;_ - allout-title-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
378 (defcustom allout-title-style "\\Large\\bf"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
379 "*Font and size of titles for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
380 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
381 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
382 ;;;_ - allout-title
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
383 (defcustom allout-title '(or buffer-file-name (current-buffer-name))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
384 "*Expression to be evaluated to determine the title for LaTeX
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
385 formatted copy."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
386 :type 'sexp
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
387 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
388 ;;;_ - allout-line-skip
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
389 (defcustom allout-line-skip ".05cm"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
390 "*Space between lines for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
391 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
392 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
393 ;;;_ - allout-indent
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
394 (defcustom allout-indent ".3cm"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
395 "*LaTeX formatted depth-indent spacing."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
396 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
397 :group 'allout)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
398
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
399 ;;;_ + Miscellaneous customization
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
400
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
401 ;;;_ = allout-command-prefix
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
402 (defcustom allout-command-prefix "\C-c"
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
403 "*Key sequence to be used as prefix for outline mode command key bindings."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
404 :type 'string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
405 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
406
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
407 ;;;_ = allout-keybindings-list
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
408 ;;; You have to reactivate allout-mode - `(allout-mode t)' - to
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
409 ;;; institute changes to this var.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
410 (defvar allout-keybindings-list ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
411 "*List of `allout-mode' key / function bindings, for `allout-mode-map'.
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
412
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
413 String or vector key will be prefaced with `allout-command-prefix',
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
414 unless optional third, non-nil element is present.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
415 (setq allout-keybindings-list
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
416 '(
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
417 ; Motion commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
418 ("\C-n" allout-next-visible-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
419 ("\C-p" allout-previous-visible-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
420 ("\C-u" allout-up-current-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
421 ("\C-f" allout-forward-current-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
422 ("\C-b" allout-backward-current-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
423 ("\C-a" allout-beginning-of-current-entry)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
424 ("\C-e" allout-end-of-current-entry)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
425 ; Exposure commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
426 ("\C-i" allout-show-children)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
427 ("\C-s" allout-show-current-subtree)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
428 ("\C-h" allout-hide-current-subtree)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
429 ("\C-o" allout-show-current-entry)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
430 ("!" allout-show-all)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
431 ; Alteration commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
432 (" " allout-open-sibtopic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
433 ("." allout-open-subtopic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
434 ("," allout-open-supertopic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
435 ("'" allout-shift-in)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
436 (">" allout-shift-in)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
437 ("<" allout-shift-out)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
438 ("\C-m" allout-rebullet-topic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
439 ("*" allout-rebullet-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
440 ("#" allout-number-siblings)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
441 ("\C-k" allout-kill-line t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
442 ("\C-y" allout-yank t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
443 ("\M-y" allout-yank-pop t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
444 ("\C-k" allout-kill-topic)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
445 ; Miscellaneous commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
446 ;([?\C-\ ] allout-mark-topic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
447 ("@" allout-resolve-xref)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
448 ("=c" allout-copy-exposed-to-buffer)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
449 ("=i" allout-indented-exposed-to-buffer)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
450 ("=t" allout-latexify-exposed)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
451 ("=p" allout-flatten-exposed-to-buffer)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
452
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
453 ;;;_ = allout-isearch-dynamic-expose
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
454 (defcustom allout-isearch-dynamic-expose t
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
455 "*Non-nil enable dynamic exposure of hidden incremental-search
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
456 targets as they're encountered."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
457 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
458 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
459 (make-variable-buffer-local 'allout-isearch-dynamic-expose)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
460
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
461 ;;;_ = allout-use-hanging-indents
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
462 (defcustom allout-use-hanging-indents t
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
463 "*If non-nil, topic body text auto-indent defaults to indent of the header.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
464 Ie, it is indented to be just past the header prefix. This is
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
465 relevant mostly for use with indented-text-mode, or other situations
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
466 where auto-fill occurs.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
467
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
468 \[This feature no longer depends in any way on the `filladapt.el'
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
469 lisp-archive package.\]"
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
470 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
471 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
472 (make-variable-buffer-local 'allout-use-hanging-indents)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
473
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
474 ;;;_ = allout-reindent-bodies
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
475 (defcustom allout-reindent-bodies (if allout-use-hanging-indents
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
476 'text)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
477 "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
478
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
479 When active, topic body lines that are indented even with or beyond
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
480 their topic header are reindented to correspond with depth shifts of
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
481 the header.
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
482
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
483 A value of t enables reindent in non-programming-code buffers, ie
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
484 those that do not have the variable `comment-start' set. A value of
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
485 `force' enables reindent whether or not `comment-start' is set."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
486 :type '(choice (const nil) (const t) (const text) (const force))
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
487 :group 'allout)
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
488
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
489 (make-variable-buffer-local 'allout-reindent-bodies)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
490
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
491 ;;;_ = allout-inhibit-protection
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
492 (defcustom allout-inhibit-protection nil
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
493 "*Non-nil disables warnings and confirmation-checks for concealed-text edits.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
494
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
495 Outline mode uses Emacs change-triggered functions to detect unruly
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
496 changes to concealed regions. Set this var non-nil to disable the
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
497 protection, potentially increasing text-entry responsiveness a bit.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
498
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
499 This var takes effect at `allout-mode' activation, so you may have to
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
500 deactivate and then reactivate the mode if you want to toggle the
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
501 behavior."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
502 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
503 :group 'allout)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
504
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
505 ;;;_* CODE - no user customizations below.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
506
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
507 ;;;_ #1 Internal Outline Formatting and Configuration
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
508 ;;;_ : Version
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
509 ;;;_ = allout-version
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
510 (defvar allout-version
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
511 (let ((rcs-rev "$Revision$"))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
512 (condition-case err
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
513 (save-match-data
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
514 (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
515 (substring rcs-rev (match-beginning 1) (match-end 1)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
516 ('error rcs-rev)))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
517 "Revision number of currently loaded outline package. \(allout.el)")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
518 ;;;_ > allout-version
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
519 (defun allout-version (&optional here)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
520 "Return string describing the loaded outline version."
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
521 (interactive "P")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
522 (let ((msg (concat "Allout Outline Mode v " allout-version)))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
523 (if here (insert msg))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
524 (message "%s" msg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
525 msg))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
526 ;;;_ : Topic header format
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
527 ;;;_ = allout-regexp
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
528 (defvar allout-regexp ""
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
529 "*Regular expression to match the beginning of a heading line.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
530
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
531 Any line whose beginning matches this regexp is considered a
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
532 heading. This var is set according to the user configuration vars
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
533 by `set-allout-regexp'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
534 (make-variable-buffer-local 'allout-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
535 ;;;_ = allout-bullets-string
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
536 (defvar allout-bullets-string ""
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
537 "A string dictating the valid set of outline topic bullets.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
538
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
539 This var should *not* be set by the user - it is set by `set-allout-regexp',
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
540 and is produced from the elements of `allout-plain-bullets-string'
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
541 and `allout-distinctive-bullets-string'.")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
542 (make-variable-buffer-local 'allout-bullets-string)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
543 ;;;_ = allout-bullets-string-len
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
544 (defvar allout-bullets-string-len 0
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
545 "Length of current buffers' `allout-plain-bullets-string'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
546 (make-variable-buffer-local 'allout-bullets-string-len)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
547 ;;;_ = allout-line-boundary-regexp
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
548 (defvar allout-line-boundary-regexp ()
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
549 "`allout-regexp' with outline style beginning-of-line anchor.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
550
7639
67b7d1ea7b2e Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 7527
diff changeset
551 \(Ie, C-j, *or* C-m, for prefixes of hidden topics). This is properly
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
552 set when `allout-regexp' is produced by `set-allout-regexp', so
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
553 that (match-beginning 2) and (match-end 2) delimit the prefix.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
554 (make-variable-buffer-local 'allout-line-boundary-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
555 ;;;_ = allout-bob-regexp
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
556 (defvar allout-bob-regexp ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
557 "Like `allout-line-boundary-regexp', for headers at beginning of buffer.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
558 \(match-beginning 2) and \(match-end 2) delimit the prefix.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
559 (make-variable-buffer-local 'allout-bob-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
560 ;;;_ = allout-header-subtraction
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
561 (defvar allout-header-subtraction (1- (length allout-header-prefix))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
562 "Allout-header prefix length to subtract when computing topic depth.")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
563 (make-variable-buffer-local 'allout-header-subtraction)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
564 ;;;_ = allout-plain-bullets-string-len
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
565 (defvar allout-plain-bullets-string-len (length allout-plain-bullets-string)
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
566 "Length of `allout-plain-bullets-string', updated by `set-allout-regexp'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
567 (make-variable-buffer-local 'allout-plain-bullets-string-len)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
568
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
569
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
570 ;;;_ X allout-reset-header-lead (header-lead)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
571 (defun allout-reset-header-lead (header-lead)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
572 "*Reset the leading string used to identify topic headers."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 (interactive "sNew lead string: ")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
574 (setq allout-header-prefix header-lead)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
575 (setq allout-header-subtraction (1- (length allout-header-prefix)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
576 (set-allout-regexp))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
577 ;;;_ X allout-lead-with-comment-string (header-lead)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
578 (defun allout-lead-with-comment-string (&optional header-lead)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
579 "*Set the topic-header leading string to specified string.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
580
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
581 Useful when for encapsulating outline structure in programming
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
582 language comments. Returns the leading string."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585 (if (not (stringp header-lead))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 (setq header-lead (read-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 "String prefix for topic headers: ")))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
588 (setq allout-reindent-bodies nil)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
589 (allout-reset-header-lead header-lead)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 header-lead)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
591 ;;;_ > allout-infer-header-lead ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
592 (defun allout-infer-header-lead ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
593 "Determine appropriate `allout-header-prefix'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
594
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
595 Works according to settings of:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
596
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
597 `comment-start'
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
598 `allout-header-prefix' (default)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
599 `allout-use-mode-specific-leader'
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
600 and `allout-mode-leaders'.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
601
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
602 Apply this via \(re)activation of `allout-mode', rather than
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
603 invoking it directly."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
604 (let* ((use-leader (and (boundp 'allout-use-mode-specific-leader)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
605 (if (or (stringp allout-use-mode-specific-leader)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
606 (memq allout-use-mode-specific-leader
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
607 '(allout-mode-leaders
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
608 comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
609 t)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
610 allout-use-mode-specific-leader
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
611 ;; Oops - garbled value, equate with effect of 't:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
612 t)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
613 (leader
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
614 (cond
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
615 ((not use-leader) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
616 ;; Use the explicitly designated leader:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
617 ((stringp use-leader) use-leader)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
618 (t (or (and (memq use-leader '(t allout-mode-leaders))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
619 ;; Get it from outline mode leaders?
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
620 (cdr (assq major-mode allout-mode-leaders)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
621 ;; ... didn't get from allout-mode-leaders...
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
622 (and (memq use-leader '(t comment-start))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
623 comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
624 ;; Use comment-start, maybe tripled, and with
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
625 ;; underscore:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
626 (concat
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
627 (if (string= " "
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
628 (substring comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
629 (1- (length comment-start))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
630 ;; Use comment-start, sans trailing space:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
631 (substring comment-start 0 -1)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
632 (concat comment-start comment-start comment-start))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
633 ;; ... and append underscore, whichever:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
634 "_")))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
635 (if (not leader)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
636 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
637 (if (string= leader allout-header-prefix)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
638 nil ; no change, nothing to do.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
639 (setq allout-header-prefix leader)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
640 allout-header-prefix))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
641 ;;;_ > allout-infer-body-reindent ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
642 (defun allout-infer-body-reindent ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
643 "Determine proper setting for `allout-reindent-bodies'.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
644
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
645 Depends on default setting of `allout-reindent-bodies' \(which see)
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
646 and presence of setting for `comment-start', to tell whether the
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
647 file is programming code."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
648 (if (and allout-reindent-bodies
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
649 comment-start
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
650 (not (eq 'force allout-reindent-bodies)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
651 (setq allout-reindent-bodies nil)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
652 ;;;_ > set-allout-regexp ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
653 (defun set-allout-regexp ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
654 "Generate proper topic-header regexp form for outline functions.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
655
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
656 Works with respect to `allout-plain-bullets-string' and
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
657 `allout-distinctive-bullets-string'."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
658
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
660 ;; Derive allout-bullets-string from user configured components:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
661 (setq allout-bullets-string "")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
662 (let ((strings (list 'allout-plain-bullets-string
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
663 'allout-distinctive-bullets-string
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
664 'allout-primary-bullet))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665 cur-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 cur-len
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
667 cur-char
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 cur-char-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 new-string)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671 (while strings
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672 (setq new-string "") (setq index 0)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 (setq cur-len (length (setq cur-string (symbol-value (car strings)))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 (while (< index cur-len)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675 (setq cur-char (aref cur-string index))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
676 (setq allout-bullets-string
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
677 (concat allout-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679 ; Single dash would denote a
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680 ; sequence, repeated denotes
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 ; a dash:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682 ((eq cur-char ?-) "--")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 ; literal close-square-bracket
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
684 ; doesn't work right in the
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685 ; expr, exclude it:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686 ((eq cur-char ?\]) "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 (t (regexp-quote (char-to-string cur-char))))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 (setq index (1+ index)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689 (setq strings (cdr strings)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
691 ;; Derive next for repeated use in allout-pending-bullet:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
692 (setq allout-plain-bullets-string-len (length allout-plain-bullets-string))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
693 (setq allout-header-subtraction (1- (length allout-header-prefix)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
694 ;; Produce the new allout-regexp:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
695 (setq allout-regexp (concat "\\(\\"
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
696 allout-header-prefix
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 "[ \t]*["
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
698 allout-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 "]\\)\\|\\"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
700 allout-primary-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 "+\\|\^l"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
702 (setq allout-line-boundary-regexp
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
703 (concat "\\([\n\r]\\)\\(" allout-regexp "\\)"))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
704 (setq allout-bob-regexp
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
705 (concat "\\(\\`\\)\\(" allout-regexp "\\)"))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706 )
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
707 ;;;_ : Key bindings
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
708 ;;;_ = allout-mode-map
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
709 (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
710 ;;;_ > produce-allout-mode-map (keymap-alist &optional base-map)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
711 (defun produce-allout-mode-map (keymap-list &optional base-map)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
712 "Produce keymap for use as allout-mode-map, from KEYMAP-LIST.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
713
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
714 Built on top of optional BASE-MAP, or empty sparse map if none specified.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
715 See doc string for allout-keybindings-list for format of binding list."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
716 (let ((map (or base-map (make-sparse-keymap)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
717 (pref (list allout-command-prefix)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
718 (mapcar (function
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
719 (lambda (cell)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
720 (let ((add-pref (null (cdr (cdr cell))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
721 (key-suff (list (car cell))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
722 (apply 'define-key
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
723 (list map
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
724 (apply 'concat (if add-pref
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
725 (append pref key-suff)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
726 key-suff))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
727 (car (cdr cell)))))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
728 keymap-list)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
729 map))
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
730
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
731 ;;;_ : Menu bar
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
732 (defvar allout-mode-exposure-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
733 (defvar allout-mode-editing-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
734 (defvar allout-mode-navigation-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
735 (defvar allout-mode-misc-menu)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
736 (defun produce-allout-mode-menubar-entries ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
737 (require 'easymenu)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
738 (easy-menu-define allout-mode-exposure-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
739 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
740 "Allout outline exposure menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
741 '("Exposure"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
742 ["Show Entry" allout-show-current-entry t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
743 ["Show Children" allout-show-children t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
744 ["Show Subtree" allout-show-current-subtree t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
745 ["Hide Subtree" allout-hide-current-subtree t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
746 ["Hide Leaves" allout-hide-current-leaves t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
747 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
748 ["Show All" allout-show-all t]))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
749 (easy-menu-define allout-mode-editing-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
750 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
751 "Allout outline editing menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
752 '("Headings"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
753 ["Open Sibling" allout-open-sibtopic t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
754 ["Open Subtopic" allout-open-subtopic t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
755 ["Open Supertopic" allout-open-supertopic t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
756 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
757 ["Shift Topic In" allout-shift-in t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
758 ["Shift Topic Out" allout-shift-out t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
759 ["Rebullet Topic" allout-rebullet-topic t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
760 ["Rebullet Heading" allout-rebullet-current-heading t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
761 ["Number Siblings" allout-number-siblings t]))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
762 (easy-menu-define allout-mode-navigation-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
763 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
764 "Allout outline navigation menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
765 '("Navigation"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
766 ["Next Visible Heading" allout-next-visible-heading t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
767 ["Previous Visible Heading"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
768 allout-previous-visible-heading t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
769 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
770 ["Up Level" allout-up-current-level t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
771 ["Forward Current Level" allout-forward-current-level t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
772 ["Backward Current Level"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
773 allout-backward-current-level t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
774 "----"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
775 ["Beginning of Entry"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
776 allout-beginning-of-current-entry t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
777 ["End of Entry" allout-end-of-current-entry t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
778 ["End of Subtree" allout-end-of-current-subtree t]))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
779 (easy-menu-define allout-mode-misc-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
780 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
781 "Allout outlines miscellaneous bindings."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
782 '("Misc"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
783 ["Version" allout-version t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
784 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
785 ["Duplicate Exposed" allout-copy-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
786 ["Duplicate Exposed, numbered"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
787 allout-flatten-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
788 ["Duplicate Exposed, indented"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
789 allout-indented-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
790 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
791 ["Set Header Lead" allout-reset-header-lead t]
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
792 ["Set New Exposure" allout-expose-topic t])))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
793 ;;;_ : Mode-Specific Variable Maintenance Utilities
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
794 ;;;_ = allout-mode-prior-settings
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
795 (defvar allout-mode-prior-settings nil
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
796 "Internal `allout-mode' use; settings to be resumed on mode deactivation.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
797 (make-variable-buffer-local 'allout-mode-prior-settings)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
798 ;;;_ > allout-resumptions (name &optional value)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
799 (defun allout-resumptions (name &optional value)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
800
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
801 "Registers or resumes settings over `allout-mode' activation/deactivation.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
802
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
803 First arg is NAME of variable affected. Optional second arg is list
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
804 containing allout-mode-specific VALUE to be imposed on named
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
805 variable, and to be registered. (It's a list so you can specify
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
806 registrations of null values.) If no value is specified, the
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
807 registered value is returned (encapsulated in the list, so the caller
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
808 can distinguish nil vs no value), and the registration is popped
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
809 from the list."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
810
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
811 (let ((on-list (assq name allout-mode-prior-settings))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
812 prior-capsule ; By `capsule' i mean a list
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813 ; containing a value, so we can
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
814 ; distinguish nil from no value.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
816
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817 (if value
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
819 ;; Registering:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820 (progn
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821 (if on-list
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 nil ; Already preserved prior value - don't mess with it.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823 ;; Register the old value, or nil if previously unbound:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
824 (setq allout-mode-prior-settings
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
825 (cons (list name
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826 (if (boundp name) (list (symbol-value name))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
827 allout-mode-prior-settings)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
828 ; And impose the new value, locally:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
829 (progn (make-local-variable name)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
830 (set name (car value))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 ;; Relinquishing:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833 (if (not on-list)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
834
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
835 ;; Oops, not registered - leave it be:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
838 ;; Some registration:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
839 ; reestablish it:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 (setq prior-capsule (car (cdr on-list)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841 (if prior-capsule
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 (set name (car prior-capsule)) ; Some prior value - reestablish it.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 (makunbound name)) ; Previously unbound - demolish var.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 ; Remove registration:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 (let (rebuild)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
846 (while allout-mode-prior-settings
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
847 (if (not (eq (car allout-mode-prior-settings)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
848 on-list))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 (setq rebuild
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
850 (cons (car allout-mode-prior-settings)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
851 rebuild)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
852 (setq allout-mode-prior-settings
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
853 (cdr allout-mode-prior-settings)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
854 (setq allout-mode-prior-settings rebuild)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855 )
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
856 ;;;_ : Mode-specific incidentals
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
857 ;;;_ = allout-during-write-cue nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
858 (defvar allout-during-write-cue nil
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
859 "Used to inhibit outline change-protection during file write.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
860
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
861 See also `allout-post-command-business', `allout-write-file-hook',
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
862 `allout-before-change-protect', and `allout-post-command-business'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
863 functions.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
864 ;;;_ = allout-pre-was-isearching nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
865 (defvar allout-pre-was-isearching nil
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
866 "Cue for isearch-dynamic-exposure mechanism, implemented in
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
867 allout-pre- and -post-command-hooks.")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
868 (make-variable-buffer-local 'allout-pre-was-isearching)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
869 ;;;_ = allout-isearch-prior-pos nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
870 (defvar allout-isearch-prior-pos nil
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
871 "Cue for isearch-dynamic-exposure tracking, used by `allout-isearch-expose'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
872 (make-variable-buffer-local 'allout-isearch-prior-pos)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
873 ;;;_ = allout-override-protect nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
874 (defvar allout-override-protect nil
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
875 "Used in `allout-mode' for regulate of concealed-text protection mechanism.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
876
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
877 Allout outline mode regulates alteration of concealed text to protect
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
878 against inadvertent, unnoticed changes. This is for use by specific,
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
879 native outline functions to temporarily override that protection.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
880 It's automatically reset to nil after every buffer modification.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
881 (make-variable-buffer-local 'allout-override-protect)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
882 ;;;_ > allout-unprotected (expr)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
883 (defmacro allout-unprotected (expression)
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
884 "Evaluate EXPRESSION with `allout-override-protect' let-bound to t."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
885 `(let ((allout-override-protect t))
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
886 ,expression))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
887 ;;;_ = allout-undo-aggregation
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
888 (defvar allout-undo-aggregation 30
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
889 "Amount of successive self-insert actions to bunch together per undo.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
890
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
891 This is purely a kludge variable, regulating the compensation for a bug in
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
892 the way that `before-change-functions' and undo interact.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
893 (make-variable-buffer-local 'allout-undo-aggregation)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
894 ;;;_ = file-var-bug hack
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
895 (defvar allout-v18/19-file-var-hack nil
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
896 "Horrible hack used to prevent invalid multiple triggering of outline
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
897 mode from prop-line file-var activation. Used by `allout-mode' function
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
898 to track repeats.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
899 ;;;_ > allout-write-file-hook ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
900 (defun allout-write-file-hook ()
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
901 "In `allout-mode', run as a `write-contents-functions' activity.
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
902
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
903 Currently just sets `allout-during-write-cue', so outline change-protection
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
904 knows to keep inactive during file write."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
905 (setq allout-during-write-cue t)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
906 nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
907
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
908 ;;;_ #2 Mode activation
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
909 ;;;_ = allout-mode
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
910 (defvar allout-mode () "Allout outline mode minor-mode flag.")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
911 (make-variable-buffer-local 'allout-mode)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
912 ;;;_ > allout-mode-p ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
913 (defmacro allout-mode-p ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
914 "Return t if `allout-mode' is active in current buffer."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
915 'allout-mode)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
916 ;;;_ = allout-explicitly-deactivated
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
917 (defvar allout-explicitly-deactivated nil
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
918 "Non-nil if `allout-mode' was last deliberately deactivated.
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
919 So `allout-post-command-business' should not reactivate it...")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
920 (make-variable-buffer-local 'allout-explicitly-deactivated)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
921 ;;;_ > allout-init (&optional mode)
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
922 ;;;###autoload
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
923 (defun allout-init (&optional mode)
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
924 "Prime `allout-mode' to enable/disable auto-activation, wrt `allout-layout'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
925
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
926 MODE is one of the following symbols:
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
927
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
928 - nil \(or no argument) deactivate auto-activation/layout;
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
929 - `activate', enable auto-activation only;
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
930 - `ask', enable auto-activation, and enable auto-layout but with
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
931 confirmation for layout operation solicited from user each time;
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
932 - `report', just report and return the current auto-activation state;
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
933 - anything else \(eg, t) for auto-activation and auto-layout, without
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
934 any confirmation check.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
935
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
936 Use this function to setup your Emacs session for automatic activation
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
937 of allout outline mode, contingent to the buffer-specific setting of
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
938 the `allout-layout' variable. (See `allout-layout' and
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
939 `allout-expose-topic' docstrings for more details on auto layout).
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
940
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
941 `allout-init' works by setting up (or removing)
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
942 `allout-find-file-hook' in `find-file-hook', and giving
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
943 `allout-auto-activation' a suitable setting.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
944
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
945 To prime your Emacs session for full auto-outline operation, include
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
946 the following two lines in your Emacs init file:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
947
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
948 \(require 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
949 \(allout-init t)"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
950
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
951 (interactive
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
952 (let ((m (completing-read
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
953 (concat "Select outline auto setup mode "
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
954 "(empty for report, ? for options) ")
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
955 '(("nil")("full")("activate")("deactivate")
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
956 ("ask") ("report") (""))
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
957 nil
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
958 t)))
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
959 (if (string= m "") 'report
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
960 (intern-soft m))))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
961 (let
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
962 ;; convenience aliases, for consistent ref to respective vars:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
963 ((hook 'allout-find-file-hook)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
964 (curr-mode 'allout-auto-activation))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
965
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
966 (cond ((not mode)
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
967 (setq find-file-hook (delq hook find-file-hook))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
968 (if (interactive-p)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
969 (message "Allout outline mode auto-activation inhibited.")))
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
970 ((eq mode 'report)
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
971 (if (memq hook find-file-hook)
48859
1c806f4edc19 (allout-init): Give report also in case auto-activation was inhibited.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48858
diff changeset
972 ;; Just punt and use the reports from each of the modes:
1c806f4edc19 (allout-init): Give report also in case auto-activation was inhibited.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48858
diff changeset
973 (allout-init (symbol-value curr-mode))
1c806f4edc19 (allout-init): Give report also in case auto-activation was inhibited.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48858
diff changeset
974 (allout-init nil)
1c806f4edc19 (allout-init): Give report also in case auto-activation was inhibited.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48858
diff changeset
975 (message "Allout outline mode auto-activation inhibited.")))
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
976 (t (add-hook 'find-file-hook hook)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
977 (set curr-mode ; `set', not `setq'!
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
978 (cond ((eq mode 'activate)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
979 (message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
980 "Outline mode auto-activation enabled.")
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
981 'activate)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
982 ((eq mode 'report)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
983 ;; Return the current mode setting:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
984 (allout-init mode))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
985 ((eq mode 'ask)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
986 (message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
987 (concat "Outline mode auto-activation and "
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
988 "-layout \(upon confirmation) enabled."))
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
989 'ask)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
990 ((message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
991 "Outline mode auto-activation and -layout enabled.")
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
992 'full)))))))
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
993
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
994 ;;;_ > allout-setup-menubar ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
995 (defun allout-setup-menubar ()
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
996 "Populate the current buffer's menubar with `allout-mode' stuff."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
997 (let ((menus (list allout-mode-exposure-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
998 allout-mode-editing-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
999 allout-mode-navigation-menu
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1000 allout-mode-misc-menu))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1001 cur)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1002 (while menus
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1003 (setq cur (car menus)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1004 menus (cdr menus))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1005 (easy-menu-add cur))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1006 ;;;_ > allout-mode (&optional toggle)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1007 ;;;_ : Defun:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1008 (defun allout-mode (&optional toggle)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1009 ;;;_ . Doc string:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1010 "Toggle minor mode for controlling exposure and editing of text outlines.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1011
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1012 Optional arg forces mode to re-initialize iff arg is positive num or
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1013 symbol. Allout outline mode always runs as a minor mode.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1014
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1015 Allout outline mode provides extensive outline oriented formatting and
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1016 manipulation. It enables structural editing of outlines, as well as
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1017 navigation and exposure. It also is specifically aimed at
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1018 accommodating syntax-sensitive text like programming languages. \(For
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1019 an example, see the allout code itself, which is organized as an allout
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1020 outline.)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1021
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1022 In addition to outline navigation and exposure, allout includes:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1023
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1024 - topic-oriented repositioning, cut, and paste
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1025 - integral outline exposure-layout
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1026 - incremental search with dynamic exposure and reconcealment of hidden text
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1027 - automatic topic-number maintenance
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1028 - \"Hot-spot\" operation, for single-keystroke maneuvering and
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1029 exposure control. \(See the allout-mode docstring.)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1030
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1031 and many other features.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1032
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1033 Below is a description of the bindings, and then explanation of
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1034 special `allout-mode' features and terminology. See also the outline
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1035 menubar additions for quick reference to many of the features, and see
54458
a0176bcc103f (allout-mode): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 54223
diff changeset
1036 the docstring of the function `allout-init' for instructions on
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1037 priming your Emacs session for automatic activation of `allout-mode'.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1038
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1039
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1040 The bindings are dictated by the `allout-keybindings-list' and
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1041 `allout-command-prefix' variables.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1042
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1043 Navigation: Exposure Control:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1044 ---------- ----------------
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1045 C-c C-n allout-next-visible-heading | C-c C-h allout-hide-current-subtree
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1046 C-c C-p allout-previous-visible-heading | C-c C-i allout-show-children
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1047 C-c C-u allout-up-current-level | C-c C-s allout-show-current-subtree
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1048 C-c C-f allout-forward-current-level | C-c C-o allout-show-current-entry
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1049 C-c C-b allout-backward-current-level | ^U C-c C-s allout-show-all
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1050 C-c C-e allout-end-of-current-entry | allout-hide-current-leaves
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1051 C-c C-a allout-beginning-of-current-entry, alternately, goes to hot-spot
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1052
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1053 Topic Header Production:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1054 -----------------------
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1055 C-c<SP> allout-open-sibtopic Create a new sibling after current topic.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1056 C-c . allout-open-subtopic ... an offspring of current topic.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1057 C-c , allout-open-supertopic ... a sibling of the current topic's parent.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1058
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1059 Topic Level and Prefix Adjustment:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1060 ---------------------------------
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1061 C-c > allout-shift-in Shift current topic and all offspring deeper.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1062 C-c < allout-shift-out ... less deep.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1063 C-c<CR> allout-rebullet-topic Reconcile bullets of topic and its offspring
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1064 - distinctive bullets are not changed, others
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1065 alternated according to nesting depth.
52861
ea2fdd7f3ff6 (allout-mode): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 52401
diff changeset
1066 C-c * allout-rebullet-current-heading Prompt for alternate bullet for
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1067 current topic.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1068 C-c # allout-number-siblings Number bullets of topic and siblings - the
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1069 offspring are not affected. With repeat
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1070 count, revoke numbering.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1071
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1072 Topic-oriented Killing and Yanking:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1073 ----------------------------------
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1074 C-c C-k allout-kill-topic Kill current topic, including offspring.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1075 C-k allout-kill-line Like kill-line, but reconciles numbering, etc.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1076 C-y allout-yank Yank, adjusting depth of yanked topic to
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1077 depth of heading if yanking into bare topic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1078 heading (ie, prefix sans text).
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1079 M-y allout-yank-pop Is to allout-yank as yank-pop is to yank
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1080
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1081 Misc commands:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1082 -------------
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1083 M-x outlineify-sticky Activate outline mode for current buffer,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1084 and establish a default file-var setting
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1085 for `allout-layout'.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1086 C-c C-SPC allout-mark-topic
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1087 C-c = c allout-copy-exposed-to-buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1088 Duplicate outline, sans concealed text, to
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1089 buffer with name derived from derived from
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1090 that of current buffer - \"*XXX exposed*\".
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1091 C-c = p allout-flatten-exposed-to-buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1092 Like above 'copy-exposed', but convert topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1093 prefixes to section.subsection... numeric
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1094 format.
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1095 ESC ESC (allout-init t) Setup Emacs session for outline mode
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1096 auto-activation.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1097
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1098 HOT-SPOT Operation
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1099
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1100 Hot-spot operation provides a means for easy, single-keystroke outline
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1101 navigation and exposure control.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1102
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1103 \\<allout-mode-map>
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1104 When the text cursor is positioned directly on the bullet character of
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1105 a topic, regular characters (a to z) invoke the commands of the
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1106 corresponding allout-mode keymap control chars. For example, \"f\"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1107 would invoke the command typically bound to \"C-c C-f\"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1108 \(\\[allout-forward-current-level] `allout-forward-current-level').
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1109
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1110 Thus, by positioning the cursor on a topic bullet, you can execute
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1111 the outline navigation and manipulation commands with a single
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1112 keystroke. Non-literal chars never get this special translation, so
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1113 you can use them to get away from the hot-spot, and back to normal
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1114 operation.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1115
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1116 Note that the command `allout-beginning-of-current-entry' \(\\[allout-beginning-of-current-entry]\)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1117 will move to the hot-spot when the cursor is already located at the
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1118 beginning of the current entry, so you can simply hit \\[allout-beginning-of-current-entry]
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1119 twice in a row to get to the hot-spot.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1120
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1121 Terminology
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1122
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1123 Topic hierarchy constituents - TOPICS and SUBTOPICS:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1124
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1125 TOPIC: A basic, coherent component of an Emacs outline. It can
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1126 contain other topics, and it can be subsumed by other topics,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1127 CURRENT topic:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1128 The visible topic most immediately containing the cursor.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1129 DEPTH: The degree of nesting of a topic; it increases with
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1130 containment. Also called the:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1131 LEVEL: The same as DEPTH.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1132
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1133 ANCESTORS:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1134 The topics that contain a topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1135 PARENT: A topic's immediate ancestor. It has a depth one less than
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1136 the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1137 OFFSPRING:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1138 The topics contained by a topic;
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1139 SUBTOPIC:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1140 An immediate offspring of a topic;
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1141 CHILDREN:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1142 The immediate offspring of a topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1143 SIBLINGS:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1144 Topics having the same parent and depth.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1145
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1146 Topic text constituents:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1147
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1148 HEADER: The first line of a topic, include the topic PREFIX and header
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1149 text.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1150 PREFIX: The leading text of a topic which which distinguishes it from
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1151 normal text. It has a strict form, which consists of a
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1152 prefix-lead string, padding, and a bullet. The bullet may be
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1153 followed by a number, indicating the ordinal number of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1154 topic among its siblings, a space, and then the header text.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1155
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1156 The relative length of the PREFIX determines the nesting depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1157 of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1158 PREFIX-LEAD:
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1159 The string at the beginning of a topic prefix, normally a `.'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1160 It can be customized by changing the setting of
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1161 `allout-header-prefix' and then reinitializing `allout-mode'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1162
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1163 By setting the prefix-lead to the comment-string of a
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1164 programming language, you can embed outline structuring in
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1165 program code without interfering with the language processing
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1166 of that code. See `allout-use-mode-specific-leader'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1167 docstring for more detail.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1168 PREFIX-PADDING:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1169 Spaces or asterisks which separate the prefix-lead and the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1170 bullet, according to the depth of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1171 BULLET: A character at the end of the topic prefix, it must be one of
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1172 the characters listed on `allout-plain-bullets-string' or
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1173 `allout-distinctive-bullets-string'. (See the documentation
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1174 for these variables for more details.) The default choice of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1175 bullet when generating varies in a cycle with the depth of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1176 topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1177 ENTRY: The text contained in a topic before any offspring.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1178 BODY: Same as ENTRY.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1179
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1180
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1181 EXPOSURE:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1182 The state of a topic which determines the on-screen visibility
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1183 of its offspring and contained text.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1184 CONCEALED:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1185 Topics and entry text whose display is inhibited. Contiguous
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1186 units of concealed text is represented by `...' ellipses.
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1187 (Ref the `selective-display' var.)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1188
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1189 Concealed topics are effectively collapsed within an ancestor.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1190 CLOSED: A topic whose immediate offspring and body-text is concealed.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1191 OPEN: A topic that is not closed, though its offspring or body may be."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1192 ;;;_ . Code
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1193 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1194
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1195 (let* ((active (and (not (equal major-mode 'outline))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1196 (allout-mode-p)))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1197 ; Massage universal-arg `toggle' val:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1198 (toggle (and toggle
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1199 (or (and (listp toggle)(car toggle))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1200 toggle)))
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
1201 ; Activation specifically demanded?
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1202 (explicit-activation (or
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1203 ;;
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1204 (and toggle
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1205 (or (symbolp toggle)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1206 (and (natnump toggle)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1207 (not (zerop toggle)))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1208 ;; allout-mode already called once during this complex command?
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1209 (same-complex-command (eq allout-v18/19-file-var-hack
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1210 (car command-history)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1211 do-layout
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1212 )
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1213
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1214 ; See comments below re v19.18,.19 bug.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1215 (setq allout-v18/19-file-var-hack (car command-history))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1216
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1217 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1218
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1219 ;; Provision for v19.18, 19.19 bug -
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1220 ;; Emacs v 19.18, 19.19 file-var code invokes prop-line-designated
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1221 ;; modes twice when file is visited. We have to avoid toggling mode
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1222 ;; off on second invocation, so we detect it as best we can, and
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1223 ;; skip everything.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1224 ((and same-complex-command ; Still in same complex command
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1225 ; as last time `allout-mode' invoked.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1226 active ; Already activated.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1227 (not explicit-activation) ; Prop-line file-vars don't have args.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1228 (string-match "^19.1[89]" ; Bug only known to be in v19.18 and
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1229 emacs-version)); 19.19.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1230 t)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1231
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1232 ;; Deactivation:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1233 ((and (not explicit-activation)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1234 (or active toggle))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1235 ; Activation not explicitly
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1236 ; requested, and either in
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1237 ; active state or *de*activation
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1238 ; specifically requested:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1239 (setq allout-explicitly-deactivated t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1240
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1241 (if allout-old-style-prefixes
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1242 (progn
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1243 (allout-resumptions 'allout-primary-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1244 (allout-resumptions 'allout-old-style-prefixes)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1245 (allout-resumptions 'selective-display)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1246 (if (and (boundp 'before-change-functions) before-change-functions)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1247 (allout-resumptions 'before-change-functions))
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1248 (setq write-contents-functions
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1249 (delq 'allout-write-file-hook
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1250 write-contents-functions))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1251 (allout-resumptions 'paragraph-start)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1252 (allout-resumptions 'paragraph-separate)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1253 (allout-resumptions (if (string-match "^18" emacs-version)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1254 'auto-fill-hook
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1255 'auto-fill-function))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1256 (allout-resumptions 'allout-former-auto-filler)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1257 (setq allout-mode nil))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1258
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1259 ;; Activation:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1260 ((not active)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1261 (setq allout-explicitly-deactivated nil)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1262 (if allout-old-style-prefixes
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1263 (progn ; Inhibit all the fancy formatting:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1264 (allout-resumptions 'allout-primary-bullet '("*"))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1265 (allout-resumptions 'allout-old-style-prefixes '(()))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1266
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1267 (allout-infer-header-lead)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1268 (allout-infer-body-reindent)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1269
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1270 (set-allout-regexp)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1271
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1272 ; Produce map from current version
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1273 ; of allout-keybindings-list:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1274 (if (boundp 'minor-mode-map-alist)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1275
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1276 (progn ; V19, and maybe lucid and
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1277 ; epoch, minor-mode key bindings:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1278 (setq allout-mode-map
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1279 (produce-allout-mode-map allout-keybindings-list))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1280 (produce-allout-mode-menubar-entries)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1281 (fset 'allout-mode-map allout-mode-map)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1282 ; Include on minor-mode-map-alist,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1283 ; if not already there:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1284 (if (not (member '(allout-mode . allout-mode-map)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1285 minor-mode-map-alist))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1286 (setq minor-mode-map-alist
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1287 (cons '(allout-mode . allout-mode-map)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1288 minor-mode-map-alist))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1289
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1290 ; and add them:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1291 (use-local-map (produce-allout-mode-map allout-keybindings-list
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1292 (current-local-map)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1293 )
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1294
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1295 ; selective-display is the
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1296 ; Emacs conditional exposure
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1297 ; mechanism:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1298 (allout-resumptions 'selective-display '(t))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1299 (if allout-inhibit-protection
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1300 t
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1301 (allout-resumptions 'before-change-functions
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1302 '(allout-before-change-protect)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1303 (add-hook 'pre-command-hook 'allout-pre-command-business)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1304 (add-hook 'post-command-hook 'allout-post-command-business)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1305 ; Temporarily set by any outline
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1306 ; functions that can be trusted to
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1307 ; deal properly with concealed text.
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1308 (add-hook 'write-contents-functions 'allout-write-file-hook)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1309 ; Custom auto-fill func, to support
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1310 ; respect for topic headline,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1311 ; hanging-indents, etc:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1312 (let* ((fill-func-var (if (string-match "^18" emacs-version)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1313 'auto-fill-hook
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1314 'auto-fill-function))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1315 (fill-func (symbol-value fill-func-var)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1316 ;; Register prevailing fill func for use by allout-auto-fill:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1317 (allout-resumptions 'allout-former-auto-filler (list fill-func))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1318 ;; Register allout-auto-fill to be used if filling is active:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1319 (allout-resumptions fill-func-var '(allout-auto-fill)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1320 ;; Paragraphs are broken by topic headlines.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1321 (make-local-variable 'paragraph-start)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1322 (allout-resumptions 'paragraph-start
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1323 (list (concat paragraph-start "\\|^\\("
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1324 allout-regexp "\\)")))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325 (make-local-variable 'paragraph-separate)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1326 (allout-resumptions 'paragraph-separate
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1327 (list (concat paragraph-separate "\\|^\\("
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1328 allout-regexp "\\)")))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1329
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1330 (or (assq 'allout-mode minor-mode-alist)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1331 (setq minor-mode-alist
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1332 (cons '(allout-mode " Allout") minor-mode-alist)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1333
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1334 (allout-setup-menubar)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1335
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1336 (if allout-layout
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1337 (setq do-layout t))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1338
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
1339 (if allout-isearch-dynamic-expose
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1340 (allout-enwrap-isearch))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1341
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1342 (run-hooks 'allout-mode-hook)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1343 (setq allout-mode t))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1344
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1345 ;; Reactivation:
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1346 ((setq do-layout t)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1347 (allout-infer-body-reindent))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1348 ) ; cond
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1349
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1350 (if (and do-layout
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1351 allout-auto-activation
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1352 (listp allout-layout)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1353 (and (not (eq allout-auto-activation 'activate))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1354 (if (eq allout-auto-activation 'ask)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1355 (if (y-or-n-p (format "Expose %s with layout '%s'? "
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1356 (buffer-name)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1357 allout-layout))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1358 t
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1359 (message "Skipped %s layout." (buffer-name))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1360 nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1361 t)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1362 (save-excursion
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1363 (message "Adjusting '%s' exposure..." (buffer-name))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1364 (goto-char 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1365 (allout-this-or-next-heading)
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1366 (condition-case err
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1367 (progn
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1368 (apply 'allout-expose-topic (list allout-layout))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1369 (message "Adjusting '%s' exposure... done." (buffer-name)))
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1370 ;; Problem applying exposure - notify user, but don't
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1371 ;; interrupt, eg, file visit:
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1372 (error (message "%s" (car (cdr err)))
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1373 (sit-for 1)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1374 allout-mode
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1375 ) ; let*
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1376 ) ; defun
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1377 ;;;_ > allout-minor-mode
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1378 ;;; XXX released verion doesn't do this?
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1379 (defalias 'allout-minor-mode 'allout-mode)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1380
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1381 ;;;_ #3 Internal Position State-Tracking - "allout-recent-*" funcs
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1382 ;;; All the basic outline functions that directly do string matches to
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1383 ;;; evaluate heading prefix location set the variables
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1384 ;;; `allout-recent-prefix-beginning' and `allout-recent-prefix-end'
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1385 ;;; when successful. Functions starting with `allout-recent-' all
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1386 ;;; use this state, providing the means to avoid redundant searches
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1387 ;;; for just-established data. This optimization can provide
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1388 ;;; significant speed improvement, but it must be employed carefully.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1389 ;;;_ = allout-recent-prefix-beginning
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1390 (defvar allout-recent-prefix-beginning 0
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1391 "Buffer point of the start of the last topic prefix encountered.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1392 (make-variable-buffer-local 'allout-recent-prefix-beginning)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1393 ;;;_ = allout-recent-prefix-end
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1394 (defvar allout-recent-prefix-end 0
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1395 "Buffer point of the end of the last topic prefix encountered.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1396 (make-variable-buffer-local 'allout-recent-prefix-end)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1397 ;;;_ = allout-recent-end-of-subtree
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1398 (defvar allout-recent-end-of-subtree 0
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1399 "Buffer point last returned by `allout-end-of-current-subtree'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1400 (make-variable-buffer-local 'allout-recent-end-of-subtree)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1401 ;;;_ > allout-prefix-data (beg end)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
1402 (defmacro allout-prefix-data (beginning end)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1403 "Register allout-prefix state data - BEGINNING and END of prefix.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1404
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1405 For reference by `allout-recent' funcs. Returns BEGINNING."
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1406 `(setq allout-recent-prefix-end ,end
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
1407 allout-recent-prefix-beginning ,beginning))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1408 ;;;_ > allout-recent-depth ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1409 (defmacro allout-recent-depth ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1410 "Return depth of last heading encountered by an outline maneuvering function.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1411
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1412 All outline functions which directly do string matches to assess
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1413 headings set the variables `allout-recent-prefix-beginning' and
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1414 `allout-recent-prefix-end' if successful. This function uses those settings
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1415 to return the current depth."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1416
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1417 '(max 1 (- allout-recent-prefix-end
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1418 allout-recent-prefix-beginning
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1419 allout-header-subtraction)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1420 ;;;_ > allout-recent-prefix ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1421 (defmacro allout-recent-prefix ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1422 "Like `allout-recent-depth', but returns text of last encountered prefix.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1423
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1424 All outline functions which directly do string matches to assess
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1425 headings set the variables `allout-recent-prefix-beginning' and
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1426 `allout-recent-prefix-end' if successful. This function uses those settings
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1427 to return the current depth."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1428 '(buffer-substring allout-recent-prefix-beginning
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1429 allout-recent-prefix-end))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1430 ;;;_ > allout-recent-bullet ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1431 (defmacro allout-recent-bullet ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1432 "Like allout-recent-prefix, but returns bullet of last encountered prefix.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1433
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1434 All outline functions which directly do string matches to assess
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1435 headings set the variables `allout-recent-prefix-beginning' and
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1436 `allout-recent-prefix-end' if successful. This function uses those settings
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1437 to return the current depth of the most recently matched topic."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1438 '(buffer-substring (1- allout-recent-prefix-end)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1439 allout-recent-prefix-end))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1440
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1441 ;;;_ #4 Navigation
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1442
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1443 ;;;_ - Position Assessment
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1444 ;;;_ : Location Predicates
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1445 ;;;_ > allout-on-current-heading-p ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1446 (defun allout-on-current-heading-p ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1447 "Return non-nil if point is on current visible topics' header line.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1448
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1449 Actually, returns prefix beginning point."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1450 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1451 (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1452 (and (looking-at allout-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1453 (allout-prefix-data (match-beginning 0) (match-end 0)))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1454 ;;;_ > allout-on-heading-p ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1455 (defalias 'allout-on-heading-p 'allout-on-current-heading-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1456 ;;;_ > allout-e-o-prefix-p ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1457 (defun allout-e-o-prefix-p ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1458 "True if point is located where current topic prefix ends, heading begins."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1459 (and (save-excursion (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1460 (looking-at allout-regexp))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1461 (= (point)(save-excursion (allout-end-of-prefix)(point)))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1462 ;;;_ > allout-hidden-p ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1463 (defmacro allout-hidden-p ()
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1464 "True if point is in hidden text."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1465 '(save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1466 (and (re-search-backward "[\n\r]" () t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1467 (= ?\r (following-char)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1468 ;;;_ > allout-visible-p ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1469 (defmacro allout-visible-p ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1470 "True if point is not in hidden text."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1471 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1472 '(not (allout-hidden-p)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1473 ;;;_ : Location attributes
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1474 ;;;_ > allout-depth ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1475 (defsubst allout-depth ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1476 "Like `allout-current-depth', but respects hidden as well as visible topics."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1477 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1478 (if (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1479 (allout-recent-depth)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1480 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1481 ;; Oops, no prefix, zero prefix data:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1482 (allout-prefix-data (point)(point))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1483 ;; ... and return 0:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1484 0))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1485 ;;;_ > allout-current-depth ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1486 (defmacro allout-current-depth ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1487 "Return nesting depth of visible topic most immediately containing point."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1488 '(save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1489 (if (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1490 (max 1
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1491 (- allout-recent-prefix-end
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1492 allout-recent-prefix-beginning
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1493 allout-header-subtraction))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1494 0)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1495 ;;;_ > allout-get-current-prefix ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1496 (defun allout-get-current-prefix ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1497 "Topic prefix of the current topic."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1498 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1499 (if (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1500 (allout-recent-prefix))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1501 ;;;_ > allout-get-bullet ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1502 (defun allout-get-bullet ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1503 "Return bullet of containing topic (visible or not)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1504 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1505 (and (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1506 (allout-recent-bullet))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1507 ;;;_ > allout-current-bullet ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1508 (defun allout-current-bullet ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1509 "Return bullet of current (visible) topic heading, or none if none found."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1510 (condition-case err
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1511 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1512 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1513 (buffer-substring (- allout-recent-prefix-end 1)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1514 allout-recent-prefix-end))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1515 ;; Quick and dirty provision, ostensibly for missing bullet:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1516 ('args-out-of-range nil))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1517 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1518 ;;;_ > allout-get-prefix-bullet (prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1519 (defun allout-get-prefix-bullet (prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1520 "Return the bullet of the header prefix string PREFIX."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1521 ;; Doesn't make sense if we're old-style prefixes, but this just
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1522 ;; oughtn't be called then, so forget about it...
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1523 (if (string-match allout-regexp prefix)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1524 (substring prefix (1- (match-end 0)) (match-end 0))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1525 ;;;_ > allout-sibling-index (&optional depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1526 (defun allout-sibling-index (&optional depth)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1527 "Item number of this prospective topic among its siblings.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1528
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1529 If optional arg DEPTH is greater than current depth, then we're
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1530 opening a new level, and return 0.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1531
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1532 If less than this depth, ascend to that depth and count..."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1533
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1534 (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1535 (cond ((and depth (<= depth 0) 0))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1536 ((or (not depth) (= depth (allout-depth)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1537 (let ((index 1))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1538 (while (allout-previous-sibling (allout-recent-depth) nil)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1539 (setq index (1+ index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1540 index))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1541 ((< depth (allout-recent-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1542 (allout-ascend-to-depth depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1543 (allout-sibling-index))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1544 (0))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1545 ;;;_ > allout-topic-flat-index ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1546 (defun allout-topic-flat-index ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1547 "Return a list indicating point's numeric section.subsect.subsubsect...
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1548 Outermost is first."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1549 (let* ((depth (allout-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1550 (next-index (allout-sibling-index depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1551 (rev-sibls nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1552 (while (> next-index 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1553 (setq rev-sibls (cons next-index rev-sibls))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1554 (setq depth (1- depth))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1555 (setq next-index (allout-sibling-index depth)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1556 rev-sibls)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1557 )
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1558
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1559 ;;;_ - Navigation macros
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1560 ;;;_ > allout-next-heading ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1561 (defsubst allout-next-heading ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1562 "Move to the heading for the topic \(possibly invisible) before this one.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1563
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1564 Returns the location of the heading, or nil if none found."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1565
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1566 (if (and (bobp) (not (eobp)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1567 (forward-char 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1568
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1569 (if (re-search-forward allout-line-boundary-regexp nil 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1570 (allout-prefix-data ; Got valid location state - set vars:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1571 (goto-char (or (match-beginning 2)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1572 allout-recent-prefix-beginning))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1573 (or (match-end 2) allout-recent-prefix-end))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1574 ;;;_ : allout-this-or-next-heading
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1575 (defun allout-this-or-next-heading ()
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1576 "Position cursor on current or next heading."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1577 ;; A throwaway non-macro that is defined after allout-next-heading
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1578 ;; and usable by allout-mode.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1579 (if (not (allout-goto-prefix)) (allout-next-heading)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1580 ;;;_ > allout-previous-heading ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1581 (defmacro allout-previous-heading ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1582 "Move to the prior \(possibly invisible) heading line.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1583
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1584 Return the location of the beginning of the heading, or nil if not found."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1585
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1586 '(if (bobp)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1587 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1588 (allout-goto-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1589 (if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1590 ;; searches are unbounded and return nil if failed:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1591 (or (re-search-backward allout-line-boundary-regexp nil 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1592 (looking-at allout-bob-regexp))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1593 (progn ; Got valid location state - set vars:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1594 (allout-prefix-data
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1595 (goto-char (or (match-beginning 2)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1596 allout-recent-prefix-beginning))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1597 (or (match-end 2) allout-recent-prefix-end))))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1598
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1599 ;;;_ - Subtree Charting
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1600 ;;;_ " These routines either produce or assess charts, which are
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1601 ;;; nested lists of the locations of topics within a subtree.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1602 ;;;
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1603 ;;; Use of charts enables efficient navigation of subtrees, by
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1604 ;;; requiring only a single regexp-search based traversal, to scope
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1605 ;;; out the subtopic locations. The chart then serves as the basis
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1606 ;;; for assessment or adjustment of the subtree, without redundant
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1607 ;;; traversal of the structure.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1608
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1609 ;;;_ > allout-chart-subtree (&optional levels orig-depth prev-depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1610 (defun allout-chart-subtree (&optional levels orig-depth prev-depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1611 "Produce a location \"chart\" of subtopics of the containing topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1612
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
1613 Optional argument LEVELS specifies the depth \(relative to start
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1614 depth) for the chart.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1615
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1616 Charts are used to capture outline structure, so that outline altering
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1617 routines need assess the structure only once, and then use the chart
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1618 for their elaborate manipulations.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1619
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1620 Topics are entered in the chart so the last one is at the car.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1621 The entry for each topic consists of an integer indicating the point
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1622 at the beginning of the topic. Charts for offspring consists of a
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1623 list containing, recursively, the charts for the respective subtopics.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1624 The chart for a topics' offspring precedes the entry for the topic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1625 itself.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1626
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
1627 \(fn &optional LEVELS)"
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1628
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1629 ;; The other function parameters are for internal recursion, and should
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1630 ;; not be specified by external callers. ORIG-DEPTH is depth of topic at
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1631 ;; starting point, and PREV-DEPTH is depth of prior topic."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1632
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1633 (let ((original (not orig-depth)) ; `orig-depth' set only in recursion.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1634 chart curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1635
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1636 (if original ; Just starting?
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1637 ; Register initial settings and
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1638 ; position to first offspring:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1639 (progn (setq orig-depth (allout-depth))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1640 (or prev-depth (setq prev-depth (1+ orig-depth)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1641 (allout-next-heading)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1642
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1643 ;; Loop over the current levels' siblings. Besides being more
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1644 ;; efficient than tail-recursing over a level, it avoids exceeding
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1645 ;; the typically quite constrained Emacs max-lisp-eval-depth.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1646 ;;
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1647 ;; Probably would speed things up to implement loop-based stack
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1648 ;; operation rather than recursing for lower levels. Bah.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1649
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1650 (while (and (not (eobp))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1651 ; Still within original topic?
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1652 (< orig-depth (setq curr-depth (allout-recent-depth)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1653 (cond ((= prev-depth curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1654 ;; Register this one and move on:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1655 (setq chart (cons (point) chart))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1656 (if (and levels (<= levels 1))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1657 ;; At depth limit - skip sublevels:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1658 (or (allout-next-sibling curr-depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1659 ;; or no more siblings - proceed to
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1660 ;; next heading at lesser depth:
7676
5b8a573e9f69 (outline-chart-subtree): Include outline-next-heading in loop conditions
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
1661 (while (and (<= curr-depth
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1662 (allout-recent-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1663 (allout-next-heading))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1664 (allout-next-heading)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1665
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1666 ((and (< prev-depth curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1667 (or (not levels)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1668 (> levels 0)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1669 ;; Recurse on deeper level of curr topic:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1670 (setq chart
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1671 (cons (allout-chart-subtree (and levels
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1672 (1- levels))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1673 orig-depth
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1674 curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1675 chart))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1676 ;; ... then continue with this one.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1677 )
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1678
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1679 ;; ... else nil if we've ascended back to prev-depth.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1680
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1681 )))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1682
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1683 (if original ; We're at the last sibling on
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1684 ; the original level. Position
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1685 ; to the end of it:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1686 (progn (and (not (eobp)) (forward-char -1))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1687 (and (memq (preceding-char) '(?\n ?\r))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1688 (memq (aref (buffer-substring (max 1 (- (point) 3))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1689 (point))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1690 1)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1691 '(?\n ?\r))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1692 (forward-char -1))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1693 (setq allout-recent-end-of-subtree (point))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1694
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1695 chart ; (nreverse chart) not necessary,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1696 ; and maybe not preferable.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1697 ))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1698 ;;;_ > allout-chart-siblings (&optional start end)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1699 (defun allout-chart-siblings (&optional start end)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1700 "Produce a list of locations of this and succeeding sibling topics.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1701 Effectively a top-level chart of siblings. See `allout-chart-subtree'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1702 for an explanation of charts."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1703 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1704 (if (allout-goto-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1705 (let ((chart (list (point))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1706 (while (allout-next-sibling)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1707 (setq chart (cons (point) chart)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1708 (if chart (setq chart (nreverse chart)))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1709 ;;;_ > allout-chart-to-reveal (chart depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1710 (defun allout-chart-to-reveal (chart depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1711
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1712 "Return a flat list of hidden points in subtree CHART, up to DEPTH.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1713
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1714 Note that point can be left at any of the points on chart, or at the
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1715 start point."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1716
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1717 (let (result here)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1718 (while (and (or (eq depth t) (> depth 0))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1719 chart)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1720 (setq here (car chart))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1721 (if (listp here)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1722 (let ((further (allout-chart-to-reveal here (or (eq depth t)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1723 (1- depth)))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1724 ;; We're on the start of a subtree - recurse with it, if there's
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1725 ;; more depth to go:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1726 (if further (setq result (append further result)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1727 (setq chart (cdr chart)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1728 (goto-char here)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1729 (if (= (preceding-char) ?\r)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1730 (setq result (cons here result)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1731 (setq chart (cdr chart))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1732 result))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1733 ;;;_ X allout-chart-spec (chart spec &optional exposing)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1734 ;; (defun allout-chart-spec (chart spec &optional exposing)
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1735 ;; "Not yet \(if ever) implemented.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1736
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1737 ;; Produce exposure directives given topic/subtree CHART and an exposure SPEC.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1738
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1739 ;; Exposure spec indicates the locations to be exposed and the prescribed
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1740 ;; exposure status. Optional arg EXPOSING is an integer, with 0
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1741 ;; indicating pending concealment, anything higher indicating depth to
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1742 ;; which subtopic headers should be exposed, and negative numbers
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1743 ;; indicating (negative of) the depth to which subtopic headers and
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1744 ;; bodies should be exposed.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1745
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1746 ;; The produced list can have two types of entries. Bare numbers
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1747 ;; indicate points in the buffer where topic headers that should be
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1748 ;; exposed reside.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1749
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1750 ;; - bare negative numbers indicates that the topic starting at the
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1751 ;; point which is the negative of the number should be opened,
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1752 ;; including their entries.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1753 ;; - bare positive values indicate that this topic header should be
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1754 ;; opened.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1755 ;; - Lists signify the beginning and end points of regions that should
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1756 ;; be flagged, and the flag to employ. (For concealment: `\(\?r\)', and
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1757 ;; exposure:"
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1758 ;; (while spec
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1759 ;; (cond ((listp spec)
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1760 ;; )
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1761 ;; )
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1762 ;; (setq spec (cdr spec)))
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1763 ;; )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1764
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1765 ;;;_ - Within Topic
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1766 ;;;_ > allout-goto-prefix ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1767 (defun allout-goto-prefix ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1768 "Put point at beginning of immediately containing outline topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1769
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1770 Goes to most immediate subsequent topic if none immediately containing.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1771
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1772 Not sensitive to topic visibility.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1773
46161
29f1f32aee5b (outline-goto-prefix): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 44182
diff changeset
1774 Returns the point at the beginning of the prefix, or nil if none."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1775
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1776 (let (done)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1777 (while (and (not done)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1778 (re-search-backward "[\n\r]" nil 1))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1779 (forward-char 1)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1780 (if (looking-at allout-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1781 (setq done (allout-prefix-data (match-beginning 0)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1782 (match-end 0)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1783 (forward-char -1)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1784 (if (bobp)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1785 (cond ((looking-at allout-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1786 (allout-prefix-data (match-beginning 0)(match-end 0)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1787 ((allout-next-heading))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1788 (done))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1789 done)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1790 ;;;_ > allout-end-of-prefix ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1791 (defun allout-end-of-prefix (&optional ignore-decorations)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1792 "Position cursor at beginning of header text.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1793
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1794 If optional IGNORE-DECORATIONS is non-nil, put just after bullet,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1795 otherwise skip white space between bullet and ensuing text."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1796
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1797 (if (not (allout-goto-prefix))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1798 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1799 (let ((match-data (match-data)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1800 (goto-char (match-end 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1801 (if ignore-decorations
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1802 t
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1803 (while (looking-at "[0-9]") (forward-char 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1804 (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1805 (store-match-data match-data))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1806 ;; Reestablish where we are:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1807 (allout-current-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1808 ;;;_ > allout-current-bullet-pos ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1809 (defun allout-current-bullet-pos ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1810 "Return position of current \(visible) topic's bullet."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1811
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1812 (if (not (allout-current-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1813 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1814 (1- (match-end 0))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1815 ;;;_ > allout-back-to-current-heading ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1816 (defun allout-back-to-current-heading ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1817 "Move to heading line of current topic, or beginning if already on the line."
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1818
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1819 (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1820 (prog1 (or (allout-on-current-heading-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1821 (and (re-search-backward (concat "^\\(" allout-regexp "\\)")
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1822 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1823 'move)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1824 (allout-prefix-data (match-beginning 1)(match-end 1))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1825 (if (interactive-p) (allout-end-of-prefix))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1826 ;;;_ > allout-back-to-heading ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1827 (defalias 'allout-back-to-heading 'allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1828 ;;;_ > allout-pre-next-preface ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1829 (defun allout-pre-next-preface ()
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1830 "Skip forward to just before the next heading line.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1831
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1832 Returns that character position."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1833
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1834 (if (re-search-forward allout-line-boundary-regexp nil 'move)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1835 (prog1 (goto-char (match-beginning 0))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1836 (allout-prefix-data (match-beginning 2)(match-end 2)))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1837 ;;;_ > allout-end-of-current-subtree ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1838 (defun allout-end-of-current-subtree ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1839 "Put point at the end of the last leaf in the currently visible topic."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1840 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1841 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1842 (let ((level (allout-recent-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1843 (allout-next-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1844 (while (and (not (eobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1845 (> (allout-recent-depth) level))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1846 (allout-next-heading))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1847 (and (not (eobp)) (forward-char -1))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1848 (and (memq (preceding-char) '(?\n ?\r))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1849 (memq (aref (buffer-substring (max 1 (- (point) 3)) (point)) 1)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1850 '(?\n ?\r))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1851 (forward-char -1))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1852 (setq allout-recent-end-of-subtree (point))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1853 ;;;_ > allout-beginning-of-current-entry ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1854 (defun allout-beginning-of-current-entry ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1855 "When not already there, position point at beginning of current topic's body.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1856
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1857 If already there, move cursor to bullet for hot-spot operation.
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1858 \(See `allout-mode' doc string for details on hot-spot operation.)"
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1859 (interactive)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1860 (let ((start-point (point)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1861 (allout-end-of-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1862 (if (and (interactive-p)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1863 (= (point) start-point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1864 (goto-char (allout-current-bullet-pos)))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1865 ;;;_ > allout-end-of-current-entry ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1866 (defun allout-end-of-current-entry ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1867 "Position the point at the end of the current topics' entry."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1868 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1869 (allout-show-entry)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1870 (prog1 (allout-pre-next-preface)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1871 (if (and (not (bobp))(looking-at "^$"))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1872 (forward-char -1))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1873 ;;;_ > allout-end-of-current-heading ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1874 (defun allout-end-of-current-heading ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1875 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1876 (allout-beginning-of-current-entry)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1877 (forward-line -1)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1878 (end-of-line))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1879 (defalias 'allout-end-of-heading 'allout-end-of-current-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1880
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1881 ;;;_ - Depth-wise
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1882 ;;;_ > allout-ascend-to-depth (depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1883 (defun allout-ascend-to-depth (depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1884 "Ascend to depth DEPTH, returning depth if successful, nil if not."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1885 (if (and (> depth 0)(<= depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1886 (let ((last-good (point)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1887 (while (and (< depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1888 (setq last-good (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1889 (allout-beginning-of-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1890 (allout-previous-heading)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1891 (if (= (allout-recent-depth) depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1892 (progn (goto-char allout-recent-prefix-beginning)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1893 depth)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1894 (goto-char last-good)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1895 ;;;_ > allout-ascend ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1896 (defun allout-ascend ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1897 "Ascend one level, returning t if successful, nil if not."
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1898 (if (allout-beginning-of-level)
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1899 (allout-previous-heading)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1900 ;;;_ > allout-descend-to-depth (depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1901 (defun allout-descend-to-depth (depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1902 "Descend to depth DEPTH within current topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1903
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1904 Returning depth if successful, nil if not."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1905 (let ((start-point (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1906 (start-depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1907 (while
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1908 (and (> (allout-depth) 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1909 (not (= depth (allout-recent-depth))) ; ... not there yet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1910 (allout-next-heading) ; ... go further
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1911 (< start-depth (allout-recent-depth)))) ; ... still in topic
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1912 (if (and (> (allout-depth) 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1913 (= (allout-recent-depth) depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1914 depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1915 (goto-char start-point)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1916 nil))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1917 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1918 ;;;_ > allout-up-current-level (arg &optional dont-complain)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1919 (defun allout-up-current-level (arg &optional dont-complain interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1920 "Move out ARG levels from current visible topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1921
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1922 Positions on heading line of containing topic. Error if unable to
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1923 ascend that far, or nil if unable to ascend but optional arg
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1924 DONT-COMPLAIN is non-nil."
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1925 (interactive "p\np")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1926 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1927 (let ((present-level (allout-recent-depth))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1928 (last-good (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1929 failed
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1930 return)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1931 ;; Loop for iterating arg:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1932 (while (and (> (allout-recent-depth) 1)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1933 (> arg 0)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1934 (not (bobp))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1935 (not failed))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1936 (setq last-good (point))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1937 ;; Loop for going back over current or greater depth:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1938 (while (and (not (< (allout-recent-depth) present-level))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1939 (or (allout-previous-visible-heading 1)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1940 (not (setq failed present-level)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1941 (setq present-level (allout-current-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1942 (setq arg (- arg 1)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1943 (if (or failed
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1944 (> arg 0))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1945 (progn (goto-char last-good)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1946 (if interactive (allout-end-of-prefix))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1947 (if (not dont-complain)
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
1948 (error "Can't ascend past outermost level")
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1949 (if interactive (allout-end-of-prefix))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1950 nil))
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
1951 (if interactive (allout-end-of-prefix))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1952 allout-recent-prefix-beginning)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1953
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1954 ;;;_ - Linear
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1955 ;;;_ > allout-next-sibling (&optional depth backward)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1956 (defun allout-next-sibling (&optional depth backward)
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1957 "Like `allout-forward-current-level', but respects invisible topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1958
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1959 Traverse at optional DEPTH, or current depth if none specified.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1960
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1961 Go backward if optional arg BACKWARD is non-nil.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1962
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1963 Return depth if successful, nil otherwise."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1964
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1965 (if (and backward (bobp))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1966 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1967 (let ((start-depth (or depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1968 (start-point (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1969 last-depth)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1970 (while (and (not (if backward (bobp) (eobp)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1971 (if backward (allout-previous-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1972 (allout-next-heading))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1973 (> (setq last-depth (allout-recent-depth)) start-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1974 (if (and (not (eobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1975 (and (> (or last-depth (allout-depth)) 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1976 (= (allout-recent-depth) start-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1977 allout-recent-prefix-beginning
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1978 (goto-char start-point)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1979 (if depth (allout-depth) start-depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1980 nil))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1981 ;;;_ > allout-previous-sibling (&optional depth backward)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1982 (defun allout-previous-sibling (&optional depth backward)
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1983 "Like `allout-forward-current-level', but backwards & respect invisible topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1984
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1985 Optional DEPTH specifies depth to traverse, default current depth.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1986
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1987 Optional BACKWARD reverses direction.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1988
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1989 Return depth if successful, nil otherwise."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1990 (allout-next-sibling depth (not backward))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1991 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1992 ;;;_ > allout-snug-back ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1993 (defun allout-snug-back ()
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
1994 "Position cursor at end of previous topic.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1995
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1996 Presumes point is at the start of a topic prefix."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1997 (if (or (bobp) (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1998 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1999 (forward-char -1))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2000 (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2001 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2002 (forward-char -1)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2003 (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2004 (forward-char -1)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2005 (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2006 ;;;_ > allout-beginning-of-level ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2007 (defun allout-beginning-of-level ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2008 "Go back to the first sibling at this level, visible or not."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2009 (allout-end-of-level 'backward))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2010 ;;;_ > allout-end-of-level (&optional backward)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2011 (defun allout-end-of-level (&optional backward)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2012 "Go to the last sibling at this level, visible or not."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2013
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2014 (let ((depth (allout-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2015 (while (allout-previous-sibling depth nil))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2016 (prog1 (allout-recent-depth)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2017 (allout-end-of-prefix))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2018 ;;;_ > allout-next-visible-heading (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2019 (defun allout-next-visible-heading (arg)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2020 "Move to the next ARG'th visible heading line, backward if arg is negative.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2021
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2022 Move as far as possible in indicated direction \(beginning or end of
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2023 buffer) if headings are exhausted."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2024
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2025 (interactive "p")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2026 (let* ((backward (if (< arg 0) (setq arg (* -1 arg))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2027 (step (if backward -1 1))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2028 (start-point (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2029 prev got)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2030
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2031 (while (> arg 0) ; limit condition
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2032 (while (and (not (if backward (bobp)(eobp))) ; boundary condition
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2033 ;; Move, skipping over all those concealed lines:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2034 (< -1 (forward-line step))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2035 (not (setq got (looking-at allout-regexp)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2036 ;; Register this got, it may be the last:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2037 (if got (setq prev got))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2038 (setq arg (1- arg)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2039 (cond (got ; Last move was to a prefix:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2040 (allout-prefix-data (match-beginning 0) (match-end 0))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2041 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2042 (prev ; Last move wasn't, but prev was:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2043 (allout-prefix-data (match-beginning 0) (match-end 0)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2044 ((not backward) (end-of-line) nil))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2045 ;;;_ > allout-previous-visible-heading (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2046 (defun allout-previous-visible-heading (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2047 "Move to the previous heading line.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2048
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2049 With argument, repeats or can move forward if negative.
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2050 A heading line is one that starts with a `*' (or that `allout-regexp'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2051 matches)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2052 (interactive "p")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2053 (allout-next-visible-heading (- arg)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2054 ;;;_ > allout-forward-current-level (arg)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2055 (defun allout-forward-current-level (arg &optional interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2056 "Position point at the next heading of the same level.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2057
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2058 Takes optional repeat-count, goes backward if count is negative.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2059
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2060 Returns resulting position, else nil if none found."
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2061 (interactive "p\np")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2062 (let ((start-depth (allout-current-depth))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2063 (start-point (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2064 (start-arg arg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2065 (backward (> 0 arg))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2066 last-depth
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2067 (last-good (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2068 at-boundary)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2069 (if (= 0 start-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2070 (error "No siblings, not in a topic..."))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2071 (if backward (setq arg (* -1 arg)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2072 (while (not (or (zerop arg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2073 at-boundary))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2074 (while (and (not (if backward (bobp) (eobp)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2075 (if backward (allout-previous-visible-heading 1)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2076 (allout-next-visible-heading 1))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2077 (> (setq last-depth (allout-recent-depth)) start-depth)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2078 (if (and last-depth (= last-depth start-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2079 (not (if backward (bobp) (eobp))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2080 (setq last-good (point)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2081 arg (1- arg))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2082 (setq at-boundary t)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2083 (if (and (not (eobp))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2084 (= arg 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2085 (and (> (or last-depth (allout-depth)) 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2086 (= (allout-recent-depth) start-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2087 allout-recent-prefix-beginning
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2088 (goto-char last-good)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2089 (if (not interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2090 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2091 (allout-end-of-prefix)
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
2092 (error "Hit %s level %d topic, traversed %d of %d requested"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2093 (if backward "first" "last")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2094 (allout-recent-depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2095 (- (abs start-arg) arg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2096 (abs start-arg))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2097 ;;;_ > allout-backward-current-level (arg)
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2098 (defun allout-backward-current-level (arg &optional interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2099 "Inverse of `allout-forward-current-level'."
57818
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2100 (interactive "p\np")
41337cd10189 (allout group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents: 55717
diff changeset
2101 (if interactive
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2102 (let ((current-prefix-arg (* -1 arg)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2103 (call-interactively 'allout-forward-current-level))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2104 (allout-forward-current-level (* -1 arg))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2105
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2106 ;;;_ #5 Alteration
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2107
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2108 ;;;_ - Fundamental
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2109 ;;;_ > allout-before-change-protect (beg end)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2110 (defun allout-before-change-protect (beg end)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2111 "Outline before-change hook, regulates changes to concealed text.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2112
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2113 Reveal concealed text that would be changed by current command, and
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2114 offer user choice to commit or forego the change. Unchanged text is
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2115 reconcealed. User has option to have changed text reconcealed.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2116
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2117 Undo commands are specially treated - the user is not prompted for
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2118 choice, the undoes are always committed (based on presumption that the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2119 things being undone were already subject to this regulation routine),
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2120 and undoes always leave the changed stuff exposed.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2121
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2122 Changes to concealed regions are ignored while file is being written.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2123 \(This is for the sake of functions that do change the file during
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2124 writes, like crypt and zip modes.)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2125
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2126 Locally bound in outline buffers to `before-change-functions', which
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2127 in Emacs 19 is run before any change to the buffer.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2128
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2129 Any functions which set [`this-command' to `undo', or which set]
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2130 `allout-override-protect' non-nil (as does, eg, allout-flag-chars)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2131 are exempt from this restriction."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2132 (if (and (allout-mode-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2133 ; allout-override-protect
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2134 ; set by functions that know what
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2135 ; they're doing, eg outline internals:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2136 (not allout-override-protect)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2137 (not allout-during-write-cue)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2138 (save-match-data ; Preserve operation position state.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2139 ; Both beginning and end chars must
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2140 ; be exposed:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2141 (save-excursion (if (memq this-command '(newline open-line))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2142 ;; Compensate for stupid Emacs {new,
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2143 ;; open-}line display optimization:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2144 (setq beg (1+ beg)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2145 end (1+ end)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2146 (goto-char beg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2147 (or (allout-hidden-p)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2148 (and (not (= beg end))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2149 (goto-char end)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2150 (allout-hidden-p))))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2151 (save-match-data
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2152 (if (equal this-command 'undo)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2153 ;; Allow undo without inhibition.
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2154 ;; - Undoing new and open-line hits stupid Emacs redisplay
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2155 ;; optimization (em 19 cmds.c, ~ line 200).
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2156 ;; - Presumably, undoing what was properly protected when
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2157 ;; done.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2158 ;; - Undo may be users' only recourse in protection faults.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2159 ;; So, expose what getting changed:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2160 (progn (message "Undo! - exposing concealed target...")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2161 (if (allout-hidden-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2162 (allout-show-children))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2163 (message "Undo!"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2164 (let (response
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2165 (rehide-completely (save-excursion (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2166 (allout-hidden-p)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2167 rehide-place)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2168
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2169 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2170 (if (condition-case err
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2171 ;; Condition case to catch keyboard quits during reads.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2172 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2173 ; Give them a peek where
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2174 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2175 (if (eolp) (setq rehide-place
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2176 (allout-goto-prefix)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2177 (allout-show-entry))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2178 ; Present the message, but...
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2179 ; leave the cursor at the location
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2180 ; until they respond:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2181 ; Then interpret the response:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2182 (while
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2183 (progn
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2184 (message (concat "Change inside concealed"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2185 " region - do it? "
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2186 "(n or 'y'/'r'eclose)"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2187 (setq response (read-char))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2188 (not
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2189 (cond ((memq response '(?r ?R))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2190 (setq response 'reclose))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2191 ((memq response '(?y ?Y ? ))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2192 (setq response t))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2193 ((memq response '(?n ?N 127))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2194 (setq response nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2195 t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2196 ((eq response ??)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2197 (message
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2198 "`r' means `yes, then reclose'")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2199 nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2200 (t (message "Please answer y, n, or r")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2201 (sit-for 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2202 nil)))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2203 response)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2204 ('quit nil))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2205 ; Continue:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2206 (if (eq response 'reclose)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2207 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2208 (if rehide-place (goto-char rehide-place))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2209 (if rehide-completely
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2210 (allout-hide-current-entry-completely)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2211 (allout-hide-current-entry)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2212 (if (allout-ascend-to-depth (1- (allout-recent-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2213 (allout-show-children)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2214 (allout-show-to-offshoot)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2215 ; Prevent:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2216 (if rehide-completely
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2217 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2218 (if rehide-place (goto-char rehide-place))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2219 (allout-hide-current-entry-completely))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2220 (allout-hide-current-entry))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2221 (error (concat
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2222 "Change within concealed region prevented.")))))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2223 ) ; if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2224 ) ; defun
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2225 ;;;_ = allout-post-goto-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2226 (defvar allout-post-goto-bullet nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2227 "Outline internal var, for `allout-pre-command-business' hot-spot operation.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2228
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2229 When set, tells post-processing to reposition on topic bullet, and
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2230 then unset it. Set by `allout-pre-command-business' when implementing
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2231 hot-spot operation, where literal characters typed over a topic bullet
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2232 are mapped to the command of the corresponding control-key on the
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2233 `allout-mode-map'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2234 (make-variable-buffer-local 'allout-post-goto-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2235 ;;;_ > allout-post-command-business ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2236 (defun allout-post-command-business ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2237 "Outline `post-command-hook' function.
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2238
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2239 - Null `allout-override-protect', so it's not left open.
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2240
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2241 - Implement (and clear) `allout-post-goto-bullet', for hot-spot
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2242 outline commands.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2243
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2244 - Massages `buffer-undo-list' so successive, standard character self-inserts
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2245 are aggregated. This kludge compensates for lack of undo bunching when
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2246 `before-change-functions' is used."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2247
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2248 ; Apply any external change func:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2249 (if (not (allout-mode-p)) ; In allout-mode.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2250 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2251 (setq allout-override-protect nil)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2252 (if allout-isearch-dynamic-expose
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2253 (allout-isearch-rectification))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2254 (if allout-during-write-cue
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2255 ;; Was used by allout-before-change-protect, done with it now:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2256 (setq allout-during-write-cue nil))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2257 ;; Undo bunching business:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2258 (if (and (listp buffer-undo-list) ; Undo history being kept.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2259 (equal this-command 'self-insert-command)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2260 (equal last-command 'self-insert-command))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2261 (let* ((prev-stuff (cdr buffer-undo-list))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2262 (before-prev-stuff (cdr (cdr prev-stuff)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2263 cur-cell cur-from cur-to
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2264 prev-cell prev-from prev-to)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2265 (if (and before-prev-stuff ; Goes back far enough to bother,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2266 (not (car prev-stuff)) ; and break before current,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2267 (not (car before-prev-stuff)) ; !and break before prev!
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2268 (setq prev-cell (car (cdr prev-stuff))) ; contents now,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2269 (setq cur-cell (car buffer-undo-list)) ; contents prev.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2270
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2271 ;; cur contents denote a single char insertion:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2272 (numberp (setq cur-from (car cur-cell)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2273 (numberp (setq cur-to (cdr cur-cell)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2274 (= 1 (- cur-to cur-from))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2275
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2276 ;; prev contents denote fewer than aggregate-limit
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2277 ;; insertions:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2278 (numberp (setq prev-from (car prev-cell)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2279 (numberp (setq prev-to (cdr prev-cell)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2280 ; Below threshold:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2281 (> allout-undo-aggregation (- prev-to prev-from)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2282 (setq buffer-undo-list
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2283 (cons (cons prev-from cur-to)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2284 (cdr (cdr (cdr buffer-undo-list))))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2285 ;; Implement -post-goto-bullet, if set: (must be after undo business)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2286 (if (and allout-post-goto-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2287 (allout-current-bullet-pos))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2288 (progn (goto-char (allout-current-bullet-pos))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2289 (setq allout-post-goto-bullet nil)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2290 ))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2291 ;;;_ > allout-pre-command-business ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2292 (defun allout-pre-command-business ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2293 "Outline `pre-command-hook' function for outline buffers.
49962
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2294 Implements special behavior when cursor is on bullet character.
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2295
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2296 When the cursor is on the bullet character, self-insert characters are
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2297 reinterpreted as the corresponding control-character in the
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2298 `allout-mode-map'. The `allout-mode' `post-command-hook' insures that
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2299 the cursor which has moved as a result of such reinterpretation is
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2300 positioned on the bullet character of the destination topic.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2301
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2302 The upshot is that you can get easy, single (ie, unmodified) key
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2303 outline maneuvering operations by positioning the cursor on the bullet
49962
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2304 char. When in this mode you can use regular cursor-positioning
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2305 command/keystrokes to relocate the cursor off of a bullet character to
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2306 return to regular interpretation of self-insert characters."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2307 (if (not (allout-mode-p))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2308 ;; Shouldn't be invoked if not in allout allout-mode, but just in case:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2309 nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2310 ;; Register isearch status:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2311 (if (and (boundp 'isearch-mode) isearch-mode)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2312 (setq allout-pre-was-isearching t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2313 (setq allout-pre-was-isearching nil))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2314 ;; Hot-spot navigation provisions:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2315 (if (and (eq this-command 'self-insert-command)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2316 (eq (point)(allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2317 (let* ((this-key-num (cond
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2318 ((numberp last-command-char)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2319 last-command-char)
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
2320 ((fboundp 'char-to-int)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2321 (char-to-int last-command-char))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2322 (t 0)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2323 mapped-binding)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2324 (if (zerop this-key-num)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2325 nil
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2326 ; Map upper-register literals
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2327 ; to lower register:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2328 (if (<= 96 this-key-num)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2329 (setq this-key-num (- this-key-num 32)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2330 ; Check if we have a literal:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2331 (if (and (<= 64 this-key-num)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2332 (>= 96 this-key-num))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2333 (setq mapped-binding
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2334 (lookup-key 'allout-mode-map
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2335 (concat allout-command-prefix
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2336 (char-to-string (- this-key-num
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2337 64))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2338 (if mapped-binding
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2339 (setq allout-post-goto-bullet t
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2340 this-command mapped-binding)))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2341 ;;;_ > allout-find-file-hook ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2342 (defun allout-find-file-hook ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2343 "Activate `allout-mode' when `allout-auto-activation' & `allout-layout' are non-nil.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2344
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2345 See `allout-init' for setup instructions."
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2346 (if (and allout-auto-activation
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2347 (not (allout-mode-p))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2348 allout-layout)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2349 (allout-mode t)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2350 ;;;_ > allout-isearch-rectification
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2351 (defun allout-isearch-rectification ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2352 "Rectify outline exposure before, during, or after isearch.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2353
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2354 Called as part of `allout-post-command-business'."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2355
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
2356 (let ((isearching isearch-mode))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2357 (cond ((and isearching (not allout-pre-was-isearching))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2358 (allout-isearch-expose 'start))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2359 ((and isearching allout-pre-was-isearching)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2360 (allout-isearch-expose 'continue))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2361 ((and (not isearching) allout-pre-was-isearching)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2362 (allout-isearch-expose 'final))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2363 ;; Not and wasn't isearching:
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
2364 (t (setq allout-isearch-prior-pos nil)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2365 ;;;_ = allout-isearch-was-font-lock
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2366 (defvar allout-isearch-was-font-lock
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2367 (and (boundp 'font-lock-mode) font-lock-mode))
36390
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2368
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2369 ;;;_ > allout-flag-region (from to flag)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2370 (defmacro allout-flag-region (from to flag)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2371 "Hide or show lines from FROM to TO, via Emacs `selective-display' FLAG char.
36390
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2372 Ie, text following flag C-m \(carriage-return) is hidden until the
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2373 next C-j (newline) char.
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2374
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2375 Returns the endpoint of the region."
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2376 `(let ((buffer-read-only nil)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2377 (allout-override-protect t))
36390
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2378 (subst-char-in-region ,from ,to
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2379 (if (= ,flag ?\n) ?\r ?\n)
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2380 ,flag t)))
495ba6e137c7 (outline-flag-region): Move macro in front of first
Gerd Moellmann <gerd@gnu.org>
parents: 29490
diff changeset
2381
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2382 ;;;_ > allout-isearch-expose (mode)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2383 (defun allout-isearch-expose (mode)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2384 "MODE is either 'clear, 'start, 'continue, or 'final."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2385 ;; allout-isearch-prior-pos encodes exposure status of prior pos:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2386 ;; (pos was-vis header-pos end-pos)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2387 ;; pos - point of concern
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2388 ;; was-vis - t, else 'topic if entire topic was exposed, 'entry otherwise
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2389 ;; Do reclosure or prior pos, as necessary:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2390 (if (eq mode 'start)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2391 (setq allout-isearch-was-font-lock (and (boundp 'font-lock-mode)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2392 font-lock-mode)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2393 font-lock-mode nil)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2394 (if (eq mode 'final)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2395 (setq font-lock-mode allout-isearch-was-font-lock))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2396 (if (and allout-isearch-prior-pos
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2397 (listp allout-isearch-prior-pos))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2398 ;; Conceal prior peek:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2399 (allout-flag-region (car (cdr allout-isearch-prior-pos))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2400 (car (cdr (cdr allout-isearch-prior-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2401 ?\r)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2402 (if (allout-visible-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2403 (setq allout-isearch-prior-pos nil)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2404 (if (not (eq mode 'final))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2405 (setq allout-isearch-prior-pos (cons (point) (allout-show-entry)))
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
2406 (if isearch-mode-end-hook-error
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2407 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2408 (setq allout-isearch-prior-pos nil)
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
2409 (allout-show-children)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2410 ;;;_ > allout-enwrap-isearch ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2411 (defun allout-enwrap-isearch ()
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2412 "Impose `isearch-abort' wrapper for dynamic exposure in isearch.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2413
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2414 The function checks to ensure that the rebinding is done only once."
64400
e169c8755108 (allout-isearch-did-quit): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 64283
diff changeset
2415 (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2416
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2417 ;;; Prevent unnecessary font-lock while isearching!
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2418 (defvar isearch-was-font-locking nil)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2419 (defun isearch-inhibit-font-lock ()
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
2420 "Inhibit `font-lock-mode' while isearching - for use on `isearch-mode-hook'."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2421 (if (and (allout-mode-p) (boundp 'font-lock-mode) font-lock-mode)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2422 (setq isearch-was-font-locking t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2423 font-lock-mode nil)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2424 (add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2425 (defun isearch-reenable-font-lock ()
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2426 "Reenable font-lock after isearching - for use on `isearch-mode-end-hook'."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2427 (if (and (boundp 'font-lock-mode) font-lock-mode)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2428 (if (and (allout-mode-p) isearch-was-font-locking)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2429 (setq isearch-was-font-locking nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2430 font-lock-mode t))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2431 (add-hook 'isearch-mode-end-hook 'isearch-reenable-font-lock)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2432
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2433 ;;;_ - Topic Format Assessment
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2434 ;;;_ > allout-solicit-alternate-bullet (depth &optional current-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2435 (defun allout-solicit-alternate-bullet (depth &optional current-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2436
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2437 "Prompt for and return a bullet char as an alternative to the current one.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2438
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2439 Offer one suitable for current depth DEPTH as default."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2440
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2441 (let* ((default-bullet (or (and (stringp current-bullet) current-bullet)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2442 (allout-bullet-for-depth depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2443 (sans-escapes (regexp-sans-escapes allout-bullets-string))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2444 choice)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2445 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2446 (goto-char (allout-current-bullet-pos))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2447 (setq choice (solicit-char-in-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2448 (format "Select bullet: %s ('%s' default): "
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2449 sans-escapes
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2450 default-bullet)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2451 sans-escapes
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2452 t)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2453 (message "")
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2454 (if (string= choice "") default-bullet choice))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2455 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2456 ;;;_ > allout-distinctive-bullet (bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2457 (defun allout-distinctive-bullet (bullet)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2458 "True if BULLET is one of those on `allout-distinctive-bullets-string'."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2459 (string-match (regexp-quote bullet) allout-distinctive-bullets-string))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2460 ;;;_ > allout-numbered-type-prefix (&optional prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2461 (defun allout-numbered-type-prefix (&optional prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2462 "True if current header prefix bullet is numbered bullet."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2463 (and allout-numbered-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2464 (string= allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2465 (if prefix
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2466 (allout-get-prefix-bullet prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2467 (allout-get-bullet)))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2468 ;;;_ > allout-bullet-for-depth (&optional depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2469 (defun allout-bullet-for-depth (&optional depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2470 "Return outline topic bullet suited to optional DEPTH, or current depth."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2471 ;; Find bullet in plain-bullets-string modulo DEPTH.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2472 (if allout-stylish-prefixes
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2473 (char-to-string (aref allout-plain-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2474 (% (max 0 (- depth 2))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2475 allout-plain-bullets-string-len)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2476 allout-primary-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2477 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2478
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2479 ;;;_ - Topic Production
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2480 ;;;_ > allout-make-topic-prefix (&optional prior-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2481 (defun allout-make-topic-prefix (&optional prior-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2482 new
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2483 depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2484 solicit
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2485 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2486 index)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2487 ;; Depth null means use current depth, non-null means we're either
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2488 ;; opening a new topic after current topic, lower or higher, or we're
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2489 ;; changing level of current topic.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2490 ;; Solicit dominates specified bullet-char.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2491 ;;;_ . Doc string:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2492 "Generate a topic prefix suitable for optional arg DEPTH, or current depth.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2493
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2494 All the arguments are optional.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2495
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2496 PRIOR-BULLET indicates the bullet of the prefix being changed, or
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2497 nil if none. This bullet may be preserved (other options
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2498 notwithstanding) if it is on the `allout-distinctive-bullets-string',
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2499 for instance.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2500
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2501 Second arg NEW indicates that a new topic is being opened after the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2502 topic at point, if non-nil. Default bullet for new topics, eg, may
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2503 be set (contingent to other args) to numbered bullets if previous
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2504 sibling is one. The implication otherwise is that the current topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2505 is being adjusted - shifted or rebulleted - and we don't consider
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2506 bullet or previous sibling.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2507
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2508 Third arg DEPTH forces the topic prefix to that depth, regardless of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2509 the current topics' depth.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2510
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2511 If SOLICIT is non-nil, then the choice of bullet is solicited from
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2512 user. If it's a character, then that character is offered as the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2513 default, otherwise the one suited to the context \(according to
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2514 distinction or depth) is offered. \(This overrides other options,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2515 including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2516 context-specific bullet is used.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2517
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2518 Fifth arg, NUMBER-CONTROL, matters only if `allout-numbered-bullet'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2519 is non-nil *and* soliciting was not explicitly invoked. Then
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2520 NUMBER-CONTROL non-nil forces prefix to either numbered or
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2521 denumbered format, depending on the value of the sixth arg, INDEX.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2522
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2523 \(Note that NUMBER-CONTROL does *not* apply to level 1 topics. Sorry...)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2524
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2525 If NUMBER-CONTROL is non-nil and sixth arg INDEX is non-nil then
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2526 the prefix of the topic is forced to be numbered. Non-nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2527 NUMBER-CONTROL and nil INDEX forces non-numbered format on the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2528 bullet. Non-nil NUMBER-CONTROL and non-nil, non-number INDEX means
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2529 that the index for the numbered prefix will be derived, by counting
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2530 siblings back to start of level. If INDEX is a number, then that
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2531 number is used as the index for the numbered prefix (allowing, eg,
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2532 sequential renumbering to not require this function counting back the
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2533 index for each successive sibling)."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2534 ;;;_ . Code:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2535 ;; The options are ordered in likely frequence of use, most common
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2536 ;; highest, least lowest. Ie, more likely to be doing prefix
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2537 ;; adjustments than soliciting, and yet more than numbering.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2538 ;; Current prefix is least dominant, but most likely to be commonly
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2539 ;; specified...
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2540
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2541 (let* (body
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2542 numbering
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2543 denumbering
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2544 (depth (or depth (allout-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2545 (header-lead allout-header-prefix)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2546 (bullet-char
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2547
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2548 ;; Getting value for bullet char is practically the whole job:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2549
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2550 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2551 ; Simplest situation - level 1:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2552 ((<= depth 1) (setq header-lead "") allout-primary-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2553 ; Simple, too: all asterisks:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2554 (allout-old-style-prefixes
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2555 ;; Cheat - make body the whole thing, null out header-lead and
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2556 ;; bullet-char:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2557 (setq body (make-string depth
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2558 (string-to-char allout-primary-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2559 (setq header-lead "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2560 "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2561
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2562 ;; (Neither level 1 nor old-style, so we're space padding.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2563 ;; Sneak it in the condition of the next case, whatever it is.)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2564
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2565 ;; Solicitation overrides numbering and other cases:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2566 ((progn (setq body (make-string (- depth 2) ?\ ))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2567 ;; The actual condition:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2568 solicit)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2569 (let* ((got (allout-solicit-alternate-bullet depth solicit)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2570 ;; Gotta check whether we're numbering and got a numbered bullet:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2571 (setq numbering (and allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2572 (not (and number-control (not index)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2573 (string= got allout-numbered-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2574 ;; Now return what we got, regardless:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2575 got))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2576
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2577 ;; Numbering invoked through args:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2578 ((and allout-numbered-bullet number-control)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2579 (if (setq numbering (not (setq denumbering (not index))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2580 allout-numbered-bullet
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2581 (if (and prior-bullet
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2582 (not (string= allout-numbered-bullet
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2583 prior-bullet)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2584 prior-bullet
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2585 (allout-bullet-for-depth depth))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2586
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2587 ;;; Neither soliciting nor controlled numbering ;;;
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2588 ;;; (may be controlled denumbering, tho) ;;;
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2589
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2590 ;; Check wrt previous sibling:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2591 ((and new ; only check for new prefixes
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2592 (<= depth (allout-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2593 allout-numbered-bullet ; ... & numbering enabled
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2594 (not denumbering)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2595 (let ((sibling-bullet
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2596 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2597 ;; Locate correct sibling:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2598 (or (>= depth (allout-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2599 (allout-ascend-to-depth depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2600 (allout-get-bullet))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2601 (if (and sibling-bullet
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2602 (string= allout-numbered-bullet sibling-bullet))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2603 (setq numbering sibling-bullet)))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2604
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2605 ;; Distinctive prior bullet?
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2606 ((and prior-bullet
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2607 (allout-distinctive-bullet prior-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2608 ;; Either non-numbered:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2609 (or (not (and allout-numbered-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2610 (string= prior-bullet allout-numbered-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2611 ;; or numbered, and not denumbering:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2612 (setq numbering (not denumbering)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2613 ;; Here 'tis:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2614 prior-bullet))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2615
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2616 ;; Else, standard bullet per depth:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2617 ((allout-bullet-for-depth depth)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2618
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2619 (concat header-lead
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2620 body
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2621 bullet-char
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2622 (if numbering
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2623 (format "%d" (cond ((and index (numberp index)) index)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2624 (new (1+ (allout-sibling-index depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2625 ((allout-sibling-index))))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2626 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2627 )
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2628 ;;;_ > allout-open-topic (relative-depth &optional before use-sib-bullet)
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2629 (defun allout-open-topic (relative-depth &optional before use-sib-bullet)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2630 "Open a new topic at depth RELATIVE-DEPTH.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2631
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2632 New topic is situated after current one, unless optional flag BEFORE
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2633 is non-nil, or unless current line is complete empty (not even
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2634 whitespace), in which case open is done on current line.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2635
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2636 If USE-SIB-BULLET is true, use the bullet of the prior sibling.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2637
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2638 Nuances:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2639
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2640 - Creation of new topics is with respect to the visible topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2641 containing the cursor, regardless of intervening concealed ones.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2642
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2643 - New headers are generally created after/before the body of a
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2644 topic. However, they are created right at cursor location if the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2645 cursor is on a blank line, even if that breaks the current topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2646 body. This is intentional, to provide a simple means for
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2647 deliberately dividing topic bodies.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2648
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2649 - Double spacing of topic lists is preserved. Also, the first
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2650 level two topic is created double-spaced (and so would be
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2651 subsequent siblings, if that's left intact). Otherwise,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2652 single-spacing is used.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2653
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2654 - Creation of sibling or nested topics is with respect to the topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2655 you're starting from, even when creating backwards. This way you
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2656 can easily create a sibling in front of the current topic without
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2657 having to go to its preceding sibling, and then open forward
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2658 from there."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2659
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2660 (let* ((depth (+ (allout-current-depth) relative-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2661 (opening-on-blank (if (looking-at "^\$")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2662 (not (setq before nil))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2663 opening-numbered ; Will get while computing ref-topic, below
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2664 ref-depth ; Will get while computing ref-topic, below
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2665 ref-bullet ; Will get while computing ref-topic, next
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2666 (ref-topic (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2667 (cond ((< relative-depth 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2668 (allout-ascend-to-depth depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2669 ((>= relative-depth 1) nil)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2670 (t (allout-back-to-current-heading)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2671 (setq ref-depth (allout-recent-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2672 (setq ref-bullet
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2673 (if (> allout-recent-prefix-end 1)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2674 (allout-recent-bullet)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2675 ""))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2676 (setq opening-numbered
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2677 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2678 (and allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2679 (or (<= relative-depth 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2680 (allout-descend-to-depth depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2681 (if (allout-numbered-type-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2682 allout-numbered-bullet))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2683 (point)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2684 dbl-space
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2685 doing-beginning)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2686
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2687 (if (not opening-on-blank)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2688 ; Positioning and vertical
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2689 ; padding - only if not
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2690 ; opening-on-blank:
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2691 (progn
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2692 (goto-char ref-topic)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2693 (setq dbl-space ; Determine double space action:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2694 (or (and (<= relative-depth 0) ; not descending;
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2695 (save-excursion
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2696 ;; at b-o-b or preceded by a blank line?
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2697 (or (> 0 (forward-line -1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2698 (looking-at "^\\s-*$")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2699 (bobp)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2700 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2701 ;; succeeded by a blank line?
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2702 (allout-end-of-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2703 (bolp)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2704 (and (= ref-depth 1)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2705 (or before
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2706 (= depth 1)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2707 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2708 ;; Don't already have following
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2709 ;; vertical padding:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2710 (not (allout-pre-next-preface)))))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2711
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2712 ; Position to prior heading,
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2713 ; if inserting backwards, and
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2714 ; not going outwards:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2715 (if (and before (>= relative-depth 0))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2716 (progn (allout-back-to-current-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2717 (setq doing-beginning (bobp))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2718 (if (not (bobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2719 (allout-previous-heading)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2720 (if (and before (bobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2721 (allout-unprotected (open-line 1))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2722
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2723 (if (<= relative-depth 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2724 ;; Not going inwards, don't snug up:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2725 (if doing-beginning
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2726 (allout-unprotected (open-line (if dbl-space 2 1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2727 (if before
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2728 (progn (end-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2729 (allout-pre-next-preface)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2730 (while (= ?\r (following-char))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2731 (forward-char 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2732 (if (not (looking-at "^$"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2733 (allout-unprotected (open-line 1))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2734 (allout-end-of-current-subtree)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2735 ;; Going inwards - double-space if first offspring is,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2736 ;; otherwise snug up.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2737 (end-of-line) ; So we skip any concealed progeny.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2738 (allout-pre-next-preface)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2739 (if (bolp)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2740 ;; Blank lines between current header body and next
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2741 ;; header - get to last substantive (non-white-space)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2742 ;; line in body:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2743 (re-search-backward "[^ \t\n]" nil t))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2744 (if (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2745 (allout-next-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2746 (if (> (allout-recent-depth) ref-depth)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2747 ;; This is an offspring.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2748 (progn (forward-line -1)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2749 (looking-at "^\\s-*$"))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2750 (progn (forward-line 1)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2751 (allout-unprotected (open-line 1))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2752 (end-of-line))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2753 ;;(if doing-beginning (goto-char doing-beginning))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2754 (if (not (bobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2755 (progn (if (and (not (> depth ref-depth))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2756 (not before))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2757 (allout-unprotected (open-line 1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2758 (if (> depth ref-depth)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2759 (allout-unprotected (newline 1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2760 (if dbl-space
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2761 (allout-unprotected (open-line 1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2762 (if (not before)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2763 (allout-unprotected (newline 1))))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2764 (if dbl-space
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2765 (allout-unprotected (newline 1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2766 (if (and (not (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2767 (not (bolp)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2768 (forward-char 1))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2769 ))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2770 (insert (concat (allout-make-topic-prefix opening-numbered
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
2771 t
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
2772 depth)
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
2773 " "))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2774
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2775 ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2776
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2777
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2778 (allout-rebullet-heading (and use-sib-bullet ref-bullet);;; solicit
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2779 depth ;;; depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2780 nil ;;; number-control
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2781 nil ;;; index
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2782 t) (end-of-line)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2783 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2784 )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2785 ;;;_ . open-topic contingencies
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2786 ;;;_ ; base topic - one from which open was issued
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2787 ;;;_ , beginning char
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2788 ;;;_ , amount of space before will be used, unless opening in place
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2789 ;;;_ , end char will be used, unless opening before (and it still may)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2790 ;;;_ ; absolute depth of new topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2791 ;;;_ ! insert in place - overrides most stuff
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2792 ;;;_ ; relative depth of new re base
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2793 ;;;_ ; before or after base topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2794 ;;;_ ; spacing around topic, if any, prior to new topic and at same depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2795 ;;;_ ; buffer boundaries - special provisions for beginning and end ob
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2796 ;;;_ ; level 1 topics have special provisions also - double space.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2797 ;;;_ ; location of new topic
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2798 ;;;_ > allout-open-subtopic (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2799 (defun allout-open-subtopic (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2800 "Open new topic header at deeper level than the current one.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2801
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2802 Negative universal arg means to open deeper, but place the new topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2803 prior to the current one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2804 (interactive "p")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2805 (allout-open-topic 1 (> 0 arg)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2806 ;;;_ > allout-open-sibtopic (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2807 (defun allout-open-sibtopic (arg)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2808 "Open new topic header at same level as the current one.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2809
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2810 Positive universal arg means to use the bullet of the prior sibling.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2811
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2812 Negative universal arg means to place the new topic prior to the current
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2813 one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2814 (interactive "p")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2815 (allout-open-topic 0 (> 0 arg) (< 1 arg)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2816 ;;;_ > allout-open-supertopic (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2817 (defun allout-open-supertopic (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2818 "Open new topic header at shallower level than the current one.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2819
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2820 Negative universal arg means to open shallower, but place the new
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2821 topic prior to the current one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2822
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2823 (interactive "p")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2824 (allout-open-topic -1 (> 0 arg)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2825
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2826 ;;;_ - Outline Alteration
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2827 ;;;_ : Topic Modification
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2828 ;;;_ = allout-former-auto-filler
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2829 (defvar allout-former-auto-filler nil
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2830 "Name of modal fill function being wrapped by `allout-auto-fill'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2831 ;;;_ > allout-auto-fill ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2832 (defun allout-auto-fill ()
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
2833 "`allout-mode' autofill function.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2834
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2835 Maintains outline hanging topic indentation if
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2836 `allout-use-hanging-indents' is set."
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2837 (let ((fill-prefix (if allout-use-hanging-indents
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2838 ;; Check for topic header indentation:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2839 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2840 (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2841 (if (looking-at allout-regexp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2842 ;; ... construct indentation to account for
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2843 ;; length of topic prefix:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2844 (make-string (progn (allout-end-of-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2845 (current-column))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2846 ?\ ))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2847 (if (or allout-former-auto-filler allout-use-hanging-indents)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2848 (do-auto-fill))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2849 ;;;_ > allout-reindent-body (old-depth new-depth &optional number)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2850 (defun allout-reindent-body (old-depth new-depth &optional number)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2851 "Reindent body lines which were indented at OLD-DEPTH to NEW-DEPTH.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2852
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2853 Optional arg NUMBER indicates numbering is being added, and it must
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2854 be accommodated.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2855
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2856 Note that refill of indented paragraphs is not done."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2857
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2858 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2859 (allout-end-of-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2860 (let* ((new-margin (current-column))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2861 excess old-indent-begin old-indent-end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2862 curr-ind
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2863 ;; We want the column where the header-prefix text started
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2864 ;; *before* the prefix was changed, so we infer it relative
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2865 ;; to the new margin and the shift in depth:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2866 (old-margin (+ old-depth (- new-margin new-depth))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2867
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2868 ;; Process lines up to (but excluding) next topic header:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2869 (allout-unprotected
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2870 (save-match-data
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2871 (while
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2872 (and (re-search-forward "[\n\r]\\(\\s-*\\)"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2873 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2874 t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2875 ;; Register the indent data, before we reset the
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2876 ;; match data with a subsequent `looking-at':
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2877 (setq old-indent-begin (match-beginning 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2878 old-indent-end (match-end 1))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2879 (not (looking-at allout-regexp)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2880 (if (> 0 (setq excess (- (current-column)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2881 old-margin)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2882 ;; Text starts left of old margin - don't adjust:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2883 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2884 ;; Text was hanging at or right of old left margin -
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2885 ;; reindent it, preserving its existing indentation
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2886 ;; beyond the old margin:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2887 (delete-region old-indent-begin old-indent-end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2888 (indent-to (+ new-margin excess)))))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2889 ;;;_ > allout-rebullet-current-heading (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2890 (defun allout-rebullet-current-heading (arg)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2891 "Solicit new bullet for current visible heading."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2892 (interactive "p")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2893 (let ((initial-col (current-column))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2894 (on-bullet (eq (point)(allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2895 (backwards (if (< arg 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2896 (setq arg (* arg -1)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2897 (while (> arg 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2898 (save-excursion (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2899 (allout-end-of-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2900 (allout-rebullet-heading t ;;; solicit
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2901 nil ;;; depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2902 nil ;;; number-control
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2903 nil ;;; index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2904 t)) ;;; do-successors
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2905 (setq arg (1- arg))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2906 (if (<= arg 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2907 nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2908 (setq initial-col nil) ; Override positioning back to init col
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2909 (if (not backwards)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2910 (allout-next-visible-heading 1)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2911 (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2912 (allout-next-visible-heading -1))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2913 (message "Done.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2914 (cond (on-bullet (goto-char (allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2915 (initial-col (move-to-column initial-col)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2916 ;;;_ > allout-rebullet-heading (&optional solicit ...)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2917 (defun allout-rebullet-heading (&optional solicit
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2918 new-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2919 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2920 index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2921 do-successors)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2922
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2923 "Adjust bullet of current topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2924
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2925 If SOLICIT is non-nil, then the choice of bullet is solicited from
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2926 user. If it's a character, then that character is offered as the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2927 default, otherwise the one suited to the context \(according to
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2928 distinction or depth) is offered. If non-nil, then the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2929 context-specific bullet is just used.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2930
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2931 Second arg NEW-DEPTH forces the topic prefix to that depth, regardless
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2932 of the topic's current depth.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2933
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2934 Third arg NUMBER-CONTROL can force the prefix to or away from
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2935 numbered form. It has effect only if `allout-numbered-bullet' is
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2936 non-nil and soliciting was not explicitly invoked (via first arg).
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2937 Its effect, numbering or denumbering, then depends on the setting
54223
7ab62964d965 (allout-rebullet-heading): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 52861
diff changeset
2938 of the fourth arg, INDEX.
7ab62964d965 (allout-rebullet-heading): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 52861
diff changeset
2939
7ab62964d965 (allout-rebullet-heading): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 52861
diff changeset
2940 If NUMBER-CONTROL is non-nil and fourth arg INDEX is nil, then the
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2941 prefix of the topic is forced to be non-numbered. Null index and
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2942 non-nil NUMBER-CONTROL forces denumbering. Non-nil INDEX (and
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2943 non-nil NUMBER-CONTROL) forces a numbered-prefix form. If non-nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2944 INDEX is a number, then that number is used for the numbered
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2945 prefix. Non-nil and non-number means that the index for the
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2946 numbered prefix will be derived by `allout-make-topic-prefix'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2947
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2948 Fifth arg DO-SUCCESSORS t means re-resolve count on succeeding
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2949 siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2950
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2951 Cf vars `allout-stylish-prefixes', `allout-old-style-prefixes',
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2952 and `allout-numbered-bullet', which all affect the behavior of
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2953 this function."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2954
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2955 (let* ((current-depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2956 (new-depth (or new-depth current-depth))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2957 (mb allout-recent-prefix-beginning)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2958 (me allout-recent-prefix-end)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2959 (current-bullet (buffer-substring (- me 1) me))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2960 (new-prefix (allout-make-topic-prefix current-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2961 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2962 new-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2963 solicit
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2964 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2965 index)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2966
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2967 ;; Is new one is identical to old?
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2968 (if (and (= current-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2969 (string= current-bullet
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2970 (substring new-prefix (1- (length new-prefix)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2971 ;; Nothing to do:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2972 t
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2973
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2974 ;; New prefix probably different from old:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2975 ; get rid of old one:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2976 (allout-unprotected (delete-region mb me))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2977 (goto-char mb)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2978 ; Dispense with number if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2979 ; numbered-bullet prefix:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2980 (if (and allout-numbered-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2981 (string= allout-numbered-bullet current-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2982 (looking-at "[0-9]+"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2983 (allout-unprotected
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2984 (delete-region (match-beginning 0)(match-end 0))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2985
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2986 ; Put in new prefix:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2987 (allout-unprotected (insert new-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2988
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2989 ;; Reindent the body if elected and margin changed:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2990 (if (and allout-reindent-bodies
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2991 (not (= new-depth current-depth)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2992 (allout-reindent-body current-depth new-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2993
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2994 ;; Recursively rectify successive siblings of orig topic if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2995 ;; caller elected for it:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2996 (if do-successors
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2997 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2998 (while (allout-next-sibling new-depth nil)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2999 (setq index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3000 (cond ((numberp index) (1+ index))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3001 ((not number-control) (allout-sibling-index))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3002 (if (allout-numbered-type-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3003 (allout-rebullet-heading nil ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3004 new-depth ;;; new-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3005 number-control;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3006 index ;;; index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3007 nil))))) ;;;(dont!)do-successors
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3008 ) ; (if (and (= current-depth new-depth)...))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3009 ) ; let* ((current-depth (allout-depth))...)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3010 ) ; defun
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3011 ;;;_ > allout-rebullet-topic (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3012 (defun allout-rebullet-topic (arg)
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3013 "Like `allout-rebullet-topic-grunt', but start from topic visible at point.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3014
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3015 Descends into invisible as well as visible topics, however.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3016
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3017 With repeat count, shift topic depth by that amount."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3018 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3019 (let ((start-col (current-column))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3020 (was-eol (eolp)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3021 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3022 ;; Normalize arg:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3023 (cond ((null arg) (setq arg 0))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3024 ((listp arg) (setq arg (car arg))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3025 ;; Fill the user in, in case we're shifting a big topic:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3026 (if (not (zerop arg)) (message "Shifting..."))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3027 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3028 (if (<= (+ (allout-recent-depth) arg) 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3029 (error "Attempt to shift topic below level 1"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3030 (allout-rebullet-topic-grunt arg)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3031 (if (not (zerop arg)) (message "Shifting... done.")))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3032 (move-to-column (max 0 (+ start-col arg)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3033 ;;;_ > allout-rebullet-topic-grunt (&optional relative-depth ...)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3034 (defun allout-rebullet-topic-grunt (&optional relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3035 starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3036 starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3037 index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3038 do-successors)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3039
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3040 "Rebullet the topic at point, visible or invisible, and all
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3041 contained subtopics. See `allout-rebullet-heading' for rebulleting
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3042 behavior.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3043
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3044 Arg RELATIVE-DEPTH means to shift the depth of the entire
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3045 topic that amount.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3046
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3047 \(fn &optional RELATIVE-DEPTH)"
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3048
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3049 ;; All args except the first one are for internal recursive use by the
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3050 ;; function itself.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3051
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3052 (let* ((relative-depth (or relative-depth 0))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3053 (new-depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3054 (starting-depth (or starting-depth new-depth))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3055 (on-starting-call (null starting-point))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3056 (index (or index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3057 ;; Leave index null on starting call, so rebullet-heading
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3058 ;; calculates it at what might be new depth:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3059 (and (or (zerop relative-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3060 (not on-starting-call))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3061 (allout-sibling-index))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3062 (moving-outwards (< 0 relative-depth))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3063 (starting-point (or starting-point (point))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3064
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3065 ;; Sanity check for excessive promotion done only on starting call:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3066 (and on-starting-call
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3067 moving-outwards
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3068 (> 0 (+ starting-depth relative-depth))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
3069 (error "Attempt to shift topic out beyond level 1")) ;;; ====>
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3070
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3071 (cond ((= starting-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3072 ;; We're at depth to work on this one:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3073 (allout-rebullet-heading nil ;;; solicit
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3074 (+ starting-depth ;;; starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3075 relative-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3076 nil ;;; number
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3077 index ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3078 ;; Every contained topic will get hit,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3079 ;; and we have to get to outside ones
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3080 ;; deliberately:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3081 nil) ;;; do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3082 ;; ... and work on subsequent ones which are at greater depth:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3083 (setq index 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3084 (allout-next-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3085 (while (and (not (eobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3086 (< starting-depth (allout-recent-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3087 (setq index (1+ index))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3088 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3089 (1+ starting-depth);;;starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3090 starting-point ;;; starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3091 index))) ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3092
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3093 ((< starting-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3094 ;; Rare case - subtopic more than one level deeper than parent.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3095 ;; Treat this one at an even deeper level:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3096 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3097 new-depth ;;; starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3098 starting-point ;;; starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3099 index))) ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3100
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3101 (if on-starting-call
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3102 (progn
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3103 ;; Rectify numbering of former siblings of the adjusted topic,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3104 ;; if topic has changed depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3105 (if (or do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3106 (and (not (zerop relative-depth))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3107 (or (= (allout-recent-depth) starting-depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3108 (= (allout-recent-depth) (+ starting-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3109 relative-depth)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3110 (allout-rebullet-heading nil nil nil nil t))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3111 ;; Now rectify numbering of new siblings of the adjusted topic,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3112 ;; if depth has been changed:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3113 (progn (goto-char starting-point)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3114 (if (not (zerop relative-depth))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3115 (allout-rebullet-heading nil nil nil nil t)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3116 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3117 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3118 ;;;_ > allout-renumber-to-depth (&optional depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3119 (defun allout-renumber-to-depth (&optional depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3120 "Renumber siblings at current depth.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3121
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3122 Affects superior topics if optional arg DEPTH is less than current depth.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3123
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3124 Returns final depth."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3125
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3126 ;; Proceed by level, processing subsequent siblings on each,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3127 ;; ascending until we get shallower than the start depth:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3128
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3129 (let ((ascender (allout-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3130 was-eobp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3131 (while (and (not (eobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3132 (allout-depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3133 (>= (allout-recent-depth) depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3134 (>= ascender depth))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3135 ; Skip over all topics at
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3136 ; lesser depths, which can not
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3137 ; have been disturbed:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3138 (while (and (not (setq was-eobp (eobp)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3139 (> (allout-recent-depth) ascender))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3140 (allout-next-heading))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3141 ; Prime ascender for ascension:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3142 (setq ascender (1- (allout-recent-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3143 (if (>= (allout-recent-depth) depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3144 (allout-rebullet-heading nil ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3145 nil ;;; depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3146 nil ;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3147 nil ;;; index
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3148 t)) ;;; do-successors
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3149 (if was-eobp (goto-char (point-max)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3150 (allout-recent-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3151 ;;;_ > allout-number-siblings (&optional denumber)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3152 (defun allout-number-siblings (&optional denumber)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3153 "Assign numbered topic prefix to this topic and its siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3154
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3155 With universal argument, denumber - assign default bullet to this
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3156 topic and its siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3157
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3158 With repeated universal argument (`^U^U'), solicit bullet for each
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3159 rebulleting each topic at this level."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3160
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3161 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3162
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3163 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3164 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3165 (allout-beginning-of-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3166 (let ((depth (allout-recent-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3167 (index (if (not denumber) 1))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3168 (use-bullet (equal '(16) denumber))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3169 (more t))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3170 (while more
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3171 (allout-rebullet-heading use-bullet ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3172 depth ;;; depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3173 t ;;; number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3174 index ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3175 nil) ;;; do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3176 (if index (setq index (1+ index)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3177 (setq more (allout-next-sibling depth nil))))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3178 ;;;_ > allout-shift-in (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3179 (defun allout-shift-in (arg)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3180 "Increase depth of current heading and any topics collapsed within it."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3181 (interactive "p")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3182 (allout-rebullet-topic arg))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3183 ;;;_ > allout-shift-out (arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3184 (defun allout-shift-out (arg)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3185 "Decrease depth of current heading and any topics collapsed within it."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3186 (interactive "p")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3187 (allout-rebullet-topic (* arg -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3188 ;;;_ : Surgery (kill-ring) functions with special provisions for outlines:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3189 ;;;_ > allout-kill-line (&optional arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3190 (defun allout-kill-line (&optional arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3191 "Kill line, adjusting subsequent lines suitably for outline mode."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3192
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3193 (interactive "*P")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3194 (if (not (and (allout-mode-p) ; active outline mode,
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3195 allout-numbered-bullet ; numbers may need adjustment,
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3196 (bolp) ; may be clipping topic head,
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3197 (looking-at allout-regexp))) ; are clipping topic head.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3198 ;; Above conditions do not obtain - just do a regular kill:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3199 (kill-line arg)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3200 ;; Ah, have to watch out for adjustments:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3201 (let* ((depth (allout-depth)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3202 ; Do the kill:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3203 (kill-line arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3204 ; Provide some feedback:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3205 (sit-for 0)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3206 (save-excursion
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3207 ; Start with the topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3208 ; following killed line:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3209 (if (not (looking-at allout-regexp))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3210 (allout-next-heading))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3211 (allout-renumber-to-depth depth)))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3212 ;;;_ > allout-kill-topic ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3213 (defun allout-kill-topic ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3214 "Kill topic together with subtopics.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3215
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3216 Leaves primary topic's trailing vertical whitespace, if any."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3217
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3218 ;; Some finagling is done to make complex topic kills appear faster
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3219 ;; than they actually are. A redisplay is performed immediately
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3220 ;; after the region is disposed of, though the renumbering process
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3221 ;; has yet to be performed. This means that there may appear to be
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3222 ;; a lag *after* the kill has been performed.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3223
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3224 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3225 (let* ((beg (prog1 (allout-back-to-current-heading)(beginning-of-line)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3226 (depth (allout-recent-depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3227 (allout-end-of-current-subtree)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3228 (if (not (eobp))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3229 (if (or (not (looking-at "^$"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3230 ;; A blank line - cut it with this topic *unless* this
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3231 ;; is the last topic at this level, in which case
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3232 ;; we'll leave the blank line as part of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3233 ;; containing topic:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3234 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3235 (and (allout-next-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3236 (>= (allout-recent-depth) depth))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3237 (forward-char 1)))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3238
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3239 (kill-region beg (point))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3240 (sit-for 0)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3241 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3242 (allout-renumber-to-depth depth))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3243 ;;;_ > allout-yank-processing ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3244 (defun allout-yank-processing (&optional arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3245
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
3246 "Incidental outline specific business to be done just after text yanks.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3247
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3248 Does depth adjustment of yanked topics, when:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3249
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3250 1 the stuff being yanked starts with a valid outline header prefix, and
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3251 2 it is being yanked at the end of a line which consists of only a valid
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3252 topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3253
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
3254 Also, adjusts numbering of subsequent siblings when appropriate.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3255
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3256 Depth adjustment alters the depth of all the topics being yanked
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3257 the amount it takes to make the first topic have the depth of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3258 header into which it's being yanked.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3259
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3260 The point is left in front of yanked, adjusted topics, rather than
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3261 at the end (and vice-versa with the mark). Non-adjusted yanks,
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
3262 however, are left exactly like normal, not outline specific yanks."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3263
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3264 (interactive "*P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3265 ; Get to beginning, leaving
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3266 ; region around subject:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3267 (if (< (my-mark-marker t) (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3268 (exchange-point-and-mark))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3269 (let* ((subj-beg (point))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3270 (subj-end (my-mark-marker t))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3271 ;; 'resituate' if yanking an entire topic into topic header:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3272 (resituate (and (allout-e-o-prefix-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3273 (looking-at (concat "\\(" allout-regexp "\\)"))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3274 (allout-prefix-data (match-beginning 1)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3275 (match-end 1))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3276 ;; `rectify-numbering' if resituating (where several topics may
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3277 ;; be resituating) or yanking a topic into a topic slot (bol):
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3278 (rectify-numbering (or resituate
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3279 (and (bolp) (looking-at allout-regexp)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3280 (if resituate
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3281 ; The yanked stuff is a topic:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3282 (let* ((prefix-len (- (match-end 1) subj-beg))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3283 (subj-depth (allout-recent-depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3284 (prefix-bullet (allout-recent-bullet))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3285 (adjust-to-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3286 ;; Nil if adjustment unnecessary, otherwise depth to which
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3287 ;; adjustment should be made:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3288 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3289 (and (goto-char subj-end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3290 (eolp)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3291 (goto-char subj-beg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3292 (and (looking-at allout-regexp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3293 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3294 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3295 (not (= (point) subj-beg)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3296 (looking-at allout-regexp)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3297 (allout-prefix-data (match-beginning 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3298 (match-end 0)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3299 (allout-recent-depth))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3300 done
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3301 (more t))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3302 (setq rectify-numbering allout-numbered-bullet)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3303 (if adjust-to-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3304 ; Do the adjustment:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3305 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3306 (message "... yanking") (sit-for 0)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3307 (save-restriction
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3308 (narrow-to-region subj-beg subj-end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3309 ; Trim off excessive blank
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3310 ; line at end, if any:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3311 (goto-char (point-max))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3312 (if (looking-at "^$")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3313 (allout-unprotected (delete-char -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3314 ; Work backwards, with each
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3315 ; shallowest level,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3316 ; successively excluding the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3317 ; last processed topic from
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3318 ; the narrow region:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3319 (while more
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3320 (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3321 ; go as high as we can in each bunch:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3322 (while (allout-ascend-to-depth (1- (allout-depth))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3323 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3324 (allout-rebullet-topic-grunt (- adjust-to-depth
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3325 subj-depth))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3326 (allout-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3327 (if (setq more (not (bobp)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3328 (progn (widen)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3329 (forward-char -1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3330 (narrow-to-region subj-beg (point))))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3331 (message "")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3332 ;; Preserve new bullet if it's a distinctive one, otherwise
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3333 ;; use old one:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3334 (if (string-match (regexp-quote prefix-bullet)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3335 allout-distinctive-bullets-string)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3336 ; Delete from bullet of old to
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3337 ; before bullet of new:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3338 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3339 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3340 (delete-region (point) subj-beg)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3341 (set-marker (my-mark-marker t) subj-end)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3342 (goto-char subj-beg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3343 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3344 ; Delete base subj prefix,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3345 ; leaving old one:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3346 (delete-region (point) (+ (point)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3347 prefix-len
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3348 (- adjust-to-depth subj-depth)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3349 ; and delete residual subj
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3350 ; prefix digits and space:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3351 (while (looking-at "[0-9]") (delete-char 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3352 (if (looking-at " ") (delete-char 1))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3353 (exchange-point-and-mark))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3354 (if rectify-numbering
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3355 (progn
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3356 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3357 ; Give some preliminary feedback:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3358 (message "... reconciling numbers") (sit-for 0)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3359 ; ... and renumber, in case necessary:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3360 (goto-char subj-beg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3361 (if (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3362 (allout-rebullet-heading nil ;;; solicit
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3363 (allout-depth) ;;; depth
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3364 nil ;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3365 nil ;;; index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3366 t))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3367 (message ""))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3368 (if (not resituate)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3369 (exchange-point-and-mark))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3370 ;;;_ > allout-yank (&optional arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3371 (defun allout-yank (&optional arg)
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
3372 "`allout-mode' yank, with depth and numbering adjustment of yanked topics.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3373
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
3374 Non-topic yanks work no differently than normal yanks.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3375
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3376 If a topic is being yanked into a bare topic prefix, the depth of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3377 yanked topic is adjusted to the depth of the topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3378
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3379 1 we're yanking in an `allout-mode' buffer
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3380 2 the stuff being yanked starts with a valid outline header prefix, and
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3381 3 it is being yanked at the end of a line which consists of only a valid
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3382 topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3383
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3384 If these conditions hold then the depth of the yanked topics are all
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3385 adjusted the amount it takes to make the first one at the depth of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3386 header into which it's being yanked.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3387
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3388 The point is left in front of yanked, adjusted topics, rather than
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3389 at the end (and vice-versa with the mark). Non-adjusted yanks,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3390 however, (ones that don't qualify for adjustment) are handled
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3391 exactly like normal yanks.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3392
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
3393 Numbering of yanked topics, and the successive siblings at the depth
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3394 into which they're being yanked, is adjusted.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3395
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
3396 `allout-yank-pop' works with `allout-yank' just like normal `yank-pop'
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
3397 works with normal `yank' in non-outline buffers."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3398
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3399 (interactive "*P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3400 (setq this-command 'yank)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3401 (yank arg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3402 (if (allout-mode-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3403 (allout-yank-processing)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3404 ;;;_ > allout-yank-pop (&optional arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3405 (defun allout-yank-pop (&optional arg)
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3406 "Yank-pop like `allout-yank' when popping to bare outline prefixes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3407
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3408 Adapts level of popped topics to level of fresh prefix.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3409
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3410 Note - prefix changes to distinctive bullets will stick, if followed
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3411 by pops to non-distinctive yanks. Bug..."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3412
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3413 (interactive "*p")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3414 (setq this-command 'yank)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3415 (yank-pop arg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3416 (if (allout-mode-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3417 (allout-yank-processing)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3418
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3419 ;;;_ - Specialty bullet functions
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3420 ;;;_ : File Cross references
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3421 ;;;_ > allout-resolve-xref ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3422 (defun allout-resolve-xref ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3423 "Pop to file associated with current heading, if it has an xref bullet.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3424
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3425 \(Works according to setting of `allout-file-xref-bullet')."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3426 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3427 (if (not allout-file-xref-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3428 (error
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3429 "outline cross references disabled - no `allout-file-xref-bullet'")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3430 (if (not (string= (allout-current-bullet) allout-file-xref-bullet))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3431 (error "current heading lacks cross-reference bullet `%s'"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3432 allout-file-xref-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3433 (let (file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3434 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3435 (let* ((text-start allout-recent-prefix-end)
15663
4f762e6ae80a (outline-resolve-xref): Do not mistake a blank line
Karl Heuer <kwzh@gnu.org>
parents: 14416
diff changeset
3436 (heading-end (progn (end-of-line) (point))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3437 (goto-char text-start)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3438 (setq file-name
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3439 (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3440 (buffer-substring (match-beginning 1) (match-end 1))))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3441 (setq file-name
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3442 (if (not (= (aref file-name 0) ?:))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3443 (expand-file-name file-name)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3444 ; A registry-files ref, strip the `:'
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3445 ; and try to follow it:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3446 (let ((reg-ref (reference-registered-file
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3447 (substring file-name 1) nil t)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3448 (if reg-ref (car (cdr reg-ref))))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3449 (if (or (file-exists-p file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3450 (if (file-writable-p file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3451 (y-or-n-p (format "%s not there, create one? "
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3452 file-name))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3453 (error "%s not found and can't be created" file-name)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3454 (condition-case failure
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3455 (find-file-other-window file-name)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3456 ('error failure))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3457 (error "%s not found" file-name))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3458 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3459 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3460 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3461 )
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3462
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3463 ;;;_ #6 Exposure Control
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3464
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3465 ;;;_ - Fundamental
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3466 ;;;_ > allout-flag-current-subtree (flag)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3467 (defun allout-flag-current-subtree (flag)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3468 "Hide or show subtree of currently-visible topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3469
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3470 See `allout-flag-region' for more details."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3471
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3472 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3473 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3474 (allout-flag-region (point)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3475 (progn (allout-end-of-current-subtree) (1- (point)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3476 flag)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3477
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3478 ;;;_ - Topic-specific
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3479 ;;;_ > allout-show-entry ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3480 (defun allout-show-entry ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3481 "Like `allout-show-current-entry', reveals entries nested in hidden topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3482
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3483 This is a way to give restricted peek at a concealed locality without the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3484 expense of exposing its context, but can leave the outline with aberrant
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
3485 exposure. `allout-hide-current-entry-completely' or `allout-show-to-offshoot'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3486 should be used after the peek to rectify the exposure."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3487
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3488 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3489 (save-excursion
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3490 (let ((at (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3491 beg end)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3492 (allout-goto-prefix)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3493 (setq beg (if (= (preceding-char) ?\r) (1- (point)) (point)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3494 (re-search-forward "[\n\r]" nil t)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3495 (setq end (1- (if (< at (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3496 ;; We're on topic head line - show only it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3497 (point)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3498 ;; or we're in body - include it:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3499 (max beg (or (allout-pre-next-preface) (point))))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3500 (allout-flag-region beg end ?\n)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3501 (list beg end))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3502 ;;;_ > allout-show-children (&optional level strict)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3503 (defun allout-show-children (&optional level strict)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3504
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3505 "If point is visible, show all direct subheadings of this heading.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3506
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3507 Otherwise, do `allout-show-to-offshoot', and then show subheadings.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3508
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3509 Optional LEVEL specifies how many levels below the current level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3510 should be shown, or all levels if t. Default is 1.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3511
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3512 Optional STRICT means don't resort to -show-to-offshoot, no matter
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3513 what. This is basically so -show-to-offshoot, which is called by
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3514 this function, can employ the pure offspring-revealing capabilities of
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3515 it.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3516
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3517 Returns point at end of subtree that was opened, if any. (May get a
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3518 point of non-opened subtree?)"
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3519
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3520 (interactive "p")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3521 (let (max-pos)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3522 (if (and (not strict)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3523 (allout-hidden-p))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3524
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3525 (progn (allout-show-to-offshoot) ; Point's concealed, open to
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3526 ; expose it.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3527 ;; Then recurse, but with "strict" set so we don't
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3528 ;; infinite regress:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3529 (setq max-pos (allout-show-children level t)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3530
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3531 (save-excursion
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3532 (save-restriction
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3533 (let* ((start-pt (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3534 (chart (allout-chart-subtree (or level 1)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3535 (to-reveal (allout-chart-to-reveal chart (or level 1))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3536 (goto-char start-pt)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3537 (if (and strict (= (preceding-char) ?\r))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3538 ;; Concealed root would already have been taken care of,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3539 ;; unless strict was set.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3540 (progn
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3541 (allout-flag-region (point) (allout-snug-back) ?\n)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3542 (if allout-show-bodies
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3543 (progn (goto-char (car to-reveal))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3544 (allout-show-current-entry)))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3545 (while to-reveal
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3546 (goto-char (car to-reveal))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3547 (allout-flag-region (point) (allout-snug-back) ?\n)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3548 (if allout-show-bodies
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3549 (progn (goto-char (car to-reveal))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3550 (allout-show-current-entry)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3551 (setq to-reveal (cdr to-reveal)))))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3552 ;;;_ > allout-hide-point-reconcile ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3553 (defun allout-hide-reconcile ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3554 "Like `allout-hide-current-entry'; hides completely if within hidden region.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3555
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3556 Specifically intended for aberrant exposure states, like entries that were
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3557 exposed by `allout-show-entry' but are within otherwise concealed regions."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3558 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3559 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3560 (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3561 (allout-flag-region (if (not (bobp)) (1- (point)) (point))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3562 (progn (allout-pre-next-preface)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3563 (if (= ?\r (following-char))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3564 (point)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3565 (1- (point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3566 ?\r)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3567 ;;;_ > allout-show-to-offshoot ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3568 (defun allout-show-to-offshoot ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3569 "Like `allout-show-entry', but reveals all concealed ancestors, as well.
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3570
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3571 As with `allout-hide-current-entry-completely', useful for rectifying
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3572 aberrant exposure states produced by `allout-show-entry'."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3573
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3574 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3575 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3576 (let ((orig-pt (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3577 (orig-pref (allout-goto-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3578 (last-at (point))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3579 bag-it)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3580 (while (or bag-it (= (preceding-char) ?\r))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3581 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3582 (if (= last-at (setq last-at (point)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3583 ;; Oops, we're not making any progress! Show the current
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3584 ;; topic completely, and bag this try.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3585 (progn (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3586 (allout-show-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3587 (goto-char orig-pt)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3588 (setq bag-it t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3589 (beep)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3590 (message "%s: %s"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3591 "allout-show-to-offshoot: "
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3592 "Aberrant nesting encountered.")))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3593 (allout-show-children)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3594 (goto-char orig-pref))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3595 (goto-char orig-pt)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3596 (if (allout-hidden-p)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3597 (allout-show-entry)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3598 ;;;_ > allout-hide-current-entry ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3599 (defun allout-hide-current-entry ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3600 "Hide the body directly following this heading."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3601 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3602 (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3603 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3604 (allout-flag-region (point)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3605 (progn (allout-end-of-current-entry) (point))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3606 ?\r)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3607 ;;;_ > allout-show-current-entry (&optional arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3608 (defun allout-show-current-entry (&optional arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3609
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3610 "Show body following current heading, or hide the entry if repeat count."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3611
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3612 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3613 (if arg
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3614 (allout-hide-current-entry)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3615 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3616 (allout-flag-region (point)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3617 (progn (allout-end-of-current-entry) (point))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3618 ?\n))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3619 ;;;_ > allout-hide-current-entry-completely ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3620 ; ... allout-hide-current-entry-completely also for isearch dynamic exposure:
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3621 (defun allout-hide-current-entry-completely ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3622 "Like `allout-hide-current-entry', but conceal topic completely.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3623
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3624 Specifically intended for aberrant exposure states, like entries that were
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3625 exposed by `allout-show-entry' but are within otherwise concealed regions."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3626 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3627 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3628 (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3629 (allout-flag-region (if (not (bobp)) (1- (point)) (point))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3630 (progn (allout-pre-next-preface)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3631 (if (= ?\r (following-char))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3632 (point)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3633 (1- (point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3634 ?\r)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3635 ;;;_ > allout-show-current-subtree (&optional arg)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3636 (defun allout-show-current-subtree (&optional arg)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3637 "Show everything within the current topic. With a repeat-count,
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3638 expose this topic and its siblings."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3639 (interactive "P")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3640 (save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3641 (if (<= (allout-current-depth) 0)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3642 ;; Outside any topics - try to get to the first:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3643 (if (not (allout-next-heading))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
3644 (error "No topics")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3645 ;; got to first, outermost topic - set to expose it and siblings:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3646 (message "Above outermost topic - exposing all.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3647 (allout-flag-region (point-min)(point-max) ?\n))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3648 (if (not arg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3649 (allout-flag-current-subtree ?\n)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3650 (allout-beginning-of-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3651 (allout-expose-topic '(* :))))))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3652 ;;;_ > allout-hide-current-subtree (&optional just-close)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3653 (defun allout-hide-current-subtree (&optional just-close)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3654 "Close the current topic, or containing topic if this one is already closed.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3655
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3656 If this topic is closed and it's a top level topic, close this topic
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3657 and its siblings.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3658
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3659 If optional arg JUST-CLOSE is non-nil, do not treat the parent or
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3660 siblings, even if the target topic is already closed."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3661
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3662 (interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3663 (let ((from (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3664 (orig-eol (progn (end-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3665 (if (not (allout-goto-prefix))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
3666 (error "No topics found")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3667 (end-of-line)(point)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3668 (allout-flag-current-subtree ?\r)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3669 (goto-char from)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3670 (if (and (= orig-eol (progn (goto-char orig-eol)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3671 (end-of-line)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3672 (point)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3673 (not just-close)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3674 ;; Structure didn't change - try hiding current level:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3675 (goto-char from)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3676 (if (allout-up-current-level 1 t)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3677 t
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3678 (goto-char 0)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3679 (let ((msg
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3680 "Top-level topic already closed - closing siblings..."))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3681 (message msg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3682 (allout-expose-topic '(0 :))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3683 (message (concat msg " Done.")))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3684 nil)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3685 (/= (allout-recent-depth) 0))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3686 (allout-hide-current-subtree))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3687 (goto-char from)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3688 ;;;_ > allout-show-current-branches ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3689 (defun allout-show-current-branches ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3690 "Show all subheadings of this heading, but not their bodies."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3691 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3692 (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3693 (allout-show-children t))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3694 ;;;_ > allout-hide-current-leaves ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3695 (defun allout-hide-current-leaves ()
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3696 "Hide the bodies of the current topic and all its offspring."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3697 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3698 (allout-back-to-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3699 (allout-hide-region-body (point) (progn (allout-end-of-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3700 (point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3701
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3702 ;;;_ - Region and beyond
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3703 ;;;_ > allout-show-all ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3704 (defun allout-show-all ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3705 "Show all of the text in the buffer."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3706 (interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3707 (message "Exposing entire buffer...")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3708 (allout-flag-region (point-min) (point-max) ?\n)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3709 (message "Exposing entire buffer... Done."))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3710 ;;;_ > allout-hide-bodies ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3711 (defun allout-hide-bodies ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3712 "Hide all of buffer except headings."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3713 (interactive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3714 (allout-hide-region-body (point-min) (point-max)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3715 ;;;_ > allout-hide-region-body (start end)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3716 (defun allout-hide-region-body (start end)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3717 "Hide all body lines in the region, but not headings."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3718 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3719 (save-restriction
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3720 (narrow-to-region start end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3721 (goto-char (point-min))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3722 (while (not (eobp))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3723 (allout-flag-region (point)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3724 (progn (allout-pre-next-preface) (point)) ?\r)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3725 (if (not (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3726 (forward-char
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3727 (if (looking-at "[\n\r][\n\r]")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3728 2 1)))))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3729
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3730 ;;;_ > allout-expose-topic (spec)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3731 (defun allout-expose-topic (spec)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3732 "Apply exposure specs to successive outline topic items.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3733
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3734 Use the more convenient frontend, `allout-new-exposure', if you don't
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3735 need evaluation of the arguments, or even better, the `allout-layout'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3736 variable-keyed mode-activation/auto-exposure feature of allout outline
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3737 mode. See the respective documentation strings for more details.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3738
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3739 Cursor is left at start position.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3740
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3741 SPEC is either a number or a list.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3742
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3743 Successive specs on a list are applied to successive sibling topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3744
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3745 A simple spec \(either a number, one of a few symbols, or the null
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3746 list) dictates the exposure for the corresponding topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3747
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3748 Non-null lists recursively designate exposure specs for respective
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3749 subtopics of the current topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3750
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3751 The `:' repeat spec is used to specify exposure for any number of
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3752 successive siblings, up to the trailing ones for which there are
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3753 explicit specs following the `:'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3754
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3755 Simple (numeric and null-list) specs are interpreted as follows:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3756
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3757 Numbers indicate the relative depth to open the corresponding topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3758 - negative numbers force the topic to be closed before opening to the
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3759 absolute value of the number, so all siblings are open only to
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3760 that level.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3761 - positive numbers open to the relative depth indicated by the
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3762 number, but do not force already opened subtopics to be closed.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3763 - 0 means to close topic - hide all offspring.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3764 : - `repeat'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3765 apply prior element to all siblings at current level, *up to*
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3766 those siblings that would be covered by specs following the `:'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3767 on the list. Ie, apply to all topics at level but the last
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3768 ones. \(Only first of multiple colons at same level is
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3769 respected - subsequent ones are discarded.)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3770 * - completely opens the topic, including bodies.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3771 + - shows all the sub headers, but not the bodies
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3772 - - exposes the body of the corresponding topic.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3773
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3774 Examples:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3775 \(allout-expose-topic '(-1 : 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3776 Close this and all following topics at current level, exposing
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3777 only their immediate children, but close down the last topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3778 at this current level completely.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3779 \(allout-expose-topic '(-1 () : 1 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3780 Close current topic so only the immediate subtopics are shown;
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3781 show the children in the second to last topic, and completely
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3782 close the last one.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3783 \(allout-expose-topic '(-2 : -1 *))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3784 Expose children and grandchildren of all topics at current
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3785 level except the last two; expose children of the second to
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3786 last and completely open the last one."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3787
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3788 (interactive "xExposure spec: ")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3789 (if (not (listp spec))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3790 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3791 (let ((depth (allout-depth))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3792 (max-pos 0)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3793 prev-elem curr-elem
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3794 stay done
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3795 snug-back
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3796 )
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3797 (while spec
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3798 (setq prev-elem curr-elem
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3799 curr-elem (car spec)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3800 spec (cdr spec))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3801 (cond ; Do current element:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3802 ((null curr-elem) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3803 ((symbolp curr-elem)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3804 (cond ((eq curr-elem '*) (allout-show-current-subtree)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3805 (if (> allout-recent-end-of-subtree max-pos)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3806 (setq max-pos allout-recent-end-of-subtree)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3807 ((eq curr-elem '+) (allout-show-current-branches)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3808 (if (> allout-recent-end-of-subtree max-pos)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3809 (setq max-pos allout-recent-end-of-subtree)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3810 ((eq curr-elem '-) (allout-show-current-entry))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3811 ((eq curr-elem ':)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3812 (setq stay t)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3813 ;; Expand the `repeat' spec to an explicit version,
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3814 ;; w.r.t. remaining siblings:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3815 (let ((residue ; = # of sibs not covered by remaining spec
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3816 ;; Dang - could be nice to make use of the chart, sigh:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3817 (- (length (allout-chart-siblings))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3818 (length spec))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3819 (if (< 0 residue)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3820 ;; Some residue - cover it with prev-elem:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3821 (setq spec (append (make-list residue prev-elem)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3822 spec)))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3823 ((numberp curr-elem)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3824 (if (and (>= 0 curr-elem) (allout-visible-p))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3825 (save-excursion (allout-hide-current-subtree t)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3826 (if (> 0 curr-elem)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3827 nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3828 (if (> allout-recent-end-of-subtree max-pos)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3829 (setq max-pos
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3830 allout-recent-end-of-subtree)))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3831 (if (> (abs curr-elem) 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3832 (progn (allout-show-children (abs curr-elem))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3833 (if (> allout-recent-end-of-subtree max-pos)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3834 (setq max-pos allout-recent-end-of-subtree)))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3835 ((listp curr-elem)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3836 (if (allout-descend-to-depth (1+ depth))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3837 (let ((got (allout-expose-topic curr-elem)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3838 (if (and got (> got max-pos)) (setq max-pos got))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3839 (cond (stay (setq stay nil))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3840 ((listp (car spec)) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3841 ((> max-pos (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3842 ;; Capitalize on max-pos state to get us nearer next sibling:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3843 (progn (goto-char (min (point-max) max-pos))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3844 (allout-next-heading)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3845 ((allout-next-sibling depth))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3846 max-pos)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3847 ;;;_ > allout-old-expose-topic (spec &rest followers)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3848 (defun allout-old-expose-topic (spec &rest followers)
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3849 "Dictate wholesale exposure scheme for current topic, according to SPEC.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3850
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3851 SPEC is either a number or a list. Optional successive args
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3852 dictate exposure for subsequent siblings of current topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3853
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3854 A simple spec (either a number, a special symbol, or the null list)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3855 dictates the overall exposure for a topic. Non null lists are
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3856 composite specs whose first element dictates the overall exposure for
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3857 a topic, with the subsequent elements in the list interpreted as specs
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3858 that dictate the exposure for the successive offspring of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3859
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3860 Simple (numeric and null-list) specs are interpreted as follows:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3861
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3862 - Numbers indicate the relative depth to open the corresponding topic:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3863 - negative numbers force the topic to be close before opening to the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3864 absolute value of the number.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3865 - positive numbers just open to the relative depth indicated by the number.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3866 - 0 just closes
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3867 - `*' completely opens the topic, including bodies.
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3868 - `+' shows all the sub headers, but not the bodies
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3869 - `-' exposes the body and immediate offspring of the corresponding topic.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3870
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3871 If the spec is a list, the first element must be a number, which
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3872 dictates the exposure depth of the topic as a whole. Subsequent
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3873 elements of the list are nested SPECs, dictating the specific exposure
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3874 for the corresponding offspring of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3875
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3876 Optional FOLLOWERS arguments dictate exposure for succeeding siblings."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3877
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3878 (interactive "xExposure spec: ")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3879 (let ((depth (allout-current-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3880 done
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3881 max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3882 (cond ((null spec) nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3883 ((symbolp spec)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3884 (if (eq spec '*) (allout-show-current-subtree))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3885 (if (eq spec '+) (allout-show-current-branches))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3886 (if (eq spec '-) (allout-show-current-entry)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3887 ((numberp spec)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3888 (if (>= 0 spec)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3889 (save-excursion (allout-hide-current-subtree t)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3890 (end-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3891 (if (or (not max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3892 (> (point) max-pos))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3893 (setq max-pos (point)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3894 (if (> 0 spec)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3895 (setq spec (* -1 spec)))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3896 (if (> spec 0)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3897 (allout-show-children spec)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3898 ((listp spec)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3899 ;(let ((got (allout-old-expose-topic (car spec))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3900 ; (if (and got (or (not max-pos) (> got max-pos)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3901 ; (setq max-pos got)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3902 (let ((new-depth (+ (allout-current-depth) 1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3903 got)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3904 (setq max-pos (allout-old-expose-topic (car spec)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3905 (setq spec (cdr spec))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3906 (if (and spec
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3907 (allout-descend-to-depth new-depth)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3908 (not (allout-hidden-p)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3909 (progn (setq got (apply 'allout-old-expose-topic spec))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3910 (if (and got (or (not max-pos) (> got max-pos)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3911 (setq max-pos got)))))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3912 (while (and followers
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3913 (progn (if (and max-pos (< (point) max-pos))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3914 (progn (goto-char max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3915 (setq max-pos nil)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3916 (end-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3917 (allout-next-sibling depth)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3918 (allout-old-expose-topic (car followers))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3919 (setq followers (cdr followers)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3920 max-pos))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3921 (make-obsolete 'allout-old-expose-topic
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3922 "use `allout-expose-topic' (with different schema format) instead."
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
3923 "19.23")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3924 ;;;_ > allout-new-exposure '()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3925 (defmacro allout-new-exposure (&rest spec)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3926 "Literal frontend for `allout-expose-topic', doesn't evaluate arguments.
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3927 Some arguments that would need to be quoted in `allout-expose-topic'
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3928 need not be quoted in `allout-new-exposure'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3929
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3930 Cursor is left at start position.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3931
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3932 Examples:
61969
38ca28ee68d6 (allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents: 59996
diff changeset
3933 \(allout-new-exposure (-1 () () () 1) 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3934 Close current topic at current level so only the immediate
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3935 subtopics are shown, except also show the children of the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3936 third subtopic; and close the next topic at the current level.
61969
38ca28ee68d6 (allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents: 59996
diff changeset
3937 \(allout-new-exposure : -1 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3938 Close all topics at current level to expose only their
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3939 immediate children, except for the last topic at the current
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3940 level, in which even its immediate children are hidden.
61969
38ca28ee68d6 (allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents: 59996
diff changeset
3941 \(allout-new-exposure -2 : -1 *)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3942 Expose children and grandchildren of first topic at current
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3943 level, and expose children of subsequent topics at current
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3944 level *except* for the last, which should be opened completely."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3945 (list 'save-excursion
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3946 '(if (not (or (allout-goto-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3947 (allout-next-heading)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3948 (error "allout-new-exposure: Can't find any outline topics"))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3949 (list 'allout-expose-topic (list 'quote spec))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3950
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3951 ;;;_ #7 Systematic outline presentation - copying, printing, flattening
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3952
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3953 ;;;_ - Mapping and processing of topics
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3954 ;;;_ ( See also Subtree Charting, in Navigation code.)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3955 ;;;_ > allout-stringify-flat-index (flat-index)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3956 (defun allout-stringify-flat-index (flat-index &optional context)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3957 "Convert list representing section/subsection/... to document string.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3958
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3959 Optional arg CONTEXT indicates interior levels to include."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3960 (let ((delim ".")
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
3961 result
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3962 numstr
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3963 (context-depth (or (and context 2) 1)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3964 ;; Take care of the explicit context:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3965 (while (> context-depth 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3966 (setq numstr (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3967 flat-index (cdr flat-index)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3968 result (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3969 (cons delim (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3970 (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3971 context-depth (if flat-index (1- context-depth) 0)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3972 (setq delim " ")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3973 ;; Take care of the indentation:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3974 (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3975 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3976 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3977 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3978 (cons delim
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3979 (cons (make-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3980 (1+ (truncate (if (zerop (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3981 1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3982 (log10 (car flat-index)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3983 ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3984 result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3985 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3986 ;; Dispose of single extra delim:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3987 (setq result (cdr result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3988 (apply 'concat result)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3989 ;;;_ > allout-stringify-flat-index-plain (flat-index)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3990 (defun allout-stringify-flat-index-plain (flat-index)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3991 "Convert list representing section/subsection/... to document string."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3992 (let ((delim ".")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3993 result)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3994 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3995 (setq result (cons (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3996 (if result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3997 (cons delim result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3998 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3999 (apply 'concat result)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4000 ;;;_ > allout-stringify-flat-index-indented (flat-index)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4001 (defun allout-stringify-flat-index-indented (flat-index)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4002 "Convert list representing section/subsection/... to document string."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4003 (let ((delim ".")
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
4004 result
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4005 numstr)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4006 ;; Take care of the explicit context:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4007 (setq numstr (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4008 flat-index (cdr flat-index)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4009 result (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4010 (cons delim (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4011 (cons numstr result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4012 (setq delim " ")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4013 ;; Take care of the indentation:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4014 (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4015 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4016 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4017 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4018 (cons delim
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4019 (cons (make-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4020 (1+ (truncate (if (zerop (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4021 1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4022 (log10 (car flat-index)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4023 ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4024 result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4025 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4026 ;; Dispose of single extra delim:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4027 (setq result (cdr result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4028 (apply 'concat result)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4029 ;;;_ > allout-listify-exposed (&optional start end format)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4030 (defun allout-listify-exposed (&optional start end format)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4031
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4032 "Produce a list representing exposed topics in current region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4033
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4034 This list can then be used by `allout-process-exposed' to manipulate
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4035 the subject region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4036
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4037 Optional START and END indicate bounds of region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4038
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4039 optional arg, FORMAT, designates an alternate presentation form for
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4040 the prefix:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4041
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4042 list - Present prefix as numeric section.subsection..., starting with
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4043 section indicated by the list, innermost nesting first.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4044 `indent' \(symbol) - Convert header prefixes to all white space,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4045 except for distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4046
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4047 The elements of the list produced are lists that represents a topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4048 header and body. The elements of that list are:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4049
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4050 - a number representing the depth of the topic,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4051 - a string representing the header-prefix, including trailing whitespace and
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4052 bullet.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4053 - a string representing the bullet character,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4054 - and a series of strings, each containing one line of the exposed
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4055 portion of the topic entry."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4056
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4057 (interactive "r")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4058 (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4059 (let*
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4060 ;; state vars:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4061 (strings prefix pad result depth new-depth out gone-out bullet beg
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4062 next done)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4063
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4064 (goto-char start)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4065 (beginning-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4066 ;; Goto initial topic, and register preceeding stuff, if any:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4067 (if (> (allout-goto-prefix) start)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4068 ;; First topic follows beginning point - register preliminary stuff:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4069 (setq result (list (list 0 "" nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4070 (buffer-substring start (1- (point)))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4071 (while (and (not done)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4072 (not (eobp)) ; Loop until we've covered the region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4073 (not (> (point) end)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4074 (setq depth (allout-recent-depth) ; Current topics depth,
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4075 bullet (allout-recent-bullet) ; ... bullet,
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4076 prefix (allout-recent-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4077 beg (progn (allout-end-of-prefix t) (point))) ; and beginning.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4078 (setq done ; The boundary for the current topic:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4079 (not (allout-next-visible-heading 1)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4080 (setq new-depth (allout-recent-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4081 (setq gone-out out
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4082 out (< new-depth depth))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4083 (beginning-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4084 (setq next (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4085 (goto-char beg)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4086 (setq strings nil)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4087 (while (> next (point)) ; Get all the exposed text in
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4088 (setq strings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4089 (cons (buffer-substring
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4090 beg
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4091 ;To hidden text or end of line:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4092 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4093 (search-forward "\r"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4094 (save-excursion (end-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4095 (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4096 1)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4097 (if (= (preceding-char) ?\r)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4098 (1- (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4099 (point))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4100 strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4101 (if (< (point) next) ; Resume from after hid text, if any.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4102 (forward-line 1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4103 (setq beg (point)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4104 ;; Accumulate list for this topic:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4105 (setq strings (nreverse strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4106 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4107 (cons
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4108 (if format
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4109 (let ((special (if (string-match
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4110 (regexp-quote bullet)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4111 allout-distinctive-bullets-string)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4112 bullet)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4113 (cond ((listp format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4114 (list depth
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4115 (if allout-abbreviate-flattened-numbering
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4116 (allout-stringify-flat-index format
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4117 gone-out)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4118 (allout-stringify-flat-index-plain
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4119 format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4120 strings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4121 special))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4122 ((eq format 'indent)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4123 (if special
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4124 (list depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4125 (concat (make-string (1+ depth) ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4126 (substring prefix -1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4127 strings)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4128 (list depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4129 (make-string depth ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4130 strings)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4131 (t (error "allout-listify-exposed: %s %s"
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4132 "invalid format" format))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4133 (list depth prefix strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4134 result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4135 ;; Reasses format, if any:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4136 (if (and format (listp format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4137 (cond ((= new-depth depth)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4138 (setq format (cons (1+ (car format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4139 (cdr format))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4140 ((> new-depth depth) ; descending - assume by 1:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4141 (setq format (cons 1 format)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4142 (t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4143 ; Pop the residue:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4144 (while (< new-depth depth)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4145 (setq format (cdr format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4146 (setq depth (1- depth)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4147 ; And increment the current one:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4148 (setq format
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4149 (cons (1+ (or (car format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4150 -1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4151 (cdr format)))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4152 ;; Put the list with first at front, to last at back:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4153 (nreverse result))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4154 ;;;_ > allout-process-exposed (&optional func from to frombuf
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4155 ;;; tobuf format)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4156 (defun allout-process-exposed (&optional func from to frombuf tobuf
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4157 format start-num)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4158 "Map function on exposed parts of current topic; results to another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4159
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4160 Apply FUNC to exposed portions FROM position TO position in buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4161 FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4162 alternate presentation form:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4163
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4164 `flat' - Present prefix as numeric section.subsection..., starting with
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4165 section indicated by the start-num, innermost nesting first.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4166 X`flat-indented' - Prefix is like `flat' for first topic at each
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4167 X level, but subsequent topics have only leaf topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4168 X number, padded with blanks to line up with first.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4169 `indent' \(symbol) - Convert header prefixes to all white space,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4170 except for distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4171
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4172 Defaults:
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4173 FUNC: `allout-insert-listified'
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4174 FROM: region start, if region active, else start of buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4175 TO: region end, if region active, else end of buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4176 FROMBUF: current buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4177 TOBUF: buffer name derived: \"*current-buffer-name exposed*\"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4178 FORMAT: nil"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4179
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4180 ; Resolve arguments,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4181 ; defaulting if necessary:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4182 (if (not func) (setq func 'allout-insert-listified))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4183 (if (not (and from to))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4184 (if (my-region-active-p)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4185 (setq from (region-beginning) to (region-end))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4186 (setq from (point-min) to (point-max))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4187 (if frombuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4188 (if (not (bufferp frombuf))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4189 ;; Specified but not a buffer - get it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4190 (let ((got (get-buffer frombuf)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4191 (if (not got)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4192 (error (concat "allout-process-exposed: source buffer "
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4193 frombuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4194 " not found."))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4195 (setq frombuf got))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4196 ;; not specified - default it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4197 (setq frombuf (current-buffer)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4198 (if tobuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4199 (if (not (bufferp tobuf))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4200 (setq tobuf (get-buffer-create tobuf)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4201 ;; not specified - default it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4202 (setq tobuf (concat "*" (buffer-name frombuf) " exposed*")))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4203 (if (listp format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4204 (nreverse format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4205
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4206 (let* ((listified
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4207 (progn (set-buffer frombuf)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4208 (allout-listify-exposed from to format))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4209 (set-buffer tobuf)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4210 (mapcar func listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4211 (pop-to-buffer tobuf)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4212
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4213 ;;;_ - Copy exposed
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4214 ;;;_ > allout-insert-listified (listified)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4215 (defun allout-insert-listified (listified)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4216 "Insert contents of listified outline portion in current buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4217
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4218 LISTIFIED is a list representing each topic header and body:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4219
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4220 \`(depth prefix text)'
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4221
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4222 or
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4223
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4224 \`(depth prefix text bullet-plus)'
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4225
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4226 If `bullet-plus' is specified, it is inserted just after the entire prefix."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4227 (setq listified (cdr listified))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4228 (let ((prefix (prog1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4229 (car listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4230 (setq listified (cdr listified))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4231 (text (prog1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4232 (car listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4233 (setq listified (cdr listified))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4234 (bullet-plus (car listified)))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4235 (insert prefix)
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4236 (if bullet-plus (insert (concat " " bullet-plus)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4237 (while text
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4238 (insert (car text))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4239 (if (setq text (cdr text))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4240 (insert "\n")))
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4241 (insert "\n")))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4242 ;;;_ > allout-copy-exposed-to-buffer (&optional arg tobuf format)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4243 (defun allout-copy-exposed-to-buffer (&optional arg tobuf format)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4244 "Duplicate exposed portions of current outline to another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4245
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4246 Other buffer has current buffers name with \" exposed\" appended to it.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4247
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4248 With repeat count, copy the exposed parts of only the current topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4249
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4250 Optional second arg TOBUF is target buffer name.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4251
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4252 Optional third arg FORMAT, if non-nil, symbolically designates an
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4253 alternate presentation format for the outline:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4254
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4255 `flat' - Convert topic header prefixes to numeric
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4256 section.subsection... identifiers.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4257 `indent' - Convert header prefixes to all white space, except for
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4258 distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4259 `indent-flat' - The best of both - only the first of each level has
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4260 the full path, the rest have only the section number
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4261 of the leaf, preceded by the right amount of indentation."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4262
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4263 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4264 (if (not tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4265 (setq tobuf (get-buffer-create (concat "*" (buffer-name) " exposed*"))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4266 (let* ((start-pt (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4267 (beg (if arg (allout-back-to-current-heading) (point-min)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4268 (end (if arg (allout-end-of-current-subtree) (point-max)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4269 (buf (current-buffer))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4270 (start-list ()))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4271 (if (eq format 'flat)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4272 (setq format (if arg (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4273 (goto-char beg)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4274 (allout-topic-flat-index))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4275 '(1))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4276 (save-excursion (set-buffer tobuf)(erase-buffer))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4277 (allout-process-exposed 'allout-insert-listified
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4278 beg
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4279 end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4280 (current-buffer)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4281 tobuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4282 format start-list)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4283 (goto-char (point-min))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4284 (pop-to-buffer buf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4285 (goto-char start-pt)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4286 ;;;_ > allout-flatten-exposed-to-buffer (&optional arg tobuf)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4287 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4288 "Present numeric outline of outline's exposed portions in another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4289
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4290 The resulting outline is not compatible with outline mode - use
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4291 `allout-copy-exposed-to-buffer' if you want that.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4292
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4293 Use `allout-indented-exposed-to-buffer' for indented presentation.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4294
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4295 With repeat count, copy the exposed portions of only current topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4296
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4297 Other buffer has current buffer's name with \" exposed\" appended to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4298 it, unless optional second arg TOBUF is specified, in which case it is
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4299 used verbatim."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4300 (interactive "P")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4301 (allout-copy-exposed-to-buffer arg tobuf 'flat))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4302 ;;;_ > allout-indented-exposed-to-buffer (&optional arg tobuf)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4303 (defun allout-indented-exposed-to-buffer (&optional arg tobuf)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4304 "Present indented outline of outline's exposed portions in another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4305
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4306 The resulting outline is not compatible with outline mode - use
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4307 `allout-copy-exposed-to-buffer' if you want that.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4308
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4309 Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4310
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4311 With repeat count, copy the exposed portions of only current topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4312
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4313 Other buffer has current buffer's name with \" exposed\" appended to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4314 it, unless optional second arg TOBUF is specified, in which case it is
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4315 used verbatim."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4316 (interactive "P")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4317 (allout-copy-exposed-to-buffer arg tobuf 'indent))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4318
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4319 ;;;_ - LaTeX formatting
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4320 ;;;_ > allout-latex-verb-quote (string &optional flow)
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4321 (defun allout-latex-verb-quote (string &optional flow)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4322 "Return copy of STRING for literal reproduction across LaTeX processing.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4323 Expresses the original characters \(including carriage returns) of the
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4324 string across LaTeX processing."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4325 (mapconcat (function
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4326 (lambda (char)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4327 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4328 (concat "\\char" (number-to-string char) "{}"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4329 ((= char ?\n) "\\\\")
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4330 (t (char-to-string char)))))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4331 string
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4332 ""))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4333 ;;;_ > allout-latex-verbatim-quote-curr-line ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4334 (defun allout-latex-verbatim-quote-curr-line ()
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4335 "Express line for exact \(literal) representation across LaTeX processing.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4336
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4337 Adjust line contents so it is unaltered \(from the original line)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4338 across LaTeX processing, within the context of a `verbatim'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4339 environment. Leaves point at the end of the line."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4340 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4341 (let ((beg (point))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4342 (end (progn (end-of-line)(point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4343 (goto-char beg)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4344 (while (re-search-forward "\\\\"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4345 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4346 end ; bounded by end-of-line
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4347 1) ; no matches, move to end & return nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4348 (goto-char (match-beginning 0))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4349 (insert "\\")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4350 (setq end (1+ end))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4351 (goto-char (1+ (match-end 0))))))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4352 ;;;_ > allout-insert-latex-header (buffer)
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4353 (defun allout-insert-latex-header (buffer)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4354 "Insert initial LaTeX commands at point in BUFFER."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4355 ;; Much of this is being derived from the stuff in appendix of E in
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4356 ;; the TeXBook, pg 421.
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4357 (set-buffer buffer)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4358 (let ((doc-style (format "\n\\documentstyle{%s}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4359 "report"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4360 (page-numbering (if allout-number-pages
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4361 "\\pagestyle{empty}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4362 ""))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4363 (linesdef (concat "\\def\\beginlines{"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4364 "\\par\\begingroup\\nobreak\\medskip"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4365 "\\parindent=0pt\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4366 " \\kern1pt\\nobreak \\obeylines \\obeyspaces "
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4367 "\\everypar{\\strut}}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4368 "\\def\\endlines{"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4369 "\\kern1pt\\endgroup\\medbreak\\noindent}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4370 (titlecmd (format "\\newcommand{\\titlecmd}[1]{{%s #1}}\n"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4371 allout-title-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4372 (labelcmd (format "\\newcommand{\\labelcmd}[1]{{%s #1}}\n"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4373 allout-label-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4374 (headlinecmd (format "\\newcommand{\\headlinecmd}[1]{{%s #1}}\n"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4375 allout-head-line-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4376 (bodylinecmd (format "\\newcommand{\\bodylinecmd}[1]{{%s #1}}\n"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4377 allout-body-line-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4378 (setlength (format "%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4379 "\\newlength{\\stepsize}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4380 "\\setlength{\\stepsize}{"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4381 allout-indent
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4382 "}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4383 (oneheadline (format "%s%s%s%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4384 "\\newcommand{\\OneHeadLine}[3]{%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4385 "\\noindent%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4386 "\\hspace*{#2\\stepsize}%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4387 "\\labelcmd{#1}\\hspace*{.2cm}"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4388 "\\headlinecmd{#3}\\\\["
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4389 allout-line-skip
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4390 "]\n}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4391 (onebodyline (format "%s%s%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4392 "\\newcommand{\\OneBodyLine}[2]{%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4393 "\\noindent%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4394 "\\hspace*{#1\\stepsize}%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4395 "\\bodylinecmd{#2}\\\\["
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4396 allout-line-skip
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4397 "]\n}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4398 (begindoc "\\begin{document}\n\\begin{center}\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4399 (title (format "%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4400 "\\titlecmd{"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4401 (allout-latex-verb-quote (if allout-title
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4402 (condition-case err
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4403 (eval allout-title)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4404 ('error "<unnamed buffer>"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4405 "Unnamed Outline"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4406 "}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4407 "\\end{center}\n\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4408 (hsize "\\hsize = 7.5 true in\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4409 (hoffset "\\hoffset = -1.5 true in\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4410 (vspace "\\vspace{.1cm}\n\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4411 (insert (concat doc-style
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4412 page-numbering
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4413 titlecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4414 labelcmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4415 headlinecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4416 bodylinecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4417 setlength
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4418 oneheadline
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4419 onebodyline
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4420 begindoc
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4421 title
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4422 hsize
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4423 hoffset
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4424 vspace)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4425 )))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4426 ;;;_ > allout-insert-latex-trailer (buffer)
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4427 (defun allout-insert-latex-trailer (buffer)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4428 "Insert concluding LaTeX commands at point in BUFFER."
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4429 (set-buffer buffer)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4430 (insert "\n\\end{document}\n"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4431 ;;;_ > allout-latexify-one-item (depth prefix bullet text)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4432 (defun allout-latexify-one-item (depth prefix bullet text)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4433 "Insert LaTeX commands for formatting one outline item.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4434
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4435 Args are the topics numeric DEPTH, the header PREFIX lead string, the
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4436 BULLET string, and a list of TEXT strings for the body."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4437 (let* ((head-line (if text (car text)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4438 (body-lines (cdr text))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4439 (curr-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4440 body-content bop)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4441 ; Do the head line:
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
4442 (insert (concat "\\OneHeadLine{\\verb\1 "
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4443 (allout-latex-verb-quote bullet)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4444 "\1}{"
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4445 depth
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4446 "}{\\verb\1 "
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4447 (if head-line
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4448 (allout-latex-verb-quote head-line)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4449 "")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4450 "\1}\n"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4451 (if (not body-lines)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4452 nil
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4453 ;;(insert "\\beginlines\n")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4454 (insert "\\begin{verbatim}\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4455 (while body-lines
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4456 (setq curr-line (car body-lines))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4457 (if (and (not body-content)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4458 (not (string-match "^\\s-*$" curr-line)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4459 (setq body-content t))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4460 ; Mangle any occurrences of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4461 ; "\end{verbatim}" in text,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4462 ; it's special:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4463 (if (and body-content
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4464 (setq bop (string-match "\\end{verbatim}" curr-line)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4465 (setq curr-line (concat (substring curr-line 0 bop)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4466 ">"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4467 (substring curr-line bop))))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4468 ;;(insert "|" (car body-lines) "|")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4469 (insert curr-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4470 (allout-latex-verbatim-quote-curr-line)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4471 (insert "\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4472 (setq body-lines (cdr body-lines)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4473 (if body-content
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4474 (setq body-content nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4475 (forward-char -1)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4476 (insert "\\ ")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4477 (forward-char 1))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4478 ;;(insert "\\endlines\n")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4479 (insert "\\end{verbatim}\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4480 )))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4481 ;;;_ > allout-latexify-exposed (arg &optional tobuf)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4482 (defun allout-latexify-exposed (arg &optional tobuf)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4483 "Format current topics exposed portions to TOBUF for LaTeX processing.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4484 TOBUF defaults to a buffer named the same as the current buffer, but
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4485 with \"*\" prepended and \" latex-formed*\" appended.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4486
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4487 With repeat count, copy the exposed portions of entire buffer."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4488
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4489 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4490 (if (not tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4491 (setq tobuf
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4492 (get-buffer-create (concat "*" (buffer-name) " latexified*"))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4493 (let* ((start-pt (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4494 (beg (if arg (point-min) (allout-back-to-current-heading)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4495 (end (if arg (point-max) (allout-end-of-current-subtree)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4496 (buf (current-buffer)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4497 (set-buffer tobuf)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4498 (erase-buffer)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4499 (allout-insert-latex-header tobuf)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4500 (goto-char (point-max))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4501 (allout-process-exposed 'allout-latexify-one-item
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4502 beg
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4503 end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4504 buf
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4505 tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4506 (goto-char (point-max))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4507 (allout-insert-latex-trailer tobuf)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4508 (goto-char (point-min))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4509 (pop-to-buffer buf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4510 (goto-char start-pt)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4511
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4512 ;;;_ #8 miscellaneous
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4513 ;;;_ > allout-mark-topic ()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4514 (defun allout-mark-topic ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4515 "Put the region around topic currently containing point."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4516 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4517 (beginning-of-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4518 (allout-goto-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4519 (push-mark (point))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4520 (allout-end-of-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4521 (exchange-point-and-mark))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4522 ;;;_ > outlineify-sticky ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4523 ;; outlinify-sticky is correct spelling; provide this alias for sticklers:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4524 (defalias 'outlinify-sticky 'outlineify-sticky)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4525 (defun outlineify-sticky (&optional arg)
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
4526 "Activate outline mode and establish file var so it is started subsequently.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4527
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4528 See doc-string for `allout-layout' and `allout-init' for details on
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4529 setup for auto-startup."
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4530
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4531 (interactive "P")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4532
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4533 (allout-mode t)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4534
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4535 (save-excursion
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4536 (goto-char (point-min))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4537 (if (looking-at allout-regexp)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4538 t
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4539 (allout-open-topic 2)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4540 (insert (concat "Dummy outline topic header - see"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4541 "`allout-mode' docstring: `^Hm'."))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4542 (forward-line 1)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4543 (goto-char (point-max))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4544 (open-line 1)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4545 (allout-open-topic 0)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4546 (insert "Local emacs vars.\n")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4547 (allout-open-topic 1)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4548 (insert "(`allout-layout' is for allout.el allout-mode)\n")
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4549 (allout-open-topic 0)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4550 (insert "Local variables:\n")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4551 (allout-open-topic 0)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4552 (insert (format "allout-layout: %s\n"
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4553 (or allout-layout
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4554 '(-1 : 0))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4555 (allout-open-topic 0)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4556 (insert "End:\n"))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4557 ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4558 (defun solicit-char-in-string (prompt string &optional do-defaulting)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4559 "Solicit (with first arg PROMPT) choice of a character from string STRING.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4560
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4561 Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4562
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4563 (let ((new-prompt prompt)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4564 got)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4565
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4566 (while (not got)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4567 (message "%s" new-prompt)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4568
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4569 ;; We do our own reading here, so we can circumvent, eg, special
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4570 ;; treatment for `?' character. (Oughta use minibuffer keymap instead.)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4571 (setq got
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4572 (char-to-string (let ((cursor-in-echo-area nil)) (read-char))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4573
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4574 (setq got
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4575 (cond ((string-match (regexp-quote got) string) got)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4576 ((and do-defaulting (string= got "\r"))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4577 ;; Return empty string to default:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4578 "")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4579 ((string= got "\C-g") (signal 'quit nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4580 (t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4581 (setq new-prompt (concat prompt
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4582 got
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4583 " ...pick from: "
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4584 string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4585 ""))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4586 nil))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4587 ;; got something out of loop - return it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4588 got)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4589 )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4590 ;;;_ > regexp-sans-escapes (string)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4591 (defun regexp-sans-escapes (regexp &optional successive-backslashes)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4592 "Return a copy of REGEXP with all character escapes stripped out.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4593
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4594 Representations of actual backslashes - '\\\\\\\\' - are left as a
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4595 single backslash.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4596
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4597 \(fn REGEXP)"
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4598 ;; Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4599
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4600 (if (string= regexp "")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4601 ""
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4602 ;; Set successive-backslashes to number if current char is
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4603 ;; backslash, or else to nil:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4604 (setq successive-backslashes
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4605 (if (= (aref regexp 0) ?\\)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4606 (if successive-backslashes (1+ successive-backslashes) 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4607 nil))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4608 (if (or (not successive-backslashes) (= 2 successive-backslashes))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4609 ;; Include first char:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4610 (concat (substring regexp 0 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4611 (regexp-sans-escapes (substring regexp 1)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4612 ;; Exclude first char, but maintain count:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4613 (regexp-sans-escapes (substring regexp 1) successive-backslashes))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4614 ;;;_ > my-region-active-p ()
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4615 (defmacro my-region-active-p ()
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4616 (if (fboundp 'region-active-p)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4617 '(region-active-p)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4618 'mark-active))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4619 ;;;_ - add-hook definition for divergent emacsen
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4620 ;;;_ > add-hook (hook function &optional append)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4621 (if (not (fboundp 'add-hook))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4622 (defun add-hook (hook function &optional append)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4623 "Add to the value of HOOK the function FUNCTION unless already present.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4624 \(It becomes the first hook on the list unless optional APPEND is non-nil, in
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4625 which case it becomes the last). HOOK should be a symbol, and FUNCTION may be
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4626 any valid function. HOOK's value should be a list of functions, not a single
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4627 function. If HOOK is void, it is first set to nil."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4628 (or (boundp hook) (set hook nil))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4629 (or (if (consp function)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4630 ;; Clever way to tell whether a given lambda-expression
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4631 ;; is equal to anything in the hook.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4632 (let ((tail (assoc (cdr function) (symbol-value hook))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4633 (equal function tail))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4634 (memq function (symbol-value hook)))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4635 (set hook
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4636 (if append
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4637 (nconc (symbol-value hook) (list function))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4638 (cons function (symbol-value hook)))))))
47127
895cc47caf77 (my-mark-marker): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 46161
diff changeset
4639 ;;;_ : my-mark-marker to accommodate divergent emacsen:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4640 (defun my-mark-marker (&optional force buffer)
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4641 "Accommodate the different signature for `mark-marker' across Emacsen.
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4642
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4643 XEmacs takes two optional args, while GNU Emacs does not,
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4644 so pass them along when appropriate."
48859
1c806f4edc19 (allout-init): Give report also in case auto-activation was inhibited.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48858
diff changeset
4645 (if (featurep 'xemacs)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4646 (mark-marker force buffer)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4647 (mark-marker)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4648
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4649 ;;;_ #9 Under development
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4650 ;;;_ > allout-bullet-isearch (&optional bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4651 (defun allout-bullet-isearch (&optional bullet)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4652 "Isearch \(regexp) for topic with bullet BULLET."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4653 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4654 (if (not bullet)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4655 (setq bullet (solicit-char-in-string
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4656 "ISearch for topic with bullet: "
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4657 (regexp-sans-escapes allout-bullets-string))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4658
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4659 (let ((isearch-regexp t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4660 (isearch-string (concat "^"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4661 allout-header-prefix
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4662 "[ \t]*"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4663 bullet)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4664 (isearch-repeat 'forward)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4665 (isearch-mode t)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4666 ;;;_ ? Re hooking up with isearch - use isearch-op-fun rather than
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4667 ;;; wrapping the isearch functions.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4668
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4669 ;;;_* Local emacs vars.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4670 ;;; The following `allout-layout' local variable setting:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4671 ;;; - closes all topics from the first topic to just before the third-to-last,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4672 ;;; - shows the children of the third to last (config vars)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4673 ;;; - and the second to last (code section),
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4674 ;;; - and closes the last topic (this local-variables section).
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4675 ;;;Local variables:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4676 ;;;allout-layout: (0 : -1 -1 0)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4677 ;;;End:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4678
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 50855
diff changeset
4679 ;;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
4680 ;;; allout.el ends here