annotate lisp/allout.el @ 112451:98ad7c9e56a3

gnus-html.el (gnus-html-image-fetched): Don't kill the temporary buffer after being called. It's apparently being killed by url.el, and killing it made point move to end-of-buffer in a random buffer. shr.el (shr-image-fetched): Ditto. shr.el (shr-image-fetched): Avoid having point move in the article buffer. gnus-html.el (gnus-html-image-fetched): Kill the buffer anyway, and fix the bug in url-http.el instead. shr.el (shr-image-fetched): Ditto. gravatar.el (gravatar-retrieve): Be silent when retrieving. gnus-gravatar.el (gnus-gravatar-insert): Don't move point around in the article buffer. (gnus-gravatar-insert): Use blank space from the current buffer to avoid breaking text properties. This makes X-Sent updating work again. gnus-art.el (gnus-article-read-summary-keys): Don't call disabled commands.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 24 Jan 2011 04:10:19 +0000
parents 744ddded8b6a
children
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
112284
61f7601898b1 Refill some copyright headers.
Glenn Morris <rgm@gnu.org>
parents: 112228
diff changeset
3 ;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
61f7601898b1 Refill some copyright headers.
Glenn Morris <rgm@gnu.org>
parents: 112228
diff changeset
4 ;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
7 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
8 ;; Created: Dec 1991 -- first release to usenet
112186
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
9 ;; Version: 2.3
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
10 ;; Keywords: outlines wp languages
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
11 ;; Website: http://myriadicity.net/Sundry/EmacsAllout
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92337
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92337
diff changeset
17 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92337
diff changeset
18 ;; (at your option) any later version.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
20 ;; 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
21 ;; 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
22 ;; 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
23 ;; 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
24
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5310
diff changeset
25 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92337
diff changeset
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
28 ;;; Commentary:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
29
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
30 ;; Allout outline minor mode provides extensive outline formatting and
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
31 ;; and manipulation beyond standard emacs outline mode. Some features:
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
32 ;;
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
33 ;; - Classic outline-mode topic-oriented navigation and exposure adjustment
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
34 ;; - Topic-oriented editing including coherent topic and subtopic
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
35 ;; creation, promotion, demotion, cut/paste across depths, etc.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
36 ;; - Incremental search with dynamic exposure and reconcealment of text
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
37 ;; - Customizable bullet format -- enables programming-language specific
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
38 ;; outlining, for code-folding editing. (Allout code itself is to try it;
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
39 ;; formatted as an outline -- do ESC-x eval-buffer in allout.el; but
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
40 ;; emacs local file variables need to be enabled when the
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
41 ;; file was visited -- see `enable-local-variables'.)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
42 ;; - Configurable per-file initial exposure settings
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
43 ;; - Symmetric-key and key-pair topic encryption, plus symmetric passphrase
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
44 ;; mnemonic support, with verification against an established passphrase
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
45 ;; (using a stashed encrypted dummy string) and user-supplied hint
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
46 ;; maintenance. Encryption is via the Emacs 'epg' library. See
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
47 ;; allout-toggle-current-subtree-encryption docstring.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
48 ;; - Automatic topic-number maintenance
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
49 ;; - "Hot-spot" operation, for single-keystroke maneuvering and
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
50 ;; exposure control (see the allout-mode docstring)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
51 ;; - Easy rendering of exposed portions into numbered, latex, indented, etc
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
52 ;; outline styles
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
53 ;; - Careful attention to whitespace -- enabling blank lines between items
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
54 ;; and maintenance of hanging indentation (in paragraph auto-fill and
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
55 ;; across topic promotion and demotion) of topic bodies consistent with
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
56 ;; indentation of their topic header.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
57 ;;
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
58 ;; and more.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
59 ;;
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
60 ;; See the `allout-mode' function's docstring for an introduction to the
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
61 ;; mode.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
62 ;;
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
63 ;; The latest development version and helpful notes are available at
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
64 ;; http://myriadicity.net/Sundry/EmacsAllout .
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
65 ;;
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
66 ;; The outline menubar additions provide quick reference to many of
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
67 ;; the features, and see the docstring of the variable `allout-init'
73763
89b9e8184350 (allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents: 73660
diff changeset
68 ;; for instructions on priming your Emacs session for automatic
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
69 ;; activation of allout-mode.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
70 ;;
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
71 ;; 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
72 ;; `allout-auto-activation' for details on automatic activation of
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
73 ;; `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
74 ;; 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
75 ;;
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
76 ;; Note -- the lines beginning with `;;;_' are outline topic headers.
71625
22433275348d Comment munging; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 70673
diff changeset
77 ;; Just `ESC-x eval-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
78
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
79 ;; ken manheimer (ken dot manheimer at gmail dot com)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
80
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
81 ;;; Code:
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
82
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
83 ;;;_* Dependency autoloads
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
84 (require 'overlay)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
85 (eval-when-compile
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
86 ;; Most of the requires here are for stuff covered by autoloads, which
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
87 ;; byte-compiling doesn't trigger.
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
88 (require 'epg)
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
89 (require 'epa)
105080
37b8e423433c (top-level): Remove unnecessary progn.
Glenn Morris <rgm@gnu.org>
parents: 101010
diff changeset
90 (require 'overlay)
37b8e423433c (top-level): Remove unnecessary progn.
Glenn Morris <rgm@gnu.org>
parents: 101010
diff changeset
91 ;; `cl' is required for `assert'. `assert' is not covered by a standard
37b8e423433c (top-level): Remove unnecessary progn.
Glenn Morris <rgm@gnu.org>
parents: 101010
diff changeset
92 ;; autoload, but it is a macro, so that eval-when-compile is sufficient
37b8e423433c (top-level): Remove unnecessary progn.
Glenn Morris <rgm@gnu.org>
parents: 101010
diff changeset
93 ;; to byte-compile it in, or to do the require when the buffer evalled.
37b8e423433c (top-level): Remove unnecessary progn.
Glenn Morris <rgm@gnu.org>
parents: 101010
diff changeset
94 (require 'cl)
37b8e423433c (top-level): Remove unnecessary progn.
Glenn Morris <rgm@gnu.org>
parents: 101010
diff changeset
95 )
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
96
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
97 ;;;_* USER CUSTOMIZATION VARIABLES:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
98
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
99 ;;;_ > defgroup allout, allout-keybindings
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
100 (defgroup allout nil
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
101 "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
102 :prefix "allout-"
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
103 :group 'outlines)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
104 (defgroup allout-keybindings nil
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
105 "Allout outline mode keyboard bindings configuration."
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
106 :group 'allout)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
107
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
108 ;;;_ + 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
109
111740
97a0564526d2 * lisp/allout.el (allout-command-prefix, allout-mode-map): Declare.
Glenn Morris <rgm@gnu.org>
parents: 111552
diff changeset
110 (defvar allout-command-prefix) ; defined below
97a0564526d2 * lisp/allout.el (allout-command-prefix, allout-mode-map): Declare.
Glenn Morris <rgm@gnu.org>
parents: 111552
diff changeset
111
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
112 ;;;_ > allout-keybindings incidentals:
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
113 ;;;_ : internal key binding stuff - in this section for load-order.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
114 ;;;_ = allout-mode-map
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
115 (defvar allout-mode-map 'allout-mode-map
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
116 "Keybindings place-holder for (allout) outline minor mode.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
117
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
118 Do NOT set the value of this variable. Instead, customize
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
119 `allout-command-prefix', `allout-prefixed-keybindings', and
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
120 `allout-unprefixed-keybindings'.")
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
121 ;;;_ = allout-mode-map-value
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
122 (defvar allout-mode-map-value nil
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
123 "Keymap for allout outline minor mode.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
124
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
125 Do NOT set the value of this variable. Instead, customize
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
126 `allout-command-prefix', `allout-prefixed-keybindings', and
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
127 `allout-unprefixed-keybindings'.")
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
128 ;;;_ = make allout-mode-map-value an alias for allout-mode-map:
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
129 ;; this needs to be revised when the value is changed, sigh.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
130 (defalias 'allout-mode-map allout-mode-map-value)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
131 ;;;_ > allout-compose-and-institute-keymap (&optional varname value)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
132 (defun allout-compose-and-institute-keymap (&optional varname value)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
133 "Create the allout keymap according to the keybinding specs, and set it.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
134
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
135 Useful standalone or to effect customizations of the
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
136 respective allout-mode keybinding variables, `allout-command-prefix',
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
137 `allout-prefixed-keybindings', and `allout-unprefixed-keybindings'"
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
138 ;; Set the customization variable, if any:
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
139 (when varname
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
140 (set-default varname value))
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
141 (let ((map (make-sparse-keymap)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
142 (when (boundp 'allout-prefixed-keybindings)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
143 ;; tolerate first definitions of the variables:
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
144 (dolist (entry allout-prefixed-keybindings)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
145 (define-key map
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
146 ;; XXX vector vs non-vector key descriptions?
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
147 (vconcat allout-command-prefix
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
148 (car (read-from-string (car entry))))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
149 (cadr entry))))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
150 (when (boundp 'allout-unprefixed-keybindings)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
151 (dolist (entry allout-unprefixed-keybindings)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
152 (define-key map (car (read-from-string (car entry))) (cadr entry))))
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
153 (substitute-key-definition 'beginning-of-line 'allout-beginning-of-line
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
154 map global-map)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
155 (substitute-key-definition 'move-beginning-of-line 'allout-beginning-of-line
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
156 map global-map)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
157 (substitute-key-definition 'end-of-line 'allout-end-of-line
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
158 map global-map)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
159 (substitute-key-definition 'move-end-of-line 'allout-end-of-line
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
160 map global-map)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
161 (allout-institute-keymap map)))
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
162 ;;;_ > allout-institute-keymap (map)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
163 (defun allout-institute-keymap (map)
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
164 "Associate allout-mode bindings with allout as a minor mode."
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
165 ;; Architecture:
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
166 ;; allout-mode-map var is a keymap by virtue of being a defalias for
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
167 ;; allout-mode-map-value, which has the actual keymap value.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
168 ;; allout-mode-map's symbol value is just 'allout-mode-map, so it can be
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
169 ;; used in minor-mode-map-alist to indirect to the actual
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
170 ;; allout-mode-map-var value, which can be adjusted and reassigned.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
171
112388
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
172 ;; allout-mode-map-value for keymap reference in various places:
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
173 (setq allout-mode-map-value map)
112388
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
174 ;; the function value keymap of allout-mode-map is used in
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
175 ;; minor-mode-map-alist - update it:
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
176 (fset allout-mode-map allout-mode-map-value))
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
177 ;;;_ * intialize the mode map:
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
178 ;; ensure that allout-mode-map has some setting even if allout-mode hasn't
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
179 ;; been invoked:
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
180 (allout-compose-and-institute-keymap)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
181 ;;;_ = allout-command-prefix
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
182 (defcustom allout-command-prefix "\C-c "
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
183 "Key sequence to be used as prefix for outline mode command key bindings.
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
184
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
185 Default is '\C-c<space>'; just '\C-c' is more short-and-sweet, if you're
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
186 willing to let allout use a bunch of \C-c keybindings."
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
187 :type 'string
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
188 :group 'allout-keybindings
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
189 :set 'allout-compose-and-institute-keymap)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
190 ;;;_ = allout-keybindings-binding
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
191 (define-widget 'allout-keybindings-binding 'lazy
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
192 "Structure of allout keybindings customization items."
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
193 :type '(repeat
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
194 (list (string :tag "Key" :value "[(meta control shift ?f)]")
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
195 (function :tag "Function name"
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
196 :value allout-forward-current-level))))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
197 ;;;_ = allout-prefixed-keybindings
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
198 (defcustom allout-prefixed-keybindings
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
199 '(("[(control ?n)]" allout-next-visible-heading)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
200 ("[(control ?p)]" allout-previous-visible-heading)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
201 ("[(control ?u)]" allout-up-current-level)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
202 ("[(control ?f)]" allout-forward-current-level)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
203 ("[(control ?b)]" allout-backward-current-level)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
204 ("[(control ?a)]" allout-beginning-of-current-entry)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
205 ("[(control ?e)]" allout-end-of-entry)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
206 ("[(control ?i)]" allout-show-children)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
207 ("[(control ?s)]" allout-show-current-subtree)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
208 ("[(control ?t)]" allout-toggle-current-subtree-exposure)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
209 ;; Let user customize if they want to preempt describe-prefix-bindings ^h use.
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
210 ;; ("[(control ?h)]" allout-hide-current-subtree)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
211 ("[?h]" allout-hide-current-subtree)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
212 ("[(control ?o)]" allout-show-current-entry)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
213 ("[?!]" allout-show-all)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
214 ("[?x]" allout-toggle-current-subtree-encryption)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
215 ("[? ]" allout-open-sibtopic)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
216 ("[?.]" allout-open-subtopic)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
217 ("[?,]" allout-open-supertopic)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
218 ("[?']" allout-shift-in)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
219 ("[?>]" allout-shift-in)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
220 ("[?<]" allout-shift-out)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
221 ("[(control ?m)]" allout-rebullet-topic)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
222 ("[?*]" allout-rebullet-current-heading)
112410
744ddded8b6a * allout.el (allout-prefixed-keybindings): Bind (prefixed) '#' to
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112388
diff changeset
223 ("[?#]" allout-number-siblings)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
224 ("[(control ?k)]" allout-kill-topic)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
225 ("[(meta ?k)]" allout-copy-topic-as-kill)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
226 ("[?@]" allout-resolve-xref)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
227 ("[?=?c]" allout-copy-exposed-to-buffer)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
228 ("[?=?i]" allout-indented-exposed-to-buffer)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
229 ("[?=?t]" allout-latexify-exposed)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
230 ("[?=?p]" allout-flatten-exposed-to-buffer)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
231 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
232 "Allout-mode key bindings that are prefixed with `allout-command-prefix'.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
233
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
234 See `allout-unprefixed-keybindings' for the list of keybindings
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
235 that are not prefixed.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
236
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
237 Use vector format for the keys:
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
238 - put literal keys after a '?' question mark, eg: '?a', '?.'
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
239 - enclose control, shift, or meta-modified keys as sequences within
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
240 parentheses, with the literal key, as above, preceded by the name(s)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
241 of the modifers, eg: [(control ?a)]
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
242 See the existing keys for examples.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
243
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
244 Functions can be bound to multiple keys, but binding keys to
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
245 multiple functions will not work - the last binding for a key
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
246 prevails."
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
247 :type 'allout-keybindings-binding
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
248 :group 'allout-keybindings
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
249 :set 'allout-compose-and-institute-keymap
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
250 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
251 ;;;_ = allout-unprefixed-keybindings
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
252 (defcustom allout-unprefixed-keybindings
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
253 '(("[(control ?k)]" allout-kill-line)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
254 ("[(meta ?k)]" allout-copy-line-as-kill)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
255 ("[(control ?y)]" allout-yank)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
256 ("[(meta ?y)]" allout-yank-pop)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
257 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
258 "Allout-mode functions bound to keys without any added prefix.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
259
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
260 This is in contrast to the majority of allout-mode bindings on
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
261 `allout-prefixed-bindings', whose bindings are created with a
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
262 preceeding command key.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
263
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
264 Use vector format for the keys:
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
265 - put literal keys after a '?' question mark, eg: '?a', '?.'
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
266 - enclose control, shift, or meta-modified keys as sequences within
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
267 parentheses, with the literal key, as above, preceded by the name(s)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
268 of the modifers, eg: [(control ?a)]
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
269 See the existing keys for examples."
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
270 :type 'allout-keybindings-binding
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
271 :group 'allout-keybindings
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
272 :set 'allout-compose-and-institute-keymap
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
273 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
274
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
275 ;;;_ = 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
276 (defcustom allout-auto-activation nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
277 "Regulates auto-activation modality of allout outlines -- see `allout-init'.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
278
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
279 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
280 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
281 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
282 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
283
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
284 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
285 \(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
286 `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
287
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
288 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
289 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
290
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
291 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
292 auto-layout is not.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
293
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
294 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
295 enabled.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
296
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
297 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
298 this variable."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
299 :type '(choice (const :tag "On" t)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
300 (const :tag "Ask about layout" "ask")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
301 (const :tag "Mode only" "activate")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
302 (const :tag "Off" nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
303 :group 'allout)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
304 ;;;_ = allout-default-layout
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
305 (defcustom allout-default-layout '(-2 : 0)
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
306 "Default allout outline layout specification.
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
307
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
308 This setting specifies the outline exposure to use when
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
309 `allout-layout' has the local value `t'. This docstring describes the
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
310 layout specifications.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
311
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
312 A list value specifies a default layout for the current buffer,
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
313 to be applied upon activation of `allout-mode'. Any non-nil
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
314 value will automatically trigger `allout-mode', provided
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
315 `allout-init' has been called to enable this behavior.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
316
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
317 The types of elements in the layout specification are:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
318
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
319 INTEGER -- dictate the relative depth to open the corresponding topic(s),
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
320 where:
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
321 -- negative numbers force the topic to be closed before opening
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
322 to the absolute value of the number, so all siblings are open
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
323 only to that level.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
324 -- positive numbers open to the relative depth indicated by the
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
325 number, but do not force already opened subtopics to be closed.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
326 -- 0 means to close topic -- hide all subitems.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
327 : -- repeat spec -- apply the preceeding element to all siblings at
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
328 current level, *up to* those siblings that would be covered by specs
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
329 following the `:' on the list. Ie, apply to all topics at level but
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
330 trailing ones accounted for by trailing specs. (Only the first of
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
331 multiple colons at the same level is honored -- later ones are ignored.)
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
332 * -- completely exposes the topic, including bodies
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
333 + -- exposes all subtopics, but not the bodies
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
334 - -- exposes the body of the corresponding topic, but not subtopics
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
335 LIST -- a nested layout spec, to be applied intricately to its
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
336 corresponding item(s)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
337
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
338 Examples:
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
339 (-2 : 0)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
340 Collapse the top-level topics to show their children and
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
341 grandchildren, but completely collapse the final top-level topic.
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
342 (-1 () : 1 0)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
343 Close the first topic so only the immediate subtopics are shown,
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
344 leave the subsequent topics exposed as they are until the second
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
345 second to last topic, which is exposed at least one level, and
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
346 completely close the last topic.
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
347 (-2 : -1 *)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
348 Expose children and grandchildren of all topics at current
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
349 level except the last two; expose children of the second to
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
350 last and completely expose the last one, including its subtopics.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
351
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
352 See `allout-expose-topic' for more about the exposure process.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
353
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
354 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
355 to the comment-start string, if any, of the language of the file. This
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
356 is modulo the setting of `allout-use-mode-specific-leader', which see."
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
357 :type 'allout-layout-type
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
358 :group 'allout)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
359 ;;;_ : allout-layout-type
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
360 (define-widget 'allout-layout-type 'lazy
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
361 "Allout layout format customization basic building blocks."
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
362 :type '(repeat
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
363 (choice (integer :tag "integer (<= zero is strict)")
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
364 (const :tag ": (repeat prior)" :)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
365 (const :tag "* (completely expose)" *)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
366 (const :tag "+ (expose all offspring, headlines only)" +)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
367 (const :tag "- (expose topic body but not offspring)" -)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
368 (allout-layout-type :tag "<Nested layout>"))))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
369
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
370 ;;;_ = allout-inhibit-auto-fill
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
371 (defcustom allout-inhibit-auto-fill nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
372 "If non-nil, auto-fill will be inhibited in the allout buffers.
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
373
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
374 You can customize this setting to set it for all allout buffers, or set it
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
375 in individual buffers if you want to inhibit auto-fill only in particular
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
376 buffers. (You could use a function on `allout-mode-hook' to inhibit
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
377 auto-fill according, eg, to the major mode.)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
378
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
379 If you don't set this and auto-fill-mode is enabled, allout will use the
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
380 value that `normal-auto-fill-function', if any, when allout mode starts, or
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
381 else allout's special hanging-indent maintaining auto-fill function,
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
382 `allout-auto-fill'."
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
383 :type 'boolean
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
384 :group 'allout)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
385 (make-variable-buffer-local 'allout-inhibit-auto-fill)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
386 ;;;_ = allout-use-hanging-indents
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
387 (defcustom allout-use-hanging-indents t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
388 "If non-nil, topic body text auto-indent defaults to indent of the header.
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
389 Ie, it is indented to be just past the header prefix. This is
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
390 relevant mostly for use with `indented-text-mode', or other situations
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
391 where auto-fill occurs."
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
392 :type 'boolean
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
393 :group 'allout)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
394 (make-variable-buffer-local 'allout-use-hanging-indents)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
395 ;;;###autoload
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
396 (put 'allout-use-hanging-indents 'safe-local-variable
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
397 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
398 ;;;_ = allout-reindent-bodies
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
399 (defcustom allout-reindent-bodies (if allout-use-hanging-indents
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
400 'text)
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
401 "Non-nil enables auto-adjust of topic body hanging indent with depth shifts.
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
402
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
403 When active, topic body lines that are indented even with or beyond
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
404 their topic header are reindented to correspond with depth shifts of
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
405 the header.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
406
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
407 A value of t enables reindent in non-programming-code buffers, ie
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
408 those that do not have the variable `comment-start' set. A value of
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
409 `force' enables reindent whether or not `comment-start' is set."
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
410 :type '(choice (const nil) (const t) (const text) (const force))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
411 :group 'allout)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
412
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
413 (make-variable-buffer-local 'allout-reindent-bodies)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
414 ;;;###autoload
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
415 (put 'allout-reindent-bodies 'safe-local-variable
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
416 '(lambda (x) (memq x '(nil t text force))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
417
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 ;;;_ = 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
419 (defcustom allout-show-bodies nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
420 "If non-nil, show entire body when exposing a topic, rather than
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
421 just the header."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
422 :type 'boolean
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
423 :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
424 (make-variable-buffer-local 'allout-show-bodies)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
425 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
426 (put 'allout-show-bodies 'safe-local-variable
70673
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
427 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t 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
428
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
429 ;;;_ = allout-beginning-of-line-cycles
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
430 (defcustom allout-beginning-of-line-cycles t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
431 "If non-nil, \\[allout-beginning-of-line] will cycle through smart-placement options.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
432
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
433 Cycling only happens on when the command is repeated, not when it
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
434 follows a different command.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
435
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
436 Smart-placement means that repeated calls to this function will
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
437 advance as follows:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
438
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
439 - if the cursor is on a non-headline body line and not on the first column:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
440 then it goes to the first column
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
441 - if the cursor is on the first column of a non-headline body line:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
442 then it goes to the start of the headline within the item body
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
443 - if the cursor is on the headline and not the start of the headline:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
444 then it goes to the start of the headline
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
445 - if the cursor is on the start of the headline:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
446 then it goes to the bullet character (for hotspot navigation)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
447 - if the cursor is on the bullet character:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
448 then it goes to the first column of that line (the headline)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
449 - if the cursor is on the first column of the headline:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
450 then it goes to the start of the headline within the item body.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
451
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
452 In this fashion, you can use the beginning-of-line command to do
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
453 its normal job and then, when repeated, advance through the
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
454 entry, cycling back to start.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
455
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
456 If this configuration variable is nil, then the cursor is just
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
457 advanced to the beginning of the line and remains there on
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
458 repeated calls."
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
459 :type 'boolean :group 'allout)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
460 ;;;_ = allout-end-of-line-cycles
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
461 (defcustom allout-end-of-line-cycles t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
462 "If non-nil, \\[allout-end-of-line] will cycle through smart-placement options.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
463
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
464 Cycling only happens on when the command is repeated, not when it
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
465 follows a different command.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
466
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
467 Smart placement means that repeated calls to this function will
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
468 advance as follows:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
469
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
470 - if the cursor is not on the end-of-line,
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
471 then it goes to the end-of-line
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
472 - if the cursor is on the end-of-line but not the end-of-entry,
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
473 then it goes to the end-of-entry, exposing it if necessary
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
474 - if the cursor is on the end-of-entry,
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
475 then it goes to the end of the head line
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
476
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
477 In this fashion, you can use the end-of-line command to do its
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
478 normal job and then, when repeated, advance through the entry,
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
479 cycling back to start.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
480
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
481 If this configuration variable is nil, then the cursor is just
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
482 advanced to the end of the line and remains there on repeated
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
483 calls."
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
484 :type 'boolean :group 'allout)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
485
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
486 ;;;_ = 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
487 (defcustom allout-header-prefix "."
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
488 ;; this string is treated as literal match. it will be `regexp-quote'd, so
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
489 ;; one cannot use regular expressions to match varying header prefixes.
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
490 "Leading string which helps distinguish topic headers.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
491
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
492 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
493 header prefix, which mostly have the value of this var at their front.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
494 Level 1 topics are exceptions. They consist of only a single
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
495 character, which is typically set to the `allout-primary-bullet'."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
496 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
497 :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
498 (make-variable-buffer-local 'allout-header-prefix)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
499 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
500 (put 'allout-header-prefix 'safe-local-variable 'stringp)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
501 ;;;_ = 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
502 (defcustom allout-primary-bullet "*"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
503 "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
504
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
505 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
506 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
507 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
508
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
509 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
510 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
511 and `allout-distinctive-bullets-string' for the range of available
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
512 bullets."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
513 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
514 :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
515 (make-variable-buffer-local 'allout-primary-bullet)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
516 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
517 (put 'allout-primary-bullet 'safe-local-variable 'stringp)
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-plain-bullets-string
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
519 (defcustom allout-plain-bullets-string ".,"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
520 "The bullets normally used in outline topic prefixes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
521
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 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
523 bullets.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
524
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
525 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
526
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
527 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
528 of this var to take effect."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
529 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
530 :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
531 (make-variable-buffer-local 'allout-plain-bullets-string)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
532 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
533 (put 'allout-plain-bullets-string 'safe-local-variable 'stringp)
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 ;;;_ = allout-distinctive-bullets-string
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
535 (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
536 "Persistent outline header bullets used to distinguish special topics.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
537
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
538 These bullets are distinguish topics with particular character.
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
539 They are not used by default in the topic creation routines, but
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
540 are offered as options when you modify topic creation with a
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
541 universal argument \(\\[universal-argument]), or during rebulleting \(\\[allout-rebullet-current-heading]).
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
542
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
543 Distinctive bullets are not cycled when topics are shifted or
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
544 otherwise automatically rebulleted, so their marking is
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
545 persistent until deliberately changed. Their significance is
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
546 purely by convention, however. Some conventions suggest
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
547 themselves:
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
548
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
549 `(' - open paren -- an aside or incidental point
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
550 `?' - question mark -- uncertain or outright question
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
551 `!' - exclamation point/bang -- emphatic
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
552 `[' - open square bracket -- meta-note, about item instead of item's subject
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
553 `\"' - double quote -- a quotation or other citation
112186
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
554 `=' - equal sign -- an assignment, some kind of definition
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
555 `^' - carat -- relates to something above
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
556
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
557 Some are more elusive, but their rationale may be recognizable:
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
558
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
559 `+' - plus -- pending consideration, completion
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
560 `_' - underscore -- done, completed
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
561 `&' - ampersand -- addendum, furthermore
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
562
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
563 \(Some other non-plain bullets have special meaning to the
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
564 software. By default:
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
565
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
566 `~' marks encryptable topics -- see `allout-topic-encryption-bullet'
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
567 `#' marks auto-numbered bullets -- see `allout-numbered-bullet'.)
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
568
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
569 See `allout-plain-bullets-string' for the standard, alternating
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
570 bullets.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
571
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
572 You must run `set-allout-regexp' in order for outline mode to
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
573 adopt changes of this value.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
574
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
575 DO NOT include the close-square-bracket, `]', on either of the bullet
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
576 strings."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
577 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
578 :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
579 (make-variable-buffer-local 'allout-distinctive-bullets-string)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
580 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
581 (put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
582
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
583 ;;;_ = 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
584 (defcustom allout-use-mode-specific-leader t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
585 "When non-nil, use mode-specific topic-header prefixes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
586
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
587 Allout outline mode will use the mode-specific `allout-mode-leaders' or
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
588 comment-start string, if any, to lead the topic prefix string, so topic
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
589 headers look like comments in the programming language. It will also use
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
590 the comment-start string, with an '_' appended, for `allout-primary-bullet'.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
591
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
592 String values are used as literals, not regular expressions, so
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
593 do not escape any regulare-expression characters.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
594
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
595 Value t means to first check for assoc value in `allout-mode-leaders'
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
596 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
597 \(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
598
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
599 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
600 `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
601
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
602 Value nil means to always use the default (`.') and leave
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
603 `allout-primary-bullet' unaltered.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
604
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
605 comment-start strings that do not end in spaces are tripled in
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
606 the header-prefix, and an `_' underscore is tacked on the end, to
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
607 distinguish them from regular comment strings. comment-start
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
608 strings that do end in spaces are not tripled, but an underscore
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
609 is substituted for the space. [This presumes that the space is
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
610 for appearance, not comment syntax. You can use
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
611 `allout-mode-leaders' to override this behavior, when
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
612 undesired.]"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
613 :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
614 (const allout-mode-leaders)
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
615 (const comment-start))
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
616 :group 'allout)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
617 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
618 (put 'allout-use-mode-specific-leader 'safe-local-variable
70616
b69cce4ff5a0 2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70256
diff changeset
619 '(lambda (x) (or (memq x '(t nil allout-mode-leaders comment-start))
b69cce4ff5a0 2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70256
diff changeset
620 (stringp x))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
621 ;;;_ = 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
622 (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
623 "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
624
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
625 Use this if the mode's comment-start string isn't what you
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
626 prefer, or if the mode lacks a comment-start string. See
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
627 `allout-use-mode-specific-leader' for more details.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
628
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
629 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
630 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
631 character, like an \"_\" underscore, to distinguish the lead string
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
632 from regular comments that start at the beginning-of-line.")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
633
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
634 ;;;_ = 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
635 (defcustom allout-old-style-prefixes nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
636 "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
637
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
638 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
639 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
640 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
641
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
642 Whatever the setting of this variable, both old and new style prefixes
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
643 are always respected by the topic maneuvering functions."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
644 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
645 :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
646 (make-variable-buffer-local 'allout-old-style-prefixes)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
647 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
648 (put 'allout-old-style-prefixes 'safe-local-variable
70673
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
649 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
650 ;;;_ = allout-stylish-prefixes -- alternating bullets
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
651 (defcustom allout-stylish-prefixes t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
652 "Do fancy stuff with topic prefix bullets according to level, etc.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
653
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
654 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
655 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
656 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
657 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
658
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
659 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
660 prefixes:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
661
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
662 * Top level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
663 .* A topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
664 . + One level 3 subtopic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
665 . . One level 4 subtopic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
666 . . A second 4 subtopic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
667 . + Another level 3 subtopic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
668 . #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
669 . #2 Another
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
670 . ! 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
671 . #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
672
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
673 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
674 numbered and other distinctive bullets retained):
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
675
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
676 * Top level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
677 .* A topic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
678 . * One level 3 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
679 . * One level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
680 . * A second 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
681 . * Another level 3 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
682 . #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
683 . #2 Another
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
684 . ! 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
685 . #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
686
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
687 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
688 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
689 this variable setting.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
690
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
691 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
692 is non-nil."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
693 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
694 :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
695 (make-variable-buffer-local 'allout-stylish-prefixes)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
696 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
697 (put 'allout-stylish-prefixes 'safe-local-variable
70673
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
698 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t 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
699
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-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
701 (defcustom allout-numbered-bullet "#"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
702 "String designating bullet of topics that have auto-numbering; nil for none.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
703
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
704 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
705 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
706 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
707 disables numbering maintenance."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
708 :type '(choice (const nil) string)
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
709 :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
710 (make-variable-buffer-local 'allout-numbered-bullet)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
711 ;;;###autoload
70673
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
712 (put 'allout-numbered-bullet 'safe-local-variable
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
713 (if (fboundp 'string-or-null-p)
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
714 'string-or-null-p
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
715 '(lambda (x) (or (stringp x) (null x)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
716 ;;;_ = 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
717 (defcustom allout-file-xref-bullet "@"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
718 "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
719
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
720 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
721 :type '(choice (const nil) string)
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
722 :group 'allout)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
723 ;;;###autoload
70673
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
724 (put 'allout-file-xref-bullet 'safe-local-variable
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
725 (if (fboundp 'string-or-null-p)
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
726 'string-or-null-p
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
727 '(lambda (x) (or (stringp x) (null x)))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
728 ;;;_ = 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
729 (defcustom allout-presentation-padding 2
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
730 "Presentation-format white-space padding factor, for greater indent."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
731 :type 'integer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
732 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
733
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
734 (make-variable-buffer-local 'allout-presentation-padding)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
735 ;;;###autoload
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
736 (put 'allout-presentation-padding 'safe-local-variable 'integerp)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
737
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
738 ;;;_ = 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
739 (defcustom allout-abbreviate-flattened-numbering nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
740 "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
741 numbers to minimal amount with some context. Otherwise, entire
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
742 numbers are always used."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
743 :type 'boolean
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
744 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
745
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
746 ;;;_ + 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
747 ;;;_ - 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
748 (defcustom allout-number-pages nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
749 "Non-nil turns on page numbering for LaTeX formatting of an outline."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
750 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
751 :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
752 ;;;_ - 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
753 (defcustom allout-label-style "\\large\\bf"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
754 "Font and size of labels for LaTeX formatting of an outline."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
755 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
756 :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
757 ;;;_ - 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
758 (defcustom allout-head-line-style "\\large\\sl "
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
759 "Font and size of entries for LaTeX formatting of an outline."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
760 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
761 :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
762 ;;;_ - 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
763 (defcustom allout-body-line-style " "
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
764 "Font and size of entries for LaTeX formatting of an outline."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
765 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
766 :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
767 ;;;_ - 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
768 (defcustom allout-title-style "\\Large\\bf"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
769 "Font and size of titles for LaTeX formatting of an outline."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
770 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
771 :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
772 ;;;_ - allout-title
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
773 (defcustom allout-title '(or buffer-file-name (buffer-name))
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
774 "Expression to be evaluated to determine the title for LaTeX
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
775 formatted copy."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
776 :type 'sexp
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
777 :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
778 ;;;_ - 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
779 (defcustom allout-line-skip ".05cm"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
780 "Space between lines for LaTeX formatting of an outline."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
781 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
782 :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
783 ;;;_ - 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
784 (defcustom allout-indent ".3cm"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
785 "LaTeX formatted depth-indent spacing."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
786 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
787 :group 'allout)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
788
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
789 ;;;_ + Topic encryption
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
790 ;;;_ = allout-encryption group
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
791 (defgroup allout-encryption nil
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
792 "Settings for topic encryption features of allout outliner."
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
793 :group 'allout)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
794 ;;;_ = allout-topic-encryption-bullet
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
795 (defcustom allout-topic-encryption-bullet "~"
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
796 "Bullet signifying encryption of the entry's body."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
797 :type '(choice (const nil) string)
92337
a1a12ed4e5e2 (allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents: 88056
diff changeset
798 :version "22.1"
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
799 :group 'allout-encryption)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
800 ;;;_ = allout-encrypt-unencrypted-on-saves
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
801 (defcustom allout-encrypt-unencrypted-on-saves t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
802 "When saving, should topics pending encryption be encrypted?
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
803
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
804 The idea is to prevent file-system exposure of any un-encrypted stuff, and
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
805 mostly covers both deliberate file writes and auto-saves.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
806
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
807 - Yes: encrypt all topics pending encryption, even if it's the one
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
808 currently being edited. (In that case, the currently edited topic
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
809 will be automatically decrypted before any user interaction, so they
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
810 can continue editing but the copy on the file system will be
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
811 encrypted.)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
812 Auto-saves will use the \"All except current topic\" mode if this
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
813 one is selected, to avoid practical difficulties -- see below.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
814 - All except current topic: skip the topic currently being edited, even if
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
815 it's pending encryption. This may expose the current topic on the
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
816 file sytem, but avoids the nuisance of prompts for the encryption
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
817 passphrase in the middle of editing for, eg, autosaves.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
818 This mode is used for auto-saves for both this option and \"Yes\".
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
819 - No: leave it to the user to encrypt any unencrypted topics.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
820
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
821 For practical reasons, auto-saves always use the 'except-current policy
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
822 when auto-encryption is enabled. (Otherwise, spurious passphrase prompts
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
823 and unavoidable timing collisions are too disruptive.) If security for a
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
824 file requires that even the current topic is never auto-saved in the clear,
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
825 disable auto-saves for that file."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
826
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
827 :type '(choice (const :tag "Yes" t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
828 (const :tag "All except current topic" except-current)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
829 (const :tag "No" nil))
92337
a1a12ed4e5e2 (allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents: 88056
diff changeset
830 :version "22.1"
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
831 :group 'allout-encryption)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
832 (make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
833
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
834 ;;;_ + Developer
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
835 ;;;_ = allout-developer group
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
836 (defgroup allout-developer nil
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
837 "Allout settings developers care about, including topic encryption and more."
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
838 :group 'allout)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
839 ;;;_ = allout-run-unit-tests-on-load
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
840 (defcustom allout-run-unit-tests-on-load nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
841 "When non-nil, unit tests will be run at end of loading the allout module.
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
842
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
843 Generally, allout code developers are the only ones who'll want to set this.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
844
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
845 \(If set, this makes it an even better practice to exercise changes by
71915
9315116570f0 (allout-run-unit-tests-on-load): Rectified docstring grammar.
Nick Roberts <nickrob@snap.net.nz>
parents: 71893
diff changeset
846 doing byte-compilation with a repeat count, so the file is loaded after
9315116570f0 (allout-run-unit-tests-on-load): Rectified docstring grammar.
Nick Roberts <nickrob@snap.net.nz>
parents: 71893
diff changeset
847 compilation.)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
848
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
849 See `allout-run-unit-tests' to see what's run."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
850 :type 'boolean
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
851 :group 'allout-developer)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
852
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
853 ;;;_ + Miscellaneous customization
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
854
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
855 ;;;_ = allout-enable-file-variable-adjustment
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
856 (defcustom allout-enable-file-variable-adjustment t
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
857 "If non-nil, some allout outline actions edit Emacs local file var text.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
858
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
859 This can range from changes to existing entries, addition of new ones,
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
860 and creation of a new local variables section when necessary.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
861
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
862 Emacs file variables adjustments are also inhibited if `enable-local-variables'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
863 is nil.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
864
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
865 Operations potentially causing edits include allout encryption routines.
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
866 For details, see `allout-toggle-current-subtree-encryption's docstring."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
867 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
868 :group 'allout)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
869 (make-variable-buffer-local 'allout-enable-file-variable-adjustment)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
870
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
871 ;;;_* CODE -- no user customizations below.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
872
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
873 ;;;_ #1 Internal Outline Formatting and Configuration
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
874 ;;;_ : 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
875 ;;;_ = allout-version
112186
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
876 (defvar allout-version "2.3"
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
877 "Version 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
878 ;;;_ > 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
879 (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
880 "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
881 (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
882 (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
883 (if here (insert msg))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
884 (message "%s" msg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
885 msg))
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
886 ;;;_ : Mode activation (defined here because it's referenced early)
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
887 ;;;_ = allout-mode
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
888 (defvar allout-mode nil "Allout outline mode minor-mode flag.")
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
889 (make-variable-buffer-local 'allout-mode)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
890 ;;;_ = allout-layout nil
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
891 (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring.
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
892 "Buffer-specific setting for allout layout.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
893
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
894 In buffers where this is non-nil (and if `allout-init' has been run, to
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
895 enable this behavior), `allout-mode' will be automatically activated. The
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
896 layout dictated by the value will be used to set the initial exposure when
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
897 `allout-mode' is activated.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
898
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
899 \*You should not setq-default this variable non-nil unless you want every
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
900 visited file to be treated as an allout file.*
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
901
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
902 The value would typically be set by a file local variable. For
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
903 example, the following lines at the bottom of an Emacs Lisp file:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
904
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
905 ;;;Local variables:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
906 ;;;allout-layout: (0 : -1 -1 0)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
907 ;;;End:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
908
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
909 dictate activation of `allout-mode' mode when the file is visited
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
910 \(presuming allout-init was already run), followed by the
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
911 equivalent of `(allout-expose-topic 0 : -1 -1 0)'. (This is
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
912 the layout used for the allout.el source file.)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
913
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
914 `allout-default-layout' describes the specification format.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
915 `allout-layout' can additionally have the value `t', in which
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
916 case the value of `allout-default-layout' is used.")
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
917 (make-variable-buffer-local 'allout-layout)
70002
e753e12d2f33 (allout-layout): Autoload its `safe-local-variable' property.
Eli Zaretskii <eliz@gnu.org>
parents: 69481
diff changeset
918 ;;;###autoload
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
919 (put 'allout-layout 'safe-local-variable
70616
b69cce4ff5a0 2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70256
diff changeset
920 '(lambda (x) (or (numberp x) (listp x) (memq x '(: * + -)))))
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
921
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
922 ;;;_ : 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
923 ;;;_ = 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
924 (defvar allout-regexp ""
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
925 "*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
926
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
927 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
928 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
929 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
930 (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
931 ;;;_ = 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
932 (defvar allout-bullets-string ""
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
933 "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
934
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
935 This var should *not* be set by the user -- it is set 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
936 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
937 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
938 (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
939 ;;;_ = 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
940 (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
941 "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
942 (make-variable-buffer-local 'allout-bullets-string-len)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
943 ;;;_ = allout-depth-specific-regexp
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
944 (defvar allout-depth-specific-regexp ""
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
945 "*Regular expression to match a heading line prefix for a particular depth.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
946
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
947 This expression is used to search for depth-specific topic
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
948 headers at depth 2 and greater. Use `allout-depth-one-regexp'
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
949 for to seek topics at depth one.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
950
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
951 This var is set according to the user configuration vars by
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
952 `set-allout-regexp'. It is prepared with format strings for two
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
953 decimal numbers, which should each be one less than the depth of the
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
954 topic prefix to be matched.")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
955 (make-variable-buffer-local 'allout-depth-specific-regexp)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
956 ;;;_ = allout-depth-one-regexp
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
957 (defvar allout-depth-one-regexp ""
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
958 "*Regular expression to match a heading line prefix for depth one.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
959
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
960 This var is set according to the user configuration vars by
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
961 `set-allout-regexp'. It is prepared with format strings for two
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
962 decimal numbers, which should each be one less than the depth of the
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
963 topic prefix to be matched.")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
964 (make-variable-buffer-local 'allout-depth-one-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
965 ;;;_ = 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
966 (defvar allout-line-boundary-regexp ()
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
967 "`allout-regexp' prepended with a newline for the search target.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
968
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
969 This is properly set 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
970 (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
971 ;;;_ = 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
972 (defvar allout-bob-regexp ()
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
973 "Like `allout-line-boundary-regexp', for headers at beginning of 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
974 (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
975 ;;;_ = 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
976 (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
977 "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
978 (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
979 ;;;_ = 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
980 (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
981 "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
982 (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
983
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
984 ;;;_ = allout-doublecheck-at-and-shallower
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
985 (defconst allout-doublecheck-at-and-shallower 3
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
986 "Validate apparent topics of this depth and shallower as being non-aberrant.
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
987
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
988 Verified with `allout-aberrant-container-p'. The usefulness of
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
989 this check is limited to shallow depths, because the
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
990 determination of aberrance is according to the mistaken item
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
991 being followed by a legitimate item of excessively greater depth.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
992
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
993 The classic example of a mistaken item, for a standard allout
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
994 outline configuration, is a body line that begins with an '...'
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
995 ellipsis. This happens to contain a legitimate depth-2 header
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
996 prefix, constituted by two '..' dots at the beginning of the
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
997 line. The only thing that can distinguish it *in principle* from
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
998 a legitimate one is if the following real header is at a depth
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
999 that is discontinuous from the depth of 2 implied by the
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1000 ellipsis, ie depth 4 or more. As the depth being tested gets
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1001 greater, the likelihood of this kind of disqualification is
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1002 lower, and the usefulness of this test is lower.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1003
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1004 Extending the depth of the doublecheck increases the amount it is
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1005 applied, increasing the cost of the test - on casual estimation,
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1006 for outlines with many deep topics, geometrically (O(n)?).
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1007 Taken together with decreasing likelihood that the test will be
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1008 useful at greater depths, more modest doublecheck limits are more
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
1009 suitably economical.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1010 ;;;_ 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
1011 (defun allout-reset-header-lead (header-lead)
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
1012 "Reset the leading string used to identify topic headers."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1013 (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
1014 (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
1015 (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
1016 (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
1017 ;;;_ 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
1018 (defun allout-lead-with-comment-string (&optional header-lead)
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 100072
diff changeset
1019 "Set the topic-header leading string to specified string.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1020
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1021 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
1022 language comments. Returns the leading string."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025 (if (not (stringp header-lead))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1026 (setq header-lead (read-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 "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
1028 (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
1029 (allout-reset-header-lead header-lead)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030 header-lead)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1031 ;;;_ > allout-infer-header-lead-and-primary-bullet ()
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1032 (defun allout-infer-header-lead-and-primary-bullet ()
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1033 "Determine appropriate `allout-header-prefix' and `allout-primary-bullet'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1034
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1035 Works according to settings of:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1036
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1037 `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
1038 `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
1039 `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
1040 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
1041
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1042 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
1043 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
1044 (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
1045 (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
1046 (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
1047 '(allout-mode-leaders
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1048 comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1049 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
1050 allout-use-mode-specific-leader
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1051 ;; Oops -- garbled value, equate with effect of t:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1052 t)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1053 (leader
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1054 (cond
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1055 ((not use-leader) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1056 ;; Use the explicitly designated leader:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1057 ((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
1058 (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
1059 ;; 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
1060 (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
1061 ;; ... 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
1062 (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
1063 comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1064 ;; Use comment-start, maybe tripled, and with
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1065 ;; underscore:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1066 (concat
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1067 (if (string= " "
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1068 (substring comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1069 (1- (length comment-start))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1070 ;; 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
1071 (substring comment-start 0 -1)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1072 (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
1073 ;; ... and append underscore, whichever:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1074 "_")))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1075 (if (not leader)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1076 nil
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1077 (setq allout-header-prefix leader)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1078 (if (not allout-old-style-prefixes)
79940
b113c474ec50 More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79939
diff changeset
1079 ;; setting allout-primary-bullet makes the top level topics use --
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1080 ;; actually, be -- the special prefix:
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1081 (setq allout-primary-bullet leader))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1082 allout-header-prefix)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1083 (defalias 'allout-infer-header-lead
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1084 'allout-infer-header-lead-and-primary-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
1085 ;;;_ > 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
1086 (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
1087 "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
1088
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1089 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
1090 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
1091 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
1092 (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
1093 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
1094 (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
1095 (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
1096 ;;;_ > 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
1097 (defun set-allout-regexp ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1098 "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
1099
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1100 Works with respect to `allout-plain-bullets-string' and
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1101 `allout-distinctive-bullets-string'.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1102
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1103 Also refresh various data structures that hinge on the regexp."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105 (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
1106 ;; 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
1107 (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
1108 (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
1109 '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
1110 'allout-primary-bullet))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1111 cur-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1112 cur-len
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1113 cur-char
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1114 index)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1115 (while strings
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1116 (setq index 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1117 (setq cur-len (length (setq cur-string (symbol-value (car strings)))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1118 (while (< index cur-len)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1119 (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
1120 (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
1121 (concat allout-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1122 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1123 ; Single dash would denote a
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1124 ; sequence, repeated denotes
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1125 ; a dash:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1126 ((eq cur-char ?-) "--")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127 ; literal close-square-bracket
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1128 ; doesn't work right in the
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1129 ; expr, exclude it:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1130 ((eq cur-char ?\]) "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1131 (t (regexp-quote (char-to-string cur-char))))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1132 (setq index (1+ index)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1133 (setq strings (cdr strings)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1134 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1135 ;; 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
1136 (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
1137 (setq allout-header-subtraction (1- (length allout-header-prefix)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1138
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1139 (let (new-part old-part formfeed-part)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1140 (setq new-part (concat "\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1141 (regexp-quote allout-header-prefix)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1142 "[ \t]*"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1143 ;; already regexp-quoted in a custom way:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1144 "[" allout-bullets-string "]"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1145 "\\)")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1146 old-part (concat "\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1147 (regexp-quote allout-primary-bullet)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1148 "\\|"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1149 (regexp-quote allout-header-prefix)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1150 "\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1151 "+"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1152 " ?[^" allout-primary-bullet "]")
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1153 formfeed-part "\\(\^L\\)"
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1154
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1155 allout-regexp (concat new-part
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1156 "\\|"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1157 old-part
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1158 "\\|"
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1159 formfeed-part)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1160
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1161 allout-line-boundary-regexp (concat "\n" new-part
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1162 "\\|"
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1163 "\n" old-part
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1164 "\\|"
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1165 "\n" formfeed-part)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1166
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1167 allout-bob-regexp (concat "\\`" new-part
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1168 "\\|"
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1169 "\\`" old-part
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1170 "\\|"
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1171 "\\`" formfeed-part
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1172 ))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1173
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1174 (setq allout-depth-specific-regexp
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1175 (concat "\\(^\\|\\`\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1176 "\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1177
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1178 ;; new-style spacers-then-bullet string:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1179 "\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1180 (allout-format-quote (regexp-quote allout-header-prefix))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1181 " \\{%s\\}"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1182 "[" (allout-format-quote allout-bullets-string) "]"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1183 "\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1184
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1185 ;; old-style all-bullets string, if primary not multi-char:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1186 (if (< 0 allout-header-subtraction)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1187 ""
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1188 (concat "\\|\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1189 (allout-format-quote
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1190 (regexp-quote allout-primary-bullet))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1191 (allout-format-quote
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1192 (regexp-quote allout-primary-bullet))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1193 (allout-format-quote
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1194 (regexp-quote allout-primary-bullet))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1195 "\\{%s\\}"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1196 ;; disqualify greater depths:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1197 "[^"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1198 (allout-format-quote allout-primary-bullet)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1199 "]\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1200 ))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1201 "\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1202 ))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1203 (setq allout-depth-one-regexp
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1204 (concat "\\(^\\|\\`\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1205 "\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1206
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1207 "\\("
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1208 (regexp-quote allout-header-prefix)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1209 ;; disqualify any bullet char following any amount of
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1210 ;; intervening whitespace:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1211 " *"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1212 (concat "[^ " allout-bullets-string "]")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1213 "\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1214 (if (< 0 allout-header-subtraction)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1215 ;; Need not support anything like the old
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1216 ;; bullet style if the prefix is multi-char.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1217 ""
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1218 (concat "\\|"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1219 (regexp-quote allout-primary-bullet)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1220 ;; disqualify deeper primary-bullet sequences:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1221 "[^" allout-primary-bullet "]"))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1222 "\\)"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1223 ))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1224 ;;;_ : Menu bar
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1225 (defvar allout-mode-exposure-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1226 (defvar allout-mode-editing-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1227 (defvar allout-mode-navigation-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
1228 (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
1229 (defun produce-allout-mode-menubar-entries ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1230 (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
1231 (easy-menu-define allout-mode-exposure-menu
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1232 allout-mode-map-value
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1233 "Allout outline exposure menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1234 '("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
1235 ["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
1236 ["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
1237 ["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
1238 ["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
1239 ["Hide Leaves" allout-hide-current-leaves t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1240 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1241 ["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
1242 (easy-menu-define allout-mode-editing-menu
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1243 allout-mode-map-value
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1244 "Allout outline editing menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1245 '("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
1246 ["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
1247 ["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
1248 ["Open Supertopic" allout-open-supertopic t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1249 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1250 ["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
1251 ["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
1252 ["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
1253 ["Rebullet Heading" allout-rebullet-current-heading t]
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1254 ["Number Siblings" allout-number-siblings t]
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1255 "----"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1256 ["Toggle Topic Encryption"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1257 allout-toggle-current-subtree-encryption
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1258 (> (allout-current-depth) 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
1259 (easy-menu-define allout-mode-navigation-menu
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1260 allout-mode-map-value
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1261 "Allout outline navigation menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1262 '("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
1263 ["Next Visible Heading" allout-next-visible-heading t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1264 ["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
1265 allout-previous-visible-heading t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1266 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1267 ["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
1268 ["Forward Current Level" allout-forward-current-level t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1269 ["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
1270 allout-backward-current-level t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1271 "----"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1272 ["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
1273 allout-beginning-of-current-entry t]
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1274 ["End of Entry" allout-end-of-entry 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
1275 ["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
1276 (easy-menu-define allout-mode-misc-menu
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1277 allout-mode-map-value
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1278 "Allout outlines miscellaneous bindings."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1279 '("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
1280 ["Version" allout-version t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1281 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1282 ["Duplicate Exposed" allout-copy-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1283 ["Duplicate Exposed, numbered"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
1284 allout-flatten-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1285 ["Duplicate Exposed, indented"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
1286 allout-indented-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1287 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1288 ["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
1289 ["Set New Exposure" allout-expose-topic t])))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1290 ;;;_ : Allout Modal-Variables 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
1291 ;;;_ = 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
1292 (defvar allout-mode-prior-settings nil
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1293 "Internal `allout-mode' use; settings to be resumed on mode deactivation.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1294
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1295 See `allout-add-resumptions' and `allout-do-resumptions'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1296 (make-variable-buffer-local 'allout-mode-prior-settings)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1297 ;;;_ > allout-add-resumptions (&rest pairs)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1298 (defun allout-add-resumptions (&rest pairs)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1299 "Set name/value PAIRS.
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1300
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1301 Old settings are preserved for later resumption using `allout-do-resumptions'.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1302
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1303 The new values are set as a buffer local. On resumption, the prior buffer
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1304 scope of the variable is restored along with its value. If it was a void
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1305 buffer-local value, then it is left as nil on resumption.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1306
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1307 The pairs are lists whose car is the name of the variable and car of the
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1308 cdr is the new value: '(some-var some-value)'. The pairs can actually be
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1309 triples, where the third element qualifies the disposition of the setting,
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1310 as described further below.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1311
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1312 If the optional third element is the symbol 'extend, then the new value
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1313 created by `cons'ing the second element of the pair onto the front of the
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1314 existing value.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1315
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1316 If the optional third element is the symbol 'append, then the new value is
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1317 extended from the existing one by `append'ing a list containing the second
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1318 element of the pair onto the end of the existing value.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1319
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1320 Extension, and resumptions in general, should not be used for hook
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1321 functions -- use the 'local mode of `add-hook' for that, instead.
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1322
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1323 The settings are stored on `allout-mode-prior-settings'."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1324 (while pairs
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1325 (let* ((pair (pop pairs))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1326 (name (car pair))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1327 (value (cadr pair))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1328 (qualifier (if (> (length pair) 2)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1329 (caddr pair)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1330 prior-value)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1331 (if (not (symbolp name))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1332 (error "Pair's name, %S, must be a symbol, not %s"
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1333 name (type-of name)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
1334 (setq prior-value (condition-case nil
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1335 (symbol-value name)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1336 (void-variable nil)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1337 (when (not (assoc name allout-mode-prior-settings))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1338 ;; Not already added as a resumption, create the prior setting entry.
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1339 (if (local-variable-p name (current-buffer))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1340 ;; is already local variable -- preserve the prior value:
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1341 (push (list name prior-value) allout-mode-prior-settings)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1342 ;; wasn't local variable, indicate so for resumption by killing
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1343 ;; local value, and make it local:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1344 (push (list name) allout-mode-prior-settings)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1345 (make-local-variable name)))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1346 (if qualifier
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1347 (cond ((eq qualifier 'extend)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1348 (if (not (listp prior-value))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1349 (error "extension of non-list prior value attempted")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1350 (set name (cons value prior-value))))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1351 ((eq qualifier 'append)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1352 (if (not (listp prior-value))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1353 (error "appending of non-list prior value attempted")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1354 (set name (append prior-value (list value)))))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1355 (t (error "unrecognized setting qualifier `%s' encountered"
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1356 qualifier)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1357 (set name value)))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1358 ;;;_ > allout-do-resumptions ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1359 (defun allout-do-resumptions ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1360 "Resume all name/value settings registered by `allout-add-resumptions'.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1361
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1362 This is used when concluding allout-mode, to resume selected variables to
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1363 their settings before allout-mode was started."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1364
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1365 (while allout-mode-prior-settings
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1366 (let* ((pair (pop allout-mode-prior-settings))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1367 (name (car pair))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1368 (value-cell (cdr pair)))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1369 (if (not value-cell)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1370 ;; Prior value was global:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1371 (kill-local-variable name)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1372 ;; Prior value was explicit:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1373 (set name (car value-cell))))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1374 ;;;_ : 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
1375 ;;;_ > allout-unprotected (expr)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1376 (defmacro allout-unprotected (expr)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1377 "Enable internal outline operations to alter invisible text."
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
1378 `(let ((inhibit-read-only (if (not buffer-read-only) t))
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
1379 (inhibit-field-text-motion t))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1380 ,expr))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1381 ;;;_ = allout-mode-hook
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1382 (defvar allout-mode-hook nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1383 "*Hook that's run when allout mode starts.")
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1384 ;;;_ = allout-mode-deactivate-hook
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1385 (defvar allout-mode-deactivate-hook nil
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1386 "*Hook that's run when allout mode ends.")
112044
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
1387 (define-obsolete-variable-alias 'allout-mode-deactivate-hook
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
1388 'allout-mode-off-hook "future")
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1389 ;;;_ = allout-exposure-category
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1390 (defvar allout-exposure-category nil
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1391 "Symbol for use as allout invisible-text overlay category.")
70616
b69cce4ff5a0 2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70256
diff changeset
1392 ;;;_ = allout-exposure-change-hook
b69cce4ff5a0 2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70256
diff changeset
1393 (defvar allout-exposure-change-hook nil
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1394 "*Hook that's run after allout outline subtree exposure changes.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1395
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1396 It is run at the conclusion of `allout-flag-region'.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1397
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1398 Functions on the hook must take three arguments:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1399
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1400 - FROM -- integer indicating the point at the start of the change.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1401 - TO -- integer indicating the point of the end of the change.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1402 - FLAG -- change mode: nil for exposure, otherwise concealment.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1403
112129
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
1404 This hook might be invoked multiple times by a single command.")
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1405 ;;;_ = allout-structure-added-hook
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1406 (defvar allout-structure-added-hook nil
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1407 "*Hook that's run after addition of items to the outline.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1408
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1409 Functions on the hook should take two arguments:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1410
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1411 - NEW-START -- integer indicating position of start of the first new item.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1412 - NEW-END -- integer indicating position of end of the last new item.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1413
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1414 This hook might be invoked multiple times by a single command.")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1415 ;;;_ = allout-structure-deleted-hook
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1416 (defvar allout-structure-deleted-hook nil
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1417 "*Hook that's run after disciplined deletion of subtrees from the outline.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1418
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1419 Functions on the hook must take two arguments:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1420
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1421 - DEPTH -- integer indicating the depth of the subtree that was deleted.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1422 - REMOVED-FROM -- integer indicating the point where the subtree was removed.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1423
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1424 Some edits that remove or invalidate items may missed by this hook:
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1425 specifically edits that native allout routines do not control.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1426
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1427 This hook might be invoked multiple times by a single command.")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1428 ;;;_ = allout-structure-shifted-hook
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1429 (defvar allout-structure-shifted-hook nil
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1430 "*Hook that's run after shifting of items in the outline.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1431
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1432 Functions on the hook should take two arguments:
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1433
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1434 - DEPTH-CHANGE -- integer indicating depth increase, negative for decrease
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1435 - START -- integer indicating the start point of the shifted parent item.
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1436
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1437 Some edits that shift items can be missed by this hook: specifically edits
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1438 that native allout routines do not control.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1439
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1440 This hook might be invoked multiple times by a single command.")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1441 ;;;_ = allout-outside-normal-auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1442 (defvar allout-outside-normal-auto-fill-function nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1443 "Value of normal-auto-fill-function outside of allout mode.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1444
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1445 Used by allout-auto-fill to do the mandated normal-auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1446 wrapped within allout's automatic fill-prefix setting.")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1447 (make-variable-buffer-local 'allout-outside-normal-auto-fill-function)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1448 ;;;_ = prevent redundant activation by desktop mode:
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1449 (add-to-list 'desktop-minor-mode-handlers '(allout-mode . nil))
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1450 ;;;_ = allout-passphrase-verifier-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1451 (defvar allout-passphrase-verifier-string nil
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1452 "Setting used to test solicited encryption passphrases against the one
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1453 already associated with a file.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1454
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1455 It consists of an encrypted random string useful only to verify that a
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1456 passphrase entered by the user is effective for decryption. The passphrase
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1457 itself is \*not* recorded in the file anywhere, and the encrypted contents
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1458 are random binary characters to avoid exposing greater susceptibility to
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1459 search attacks.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1460
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1461 The verifier string is retained as an Emacs file variable, as well as in
73763
89b9e8184350 (allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents: 73660
diff changeset
1462 the Emacs buffer state, if file variable adjustments are enabled. See
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1463 `allout-enable-file-variable-adjustment' for details about that.")
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1464 (make-variable-buffer-local 'allout-passphrase-verifier-string)
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1465 (make-obsolete 'allout-passphrase-verifier-string
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1466 'allout-passphrase-verifier-string "23.3")
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
1467 ;;;###autoload
70225
81a284d45346 (allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70002
diff changeset
1468 (put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1469 ;;;_ = allout-passphrase-hint-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1470 (defvar allout-passphrase-hint-string ""
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1471 "Variable used to retain reminder string for file's encryption passphrase.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1472
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1473 See the description of `allout-passphrase-hint-handling' for details about how
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1474 the reminder is deployed.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1475
73763
89b9e8184350 (allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents: 73660
diff changeset
1476 The hint is retained as an Emacs file variable, as well as in the Emacs buffer
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1477 state, if file variable adjustments are enabled. See
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1478 `allout-enable-file-variable-adjustment' for details about that.")
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1479 (make-variable-buffer-local 'allout-passphrase-hint-string)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
1480 (setq-default allout-passphrase-hint-string "")
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1481 (make-obsolete 'allout-passphrase-hint-string
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1482 'allout-passphrase-hint-string "23.3")
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
1483 ;;;###autoload
70225
81a284d45346 (allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70002
diff changeset
1484 (put 'allout-passphrase-hint-string 'safe-local-variable 'stringp)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1485 ;;;_ = allout-after-save-decrypt
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1486 (defvar allout-after-save-decrypt nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1487 "Internal variable, is nil or has the value of two points:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1488
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1489 - the location of a topic to be decrypted after saving is done
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1490 - where to situate the cursor after the decryption is performed
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1491
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1492 This is used to decrypt the topic that was currently being edited, if it
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1493 was encrypted automatically as part of a file write or autosave.")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1494 (make-variable-buffer-local 'allout-after-save-decrypt)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1495 ;;;_ = allout-encryption-plaintext-sanitization-regexps
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1496 (defvar allout-encryption-plaintext-sanitization-regexps nil
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1497 "List of regexps whose matches are removed from plaintext before encryption.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1498
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1499 This is for the sake of removing artifacts, like escapes, that are added on
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1500 and not actually part of the original plaintext. The removal is done just
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1501 prior to encryption.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1502
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1503 Entries must be symbols that are bound to the desired values.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1504
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1505 Each value can be a regexp or a list with a regexp followed by a
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1506 substitution string. If it's just a regexp, all its matches are removed
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1507 before the text is encrypted. If it's a regexp and a substitution, the
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1508 substition is used against the regexp matches, a la `replace-match'.")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1509 (make-variable-buffer-local 'allout-encryption-text-removal-regexps)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1510 ;;;_ = allout-encryption-ciphertext-rejection-regexps
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1511 (defvar allout-encryption-ciphertext-rejection-regexps nil
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1512 "Variable for regexps matching plaintext to remove before encryption.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1513
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
1514 This is used to detect strings in encryption results that would
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
1515 register as allout mode structural elements, for exmple, as a
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
1516 topic prefix.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1517
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1518 Entries must be symbols that are bound to the desired regexp values.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1519
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
1520 Encryptions that result in matches will be retried, up to
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
1521 `allout-encryption-ciphertext-rejection-limit' times, after which
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
1522 an error is raised.")
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1523
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1524 (make-variable-buffer-local 'allout-encryption-ciphertext-rejection-regexps)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1525 ;;;_ = allout-encryption-ciphertext-rejection-ceiling
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1526 (defvar allout-encryption-ciphertext-rejection-ceiling 5
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1527 "Limit on number of times encryption ciphertext is rejected.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1528
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1529 See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
1530 (make-variable-buffer-local 'allout-encryption-ciphertext-rejection-ceiling)
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1531 ;;;_ > allout-mode-p ()
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1532 ;; Must define this macro above any uses, or byte compilation will lack
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1533 ;; proper def, if file isn't loaded -- eg, during emacs build!
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1534 (defmacro allout-mode-p ()
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1535 "Return t if `allout-mode' is active in current buffer."
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1536 'allout-mode)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1537 ;;;_ > allout-write-file-hook-handler ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1538 (defun allout-write-file-hook-handler ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1539 "Implement `allout-encrypt-unencrypted-on-saves' policy for file writes."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1540
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1541 (if (or (not (allout-mode-p))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1542 (not (boundp 'allout-encrypt-unencrypted-on-saves))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1543 (not allout-encrypt-unencrypted-on-saves))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1544 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1545 (let ((except-mark (and (equal allout-encrypt-unencrypted-on-saves
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1546 'except-current)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1547 (point-marker))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1548 (if (save-excursion (goto-char (point-min))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1549 (allout-next-topic-pending-encryption except-mark))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1550 (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1551 (message "auto-encrypting pending topics")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1552 (sit-for 0)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1553 (condition-case failure
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1554 (setq allout-after-save-decrypt
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1555 (allout-encrypt-decrypted except-mark))
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1556 (error (message
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1557 "allout-write-file-hook-handler suppressing error %s"
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1558 failure)
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1559 (sit-for 2)))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1560 ))
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
1561 nil)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1562 ;;;_ > allout-auto-save-hook-handler ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1563 (defun allout-auto-save-hook-handler ()
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1564 "Implement `allout-encrypt-unencrypted-on-saves' policy for auto save."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1565
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1566 (if (and (allout-mode-p) allout-encrypt-unencrypted-on-saves)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1567 ;; Always implement 'except-current policy when enabled.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1568 (let ((allout-encrypt-unencrypted-on-saves 'except-current))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1569 (allout-write-file-hook-handler))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1570 ;;;_ > allout-after-saves-handler ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1571 (defun allout-after-saves-handler ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1572 "Decrypt topic encrypted for save, if it's currently being edited.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1573
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1574 Ie, if it was pending encryption and contained the point in its body before
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1575 the save.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1576
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1577 We use values stored in `allout-after-save-decrypt' to locate the topic
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1578 and the place for the cursor after the decryption is done."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1579 (if (not (and (allout-mode-p)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1580 (boundp 'allout-after-save-decrypt)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1581 allout-after-save-decrypt))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1582 t
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1583 (goto-char (car allout-after-save-decrypt))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1584 (let ((was-modified (buffer-modified-p)))
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1585 (allout-toggle-subtree-encryption)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1586 (if (not was-modified)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1587 (set-buffer-modified-p nil)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1588 (goto-char (cadr allout-after-save-decrypt))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1589 (setq allout-after-save-decrypt nil))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1590 )
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1591 ;;;_ > allout-called-interactively-p ()
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1592 (defmacro allout-called-interactively-p ()
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1593 "A version of called-interactively-p independent of emacs version."
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1594 ;; ... to ease maintenance of allout without betraying deprecation.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1595 (if (equal (subr-arity (symbol-function 'called-interactively-p))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1596 '(0 . 0))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1597 '(called-interactively-p)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1598 '(called-interactively-p 'interactive)))
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1599 ;;;_ = allout-inhibit-aberrance-doublecheck nil
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1600 ;; In some exceptional moments, disparate topic depths need to be allowed
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1601 ;; momentarily, eg when one topic is being yanked into another and they're
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1602 ;; about to be reconciled. let-binding allout-inhibit-aberrance-doublecheck
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1603 ;; prevents the aberrance doublecheck to allow, eg, the reconciliation
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1604 ;; processing to happen in the presence of such discrepancies. It should
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1605 ;; almost never be needed, however.
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1606 (defvar allout-inhibit-aberrance-doublecheck nil
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1607 "Internal state, for momentarily inhibits aberrance doublecheck.
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1608
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1609 This should only be momentarily let-bound non-nil, not set
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
1610 non-nil in a lasting way.")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1611
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1612 ;;;_ #2 Mode environment and 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
1613 ;;;_ = 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
1614 (defvar allout-explicitly-deactivated nil
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1615 "If t, `allout-mode's last deactivation was deliberate.
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
1616 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
1617 (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
1618 ;;;_ > allout-init (&optional mode)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1619 (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
1620 "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
1621
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1622 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
1623
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1624 - nil (or no argument) deactivate auto-activation/layout;
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1625 - `activate', enable auto-activation only;
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1626 - `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
1627 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
1628 - `report', just report and return the current auto-activation state;
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1629 - anything else (eg, t) for auto-activation and auto-layout, without
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1630 any confirmation check.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1631
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1632 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
1633 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
1634 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
1635 `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
1636
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1637 `allout-init' works by setting up (or removing) the `allout-mode'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1638 find-file-hook, and giving `allout-auto-activation' a suitable
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1639 setting.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1640
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1641 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
1642 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
1643
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1644 \(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
1645 \(allout-init t)"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1646
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1647 (interactive)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1648 (if (allout-called-interactively-p)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1649 (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1650 (setq mode
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1651 (completing-read
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1652 (concat "Select outline auto setup mode "
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1653 "(empty for report, ? for options) ")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1654 '(("nil")("full")("activate")("deactivate")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1655 ("ask") ("report") (""))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1656 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1657 t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1658 (if (string= mode "")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1659 (setq mode 'report)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1660 (setq mode (intern-soft mode)))))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1661 (let
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1662 ;; 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
1663 ((hook 'allout-find-file-hook)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1664 (find-file-hook-var-name (if (boundp 'find-file-hook)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1665 'find-file-hook
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1666 'find-file-hooks))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1667 (curr-mode 'allout-auto-activation))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1668
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1669 (cond ((not mode)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1670 (set find-file-hook-var-name
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1671 (delq hook (symbol-value find-file-hook-var-name)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1672 (if (allout-called-interactively-p)
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1673 (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
1674 ((eq mode 'report)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1675 (if (not (memq hook (symbol-value find-file-hook-var-name)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1676 (allout-init nil)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1677 ;; Just punt and use the reports from each of the modes:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1678 (allout-init (symbol-value curr-mode))))
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1679 (t (add-hook find-file-hook-var-name hook)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1680 (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
1681 (cond ((eq mode 'activate)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1682 (message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1683 "Outline mode auto-activation enabled.")
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1684 'activate)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1685 ((eq mode 'report)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1686 ;; 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
1687 (allout-init mode))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1688 ((eq mode 'ask)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1689 (message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1690 (concat "Outline mode auto-activation and "
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1691 "-layout (upon confirmation) enabled."))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1692 'ask)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1693 ((message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1694 "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
1695 'full)))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1696 ;;;_ > 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
1697 (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
1698 "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
1699 (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
1700 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
1701 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
1702 allout-mode-misc-menu))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1703 cur)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1704 (while menus
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1705 (setq cur (car menus)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1706 menus (cdr menus))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1707 (easy-menu-add cur))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1708 ;;;_ > allout-overlay-preparations
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1709 (defun allout-overlay-preparations ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1710 "Set the properties of the allout invisible-text overlay and others."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1711 (setplist 'allout-exposure-category nil)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1712 (put 'allout-exposure-category 'invisible 'allout)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1713 (put 'allout-exposure-category 'evaporate t)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
1714 ;; ??? We use isearch-open-invisible *and* isearch-mode-end-hook. The
79940
b113c474ec50 More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79939
diff changeset
1715 ;; latter would be sufficient, but it seems that a separate behavior --
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1716 ;; the _transient_ opening of invisible text during isearch -- is keyed to
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1717 ;; presence of the isearch-open-invisible property -- even though this
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1718 ;; property controls the isearch _arrival_ behavior. This is the case at
92337
a1a12ed4e5e2 (allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents: 88056
diff changeset
1719 ;; least in emacs 21, 22.1, and xemacs 21.4.
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1720 (put 'allout-exposure-category 'isearch-open-invisible
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1721 'allout-isearch-end-handler)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1722 (if (featurep 'xemacs)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1723 (put 'allout-exposure-category 'start-open t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1724 (put 'allout-exposure-category 'insert-in-front-hooks
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1725 '(allout-overlay-insert-in-front-handler)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1726 (put 'allout-exposure-category 'modification-hooks
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
1727 '(allout-overlay-interior-modification-handler)))
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1728 ;;;_ > define-minor-mode allout-mode
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1729 ;;;_ : Defun:
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1730 ;;;###autoload
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1731 (define-minor-mode allout-mode
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1732 ;;;_ . Doc string:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1733 "Toggle minor mode for controlling exposure and editing of text outlines.
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1734 \\<allout-mode-map-value>
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1735
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1736 Allout outline mode always runs as a minor mode.
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1737
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1738 Allout outline mode provides extensive outline oriented
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1739 formatting and manipulation. It enables structural editing of
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1740 outlines, as well as navigation and exposure. It also is
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1741 specifically aimed at accommodating syntax-sensitive text like
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1742 programming languages. \(For example, see the allout code itself,
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1743 which is organized as an allout outline.)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1744
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1745 In addition to typical outline navigation and exposure, allout includes:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1746
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1747 - topic-oriented authoring, including keystroke-based topic creation,
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1748 repositioning, promotion/demotion, cut, and paste
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1749 - incremental search with dynamic exposure and reconcealment of hidden text
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1750 - adjustable format, so programming code can be developed in outline-structure
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1751 - easy topic encryption and decryption, symmetric or key-pair
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1752 - \"Hot-spot\" operation, for single-keystroke maneuvering and exposure control
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1753 - integral outline layout, for automatic initial exposure when visiting a file
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1754 - independent extensibility, using comprehensive exposure and authoring hooks
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1755
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1756 and many other features.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1757
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1758 Below is a description of the key bindings, and then description
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1759 of special `allout-mode' features and terminology. See also the
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1760 outline menubar additions for quick reference to many of the
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1761 features, and see the docstring of the function `allout-init' for
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1762 instructions on priming your emacs session for automatic
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1763 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
1764
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1765 The bindings are those listed in `allout-prefixed-keybindings'
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1766 and `allout-unprefixed-keybindings'. We recommend customizing
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1767 `allout-command-prefix' to use just `\\C-c' as the command
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1768 prefix, if the allout bindings don't conflict with any personal
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1769 bindings you have on \\C-c. In any case, outline structure
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1770 navigation and authoring is simplified by positioning the cursor
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1771 on an item's bullet character, the \"hot-spot\" -- then you can
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1772 invoke allout commands with just the un-prefixed,
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1773 un-control-shifted command letters. This is described further in
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1774 the HOT-SPOT Operation section.
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1775
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1776 Exposure Control:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1777 ----------------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1778 \\[allout-hide-current-subtree] `allout-hide-current-subtree'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1779 \\[allout-show-children] `allout-show-children'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1780 \\[allout-show-current-subtree] `allout-show-current-subtree'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1781 \\[allout-show-current-entry] `allout-show-current-entry'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1782 \\[allout-show-all] `allout-show-all'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1783
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1784 Navigation:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1785 ----------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1786 \\[allout-next-visible-heading] `allout-next-visible-heading'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1787 \\[allout-previous-visible-heading] `allout-previous-visible-heading'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1788 \\[allout-up-current-level] `allout-up-current-level'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1789 \\[allout-forward-current-level] `allout-forward-current-level'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1790 \\[allout-backward-current-level] `allout-backward-current-level'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1791 \\[allout-end-of-entry] `allout-end-of-entry'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1792 \\[allout-beginning-of-current-entry] `allout-beginning-of-current-entry' (alternately, goes to hot-spot)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1793 \\[allout-beginning-of-line] `allout-beginning-of-line' -- like regular beginning-of-line, but
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1794 if immediately repeated cycles to the beginning of the current item
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1795 and then to the hot-spot (if `allout-beginning-of-line-cycles' is set).
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1796
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1797
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1798 Topic Header Production:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1799 -----------------------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1800 \\[allout-open-sibtopic] `allout-open-sibtopic' Create a new sibling after current topic.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1801 \\[allout-open-subtopic] `allout-open-subtopic' ... an offspring of current topic.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1802 \\[allout-open-supertopic] `allout-open-supertopic' ... a sibling of the current topic's parent.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1803
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1804 Topic Level and Prefix Adjustment:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1805 ---------------------------------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1806 \\[allout-shift-in] `allout-shift-in' Shift current topic and all offspring deeper
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1807 \\[allout-shift-out] `allout-shift-out' ... less deep
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1808 \\[allout-rebullet-current-heading] `allout-rebullet-current-heading' Prompt for alternate bullet for
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1809 current topic
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1810 \\[allout-rebullet-topic] `allout-rebullet-topic' Reconcile bullets of topic and
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1811 its' offspring -- distinctive bullets are not changed, others
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1812 are alternated according to nesting depth.
79940
b113c474ec50 More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79939
diff changeset
1813 \\[allout-number-siblings] `allout-number-siblings' Number bullets of topic and siblings --
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1814 the offspring are not affected.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1815 With repeat count, revoke numbering.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1816
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1817 Topic-oriented Killing and Yanking:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1818 ----------------------------------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1819 \\[allout-kill-topic] `allout-kill-topic' Kill current topic, including offspring.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1820 \\[allout-copy-topic-as-kill] `allout-copy-topic-as-kill' Copy current topic, including offspring.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1821 \\[allout-kill-line] `allout-kill-line' kill-line, attending to outline structure.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1822 \\[allout-copy-line-as-kill] `allout-copy-line-as-kill' Copy line but don't delete it.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1823 \\[allout-yank] `allout-yank' Yank, adjusting depth of yanked topic to
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1824 depth of heading if yanking into bare topic
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1825 heading (ie, prefix sans text).
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1826 \\[allout-yank-pop] `allout-yank-pop' Is to allout-yank as yank-pop is to yank
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1827
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1828 Topic-oriented Encryption:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1829 -------------------------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1830 \\[allout-toggle-current-subtree-encryption] `allout-toggle-current-subtree-encryption'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1831 Encrypt/Decrypt topic content
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1832
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1833 Misc commands:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1834 -------------
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1835 M-x outlineify-sticky Activate outline mode for current buffer,
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1836 and establish a default file-var setting
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1837 for `allout-layout'.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1838 \\[allout-mark-topic] `allout-mark-topic'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1839 \\[allout-copy-exposed-to-buffer] `allout-copy-exposed-to-buffer'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1840 Duplicate outline, sans concealed text, to
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1841 buffer with name derived from derived from that
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1842 of current buffer -- \"*BUFFERNAME exposed*\".
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1843 \\[allout-flatten-exposed-to-buffer] `allout-flatten-exposed-to-buffer'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1844 Like above 'copy-exposed', but convert topic
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1845 prefixes to section.subsection... numeric
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1846 format.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1847 \\[eval-expression] (allout-init t) Setup Emacs session for outline mode
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1848 auto-activation.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1849
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1850 Topic Encryption
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1851
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1852 Outline mode supports gpg encryption of topics, with support for
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1853 symmetric and key-pair modes, and auto-encryption of topics
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1854 pending encryption on save.
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1855
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1856 Topics pending encryption are, by default, automatically
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1857 encrypted during file saves, including checkpoint saves, to avoid
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1858 exposing the plain text of encrypted topics in the file system.
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1859 If the content of the topic containing the cursor was encrypted
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
1860 for a save, it is automatically decrypted for continued editing.
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1861
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1862 NOTE: A few GnuPG v2 versions improperly preserve incorrect
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1863 symmetric decryption keys, preventing entry of the correct key on
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1864 subsequent decryption attempts until the cache times-out. That
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1865 can take several minutes. \(Decryption of other entries is not
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1866 affected.) Upgrade your EasyPG version, if you can, and you can
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1867 deliberately clear your gpg-agent's cache by sending it a '-HUP'
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1868 signal.
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1869
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1870 See `allout-toggle-current-subtree-encryption' function docstring
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1871 and `allout-encrypt-unencrypted-on-saves' customization variable
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1872 for details.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1873
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1874 HOT-SPOT Operation
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1875
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1876 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
1877 navigation and exposure control.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1878
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1879 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
1880 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
1881 corresponding allout-mode keymap control chars. For example, \"f\"
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1882 would invoke the command typically bound to \"C-c<space>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
1883 \(\\[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
1884
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1885 Thus, by positioning the cursor on a topic bullet, you can
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1886 execute the outline navigation and manipulation commands with a
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1887 single keystroke. Regular navigation keys (eg, \\[forward-char], \\[next-line]) don't get
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1888 this special translation, so you can use them to get out of the
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1889 hot-spot and back to normal editing operation.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1890
99841
fd7d46b20afe * allout.el (allout-mode): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 95241
diff changeset
1891 In allout-mode, the normal beginning-of-line command (\\[allout-beginning-of-line]) is
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1892 replaced with one that makes it easy to get to the hot-spot. If you
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1893 repeat it immediately it cycles (if `allout-beginning-of-line-cycles'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1894 is set) to the beginning of the item and then, if you hit it again
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1895 immediately, to the hot-spot. Similarly, `allout-beginning-of-current-entry'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1896 \(\\[allout-beginning-of-current-entry]) moves to the hot-spot when the cursor is already located
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1897 at the beginning of the current entry.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1898
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1899 Extending Allout
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1900
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1901 Allout exposure and authoring activites all have associated
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1902 hooks, by which independent code can cooperate with allout
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1903 without changes to the allout core. Here are key ones:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1904
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1905 `allout-mode-hook'
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1906 `allout-mode-deactivate-hook' \(deprecated)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1907 `allout-mode-off-hook'
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1908 `allout-exposure-change-hook'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1909 `allout-structure-added-hook'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1910 `allout-structure-deleted-hook'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1911 `allout-structure-shifted-hook'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1912
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1913 Terminology
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1914
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
1915 Topic hierarchy constituents -- TOPICS and SUBTOPICS:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1916
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1917 ITEM: A unitary outline element, including the HEADER and ENTRY text.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1918 TOPIC: An ITEM and any ITEMs contained within it, ie having greater DEPTH
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1919 and with no intervening items of lower DEPTH than the container.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1920 CURRENT ITEM:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1921 The visible ITEM most immediately containing the cursor.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1922 DEPTH: The degree of nesting of an ITEM; it increases with containment.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1923 The DEPTH is determined by the HEADER PREFIX. The DEPTH is also
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1924 called the:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1925 LEVEL: The same as DEPTH.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1926
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1927 ANCESTORS:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1928 Those ITEMs whose TOPICs contain an ITEM.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1929 PARENT: An ITEM's immediate ANCESTOR. It has a DEPTH one less than that
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1930 of the ITEM.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1931 OFFSPRING:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1932 The ITEMs contained within an ITEM's TOPIC.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1933 SUBTOPIC:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1934 An OFFSPRING of its ANCESTOR TOPICs.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1935 CHILD:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1936 An immediate SUBTOPIC of its PARENT.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1937 SIBLINGS:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1938 TOPICs having the same PARENT and DEPTH.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1939
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1940 Topic text constituents:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1941
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1942 HEADER: The first line of an ITEM, include the ITEM PREFIX and HEADER
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1943 text.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1944 ENTRY: The text content of an ITEM, before any OFFSPRING, but including
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1945 the HEADER text and distinct from the ITEM PREFIX.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1946 BODY: Same as ENTRY.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1947 PREFIX: The leading text of an ITEM which distinguishes it from normal
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1948 ENTRY text. Allout recognizes the outline structure according
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1949 to the strict PREFIX format. It consists of a PREFIX-LEAD string,
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1950 PREFIX-PADDING, and a BULLET. The BULLET might be followed by a
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1951 number, indicating the ordinal number of the topic among its
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1952 siblings, or an asterisk indicating encryption, plus an optional
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1953 space. After that is the ITEM HEADER text, which is not part of
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1954 the PREFIX.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1955
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1956 The relative length of the PREFIX determines the nesting DEPTH
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1957 of the ITEM.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1958 PREFIX-LEAD:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1959 The string at the beginning of a HEADER PREFIX, by default a `.'.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1960 It can be customized by changing the setting of
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1961 `allout-header-prefix' and then reinitializing `allout-mode'.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1962
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1963 When the PREFIX-LEAD is set to the comment-string of a
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1964 programming language, outline structuring can be embedded in
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1965 program code without interfering with processing of the text
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1966 (by emacs or the language processor) as program code. This
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1967 setting happens automatically when allout mode is used in
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1968 programming-mode buffers. See `allout-use-mode-specific-leader'
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1969 docstring for more detail.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1970 PREFIX-PADDING:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1971 Spaces or asterisks which separate the PREFIX-LEAD and the
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1972 bullet, determining the ITEM's DEPTH.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1973 BULLET: A character at the end of the ITEM PREFIX, it must be one of
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1974 the characters listed on `allout-plain-bullets-string' or
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1975 `allout-distinctive-bullets-string'. When creating a TOPIC,
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1976 plain BULLETs are by default used, according to the DEPTH of the
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1977 TOPIC. Choice among the distinctive BULLETs is offered when you
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1978 provide a universal argugment \(\\[universal-argument]) to the
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1979 TOPIC creation command, or when explictly rebulleting a TOPIC. The
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1980 significance of the various distinctive bullets is purely by
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1981 convention. See the documentation for the above bullet strings for
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
1982 more details.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1983 EXPOSURE:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1984 The state of a TOPIC which determines the on-screen visibility
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1985 of its OFFSPRING and contained ENTRY text.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1986 CONCEALED:
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1987 TOPICs and ENTRY text whose EXPOSURE is inhibited. Concealed
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1988 text is represented by \"...\" ellipses.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1989
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1990 CONCEALED TOPICs are effectively collapsed within an ANCESTOR.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1991 CLOSED: A TOPIC whose immediate OFFSPRING and body-text is CONCEALED.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
1992 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
1993 ;;;_ . Code
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1994 :lighter " Allout"
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
1995 :keymap 'allout-mode-map
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1996
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1997 (let ((write-file-hook-var-name (cond ((boundp 'write-file-functions)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1998 'write-file-functions)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
1999 ((boundp 'write-file-hooks)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2000 'write-file-hooks)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2001 (t 'local-write-file-hooks)))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2002 (use-layout (if (listp allout-layout)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2003 allout-layout
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2004 allout-default-layout)))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2005
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2006 (if (not (allout-mode-p))
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2007 (progn
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2008 ;; Deactivation:
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2009
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2010 ; Activation not explicitly
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2011 ; requested, and either in
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2012 ; active state or *de*activation
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2013 ; specifically requested:
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2014 (allout-do-resumptions)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2015
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2016 (remove-from-invisibility-spec '(allout . t))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2017 (remove-hook 'pre-command-hook 'allout-pre-command-business t)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2018 (remove-hook 'post-command-hook 'allout-post-command-business t)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2019 (remove-hook 'before-change-functions 'allout-before-change-handler t)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2020 (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2021 (remove-hook write-file-hook-var-name
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2022 'allout-write-file-hook-handler t)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2023 (remove-hook 'auto-save-hook 'allout-auto-save-hook-handler t)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2024
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2025 (remove-overlays (point-min) (point-max)
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2026 'category 'allout-exposure-category))
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2027
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2028 ;; Activating:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2029 (if allout-old-style-prefixes
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2030 ;; Inhibit all the fancy formatting:
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2031 (allout-add-resumptions '(allout-primary-bullet "*")))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2032
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2033 (allout-overlay-preparations) ; Doesn't hurt to redo this.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2034
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2035 (allout-infer-header-lead-and-primary-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
2036 (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
2037
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2038 (set-allout-regexp)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2039 (allout-add-resumptions '(allout-encryption-ciphertext-rejection-regexps
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2040 allout-line-boundary-regexp
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2041 extend)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2042 '(allout-encryption-ciphertext-rejection-regexps
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2043 allout-bob-regexp
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2044 extend))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2045
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
2046 (allout-compose-and-institute-keymap)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2047 (produce-allout-mode-menubar-entries)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2048
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2049 (add-to-invisibility-spec '(allout . t))
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
2050
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2051 (allout-add-resumptions '(line-move-ignore-invisible t))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2052 (add-hook 'pre-command-hook 'allout-pre-command-business nil t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2053 (add-hook 'post-command-hook 'allout-post-command-business nil t)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2054 (add-hook 'before-change-functions 'allout-before-change-handler nil t)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2055 (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler nil t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2056 (add-hook write-file-hook-var-name 'allout-write-file-hook-handler
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2057 nil t)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2058 (add-hook 'auto-save-hook 'allout-auto-save-hook-handler nil t)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2059
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2060 ;; Stash auto-fill settings and adjust so custom allout auto-fill
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2061 ;; func will be used if auto-fill is active or activated. (The
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2062 ;; custom func respects topic headline, maintains hanging-indents,
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2063 ;; etc.)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2064 (allout-add-resumptions (list 'allout-former-auto-filler
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2065 auto-fill-function)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2066 ;; Register allout-auto-fill to be used if
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2067 ;; filling is active:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2068 (list 'allout-outside-normal-auto-fill-function
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2069 normal-auto-fill-function)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2070 '(normal-auto-fill-function allout-auto-fill)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2071 ;; Paragraphs are broken by topic headlines.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2072 (list 'paragraph-start
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2073 (concat paragraph-start "\\|^\\("
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2074 allout-regexp "\\)"))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2075 (list 'paragraph-separate
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2076 (concat paragraph-separate "\\|^\\("
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2077 allout-regexp "\\)")))
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2078 (if (and auto-fill-function (not allout-inhibit-auto-fill))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2079 ;; allout-auto-fill will use the stashed values and so forth.
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2080 (allout-add-resumptions '(auto-fill-function allout-auto-fill)))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2081
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2082 (allout-setup-menubar)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2083
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2084 ;; Do auto layout if warranted:
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2085 (when (and allout-layout
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2086 allout-auto-activation
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2087 use-layout
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2088 (and (not (eq allout-auto-activation 'activate))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2089 (if (eq allout-auto-activation 'ask)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2090 (if (y-or-n-p (format "Expose %s with layout '%s'? "
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2091 (buffer-name)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2092 use-layout))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2093 t
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2094 (message "Skipped %s layout." (buffer-name))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2095 nil)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2096 t)))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2097 (save-excursion
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2098 (message "Adjusting '%s' exposure..." (buffer-name))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2099 (goto-char 0)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2100 (allout-this-or-next-heading)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2101 (condition-case err
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2102 (progn
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2103 (apply 'allout-expose-topic (list use-layout))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2104 (message "Adjusting '%s' exposure... done."
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2105 (buffer-name)))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2106 ;; Problem applying exposure -- notify user, but don't
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2107 ;; interrupt, eg, file visit:
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2108 (error (message "%s" (car (cdr err)))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2109 (sit-for 1))))
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2110 ) ; when allout-layout
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2111 ) ; if (allout-mode-p)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2112 ) ; let (())
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2113 ) ; define-minor-mode
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2114 ;;;_ > allout-minor-mode alias
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2115 (defalias 'allout-minor-mode 'allout-mode)
79920
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2116 ;;;_ > allout-unload-function
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2117 (defun allout-unload-function ()
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2118 "Unload the allout outline library."
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2119 (save-current-buffer
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2120 (dolist (buffer (buffer-list))
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2121 (set-buffer buffer)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
2122 (when (allout-mode-p) (allout-mode))))
79920
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2123 ;; continue standard unloading
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2124 nil)
5096ade2d1f5 (allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 79915
diff changeset
2125
68956
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
2126 ;;;_ - Position Assessment
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
2127 ;;;_ > allout-hidden-p (&optional pos)
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
2128 (defsubst allout-hidden-p (&optional pos)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2129 "Non-nil if the character after point was made invisible by allout."
70616
b69cce4ff5a0 2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70256
diff changeset
2130 (eq (get-char-property (or pos (point)) 'invisible) 'allout))
68956
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
2131
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2132 ;;;_ > allout-overlay-insert-in-front-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2133 ;;; &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2134 (defun allout-overlay-insert-in-front-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2135 &optional prelen)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2136 "Shift the overlay so stuff inserted in front of it is excluded."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2137 (if after
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2138 ;; ??? Shouldn't moving the overlay should be unnecessary, if overlay
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2139 ;; front-advance on the overlay worked as expected?
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2140 (move-overlay ol (1+ beg) (overlay-end ol))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2141 ;;;_ > allout-overlay-interior-modification-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2142 ;;; &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2143 (defun allout-overlay-interior-modification-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2144 &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2145 "Get confirmation before making arbitrary changes to invisible text.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2146
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2147 We expose the invisible text and ask for confirmation. Refusal or
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
2148 `keyboard-quit' abandons the changes, with keyboard-quit additionally
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2149 reclosing the opened text.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2150
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2151 No confirmation is necessary when `inhibit-read-only' is set -- eg, allout
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2152 internal functions use this feature cohesively bunch changes."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2153
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2154 (when (and (not inhibit-read-only) (not after))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2155 (let ((start (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2156 (ol-start (overlay-start ol))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2157 (ol-end (overlay-end ol))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2158 first)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2159 (goto-char beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2160 (while (< (point) end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2161 (when (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2162 (allout-show-to-offshoot)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2163 (if (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2164 (save-excursion (forward-char 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2165 (allout-show-to-offshoot)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2166 (when (not first)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2167 (setq first (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2168 (goto-char (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2169 (next-property-change (1+ (point)) nil end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2170 (next-char-property-change (1+ (point)) end))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2171 (when first
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2172 (goto-char first)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2173 (condition-case nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2174 (if (not
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2175 (yes-or-no-p
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2176 (substitute-command-keys
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
2177 (concat "Modify concealed text? (\"no\" just aborts,"
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2178 " \\[keyboard-quit] also reconceals) "))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2179 (progn (goto-char start)
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105080
diff changeset
2180 (error "Concealed-text change refused")))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2181 (quit (allout-flag-region ol-start ol-end nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2182 (allout-flag-region ol-start ol-end t)
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105080
diff changeset
2183 (error "Concealed-text change abandoned, text reconcealed"))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2184 (goto-char start))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2185 ;;;_ > allout-before-change-handler (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2186 (defun allout-before-change-handler (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2187 "Protect against changes to invisible text.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2188
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2189 See `allout-overlay-interior-modification-handler' for details."
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2190
112410
744ddded8b6a * allout.el (allout-prefixed-keybindings): Bind (prefixed) '#' to
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112388
diff changeset
2191 (when (and (allout-mode-p) undo-in-progress (allout-hidden-p))
744ddded8b6a * allout.el (allout-prefixed-keybindings): Bind (prefixed) '#' to
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112388
diff changeset
2192 (allout-show-children))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2193
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2194 ;; allout-overlay-interior-modification-handler on an overlay handles
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2195 ;; this in other emacs, via `allout-exposure-category's 'modification-hooks.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2196 (when (and (featurep 'xemacs) (allout-mode-p))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
2197 ;; process all of the pending overlays:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2198 (save-excursion
78915
e7a2828a162d (allout-before-change-handler): Replace got-char by goto-char.
Martin Rudalics <rudalics@gmx.at>
parents: 78492
diff changeset
2199 (goto-char beg)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2200 (let ((overlay (allout-get-invisibility-overlay)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2201 (if overlay
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2202 (allout-overlay-interior-modification-handler
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2203 overlay nil beg end nil))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2204 ;;;_ > allout-isearch-end-handler (&optional overlay)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2205 (defun allout-isearch-end-handler (&optional overlay)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2206 "Reconcile allout outline exposure on arriving in hidden text after isearch.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2207
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2208 Optional OVERLAY parameter is for when this function is used by
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2209 `isearch-open-invisible' overlay property. It is otherwise unused, so this
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2210 function can also be used as an `isearch-mode-end-hook'."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2211
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2212 (if (and (allout-mode-p) (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2213 (allout-show-to-offshoot)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2214
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2215 ;;;_ #3 Internal Position State-Tracking -- "allout-recent-*" funcs
108209
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2216 ;; All the basic outline functions that directly do string matches to
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2217 ;; evaluate heading prefix location set the variables
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2218 ;; `allout-recent-prefix-beginning' and `allout-recent-prefix-end'
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2219 ;; when successful. Functions starting with `allout-recent-' all
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2220 ;; use this state, providing the means to avoid redundant searches
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2221 ;; for just-established data. This optimization can provide
b757d9aee37e * allout.el: Fix commenting convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
2222 ;; 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
2223 ;;;_ = 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
2224 (defvar allout-recent-prefix-beginning 0
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2225 "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
2226 (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
2227 ;;;_ = 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
2228 (defvar allout-recent-prefix-end 0
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2229 "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
2230 (make-variable-buffer-local 'allout-recent-prefix-end)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2231 ;;;_ = allout-recent-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2232 (defvar allout-recent-depth 0
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2233 "Depth of the last topic prefix encountered.")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2234 (make-variable-buffer-local 'allout-recent-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
2235 ;;;_ = 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
2236 (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
2237 "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
2238 (make-variable-buffer-local 'allout-recent-end-of-subtree)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2239 ;;;_ > allout-prefix-data ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2240 (defsubst allout-prefix-data ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2241 "Register allout-prefix state 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
2242
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
2243 For reference by `allout-recent' funcs. Return
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
2244 the new value of `allout-recent-prefix-beginning'."
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2245 (setq allout-recent-prefix-end (or (match-end 1) (match-end 2) (match-end 3))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2246 allout-recent-prefix-beginning (or (match-beginning 1)
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2247 (match-beginning 2)
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2248 (match-beginning 3))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2249 allout-recent-depth (max 1 (- allout-recent-prefix-end
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2250 allout-recent-prefix-beginning
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2251 allout-header-subtraction)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2252 allout-recent-prefix-beginning)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2253 ;;;_ > nullify-allout-prefix-data ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2254 (defsubst nullify-allout-prefix-data ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2255 "Mark allout prefix data as being uninformative."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2256 (setq allout-recent-prefix-end (point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2257 allout-recent-prefix-beginning (point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2258 allout-recent-depth 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2259 allout-recent-prefix-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
2260 ;;;_ > allout-recent-depth ()
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2261 (defsubst allout-recent-depth ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2262 "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
2263
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2264 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
2265 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
2266 `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
2267 to return the current depth."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2268
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2269 allout-recent-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
2270 ;;;_ > allout-recent-prefix ()
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2271 (defsubst 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
2272 "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
2273
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2274 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
2275 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
2276 `allout-recent-prefix-end' if successful. This function uses those settings
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2277 to return the current prefix."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2278 (buffer-substring-no-properties allout-recent-prefix-beginning
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2279 allout-recent-prefix-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
2280 ;;;_ > 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
2281 (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
2282 "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
2283
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2284 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
2285 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
2286 `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
2287 to return the current depth of the most recently matched topic."
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2288 '(buffer-substring-no-properties (1- allout-recent-prefix-end)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2289 allout-recent-prefix-end))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2290
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2291 ;;;_ #4 Navigation
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2292
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2293 ;;;_ - Position Assessment
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2294 ;;;_ : Location Predicates
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2295 ;;;_ > allout-do-doublecheck ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2296 (defsubst allout-do-doublecheck ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2297 "True if current item conditions qualify for checking on topic aberrance."
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2298 (and
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2299 ;; presume integrity of outline and yanked content during yank -- necessary
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2300 ;; to allow for level disparity of yank location and yanked text:
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
2301 (not allout-inhibit-aberrance-doublecheck)
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2302 ;; allout-doublecheck-at-and-shallower is ceiling for doublecheck:
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2303 (<= allout-recent-depth allout-doublecheck-at-and-shallower)))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2304 ;;;_ > allout-aberrant-container-p ()
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2305 (defun allout-aberrant-container-p ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2306 "True if topic, or next sibling with children, contains them discontinuously.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2307
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2308 Discontinuous means an immediate offspring that is nested more
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2309 than one level deeper than the topic.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2310
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2311 If topic has no offspring, then the next sibling with offspring will
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2312 determine whether or not this one is determined to be aberrant.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2313
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2314 If true, then the allout-recent-* settings are calibrated on the
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2315 offspring that qaulifies it as aberrant, ie with depth that
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2316 exceeds the topic by more than one."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2317
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2318 ;; This is most clearly understood when considering standard-prefix-leader
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2319 ;; low-level topics, which can all too easily match text not intended as
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2320 ;; headers. For example, any line with a leading '.' or '*' and lacking a
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2321 ;; following bullet qualifies without this protection. (A sequence of
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2322 ;; them can occur naturally, eg a typical textual bullet list.) We
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2323 ;; disqualify such low-level sequences when they are followed by a
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2324 ;; discontinuously contained child, inferring that the sequences are not
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2325 ;; actually connected with their prospective context.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2326
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2327 (let ((depth (allout-depth))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2328 (start-point (point))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2329 done aberrant)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2330 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2331 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2332 (while (and (not done)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2333 (re-search-forward allout-line-boundary-regexp nil 0))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2334 (allout-prefix-data)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2335 (goto-char allout-recent-prefix-beginning)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2336 (cond
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
2337 ;; sibling -- continue:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2338 ((eq allout-recent-depth depth))
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
2339 ;; first offspring is excessive -- aberrant:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2340 ((> allout-recent-depth (1+ depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2341 (setq done t aberrant t))
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
2342 ;; next non-sibling is lower-depth -- not aberrant:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2343 (t (setq done t))))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2344 (if aberrant
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2345 aberrant
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2346 (goto-char start-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2347 ;; recalibrate allout-recent-*
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2348 (allout-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2349 nil)))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2350 ;;;_ > allout-on-current-heading-p ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2351 (defun allout-on-current-heading-p ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2352 "Return non-nil if point is on current visible topics' header line.
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2353
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2354 Actually, returns prefix beginning point."
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2355 (save-excursion
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2356 (allout-beginning-of-current-line)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2357 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2358 (and (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2359 (allout-prefix-data)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2360 (or (not (allout-do-doublecheck))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2361 (not (allout-aberrant-container-p)))))))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2362 ;;;_ > allout-on-heading-p ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2363 (defalias 'allout-on-heading-p 'allout-on-current-heading-p)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2364 ;;;_ > allout-e-o-prefix-p ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2365 (defun allout-e-o-prefix-p ()
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2366 "True if point is located where current topic prefix ends, heading begins."
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2367 (and (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2368 (save-excursion (let ((inhibit-field-text-motion t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2369 (beginning-of-line))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2370 (looking-at allout-regexp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2371 (= (point) (save-excursion (allout-end-of-prefix)(point))))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2372 ;;;_ : 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
2373 ;;;_ > allout-depth ()
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2374 (defun allout-depth ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2375 "Return depth of topic most immediately containing point.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2376
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2377 Does not do doublecheck for aberrant topic header.
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2378
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2379 Return zero if point is not within any topic.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2380
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2381 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
2382 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2383 (let ((start-point (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2384 (if (and (allout-goto-prefix)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2385 (not (< start-point (point))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2386 allout-recent-depth
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2387 (progn
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2388 ;; Oops, no prefix, nullify it:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2389 (nullify-allout-prefix-data)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2390 ;; ... and return 0:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2391 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
2392 ;;;_ > allout-current-depth ()
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2393 (defun allout-current-depth ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2394 "Return depth of visible topic most immediately containing point.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2395
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2396 Return zero if point is not within any topic."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2397 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2398 (if (allout-back-to-current-heading)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2399 (max 1
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2400 (- allout-recent-prefix-end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2401 allout-recent-prefix-beginning
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2402 allout-header-subtraction))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2403 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
2404 ;;;_ > 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
2405 (defun allout-get-current-prefix ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2406 "Topic prefix of the current topic."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2407 (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
2408 (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
2409 (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
2410 ;;;_ > 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
2411 (defun allout-get-bullet ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2412 "Return bullet of containing topic (visible or not)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2413 (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
2414 (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
2415 (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
2416 ;;;_ > 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
2417 (defun allout-current-bullet ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2418 "Return bullet of current (visible) topic heading, or none if none found."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2419 (condition-case nil
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2420 (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
2421 (allout-back-to-current-heading)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2422 (buffer-substring-no-properties (- allout-recent-prefix-end 1)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2423 allout-recent-prefix-end))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2424 ;; Quick and dirty provision, ostensibly for missing bullet:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2425 (args-out-of-range nil))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2426 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2427 ;;;_ > 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
2428 (defun allout-get-prefix-bullet (prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2429 "Return the bullet of the header prefix string PREFIX."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2430 ;; 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
2431 ;; 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
2432 (if (string-match allout-regexp prefix)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2433 (substring prefix (1- (match-end 2)) (match-end 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
2434 ;;;_ > 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
2435 (defun allout-sibling-index (&optional depth)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2436 "Item number of this prospective topic among its siblings.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2437
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2438 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
2439 opening a new level, and return 0.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2440
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2441 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
2442
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2443 (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2444 (cond ((and depth (<= depth 0) 0))
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2445 ((or (null depth) (= depth (allout-depth)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2446 (let ((index 1))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2447 (while (allout-previous-sibling allout-recent-depth nil)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2448 (setq index (1+ index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2449 index))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2450 ((< depth allout-recent-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
2451 (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
2452 (allout-sibling-index))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2453 (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
2454 ;;;_ > 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
2455 (defun allout-topic-flat-index ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2456 "Return a list indicating point's numeric section.subsect.subsubsect...
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2457 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
2458 (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
2459 (next-index (allout-sibling-index depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2460 (rev-sibls nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2461 (while (> next-index 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2462 (setq rev-sibls (cons next-index rev-sibls))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2463 (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
2464 (setq next-index (allout-sibling-index depth)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2465 rev-sibls)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2466 )
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2467
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2468 ;;;_ - Navigation routines
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2469 ;;;_ > allout-beginning-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2470 (defun allout-beginning-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2471 "Like beginning of line, but to visible text."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2472
71915
9315116570f0 (allout-run-unit-tests-on-load): Rectified docstring grammar.
Nick Roberts <nickrob@snap.net.nz>
parents: 71893
diff changeset
2473 ;; This combination of move-beginning-of-line and beginning-of-line is
9315116570f0 (allout-run-unit-tests-on-load): Rectified docstring grammar.
Nick Roberts <nickrob@snap.net.nz>
parents: 71893
diff changeset
2474 ;; deliberate, but the (beginning-of-line) may now be superfluous.
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2475 (let ((inhibit-field-text-motion t))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2476 (move-beginning-of-line 1)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2477 (beginning-of-line)
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2478 (while (and (not (bobp)) (or (not (bolp)) (allout-hidden-p)))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2479 (beginning-of-line)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2480 (if (or (allout-hidden-p) (not (bolp)))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2481 (forward-char -1)))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2482 ;;;_ > allout-end-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2483 (defun allout-end-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2484 "Move to the end of line, past concealed text if any."
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2485 ;; This is for symmetry with `allout-beginning-of-current-line' --
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2486 ;; `move-end-of-line' doesn't suffer the same problem as
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2487 ;; `move-beginning-of-line'.
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2488 (let ((inhibit-field-text-motion t))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2489 (end-of-line)
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2490 (while (allout-hidden-p)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2491 (end-of-line)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
2492 (if (allout-hidden-p) (forward-char 1)))))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2493 ;;;_ > allout-beginning-of-line ()
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2494 (defun allout-beginning-of-line ()
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2495 "Beginning-of-line with `allout-beginning-of-line-cycles' behavior, if set."
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2496
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2497 (interactive)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2498
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2499 (if (or (not allout-beginning-of-line-cycles)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2500 (not (equal last-command this-command)))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2501 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2502 (if (and (not (bolp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2503 (allout-hidden-p (1- (point))))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2504 (goto-char (allout-previous-single-char-property-change
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2505 (1- (point)) 'invisible)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2506 (move-beginning-of-line 1))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2507 (allout-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2508 (let ((beginning-of-body
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2509 (save-excursion
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2510 (while (and (allout-do-doublecheck)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2511 (allout-aberrant-container-p)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2512 (allout-previous-visible-heading 1)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2513 (allout-beginning-of-current-entry)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2514 (point))))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2515 (cond ((= (current-column) 0)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2516 (goto-char beginning-of-body))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2517 ((< (point) beginning-of-body)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2518 (allout-beginning-of-current-line))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2519 ((= (point) beginning-of-body)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2520 (goto-char (allout-current-bullet-pos)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2521 (t (allout-beginning-of-current-line)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2522 (if (< (point) beginning-of-body)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2523 ;; we were on the headline after its start:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2524 (goto-char beginning-of-body)))))))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2525 ;;;_ > allout-end-of-line ()
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2526 (defun allout-end-of-line ()
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2527 "End-of-line with `allout-end-of-line-cycles' behavior, if set."
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2528
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2529 (interactive)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2530
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2531 (if (or (not allout-end-of-line-cycles)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2532 (not (equal last-command this-command)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2533 (allout-end-of-current-line)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2534 (let ((end-of-entry (save-excursion
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2535 (allout-end-of-entry)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2536 (point))))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2537 (cond ((not (eolp))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2538 (allout-end-of-current-line))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2539 ((or (allout-hidden-p) (save-excursion
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2540 (forward-char -1)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2541 (allout-hidden-p)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2542 (allout-back-to-current-heading)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2543 (allout-show-current-entry)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2544 (allout-show-children)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2545 (allout-end-of-entry))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2546 ((>= (point) end-of-entry)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2547 (allout-back-to-current-heading)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2548 (allout-end-of-current-line))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2549 (t
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2550 (if (not (allout-mark-active-p))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2551 (push-mark))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2552 (allout-end-of-entry))))))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2553 ;;;_ > allout-mark-active-p ()
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2554 (defun allout-mark-active-p ()
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2555 "True if the mark is currently or always active."
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2556 ;; `(cond (boundp...))' (or `(if ...)') invokes special byte-compiler
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2557 ;; provisions, at least in fsf emacs to prevent warnings about lack of,
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2558 ;; eg, region-active-p.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2559 (cond ((boundp 'mark-active)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2560 mark-active)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2561 ((fboundp 'region-active-p)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2562 (region-active-p))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2563 (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
2564 ;;;_ > 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
2565 (defsubst allout-next-heading ()
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2566 "Move to the heading for the topic (possibly invisible) after this one.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2567
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2568 Returns the location of the heading, or nil if none found.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2569
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
2570 We skip anomalous low-level topics, a la `allout-aberrant-container-p'."
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2571 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2572
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2573 (if (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2574 (forward-char 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2575
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2576 (when (re-search-forward allout-line-boundary-regexp nil 0)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2577 (allout-prefix-data)
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2578 (goto-char allout-recent-prefix-beginning)
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2579 (while (not (bolp))
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2580 (forward-char -1))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2581 (and (allout-do-doublecheck)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2582 ;; this will set allout-recent-* on the first non-aberrant topic,
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2583 ;; whether it's the current one or one that disqualifies it:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2584 (allout-aberrant-container-p))
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
2585 ;; this may or may not be the same as above depending on doublecheck:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2586 (goto-char allout-recent-prefix-beginning))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2587 ;;;_ > allout-this-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
2588 (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
2589 "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
2590 ;; 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
2591 ;; and usable by allout-mode.
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2592 (if (not (allout-goto-prefix-doublechecked)) (allout-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
2593 ;;;_ > allout-previous-heading ()
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
2594 (defun allout-previous-heading ()
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2595 "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
2596
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2597 Return the location of the beginning of the heading, or nil if not found.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2598
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
2599 We skip anomalous low-level topics, a la `allout-aberrant-container-p'."
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2600
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2601 (if (bobp)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2602 nil
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2603 (let ((start-point (point)))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2604 ;; allout-goto-prefix-doublechecked calls us, so we can't use it here.
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2605 (allout-goto-prefix)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2606 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2607 (when (or (re-search-backward allout-line-boundary-regexp nil 0)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2608 (looking-at allout-bob-regexp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2609 (goto-char (allout-prefix-data))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2610 (if (and (allout-do-doublecheck)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2611 (allout-aberrant-container-p))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2612 (or (allout-previous-heading)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2613 (and (goto-char start-point)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2614 ;; recalibrate allout-recent-*:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2615 (allout-depth)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2616 nil))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2617 (point)))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2618 ;;;_ > allout-get-invisibility-overlay ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2619 (defun allout-get-invisibility-overlay ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2620 "Return the overlay at point that dictates allout invisibility."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2621 (let ((overlays (overlays-at (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2622 got)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2623 (while (and overlays (not got))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2624 (if (equal (overlay-get (car overlays) 'invisible) 'allout)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2625 (setq got (car overlays))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2626 (pop overlays)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2627 got))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2628 ;;;_ > allout-back-to-visible-text ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2629 (defun allout-back-to-visible-text ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2630 "Move to most recent prior character that is visible, and return point."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2631 (if (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2632 (goto-char (overlay-start (allout-get-invisibility-overlay))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2633 (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2634
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2635 ;;;_ - Subtree Charting
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2636 ;;;_ " 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
2637 ;;; 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
2638 ;;;
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2639 ;;; Charts enable efficient subtree navigation by providing a reusable basis
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2640 ;;; for elaborate, compound assessment and adjustment of a subtree.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2641
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2642 ;;;_ > allout-chart-subtree (&optional levels visible orig-depth prev-depth)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2643 (defun allout-chart-subtree (&optional levels visible orig-depth prev-depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2644 "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
2645
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2646 Optional argument LEVELS specifies a depth limit (relative to start
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2647 depth) for the chart. Null LEVELS means no limit.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2648
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2649 When optional argument VISIBLE is non-nil, the chart includes
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2650 only the visible subelements of the charted subjects.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2651
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2652 The remaining optional args are for internal use by the function.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2653
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2654 Point is left at the end of the subtree.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2655
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2656 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
2657 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
2658 for their elaborate manipulations.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2659
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2660 The chart entries for the topics are in reverse order, so the
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2661 last topic is listed first. The entry for each topic consists of
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2662 an integer indicating the point at the beginning of the topic
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2663 prefix. Charts for offspring consists of a list containing,
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2664 recursively, the charts for the respective subtopics. The chart
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2665 for a topics' offspring precedes the entry for the topic itself.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2666
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2667 The other function parameters are for internal recursion, and should
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2668 not be specified by external callers. ORIG-DEPTH is depth of topic at
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2669 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
2670
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2671 (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
2672 chart curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2673
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2674 (if original ; Just starting?
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2675 ; Register initial settings and
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2676 ; 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
2677 (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
2678 (or prev-depth (setq prev-depth (1+ orig-depth)))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2679 (if visible
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2680 (allout-next-visible-heading 1)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2681 (allout-next-heading))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2682
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2683 ;; 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
2684 ;; 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
2685 ;; the typically quite constrained Emacs max-lisp-eval-depth.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2686 ;;
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2687 ;; 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
2688 ;; operation rather than recursing for lower levels. Bah.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2689
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2690 (while (and (not (eobp))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2691 ; Still within original topic?
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2692 (< 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
2693 (cond ((= prev-depth curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2694 ;; Register this one and move on:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2695 (setq chart (cons allout-recent-prefix-beginning chart))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2696 (if (and levels (<= levels 1))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2697 ;; 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
2698 (or (allout-next-sibling curr-depth)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2699 ;; or no more siblings -- proceed to
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2700 ;; 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
2701 (while (and (<= curr-depth
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2702 allout-recent-depth)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2703 (if visible
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2704 (allout-next-visible-heading 1)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2705 (allout-next-heading)))))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2706 (if visible
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2707 (allout-next-visible-heading 1)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2708 (allout-next-heading))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2709
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2710 ((and (< prev-depth curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2711 (or (not levels)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2712 (> levels 0)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2713 ;; 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
2714 (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
2715 (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
2716 (1- levels))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2717 visible
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2718 orig-depth
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2719 curr-depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2720 chart))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2721 ;; ... then continue with this one.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2722 )
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2723
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2724 ;; ... 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
2725
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2726 )))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2727
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2728 (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
2729 ; the original level. Position
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2730 ; to the end of it:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2731 (progn (and (not (eobp)) (forward-char -1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2732 (and (= (preceding-char) ?\n)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2733 (= (aref (buffer-substring (max 1 (- (point) 3))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2734 (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2735 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2736 ?\n)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2737 (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
2738 (setq allout-recent-end-of-subtree (point))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2739
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2740 chart ; (nreverse chart) not necessary,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2741 ; and maybe not preferable.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2742 ))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2743 ;;;_ > 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
2744 (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
2745 "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
2746 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
2747 for an explanation of charts."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2748 (save-excursion
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2749 (when (allout-goto-prefix-doublechecked)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2750 (let ((chart (list (point))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2751 (while (allout-next-sibling)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2752 (setq chart (cons (point) chart)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2753 (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
2754 ;;;_ > 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
2755 (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
2756
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2757 "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
2758
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2759 If DEPTH is nil, include hidden points at any depth.
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2760
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2761 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
2762 start point."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2763
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2764 (let (result here)
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2765 (while (and (or (null depth) (> depth 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2766 chart)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2767 (setq here (car chart))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2768 (if (listp here)
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2769 (let ((further (allout-chart-to-reveal here (if (null depth)
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2770 depth
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2771 (1- depth)))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
2772 ;; We're on the start of a subtree -- recurse with it, if there's
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2773 ;; more depth to go:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2774 (if further (setq result (append further result)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2775 (setq chart (cdr chart)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2776 (goto-char here)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2777 (if (allout-hidden-p)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2778 (setq result (cons here result)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2779 (setq chart (cdr chart))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2780 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
2781 ;;;_ 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
2782 ;; (defun allout-chart-spec (chart spec &optional exposing)
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2783 ;; "Not yet (if ever) implemented.
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2784
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2785 ;; 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
2786
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2787 ;; 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
2788 ;; 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
2789 ;; 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
2790 ;; 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
2791 ;; 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
2792 ;; 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
2793
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2794 ;; 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
2795 ;; 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
2796 ;; exposed reside.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2797
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2798 ;; - 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
2799 ;; 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
2800 ;; 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
2801 ;; - 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
2802 ;; opened.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2803 ;; - Lists signify the beginning and end points of regions that should
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2804 ;; be flagged, and the flag to employ. (For concealment: `(\?r)', and
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2805 ;; exposure:"
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2806 ;; (while spec
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2807 ;; (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
2808 ;; )
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2809 ;; )
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2810 ;; (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
2811 ;; )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2812
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2813 ;;;_ - 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
2814 ;;;_ > 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
2815 (defun allout-goto-prefix ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2816 "Put point at beginning of immediately containing outline topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2817
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2818 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
2819
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2820 Not sensitive to topic visibility.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2821
46161
29f1f32aee5b (outline-goto-prefix): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 44182
diff changeset
2822 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
2823
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2824 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2825 (let (done)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2826 (while (and (not done)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2827 (search-backward "\n" nil 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2828 (forward-char 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2829 (if (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2830 (setq done (allout-prefix-data))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2831 (forward-char -1)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2832 (if (bobp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2833 (cond ((looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2834 (allout-prefix-data))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2835 ((allout-next-heading))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2836 (done))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2837 done))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2838 ;;;_ > allout-goto-prefix-doublechecked ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2839 (defun allout-goto-prefix-doublechecked ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2840 "Put point at beginning of immediately containing outline topic.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2841
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2842 Like `allout-goto-prefix', but shallow topics (according to
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2843 `allout-doublecheck-at-and-shallower') are checked and
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2844 disqualified for child containment discontinuity, according to
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
2845 `allout-aberrant-container-p'."
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2846 (if (allout-goto-prefix)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2847 (if (and (allout-do-doublecheck)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2848 (allout-aberrant-container-p))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2849 (allout-previous-heading)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2850 (point))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2851
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2852 ;;;_ > 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
2853 (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
2854 "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
2855
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2856 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
2857 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
2858
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2859 (if (not (allout-goto-prefix-doublechecked))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2860 nil
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2861 (goto-char allout-recent-prefix-end)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2862 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2863 (if ignore-decorations
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2864 t
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2865 (while (looking-at "[0-9]") (forward-char 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
2866 (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2867 ;; 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
2868 (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
2869 ;;;_ > 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
2870 (defun allout-current-bullet-pos ()
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
2871 "Return position of current (visible) topic's bullet."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2872
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
2873 (if (not (allout-current-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2874 nil
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
2875 (1- allout-recent-prefix-end)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2876 ;;;_ > allout-back-to-current-heading (&optional interactive)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2877 (defun allout-back-to-current-heading (&optional interactive)
73315
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2878 "Move to heading line of current topic, or beginning if not in a topic.
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2879
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2880 If interactive, we position at the end of the prefix.
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2881
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2882 Return value of resulting point, unless we started outside
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2883 of (before any) topics, in which case we return nil."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2884
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2885 (interactive "p")
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2886
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2887 (allout-beginning-of-current-line)
73315
df3186ae0953 * allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents: 73201
diff changeset
2888 (let ((bol-point (point)))
112129
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2889 (when (allout-goto-prefix-doublechecked)
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2890 (if (<= (point) bol-point)
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2891 (progn
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2892 (setq bol-point (point))
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2893 (allout-beginning-of-current-line)
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2894 (if (not (= bol-point (point)))
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2895 (if (looking-at allout-regexp)
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2896 (allout-prefix-data)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2897 (if interactive
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
2898 (allout-end-of-prefix)
112129
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2899 (point)))
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2900 (goto-char (point-min))
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
2901 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
2902 ;;;_ > 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
2903 (defalias 'allout-back-to-heading 'allout-back-to-current-heading)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2904 ;;;_ > allout-pre-next-prefix ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2905 (defun allout-pre-next-prefix ()
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2906 "Skip forward to just before the next heading line.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2907
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2908 Returns that character position."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2909
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
2910 (if (allout-next-heading)
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
2911 (goto-char (1- allout-recent-prefix-beginning))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2912 ;;;_ > allout-end-of-subtree (&optional current include-trailing-blank)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2913 (defun allout-end-of-subtree (&optional current include-trailing-blank)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2914 "Put point at the end of the last leaf in the containing topic.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2915
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2916 Optional CURRENT means put point at the end of the containing
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2917 visible topic.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2918
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2919 Optional INCLUDE-TRAILING-BLANK means include a trailing blank line, if
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2920 any, as part of the subtree. Otherwise, that trailing blank will be
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2921 excluded as delimiting whitespace between topics.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2922
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2923 Returns the value of point."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2924 (interactive "P")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2925 (if current
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2926 (allout-back-to-current-heading)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2927 (allout-goto-prefix-doublechecked))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2928 (let ((level allout-recent-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
2929 (allout-next-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2930 (while (and (not (eobp))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2931 (> allout-recent-depth 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
2932 (allout-next-heading))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2933 (if (eobp)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2934 (allout-end-of-entry)
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
2935 (forward-char -1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2936 (if (and (not include-trailing-blank) (= ?\n (preceding-char)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2937 (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
2938 (setq allout-recent-end-of-subtree (point))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2939 ;;;_ > allout-end-of-current-subtree (&optional include-trailing-blank)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2940 (defun allout-end-of-current-subtree (&optional include-trailing-blank)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2941
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2942 "Put point at end of last leaf in currently visible containing topic.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2943
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2944 Optional INCLUDE-TRAILING-BLANK means include a trailing blank line, if
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2945 any, as part of the subtree. Otherwise, that trailing blank will be
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2946 excluded as delimiting whitespace between topics.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2947
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2948 Returns the value of point."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2949 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2950 (allout-end-of-subtree t include-trailing-blank))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2951 ;;;_ > allout-beginning-of-current-entry (&optional interactive)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2952 (defun allout-beginning-of-current-entry (&optional interactive)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2953 "When not already there, position point at beginning of current topic header.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2954
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2955 If already there, move cursor to bullet for hot-spot operation.
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2956 \(See `allout-mode' doc string for details of hot-spot operation.)"
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2957 (interactive "p")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2958 (let ((start-point (point)))
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2959 (move-beginning-of-line 1)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2960 (if (< 0 (allout-current-depth))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2961 (goto-char allout-recent-prefix-end)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
2962 (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
2963 (allout-end-of-prefix)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
2964 (if (and interactive
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2965 (= (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
2966 (goto-char (allout-current-bullet-pos)))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2967 ;;;_ > allout-end-of-entry (&optional inclusive)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2968 (defun allout-end-of-entry (&optional inclusive)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2969 "Position the point at the end of the current topics' entry.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2970
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2971 Optional INCLUSIVE means also include trailing empty line, if any. When
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2972 unset, whitespace between items separates them even when the items are
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2973 collapsed."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2974 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2975 (allout-pre-next-prefix)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2976 (if (and (not inclusive) (not (bobp)) (= ?\n (preceding-char)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2977 (forward-char -1))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2978 (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
2979 ;;;_ > 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
2980 (defun allout-end-of-current-heading ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2981 (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
2982 (allout-beginning-of-current-entry)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2983 (search-forward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2984 (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
2985 (defalias 'allout-end-of-heading 'allout-end-of-current-heading)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2986 ;;;_ > allout-get-body-text ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2987 (defun allout-get-body-text ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2988 "Return the unmangled body text of the topic immediately containing point."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2989 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2990 (allout-end-of-prefix)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2991 (if (not (search-forward "\n" nil t))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2992 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2993 (backward-char 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2994 (let ((pre-body (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2995 (if (not pre-body)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2996 nil
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2997 (allout-end-of-entry t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2998 (if (not (= pre-body (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2999 (buffer-substring-no-properties (1+ pre-body) (point))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3000 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3001 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3002 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3003 )
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3004
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3005 ;;;_ - 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
3006 ;;;_ > 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
3007 (defun allout-ascend-to-depth (depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3008 "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
3009 (if (and (> depth 0)(<= depth (allout-depth)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3010 (let (last-ascended)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3011 (while (and (< depth allout-recent-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3012 (setq last-ascended (allout-ascend))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3013 (goto-char allout-recent-prefix-beginning)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3014 (if (allout-called-interactively-p) (allout-end-of-prefix))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3015 (and last-ascended allout-recent-depth))))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3016 ;;;_ > allout-ascend (&optional dont-move-if-unsuccessful)
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3017 (defun allout-ascend (&optional dont-move-if-unsuccessful)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3018 "Ascend one level, returning resulting depth if successful, nil if not.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3019
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3020 Point is left at the beginning of the level whether or not
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3021 successful, unless optional DONT-MOVE-IF-UNSUCCESSFUL is set, in
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3022 which case point is returned to its original starting location."
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3023 (if dont-move-if-unsuccessful
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3024 (setq dont-move-if-unsuccessful (point)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3025 (prog1
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3026 (if (allout-beginning-of-level)
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
3027 (let ((bolevel (point))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
3028 (bolevel-depth allout-recent-depth))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
3029 (allout-previous-heading)
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3030 (cond ((< allout-recent-depth bolevel-depth)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3031 allout-recent-depth)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3032 ((= allout-recent-depth bolevel-depth)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3033 (if dont-move-if-unsuccessful
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3034 (goto-char dont-move-if-unsuccessful))
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3035 (allout-depth)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3036 nil)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3037 (t
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3038 ;; some topic after very first is lower depth than first:
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3039 (goto-char bolevel)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3040 (allout-depth)
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3041 nil))))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3042 (if (allout-called-interactively-p) (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
3043 ;;;_ > 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
3044 (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
3045 "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
3046
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3047 Returning depth if successful, nil if not."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3048 (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
3049 (start-depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3050 (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
3051 (and (> (allout-depth) 0)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3052 (not (= depth allout-recent-depth)) ; ... not there yet
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 (allout-next-heading) ; ... go further
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3054 (< start-depth allout-recent-depth))) ; ... still in 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
3055 (if (and (> (allout-depth) 0)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3056 (= allout-recent-depth depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3057 depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3058 (goto-char start-point)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3059 nil))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3060 )
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3061 ;;;_ > allout-up-current-level (arg)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3062 (defun allout-up-current-level (arg)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3063 "Move out ARG levels from current visible topic."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3064 (interactive "p")
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
3065 (let ((start-point (point)))
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
3066 (allout-back-to-current-heading)
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
3067 (if (not (allout-ascend))
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
3068 (progn (goto-char start-point)
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
3069 (error "Can't ascend past outermost level"))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3070 (if (allout-called-interactively-p) (allout-end-of-prefix))
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
3071 allout-recent-prefix-beginning)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3072
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3073 ;;;_ - 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
3074 ;;;_ > 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
3075 (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
3076 "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
3077
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3078 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
3079
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3080 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
3081
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3082 Return the start point of the new topic if successful, nil otherwise."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3083
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3084 (if (if backward (bobp) (eobp))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3085 nil
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3086 (let ((target-depth (or depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3087 (start-point (point))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
3088 (start-prefix-beginning allout-recent-prefix-beginning)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3089 (count 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3090 leaping
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3091 last-depth)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3092 (while (and
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3093 ;; done too few single steps to resort to the leap routine:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3094 (not leaping)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3095 ;; not at limit:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3096 (not (if backward (bobp) (eobp)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3097 ;; still traversable:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3098 (if backward (allout-previous-heading) (allout-next-heading))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3099 ;; we're below the target depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3100 (> (setq last-depth allout-recent-depth) target-depth))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3101 (setq count (1+ count))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3102 (if (> count 7) ; lists are commonly 7 +- 2, right?-)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3103 (setq leaping t)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3104 (cond (leaping
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3105 (or (allout-next-sibling-leap target-depth backward)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3106 (progn
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3107 (goto-char start-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3108 (if depth (allout-depth) target-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3109 nil)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3110 ((and (not (eobp))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3111 (and (> (or last-depth (allout-depth)) 0)
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
3112 (= allout-recent-depth target-depth))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
3113 (not (= start-prefix-beginning
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
3114 allout-recent-prefix-beginning)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3115 allout-recent-prefix-beginning)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3116 (t
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3117 (goto-char start-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3118 (if depth (allout-depth) target-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3119 nil)))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3120 ;;;_ > allout-next-sibling-leap (&optional depth backward)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3121 (defun allout-next-sibling-leap (&optional depth backward)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3122 "Like `allout-next-sibling', but by direct search for topic at depth.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3123
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3124 Traverse at optional DEPTH, or current depth if none specified.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3125
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3126 Go backward if optional arg BACKWARD is non-nil.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3127
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3128 Return the start point of the new topic if successful, nil otherwise.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3129
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3130 Costs more than regular `allout-next-sibling' for short traversals:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3131
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3132 - we have to check the prior (next, if travelling backwards)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3133 item to confirm connectivity with the prior topic, and
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3134 - if confirmed, we have to reestablish the allout-recent-* settings with
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3135 some extra navigation
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3136 - if confirmation fails, we have to do more work to recover
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3137
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3138 It is an increasingly big win when there are many intervening
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3139 offspring before the next sibling, however, so
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3140 `allout-next-sibling' resorts to this if it finds itself in that
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3141 situation."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3142
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3143 (if (if backward (bobp) (eobp))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3144 nil
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3145 (let* ((start-point (point))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3146 (target-depth (or depth (allout-depth)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3147 (search-whitespace-regexp nil)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3148 (depth-biased (- target-depth 2))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3149 (expression (if (<= target-depth 1)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3150 allout-depth-one-regexp
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3151 (format allout-depth-specific-regexp
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3152 depth-biased depth-biased)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3153 found
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3154 done)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3155 (while (not done)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3156 (setq found (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3157 (if backward
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3158 (re-search-backward expression nil 'to-limit)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3159 (forward-char 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3160 (re-search-forward expression nil 'to-limit))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3161 (if (and found (allout-aberrant-container-p))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3162 (setq found nil))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3163 (setq done (or found (if backward (bobp) (eobp)))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3164 (if (not found)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3165 (progn (goto-char start-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3166 nil)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3167 ;; rationale: if any intervening items were at a lower depth, we
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3168 ;; would now be on the first offspring at the target depth -- ie,
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3169 ;; the preceeding item (per the search direction) must be at a
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3170 ;; lesser depth. that's all we need to check.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3171 (if backward (allout-next-heading) (allout-previous-heading))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3172 (if (< allout-recent-depth target-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3173 ;; return to start and reestablish allout-recent-*:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3174 (progn
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3175 (goto-char start-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3176 (allout-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3177 nil)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3178 (goto-char found)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3179 ;; locate cursor and set allout-recent-*:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3180 (allout-goto-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
3181 ;;;_ > 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
3182 (defun allout-previous-sibling (&optional depth backward)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3183 "Like `allout-forward-current-level' backwards, respecting invisible topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3184
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3185 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
3186
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3187 Optional BACKWARD reverses direction.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3188
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3189 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
3190 (allout-next-sibling depth (not backward))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3191 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3192 ;;;_ > 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
3193 (defun allout-snug-back ()
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
3194 "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
3195
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3196 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
3197 (if (or (bobp) (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3198 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3199 (forward-char -1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3200 (if (or (bobp) (not (= ?\n (preceding-char))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3201 nil
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3202 (forward-char -1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3203 (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
3204 ;;;_ > 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
3205 (defun allout-beginning-of-level ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3206 "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
3207 (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
3208 ;;;_ > 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
3209 (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
3210 "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
3211
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3212 (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
3213 (while (allout-previous-sibling depth nil))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3214 (prog1 allout-recent-depth
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3215 (if (allout-called-interactively-p) (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
3216 ;;;_ > 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
3217 (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
3218 "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
3219
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3220 Move to buffer limit in indicated direction if headings are exhausted."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3221
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3222 (interactive "p")
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
3223 (let* ((inhibit-field-text-motion t)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
3224 (backward (if (< arg 0) (setq arg (* -1 arg))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3225 (step (if backward -1 1))
112119
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3226 (progress (allout-current-bullet-pos))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3227 prev got)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3228
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3229 (while (> arg 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3230 (while (and
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3231 ;; Boundary condition:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3232 (not (if backward (bobp)(eobp)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3233 ;; Move, skipping over all concealed lines in one fell swoop:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3234 (prog1 (condition-case nil (or (line-move step) t)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3235 (error nil))
112119
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3236 (allout-beginning-of-current-line)
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3237 ;; line-move can wind up on the same line if long.
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3238 ;; when moving forward, that would yield no-progress
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3239 (when (and (not backward)
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3240 (<= (point) progress))
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3241 ;; ensure progress by doing line-move from end-of-line:
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3242 (end-of-line)
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3243 (condition-case nil (or (line-move step) t)
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3244 (error nil))
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3245 (allout-beginning-of-current-line)
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
3246 (setq progress (point))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3247 ;; Deal with apparent header line:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3248 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3249 (if (not (looking-at allout-regexp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3250 ;; not a header line, keep looking:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3251 t
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3252 (allout-prefix-data)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3253 (if (and (allout-do-doublecheck)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3254 (allout-aberrant-container-p))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3255 ;; skip this aberrant prospective header line:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3256 t
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
3257 ;; this prospective headerline qualifies -- register:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3258 (setq got allout-recent-prefix-beginning)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3259 ;; and break the loop:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3260 nil)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3261 ;; 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
3262 (if got (setq prev got))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3263 (setq arg (1- arg)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3264 (cond (got ; Last move was to a prefix:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3265 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3266 (prev ; Last move wasn't, but prev was:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3267 (goto-char prev)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3268 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3269 ((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
3270 ;;;_ > 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
3271 (defun allout-previous-visible-heading (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3272 "Move to the previous heading line.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3273
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3274 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
3275 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
3276 matches)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3277 (interactive "p")
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3278 (prog1 (allout-next-visible-heading (- arg))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3279 (if (allout-called-interactively-p) (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
3280 ;;;_ > allout-forward-current-level (arg)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3281 (defun allout-forward-current-level (arg)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3282 "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
3283
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3284 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
3285
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3286 Returns resulting position, else nil if none found."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3287 (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
3288 (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
3289 (start-arg arg)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3290 (backward (> 0 arg)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3291 (if (= 0 start-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3292 (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
3293 (if backward (setq arg (* -1 arg)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3294 (allout-back-to-current-heading)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3295 (while (and (not (zerop arg))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3296 (if backward
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3297 (allout-previous-sibling)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3298 (allout-next-sibling)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3299 (setq arg (1- arg)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3300 (if (not (allout-called-interactively-p))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3301 nil
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3302 (allout-end-of-prefix)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3303 (if (not (zerop arg))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3304 (error "Hit %s level %d topic, traversed %d of %d requested"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3305 (if backward "first" "last")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3306 allout-recent-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3307 (- (abs start-arg) arg)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3308 (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
3309 ;;;_ > allout-backward-current-level (arg)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3310 (defun allout-backward-current-level (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
3311 "Inverse of `allout-forward-current-level'."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3312 (interactive "p")
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3313 (if (allout-called-interactively-p)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3314 (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
3315 (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
3316 (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
3317
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3318 ;;;_ #5 Alteration
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3319
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3320 ;;;_ - 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
3321 ;;;_ = 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
3322 (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
3323 "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
3324
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3325 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
3326 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
3327 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
3328 are mapped to the command of the corresponding control-key on the
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3329 `allout-mode-map-value'.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3330 (make-variable-buffer-local 'allout-post-goto-bullet)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3331 ;;;_ = allout-command-counter
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3332 (defvar allout-command-counter 0
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3333 "Counter that monotonically increases in allout-mode buffers.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3334
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3335 Set by `allout-pre-command-business', to support allout addons in
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3336 coordinating with allout activity.")
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3337 (make-variable-buffer-local 'allout-command-counter)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3338 ;;;_ > 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
3339 (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
3340 "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
3341
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3342 - 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
3343 outline commands.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3344
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3345 - Decrypt topic currently being edited if it was encrypted for a save."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3346
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3347 ; 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
3348 (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
3349 nil
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3350
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3351 (if (and (boundp 'allout-after-save-decrypt)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3352 allout-after-save-decrypt)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3353 (allout-after-saves-handler))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3354
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3355 ;; Implement allout-post-goto-bullet, if 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
3356 (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
3357 (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
3358 (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
3359 (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
3360 ))
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 ;;;_ > 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
3362 (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
3363 "Outline `pre-command-hook' function for outline buffers.
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3364
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3365 Among other things, implements special behavior when the cursor is on the
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3366 topic bullet character.
49962
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
3367
112387
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3368 When the cursor is on the bullet character, self-insert
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3369 characters are reinterpreted as the corresponding
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3370 control-character in the `allout-mode-map-value'. The
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3371 `allout-mode' `post-command-hook' insures that the cursor which
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3372 has moved as a result of such reinterpretation is positioned on
ac3e3168aca2 allout.el: Summary - migrate to defining allout mode using
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112284
diff changeset
3373 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
3374
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3375 The upshot is that you can get easy, single (ie, unmodified) key
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3376 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
3377 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
3378 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
3379 return to regular interpretation of self-insert characters."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3380
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3381 (if (not (allout-mode-p))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3382 nil
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3383 ;; Increment allout-command-counter
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3384 (setq allout-command-counter (1+ allout-command-counter))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
3385 ;; Do hot-spot navigation.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3386 (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
3387 (eq (point)(allout-current-bullet-pos)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3388 (allout-hotspot-key-handler))))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3389 ;;;_ > allout-hotspot-key-handler ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3390 (defun allout-hotspot-key-handler ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3391 "Catchall handling of key bindings in hot-spots.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3392
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3393 Translates unmodified keystrokes to corresponding allout commands, when
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3394 they would qualify if prefixed with the allout-command-prefix, and sets
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3395 this-command accordingly.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3396
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3397 Returns the qualifying command, if any, else nil."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3398 (interactive)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3399 (let* ((modified (event-modifiers last-command-event))
101010
4efc7ca085ce Replace last-command-char with last-command-event.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
3400 (key-num (cond ((numberp last-command-event) last-command-event)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3401 ;; for XEmacs character type:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3402 ((and (fboundp 'characterp)
101010
4efc7ca085ce Replace last-command-char with last-command-event.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
3403 (apply 'characterp (list last-command-event)))
4efc7ca085ce Replace last-command-char with last-command-event.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
3404 (apply 'char-to-int (list last-command-event)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3405 (t 0)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3406 mapped-binding)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3407
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3408 (if (zerop key-num)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3409 nil
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3410
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3411 (if (and
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3412 ;; exclude control chars and escape:
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3413 (not modified)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3414 (<= 33 key-num)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3415 (setq mapped-binding
112388
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3416 (or
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3417 ;; try control-modified versions of keys:
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3418 (key-binding (vconcat allout-command-prefix
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3419 (vector
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3420 (if (and (<= 97 key-num) ; "a"
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3421 (>= 122 key-num)) ; "z"
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3422 (- key-num 96) key-num)))
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3423 t)
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3424 ;; try non-modified versions of keys:
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3425 (key-binding (vconcat allout-command-prefix
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3426 (vector key-num))
e5e8faa33346 (allout-institute-keymap): Use fset instead of reapplying defalias.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112387
diff changeset
3427 t))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3428 ;; Qualified as an allout command -- do hot-spot operation.
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3429 (setq allout-post-goto-bullet t)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3430 ;; accept-defaults nil, or else we get allout-item-icon-key-handler.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3431 (setq mapped-binding (key-binding (vector key-num))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3432
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3433 (while (keymapp mapped-binding)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3434 (setq mapped-binding
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3435 (lookup-key mapped-binding (vector (read-char)))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3436
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3437 (when mapped-binding
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3438 (setq this-command mapped-binding)))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3439
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3440 ;;;_ > 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
3441 (defun allout-find-file-hook ()
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
3442 "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-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
3443
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3444 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
3445 (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
3446 (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
3447 allout-layout)
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
3448 (allout-mode)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3449
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3450 ;;;_ - 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
3451 ;;;_ > 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
3452 (defun allout-solicit-alternate-bullet (depth &optional current-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3453
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3454 "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
3455
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3456 Offer one suitable for current depth DEPTH as default."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3457
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3458 (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
3459 (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
3460 (sans-escapes (regexp-sans-escapes allout-bullets-string))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3461 choice)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3462 (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
3463 (goto-char (allout-current-bullet-pos))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3464 (setq choice (solicit-char-in-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3465 (format "Select bullet: %s ('%s' default): "
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3466 sans-escapes
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
3467 (allout-substring-no-properties default-bullet))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3468 sans-escapes
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3469 t)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3470 (message "")
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3471 (if (string= choice "") default-bullet choice))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3472 )
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-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
3474 (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
3475 "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
3476 (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
3477 ;;;_ > 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
3478 (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
3479 "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
3480 (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
3481 (string= allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3482 (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
3483 (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
3484 (allout-get-bullet)))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3485 ;;;_ > allout-encrypted-type-prefix (&optional prefix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3486 (defun allout-encrypted-type-prefix (&optional prefix)
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3487 "True if current header prefix bullet is for an encrypted entry (body)."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3488 (and allout-topic-encryption-bullet
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3489 (string= allout-topic-encryption-bullet
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3490 (if prefix
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3491 (allout-get-prefix-bullet prefix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3492 (allout-get-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
3493 ;;;_ > 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
3494 (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
3495 "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
3496 ;; 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
3497 (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
3498 (char-to-string (aref allout-plain-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3499 (% (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
3500 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
3501 allout-primary-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3502 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3503
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3504 ;;;_ - 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
3505 ;;;_ > 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
3506 (defun allout-make-topic-prefix (&optional prior-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3507 new
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3508 depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3509 solicit
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3510 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3511 index)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3512 ;; 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
3513 ;; 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
3514 ;; changing level of current topic.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3515 ;; Solicit dominates specified bullet-char.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3516 ;;;_ . Doc string:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3517 "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
3518
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3519 All the arguments are optional.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3520
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3521 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
3522 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
3523 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
3524 for instance.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3525
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3526 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
3527 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
3528 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
3529 sibling is one. The implication otherwise is that the current topic
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3530 is being adjusted -- shifted or rebulleted -- and we don't consider
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3531 bullet or previous sibling.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3532
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3533 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
3534 the current topics' depth.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3535
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3536 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
3537 user. If it's a character, then that character is offered as the
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3538 default, otherwise the one suited to the context (according to
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3539 distinction or depth) is offered. (This overrides other options,
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3540 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
3541 context-specific bullet is used.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3542
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3543 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
3544 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
3545 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
3546 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
3547
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3548 \(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
3549
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3550 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
3551 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
3552 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
3553 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
3554 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
3555 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
3556 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
3557 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
3558 index for each successive sibling)."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3559 ;;;_ . Code:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3560 ;; The options are ordered in likely frequence of use, most common
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3561 ;; highest, least lowest. Ie, more likely to be doing prefix
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3562 ;; adjustments than soliciting, and yet more than numbering.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3563 ;; Current prefix is least dominant, but most likely to be commonly
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3564 ;; specified...
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3565
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3566 (let* (body
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3567 numbering
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3568 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
3569 (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
3570 (header-lead allout-header-prefix)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3571 (bullet-char
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3572
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3573 ;; Getting value for bullet char is practically the whole job:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3574
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3575 (cond
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3576 ; 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
3577 ((<= depth 1) (setq header-lead "") allout-primary-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3578 ; 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
3579 (allout-old-style-prefixes
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3580 ;; Cheat -- make body the whole thing, null out header-lead and
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3581 ;; bullet-char:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3582 (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
3583 (string-to-char allout-primary-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3584 (setq header-lead "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3585 "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3586
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3587 ;; (Neither level 1 nor old-style, so we're space padding.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3588 ;; 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
3589
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3590 ;; Solicitation overrides numbering and other cases:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3591 ((progn (setq body (make-string (- depth 2) ?\ ))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3592 ;; The actual condition:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3593 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
3594 (let* ((got (allout-solicit-alternate-bullet depth solicit)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3595 ;; 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
3596 (setq numbering (and allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3597 (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
3598 (string= got allout-numbered-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3599 ;; Now return what we got, regardless:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3600 got))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3601
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3602 ;; 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
3603 ((and allout-numbered-bullet number-control)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3604 (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
3605 allout-numbered-bullet
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3606 (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
3607 (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
3608 prior-bullet)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3609 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
3610 (allout-bullet-for-depth depth))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3611
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3612 ;;; Neither soliciting nor controlled numbering ;;;
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3613 ;;; (may be controlled denumbering, tho) ;;;
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3614
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3615 ;; Check wrt previous sibling:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3616 ((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
3617 (<= 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
3618 allout-numbered-bullet ; ... & numbering enabled
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3619 (not denumbering)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3620 (let ((sibling-bullet
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3621 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3622 ;; 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
3623 (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
3624 (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
3625 (allout-get-bullet))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3626 (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
3627 (string= allout-numbered-bullet sibling-bullet))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3628 (setq numbering sibling-bullet)))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3629
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3630 ;; Distinctive prior bullet?
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3631 ((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
3632 (allout-distinctive-bullet prior-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3633 ;; 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
3634 (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
3635 (string= prior-bullet allout-numbered-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3636 ;; or numbered, and not denumbering:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3637 (setq numbering (not denumbering)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3638 ;; Here 'tis:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3639 prior-bullet))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3640
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3641 ;; 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
3642 ((allout-bullet-for-depth depth)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3643
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3644 (concat header-lead
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3645 body
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3646 bullet-char
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3647 (if numbering
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3648 (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
3649 (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
3650 ((allout-sibling-index))))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3651 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3652 )
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3653 ;;;_ > allout-open-topic (relative-depth &optional before offer-recent-bullet)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3654 (defun allout-open-topic (relative-depth &optional before offer-recent-bullet)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3655 "Open a new topic at depth DEPTH.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3656
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3657 New topic is situated after current one, unless optional flag BEFORE
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3658 is non-nil, or unless current line is completely empty -- lacking even
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3659 whitespace -- in which case open is done on the current line.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3660
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3661 When adding an offspring, it will be added immediately after the parent if
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3662 the other offspring are exposed, or after the last child if the offspring
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3663 are hidden. (The intervening offspring will be exposed in the latter
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3664 case.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3665
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3666 If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3667
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3668 Nuances:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3669
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3670 - 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
3671 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
3672
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3673 - 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
3674 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
3675 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
3676 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
3677 deliberately dividing topic bodies.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3678
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3679 - 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
3680 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
3681 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
3682 single-spacing is used.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3683
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3684 - 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
3685 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
3686 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
3687 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
3688 from there."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3689
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3690 (allout-beginning-of-current-line)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3691 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3692 (let* ((inhibit-field-text-motion t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3693 (depth (+ (allout-current-depth) relative-depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3694 (opening-on-blank (if (looking-at "^\$")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3695 (not (setq before nil))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3696 ;; bunch o vars set while computing ref-topic
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3697 opening-numbered
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3698 ref-depth
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3699 ref-bullet
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3700 (ref-topic (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3701 (cond ((< relative-depth 0)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3702 (allout-ascend-to-depth depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3703 ((>= relative-depth 1) nil)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3704 (t (allout-back-to-current-heading)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3705 (setq ref-depth allout-recent-depth)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3706 (setq ref-bullet
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3707 (if (> allout-recent-prefix-end 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3708 (allout-recent-bullet)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3709 ""))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3710 (setq opening-numbered
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3711 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3712 (and allout-numbered-bullet
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3713 (or (<= relative-depth 0)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3714 (allout-descend-to-depth depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3715 (if (allout-numbered-type-prefix)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3716 allout-numbered-bullet))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3717 (point)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3718 dbl-space
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3719 doing-beginning
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3720 start end)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3721
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3722 (if (not opening-on-blank)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3723 ; Positioning and vertical
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3724 ; padding -- only if not
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3725 ; opening-on-blank:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3726 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3727 (goto-char ref-topic)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3728 (setq dbl-space ; Determine double space action:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3729 (or (and (<= relative-depth 0) ; not descending;
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3730 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3731 ;; at b-o-b or preceded by a blank line?
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3732 (or (> 0 (forward-line -1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3733 (looking-at "^\\s-*$")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3734 (bobp)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3735 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3736 ;; succeeded by a blank line?
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3737 (allout-end-of-current-subtree)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3738 (looking-at "\n\n")))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3739 (and (= ref-depth 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3740 (or before
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3741 (= depth 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3742 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3743 ;; Don't already have following
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3744 ;; vertical padding:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3745 (not (allout-pre-next-prefix)))))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3746
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3747 ;; Position to prior heading, if inserting backwards, and not
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3748 ;; going outwards:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3749 (if (and before (>= relative-depth 0))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3750 (progn (allout-back-to-current-heading)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3751 (setq doing-beginning (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3752 (if (not (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3753 (allout-previous-heading)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3754 (if (and before (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3755 (open-line 1)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3756
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3757 (if (<= relative-depth 0)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3758 ;; Not going inwards, don't snug up:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3759 (if doing-beginning
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3760 (if (not dbl-space)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3761 (open-line 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3762 (open-line 2))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3763 (if before
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3764 (progn (end-of-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3765 (allout-pre-next-prefix)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3766 (while (and (= ?\n (following-char))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3767 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3768 (forward-char 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3769 (allout-hidden-p)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3770 (forward-char 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3771 (if (not (looking-at "^$"))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3772 (open-line 1)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3773 (allout-end-of-current-subtree)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3774 (if (looking-at "\n\n") (forward-char 1))))
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
3775 ;; Going inwards -- double-space if first offspring is
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3776 ;; double-spaced, otherwise snug up.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3777 (allout-end-of-entry)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3778 (if (eobp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3779 (newline 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3780 (line-move 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3781 (allout-beginning-of-current-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3782 (backward-char 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3783 (if (bolp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3784 ;; Blank lines between current header body and next
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
3785 ;; header -- get to last substantive (non-white-space)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3786 ;; line in body:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3787 (progn (setq dbl-space t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3788 (re-search-backward "[^ \t\n]" nil t)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3789 (if (looking-at "\n\n")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3790 (setq dbl-space t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3791 (if (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3792 (allout-next-heading)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3793 (when (> allout-recent-depth ref-depth)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3794 ;; This is an offspring.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3795 (forward-line -1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3796 (looking-at "^\\s-*$")))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3797 (progn (forward-line 1)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3798 (open-line 1)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3799 (forward-line 1)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3800 (allout-end-of-current-line))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3801
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3802 ;;(if doing-beginning (goto-char doing-beginning))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3803 (if (not (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3804 ;; We insert a newline char rather than using open-line to
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3805 ;; avoid rear-stickiness inheritence of read-only property.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3806 (progn (if (and (not (> depth ref-depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3807 (not before))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3808 (open-line 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3809 (if (and (not dbl-space) (> depth ref-depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3810 (newline 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3811 (if dbl-space
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3812 (open-line 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3813 (if (not before)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3814 (newline 1)))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3815 (if (and dbl-space (not (> relative-depth 0)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3816 (newline 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3817 (if (and (not (eobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3818 (or (not (bolp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3819 (and (not (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3820 ;; bolp doesnt detect concealed
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3821 ;; trailing newlines, compensate:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3822 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3823 (forward-char -1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3824 (allout-hidden-p)))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3825 (forward-char 1))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3826 ))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3827 (setq start (point))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3828 (insert (concat (allout-make-topic-prefix opening-numbered t depth)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3829 " "))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3830 (setq end (1+ (point)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3831
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3832 (allout-rebullet-heading (and offer-recent-bullet ref-bullet)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3833 depth nil nil t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3834 (if (> relative-depth 0)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3835 (save-excursion (goto-char ref-topic)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3836 (allout-show-children)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3837 (end-of-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3838
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3839 (run-hook-with-args 'allout-structure-added-hook start end)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3840 )
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3841 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3842 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3843 ;;;_ > 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
3844 (defun allout-open-subtopic (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3845 "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
3846
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3847 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
3848 prior to the current one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3849 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3850 (allout-open-topic 1 (> 0 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
3851 ;;;_ > 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
3852 (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
3853 "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
3854
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3855 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
3856
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3857 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
3858 one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3859 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3860 (allout-open-topic 0 (> 0 arg) (not (= 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
3861 ;;;_ > 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
3862 (defun allout-open-supertopic (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3863 "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
3864
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3865 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
3866 topic prior to the current one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3867
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3868 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3869 (allout-open-topic -1 (> 0 arg) (< 1 arg)))
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 ;;;_ - Outline Alteration
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3872 ;;;_ : 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
3873 ;;;_ = 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
3874 (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
3875 "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
3876 ;;;_ > 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
3877 (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
3878 "`allout-mode' autofill function.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3879
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3880 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
3881 `allout-use-hanging-indents' is set."
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3882
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3883 (when (not allout-inhibit-auto-fill)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3884 (let ((fill-prefix (if allout-use-hanging-indents
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3885 ;; Check for topic header indentation:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3886 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3887 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3888 (beginning-of-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3889 (if (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3890 ;; ... construct indentation to account for
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3891 ;; length of topic prefix:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3892 (make-string (progn (allout-end-of-prefix)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3893 (current-column))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
3894 ?\ ))))))
112044
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3895 (use-auto-fill-function
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3896 (if (and (eq allout-outside-normal-auto-fill-function
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3897 'allout-auto-fill)
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3898 (eq auto-fill-function 'allout-auto-fill))
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3899 'do-auto-fill
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3900 (or allout-outside-normal-auto-fill-function
38481fb0a538 (allout-auto-fill): Do not infinitely recurse - use do-auto-fill if
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112027
diff changeset
3901 auto-fill-function))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3902 (if (or allout-former-auto-filler allout-use-hanging-indents)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
3903 (funcall use-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
3904 ;;;_ > 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
3905 (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
3906 "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
3907
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3908 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
3909 be accommodated.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3910
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3911 Note that refill of indented paragraphs is not done."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3912
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3913 (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
3914 (allout-end-of-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3915 (let* ((new-margin (current-column))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3916 excess old-indent-begin old-indent-end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3917 ;; 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
3918 ;; *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
3919 ;; 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
3920 (old-margin (+ old-depth (- new-margin new-depth))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3921
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3922 ;; 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
3923 (allout-unprotected
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3924 (save-match-data
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3925 (while
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3926 (and (re-search-forward "\n\\(\\s-*\\)"
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3927 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3928 t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3929 ;; Register the indent data, before we reset the
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3930 ;; 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
3931 (setq old-indent-begin (match-beginning 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3932 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
3933 (not (looking-at allout-regexp)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3934 (if (> 0 (setq excess (- (- old-indent-end old-indent-begin)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3935 old-margin)))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
3936 ;; Text starts left of old margin -- don't adjust:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3937 nil
79940
b113c474ec50 More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79939
diff changeset
3938 ;; Text was hanging at or right of old left margin --
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3939 ;; reindent it, preserving its existing indentation
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3940 ;; beyond the old margin:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3941 (delete-region old-indent-begin old-indent-end)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3942 (indent-to (+ new-margin excess (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
3943 ;;;_ > 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
3944 (defun allout-rebullet-current-heading (arg)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3945 "Solicit new bullet for current visible heading."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3946 (interactive "p")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3947 (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
3948 (on-bullet (eq (point)(allout-current-bullet-pos)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3949 from to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3950 (backwards (if (< arg 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3951 (setq arg (* arg -1)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3952 (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
3953 (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
3954 (allout-end-of-prefix)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3955 (setq from allout-recent-prefix-beginning
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3956 to allout-recent-prefix-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
3957 (allout-rebullet-heading t ;;; solicit
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3958 nil ;;; depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3959 nil ;;; number-control
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3960 nil ;;; index
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3961 t) ;;; do-successors
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3962 (run-hook-with-args 'allout-exposure-change-hook
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3963 from to t))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3964 (setq arg (1- arg))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3965 (if (<= arg 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3966 nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3967 (setq initial-col nil) ; Override positioning back to init col
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3968 (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
3969 (allout-next-visible-heading 1)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
3970 (allout-goto-prefix-doublechecked)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3971 (allout-next-visible-heading -1))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3972 (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
3973 (cond (on-bullet (goto-char (allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3974 (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
3975 ;;;_ > 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
3976 (defun allout-rebullet-heading (&optional solicit
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3977 new-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3978 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3979 index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3980 do-successors)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3981
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3982 "Adjust bullet of current topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3983
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3984 All args are optional.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3985
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3986 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
3987 user. If it's a character, then that character is offered as the
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
3988 default, otherwise the one suited to the context (according to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3989 distinction or depth) is offered. If non-nil, then the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3990 context-specific bullet is just used.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3991
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3992 Second arg DEPTH forces the topic prefix to that depth, regardless
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3993 of the topic's current depth.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3994
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3995 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
3996 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
3997 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
3998 Its effect, numbering or denumbering, then depends on the setting
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
3999 of the fourth arg, INDEX.
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4000
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4001 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
4002 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
4003 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
4004 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
4005 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
4006 prefix. Non-nil and non-number means that the index for the
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4007 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
4008
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4009 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
4010 siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4011
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4012 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
4013 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
4014 this function."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4015
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4016 (let* ((current-depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4017 (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
4018 (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
4019 (me allout-recent-prefix-end)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4020 (current-bullet (buffer-substring-no-properties (- me 1) me))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4021 (has-annotation (get-text-property mb 'allout-was-hidden))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4022 (new-prefix (allout-make-topic-prefix current-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4023 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4024 new-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4025 solicit
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4026 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4027 index)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4028
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4029 ;; Is new one is identical to old?
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4030 (if (and (= current-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4031 (string= current-bullet
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4032 (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
4033 ;; Nothing to do:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4034 t
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4035
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4036 ;; New prefix probably different from old:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4037 ; 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
4038 (allout-unprotected (delete-region mb me))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4039 (goto-char mb)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4040 ; Dispense with number if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4041 ; numbered-bullet prefix:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4042 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4043 (if (and allout-numbered-bullet
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4044 (string= allout-numbered-bullet current-bullet)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4045 (looking-at "[0-9]+"))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4046 (allout-unprotected
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4047 (delete-region (match-beginning 0)(match-end 0)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4048
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4049 ;; convey 'allout-was-hidden annotation, if original had it:
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4050 (if has-annotation
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4051 (put-text-property 0 (length new-prefix) 'allout-was-hidden t
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4052 new-prefix))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4053
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4054 ; 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
4055 (allout-unprotected (insert new-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4056
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4057 ;; Reindent the body if elected, margin changed, and not encrypted body:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4058 (if (and allout-reindent-bodies
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4059 (not (= new-depth current-depth))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4060 (not (allout-encrypted-topic-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
4061 (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
4062
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4063 ;; 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
4064 ;; caller elected for it:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4065 (if do-successors
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4066 (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
4067 (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
4068 (setq index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4069 (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
4070 ((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
4071 (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
4072 (allout-rebullet-heading nil ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4073 new-depth ;;; new-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4074 number-control;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4075 index ;;; index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4076 nil))))) ;;;(dont!)do-successors
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4077 ) ; (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
4078 ) ; let* ((current-depth (allout-depth))...)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4079 ) ; 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
4080 ;;;_ > allout-rebullet-topic (arg)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4081 (defun allout-rebullet-topic (arg &optional sans-offspring)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4082 "Rebullet the visible topic containing point and all contained subtopics.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4083
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4084 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
4085
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4086 When optional SANS-OFFSPRING is non-nil, subtopics are not
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
4087 shifted. (Shifting a topic outwards without shifting its
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4088 offspring is disallowed, since this would create a \"containment
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4089 discontinuity\", where the depth difference between a topic and
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4090 its immediate offspring is greater than one.)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4091
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4092 With repeat count, shift topic depth by that amount."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4093 (interactive "P")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4094 (let ((start-col (current-column)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4095 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4096 ;; Normalize arg:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4097 (cond ((null arg) (setq arg 0))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4098 ((listp arg) (setq arg (car arg))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4099 ;; 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
4100 (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
4101 (allout-back-to-current-heading)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4102 (if (<= (+ allout-recent-depth arg) 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4103 (error "Attempt to shift topic below level 1"))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4104 (allout-rebullet-topic-grunt arg nil nil nil nil sans-offspring)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4105 (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
4106 (move-to-column (max 0 (+ start-col arg)))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4107 ;;;_ > allout-rebullet-topic-grunt (&optional 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
4108 (defun allout-rebullet-topic-grunt (&optional relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4109 starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4110 starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4111 index
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4112 do-successors
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4113 sans-offspring)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4114 "Like `allout-rebullet-topic', but on nearest containing topic
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4115 \(visible or not).
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4116
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4117 See `allout-rebullet-heading' for rebulleting behavior.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4118
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4119 All arguments are optional.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4120
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4121 First 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
4122 topic that amount.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4123
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4124 Several subsequent args are for internal recursive use by the function
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4125 itself: STARTING-DEPTH, STARTING-POINT, and INDEX.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4126
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4127 Finally, if optional SANS-OFFSPRING is non-nil then the offspring
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
4128 are not shifted. (Shifting a topic outwards without shifting
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4129 its offspring is disallowed, since this would create a
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4130 \"containment discontinuity\", where the depth difference between
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4131 a topic and its immediate offspring is greater than one.)"
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4132
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4133 ;; XXX the recursion here is peculiar, and in general the routine may
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4134 ;; need simplification with refactoring.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4135
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4136 (if (and sans-offspring
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4137 relative-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4138 (< relative-depth 0))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4139 (error (concat "Attempt to shift topic outwards without offspring,"
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4140 " would cause containment discontinuity.")))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4141
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4142 (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
4143 (new-depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4144 (starting-depth (or starting-depth new-depth))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4145 (on-starting-call (null starting-point))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4146 (index (or index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4147 ;; Leave index null on starting call, so rebullet-heading
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4148 ;; calculates it at what might be new depth:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4149 (and (or (zerop relative-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4150 (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
4151 (allout-sibling-index))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4152 (starting-index index)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4153 (moving-outwards (< 0 relative-depth))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4154 (starting-point (or starting-point (point)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4155 (local-point (point)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4156
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4157 ;; Sanity check for excessive promotion done only on starting call:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4158 (and on-starting-call
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4159 moving-outwards
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4160 (> 0 (+ starting-depth relative-depth))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4161 (error "Attempt to shift topic out beyond level 1"))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4162
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4163 (cond ((= starting-depth new-depth)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4164 ;; We're at depth to work on this one.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4165
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4166 ;; When shifting out we work on the children before working on
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4167 ;; the parent to avoid interim `allout-aberrant-container-p'
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4168 ;; aberrancy, and vice-versa when shifting in:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4169 (if (>= relative-depth 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4170 (allout-rebullet-heading nil
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4171 (+ starting-depth relative-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4172 nil ;;; number
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4173 index
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4174 nil)) ;;; do-successors
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4175 (when (not sans-offspring)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4176 ;; ... and work on subsequent ones which are at greater depth:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4177 (setq index 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4178 (allout-next-heading)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4179 (while (and (not (eobp))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4180 (< starting-depth (allout-depth)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4181 (setq index (1+ index))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4182 (allout-rebullet-topic-grunt relative-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4183 (1+ starting-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4184 starting-point
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4185 index)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4186 (when (< relative-depth 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4187 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4188 (goto-char local-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4189 (allout-rebullet-heading nil ;;; solicit
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4190 (+ starting-depth relative-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4191 nil ;;; number
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4192 starting-index
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4193 nil)))) ;;; do-successors
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4194
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4195 ((< starting-depth new-depth)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4196 ;; Rare case -- subtopic more than one level deeper than parent.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4197 ;; Treat this one at an even deeper level:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4198 (allout-rebullet-topic-grunt relative-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4199 new-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4200 starting-point
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4201 index
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4202 sans-offspring)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4203
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4204 (if on-starting-call
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4205 (progn
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4206 ;; Rectify numbering of former siblings of the adjusted topic,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4207 ;; if topic has changed depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4208 (if (or do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4209 (and (not (zerop relative-depth))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4210 (or (= allout-recent-depth starting-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4211 (= allout-recent-depth (+ starting-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4212 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
4213 (allout-rebullet-heading nil nil nil nil t))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4214 ;; Now rectify numbering of new siblings of the adjusted topic,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4215 ;; if depth has been changed:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4216 (progn (goto-char starting-point)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4217 (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
4218 (allout-rebullet-heading nil nil nil nil t)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4219 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4220 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4221 ;;;_ > 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
4222 (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
4223 "Renumber siblings at current depth.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4224
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4225 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
4226
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4227 Returns final depth."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4228
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4229 ;; 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
4230 ;; 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
4231
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4232 (let ((ascender (allout-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4233 was-eobp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4234 (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
4235 (allout-depth)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4236 (>= allout-recent-depth depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4237 (>= ascender depth))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4238 ; Skip over all topics at
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4239 ; lesser depths, which can not
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4240 ; have been disturbed:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4241 (while (and (not (setq was-eobp (eobp)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4242 (> allout-recent-depth ascender))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4243 (allout-next-heading))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4244 ; Prime ascender for ascension:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4245 (setq ascender (1- allout-recent-depth))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4246 (if (>= allout-recent-depth 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
4247 (allout-rebullet-heading nil ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4248 nil ;;; depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4249 nil ;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4250 nil ;;; index
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4251 t)) ;;; do-successors
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4252 (if was-eobp (goto-char (point-max)))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4253 allout-recent-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
4254 ;;;_ > 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
4255 (defun allout-number-siblings (&optional denumber)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4256 "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
4257
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4258 With universal argument, denumber -- assign default bullet to this
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4259 topic and its siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4260
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4261 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
4262 rebulleting each topic at this level."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4263
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4264 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4265
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4266 (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
4267 (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
4268 (allout-beginning-of-level)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4269 (let ((depth allout-recent-depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4270 (index (if (not denumber) 1))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4271 (use-bullet (equal '(16) denumber))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4272 (more t))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4273 (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
4274 (allout-rebullet-heading use-bullet ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4275 depth ;;; depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4276 t ;;; number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4277 index ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4278 nil) ;;; do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4279 (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
4280 (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
4281 ;;;_ > 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
4282 (defun allout-shift-in (arg)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4283 "Increase depth of current heading and any items collapsed within it.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4284
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4285 With a negative argument, the item is shifted out using
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4286 `allout-shift-out', instead.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4287
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4288 With an argument greater than one, shift-in the item but not its
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4289 offspring, making the item into a sibling of its former children,
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4290 and a child of sibling that formerly preceeded it.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4291
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4292 You are not allowed to shift the first offspring of a topic
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4293 inwards, because that would yield a \"containment
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4294 discontinuity\", where the depth difference between a topic and
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4295 its immediate offspring is greater than one. The first topic in
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4296 the file can be adjusted to any positive depth, however."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4297
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4298 (interactive "p")
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4299 (if (< arg 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4300 (allout-shift-out (* arg -1))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4301 ;; refuse to create a containment discontinuity:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4302 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4303 (allout-back-to-current-heading)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4304 (if (not (bobp))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4305 (let* ((current-depth allout-recent-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4306 (start-point (point))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4307 (predecessor-depth (progn
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4308 (forward-char -1)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4309 (allout-goto-prefix-doublechecked)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4310 (if (< (point) start-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4311 allout-recent-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4312 0))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4313 (if (and (> predecessor-depth 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4314 (> (1+ current-depth)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4315 (1+ predecessor-depth)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4316 (error (concat "Disallowed shift deeper than"
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
4317 " containing topic's children."))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
4318 (allout-back-to-current-heading)
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
4319 (if (< allout-recent-depth (1+ current-depth))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
4320 (allout-show-children))))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4321 (let ((where (point)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4322 (allout-rebullet-topic 1 (and (> arg 1) 'sans-offspring))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4323 (run-hook-with-args 'allout-structure-shifted-hook arg where))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4324 ;;;_ > 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
4325 (defun allout-shift-out (arg)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4326 "Decrease depth of current heading and any topics collapsed within it.
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4327 This will make the item a sibling of its former container.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4328
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4329 With a negative argument, the item is shifted in using
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4330 `allout-shift-in', instead.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4331
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4332 With an argument greater than one, shift-out the item's offspring
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4333 but not the item itself, making the former children siblings of
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4334 the item.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4335
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4336 With an argument greater than 1, the item's offspring are shifted
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4337 out without shifting the item. This will make the immediate
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4338 subtopics into siblings of the item."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4339 (interactive "p")
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4340 (if (< arg 0)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4341 (allout-shift-in (* arg -1))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4342 ;; Get proper exposure in this area:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4343 (save-excursion (if (allout-ascend)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4344 (allout-show-children)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4345 ;; Show collapsed children if there's a successor which will become
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4346 ;; their sibling:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4347 (if (and (allout-current-topic-collapsed-p)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4348 (save-excursion (allout-next-sibling)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4349 (allout-show-children))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4350 (let ((where (and (allout-depth) allout-recent-prefix-beginning)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4351 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4352 (if (> arg 1)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4353 ;; Shift the offspring but not the topic:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4354 (let ((children-chart (allout-chart-subtree 1)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4355 (if (listp (car children-chart))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4356 ;; whoops:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4357 (setq children-chart (allout-flatten children-chart)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4358 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4359 (dolist (child-point children-chart)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4360 (goto-char child-point)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4361 (allout-shift-out 1))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4362 (allout-rebullet-topic (* arg -1))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4363 (run-hook-with-args 'allout-structure-shifted-hook (* arg -1) where))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4364 ;;;_ : 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
4365 ;;;_ > 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
4366 (defun allout-kill-line (&optional arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4367 "Kill line, adjusting subsequent lines suitably for outline mode."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4368
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4369 (interactive "*P")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4370
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4371 (if (or (not (allout-mode-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4372 (not (bolp))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4373 (not (save-match-data (looking-at allout-regexp))))
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
4374 ;; Just do a regular kill:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4375 (kill-line arg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4376 ;; Ah, have to watch out for adjustments:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4377 (let* ((beg (point))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4378 end
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4379 (beg-hidden (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4380 (end-hidden (save-excursion (allout-end-of-current-line)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4381 (setq end (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4382 (allout-hidden-p)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4383 (depth (allout-depth)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4384
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4385 (allout-annotate-hidden beg end)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4386 (if (and (not beg-hidden) (not end-hidden))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4387 (allout-unprotected (kill-line arg))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4388 (kill-line arg))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4389 (allout-deannotate-hidden beg end)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4390
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4391 (if allout-numbered-bullet
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4392 (save-excursion ; Renumber subsequent topics if needed:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4393 (if (not (save-match-data (looking-at allout-regexp)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4394 (allout-next-heading))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4395 (allout-renumber-to-depth depth)))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4396 (run-hook-with-args 'allout-structure-deleted-hook depth (point)))))
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4397 ;;;_ > allout-copy-line-as-kill ()
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4398 (defun allout-copy-line-as-kill ()
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4399 "Like allout-kill-topic, but save to kill ring instead of deleting."
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4400 (interactive)
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4401 (let ((buffer-read-only t))
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4402 (condition-case nil
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4403 (allout-kill-line)
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4404 (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
4405 ;;;_ > 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
4406 (defun allout-kill-topic ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4407 "Kill topic together with subtopics.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4408
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4409 Trailing whitespace is killed with a topic if that whitespace:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4410
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4411 - would separate the topic from a subsequent sibling
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4412 - would separate the topic from the end of buffer
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4413 - would not be added to whitespace already separating the topic from the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4414 previous one.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4415
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4416 Topic exposure is marked with text-properties, to be used by
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4417 `allout-yank-processing' for exposure recovery."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4418
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4419 (interactive)
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4420 (let* ((inhibit-field-text-motion t)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4421 (beg (prog1 (allout-back-to-current-heading) (beginning-of-line)))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4422 end
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4423 (depth allout-recent-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
4424 (allout-end-of-current-subtree)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4425 (if (and (/= (current-column) 0) (not (eobp)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4426 (forward-char 1))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4427 (if (not (eobp))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4428 (if (and (save-match-data (looking-at "\n"))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4429 (or (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4430 (or (not (allout-next-heading))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4431 (= depth allout-recent-depth)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4432 (and (> (- beg (point-min)) 3)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4433 (string= (buffer-substring (- beg 2) beg) "\n\n"))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4434 (forward-char 1)))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4435
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4436 (allout-annotate-hidden beg (setq end (point)))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4437 (unwind-protect
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4438 (allout-unprotected (kill-region beg end))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4439 (if buffer-read-only
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4440 ;; eg, during copy-as-kill.
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4441 (allout-deannotate-hidden beg end)))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4442
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4443 (save-excursion
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4444 (allout-renumber-to-depth depth))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4445 (run-hook-with-args 'allout-structure-deleted-hook depth (point))))
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4446 ;;;_ > allout-copy-topic-as-kill ()
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4447 (defun allout-copy-topic-as-kill ()
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4448 "Like `allout-kill-topic', but save to kill ring instead of deleting."
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4449 (interactive)
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4450 (let ((buffer-read-only t))
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4451 (condition-case nil
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4452 (allout-kill-topic)
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4453 (buffer-read-only (message "Topic copied...")))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4454 ;;;_ > allout-annotate-hidden (begin end)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4455 (defun allout-annotate-hidden (begin end)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4456 "Qualify text with properties to indicate exposure status."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4457
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4458 (let ((was-modified (buffer-modified-p))
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4459 (buffer-read-only nil))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4460 (allout-deannotate-hidden begin end)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4461 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4462 (goto-char begin)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4463 (let (done next prev overlay)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4464 (while (not done)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4465 ;; at or advance to start of next hidden region:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4466 (if (not (allout-hidden-p))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4467 (setq next
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
4468 (max (1+ (point))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4469 (allout-next-single-char-property-change (point)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4470 'invisible
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4471 nil end))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4472 (if (or (not next) (eq prev next))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4473 ;; still not at start of hidden area -- must not be any left.
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4474 (setq done t)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4475 (goto-char next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4476 (setq prev next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4477 (if (not (allout-hidden-p))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4478 ;; still not at start of hidden area.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4479 (setq done t)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4480 (setq overlay (allout-get-invisibility-overlay))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4481 (setq next (overlay-end overlay)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4482 prev next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4483 ;; advance to end of this hidden area:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4484 (when next
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4485 (goto-char next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4486 (allout-unprotected
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4487 (let ((buffer-undo-list t))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4488 (put-text-property (overlay-start overlay) next
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4489 'allout-was-hidden t)))))))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4490 (set-buffer-modified-p was-modified)))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4491 ;;;_ > allout-deannotate-hidden (begin end)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4492 (defun allout-deannotate-hidden (begin end)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4493 "Remove allout hidden-text annotation between BEGIN and END."
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4494
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4495 (allout-unprotected
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4496 (let ((inhibit-read-only t)
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4497 (buffer-undo-list t))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4498 ;(remove-text-properties begin end '(allout-was-hidden t))
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4499 )))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4500 ;;;_ > allout-hide-by-annotation (begin end)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4501 (defun allout-hide-by-annotation (begin end)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4502 "Translate text properties indicating exposure status into actual exposure."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4503 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4504 (goto-char begin)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4505 (let ((was-modified (buffer-modified-p))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4506 done next prev)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4507 (while (not done)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4508 ;; at or advance to start of next annotation:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4509 (if (not (get-text-property (point) 'allout-was-hidden))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4510 (setq next (allout-next-single-char-property-change
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4511 (point) 'allout-was-hidden nil end)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4512 (if (or (not next) (eq prev next))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4513 ;; no more or not advancing -- must not be any left.
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4514 (setq done t)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4515 (goto-char next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4516 (setq prev next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4517 (if (not (get-text-property (point) 'allout-was-hidden))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4518 ;; still not at start of annotation.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4519 (setq done t)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4520 ;; advance to just after end of this annotation:
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4521 (setq next (allout-next-single-char-property-change
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4522 (point) 'allout-was-hidden nil end))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4523 (overlay-put (make-overlay prev next nil 'front-advance)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4524 'category 'allout-exposure-category)
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
4525 (allout-deannotate-hidden prev next)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4526 (setq prev next)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4527 (if next (goto-char next)))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4528 (set-buffer-modified-p was-modified))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4529 ;;;_ > 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
4530 (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
4531
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4532 "Incidental allout-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
4533
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4534 Does depth adjustment of yanked topics, when:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4535
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4536 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
4537 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
4538 topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4539
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
4540 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
4541
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4542 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
4543 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
4544 header into which it's being yanked.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4545
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4546 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
4547 at the end (and vice-versa with the mark). Non-adjusted yanks,
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4548 however, are left exactly like normal, non-allout-specific yanks."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4549
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4550 (interactive "*P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4551 ; Get to beginning, leaving
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4552 ; region around subject:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4553 (if (< (allout-mark-marker t) (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4554 (exchange-point-and-mark))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4555 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4556 (let* ((subj-beg (point))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4557 (into-bol (bolp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4558 (subj-end (allout-mark-marker t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4559 ;; 'resituate' if yanking an entire topic into topic header:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4560 (resituate (and (let ((allout-inhibit-aberrance-doublecheck t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4561 (allout-e-o-prefix-p))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4562 (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4563 (allout-prefix-data)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4564 ;; `rectify-numbering' if resituating (where several topics may
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4565 ;; be resituating) or yanking a topic into a topic slot (bol):
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4566 (rectify-numbering (or resituate
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
4567 (and into-bol (looking-at allout-regexp)))))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4568 (if resituate
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87943 79940
diff changeset
4569 ;; Yanking a topic into the start of a topic -- reconcile to fit:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4570 (let* ((inhibit-field-text-motion t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4571 (prefix-len (if (not (match-end 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4572 1
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4573 (- (match-end 1) subj-beg)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4574 (subj-depth allout-recent-depth)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4575 (prefix-bullet (allout-recent-bullet))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4576 (adjust-to-depth
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4577 ;; Nil if adjustment unnecessary, otherwise depth to which
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4578 ;; adjustment should be made:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4579 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4580 (and (goto-char subj-end)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4581 (eolp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4582 (goto-char subj-beg)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4583 (and (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4584 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4585 (beginning-of-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4586 (not (= (point) subj-beg)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4587 (looking-at allout-regexp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4588 (allout-prefix-data))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4589 allout-recent-depth)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4590 (more t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4591 (setq rectify-numbering allout-numbered-bullet)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4592 (if adjust-to-depth
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4593 ; Do the adjustment:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4594 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4595 (save-restriction
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4596 (narrow-to-region subj-beg subj-end)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4597 ; Trim off excessive blank
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4598 ; line at end, if any:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4599 (goto-char (point-max))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4600 (if (looking-at "^$")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4601 (allout-unprotected (delete-char -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4602 ; Work backwards, with each
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4603 ; shallowest level,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4604 ; successively excluding the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4605 ; last processed topic from
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4606 ; the narrow region:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4607 (while more
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4608 (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4609 ; go as high as we can in each bunch:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4610 (while (allout-ascend t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4611 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4612 (allout-unprotected
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4613 (allout-rebullet-topic-grunt (- adjust-to-depth
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4614 subj-depth)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4615 (allout-depth))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4616 (if (setq more (not (bobp)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4617 (progn (widen)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4618 (forward-char -1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4619 (narrow-to-region subj-beg (point))))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4620 ;; Preserve new bullet if it's a distinctive one, otherwise
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4621 ;; use old one:
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4622 (if (string-match (regexp-quote prefix-bullet)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4623 allout-distinctive-bullets-string)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4624 ; Delete from bullet of old to
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4625 ; before bullet of new:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4626 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4627 (beginning-of-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4628 (allout-unprotected
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4629 (delete-region (point) subj-beg))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4630 (set-marker (allout-mark-marker t) subj-end)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4631 (goto-char subj-beg)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4632 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4633 ; Delete base subj prefix,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4634 ; leaving old one:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4635 (allout-unprotected
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4636 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4637 (delete-region (point) (+ (point)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4638 prefix-len
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4639 (- adjust-to-depth
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4640 subj-depth)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4641 ; and delete residual subj
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4642 ; prefix digits and space:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4643 (while (looking-at "[0-9]") (delete-char 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4644 (if (looking-at " ")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4645 (delete-char 1))))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4646 (exchange-point-and-mark))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4647 (if rectify-numbering
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4648 (progn
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4649 (save-excursion
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4650 ; Give some preliminary feedback:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4651 (message "... reconciling numbers")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4652 ; ... and renumber, in case necessary:
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4653 (goto-char subj-beg)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4654 (if (allout-goto-prefix-doublechecked)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4655 (allout-unprotected
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4656 (allout-rebullet-heading nil ;;; solicit
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4657 (allout-depth) ;;; depth
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4658 nil ;;; number-control
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4659 nil ;;; index
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4660 t)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4661 (message ""))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4662 (if (or into-bol resituate)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4663 (allout-hide-by-annotation (point) (allout-mark-marker t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4664 (allout-deannotate-hidden (allout-mark-marker t) (point)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4665 (if (not resituate)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4666 (exchange-point-and-mark))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4667 (run-hook-with-args 'allout-structure-added-hook subj-beg subj-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
4668 ;;;_ > 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
4669 (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
4670 "`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
4671
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
4672 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
4673
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4674 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
4675 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
4676
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
4677 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
4678 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
4679 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
4680 topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4681
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4682 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
4683 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
4684 header into which it's being yanked.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4685
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4686 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
4687 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
4688 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
4689 exactly like normal yanks.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4690
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
4691 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
4692 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
4693
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
4694 `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
4695 works with normal `yank' in non-outline buffers."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4696
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4697 (interactive "*P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4698 (setq this-command 'yank)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4699 (allout-unprotected
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4700 (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
4701 (if (allout-mode-p)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4702 (allout-yank-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
4703 ;;;_ > 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
4704 (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
4705 "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
4706
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4707 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
4708
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4709 Note -- prefix changes to distinctive bullets will stick, if followed
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4710 by pops to non-distinctive yanks. Bug..."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4711
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4712 (interactive "*p")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4713 (setq this-command 'yank)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4714 (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
4715 (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
4716 (allout-yank-processing)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4717
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4718 ;;;_ - Specialty bullet functions
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4719 ;;;_ : 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
4720 ;;;_ > 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
4721 (defun allout-resolve-xref ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4722 "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
4723
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4724 \(Works according to setting of `allout-file-xref-bullet')."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4725 (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
4726 (if (not allout-file-xref-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4727 (error
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4728 "Outline cross references disabled -- no `allout-file-xref-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
4729 (if (not (string= (allout-current-bullet) allout-file-xref-bullet))
64428
e55dd693f95b (allout-resolve-xref): Fix typos in error strings.
Juanma Barranquero <lekktu@gmail.com>
parents: 64400
diff changeset
4730 (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
4731 allout-file-xref-bullet)
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4732 (let ((inhibit-field-text-motion t)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4733 file-name)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4734 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4735 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4736 (let* ((text-start allout-recent-prefix-end)
111445
56b71cddc9c5 Replace still more end-of-line etc with line-end-position, etc.
Glenn Morris <rgm@gnu.org>
parents: 108209
diff changeset
4737 (heading-end (point-at-eol)))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4738 (goto-char text-start)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4739 (setq file-name
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4740 (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4741 (buffer-substring (match-beginning 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4742 (match-end 1)))))))
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4743 (setq file-name (expand-file-name file-name))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4744 (if (or (file-exists-p file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4745 (if (file-writable-p file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4746 (y-or-n-p (format "%s not there, create one? "
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4747 file-name))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4748 (error "%s not found and can't be created" file-name)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4749 (condition-case failure
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4750 (find-file-other-window file-name)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4751 (error failure))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4752 (error "%s not found" file-name))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4753 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4754 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4755 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4756 )
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4757
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4758 ;;;_ #6 Exposure Control
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4759
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4760 ;;;_ - Fundamental
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4761 ;;;_ > allout-flag-region (from to flag)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4762 (defun allout-flag-region (from to flag)
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4763 "Conceal text between FROM and TO if FLAG is non-nil, else reveal it.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4764
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4765 Exposure-change hook `allout-exposure-change-hook' is run with the same
112129
5a83a0764cb0 allout.el: (allout-back-to-current-heading): Ensure return to the visible
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112119
diff changeset
4766 arguments as this function, after the exposure changes are made."
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4767
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4768 ;; We use outline invisibility spec.
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
4769 (remove-overlays from to 'category 'allout-exposure-category)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4770 (when flag
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4771 (let ((o (make-overlay from to nil 'front-advance)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
4772 (overlay-put o 'category 'allout-exposure-category)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4773 (when (featurep 'xemacs)
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
4774 (let ((props (symbol-plist 'allout-exposure-category)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4775 (while props
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4776 (condition-case nil
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4777 ;; as of 2008-02-27, xemacs lacks modification-hooks
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4778 (overlay-put o (pop props) (pop props))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4779 (error nil)))))))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
4780 (run-hook-with-args 'allout-exposure-change-hook from to flag))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4781 ;;;_ > 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
4782 (defun allout-flag-current-subtree (flag)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4783 "Conceal currently-visible topic's subtree if FLAG non-nil, else reveal it."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4784
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4785 (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
4786 (allout-back-to-current-heading)
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4787 (let ((inhibit-field-text-motion t))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4788 (end-of-line))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4789 (allout-flag-region (point)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4790 ;; Exposing must not leave trailing blanks hidden,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4791 ;; but can leave them exposed when hiding, so we
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4792 ;; can use flag's inverse as the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4793 ;; include-trailing-blank cue:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4794 (allout-end-of-current-subtree (not flag))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4795 flag)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4796
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4797 ;;;_ - Topic-specific
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
4798 ;;;_ > allout-show-entry ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
4799 (defun allout-show-entry ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
4800 "Like `allout-show-current-entry', but reveals entries in hidden topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4801
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4802 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
4803 expense of exposing its context, but can leave the outline with aberrant
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4804 exposure. `allout-show-offshoot' should be used after the peek to rectify
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4805 the exposure."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4806
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4807 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4808 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4809 (let (beg end)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4810 (allout-goto-prefix-doublechecked)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4811 (setq beg (if (allout-hidden-p) (1- (point)) (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4812 (setq end (allout-pre-next-prefix))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4813 (allout-flag-region beg end nil)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4814 (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
4815 ;;;_ > 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
4816 (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
4817
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4818 "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
4819
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
4820 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
4821
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4822 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
4823 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
4824
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4825 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
4826 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
4827 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
4828 it.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4829
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4830 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
4831 point of non-opened subtree?)"
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4832
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4833 (interactive "p")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4834 (let ((start-point (point)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4835 (if (and (not strict)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4836 (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4837
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4838 (progn (allout-show-to-offshoot) ; Point's concealed, open to
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4839 ; expose it.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4840 ;; Then recurse, but with "strict" set so we don't
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4841 ;; infinite regress:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4842 (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
4843
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4844 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4845 (allout-beginning-of-current-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4846 (save-restriction
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4847 (let* (depth
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4848 ;; translate the level spec for this routine to the ones
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4849 ;; used by -chart-subtree and -chart-to-reveal:
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4850 (chart-level (cond ((not level) 1)
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4851 ((eq level t) nil)
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4852 (t level)))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4853 (chart (allout-chart-subtree chart-level))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4854 (to-reveal (or (allout-chart-to-reveal chart chart-level)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4855 ;; interactive, show discontinuous children:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4856 (and chart
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
4857 (allout-called-interactively-p)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4858 (save-excursion
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4859 (allout-back-to-current-heading)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4860 (setq depth (allout-current-depth))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4861 (and (allout-next-heading)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4862 (> allout-recent-depth
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4863 (1+ depth))))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4864 (message
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4865 "Discontinuous offspring; use `%s %s'%s."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4866 (substitute-command-keys
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4867 "\\[universal-argument]")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4868 (substitute-command-keys
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4869 "\\[allout-shift-out]")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4870 " to elevate them.")
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4871 (allout-chart-to-reveal
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4872 chart (- allout-recent-depth depth))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4873 (goto-char start-point)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4874 (when (and strict (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4875 ;; Concealed root would already have been taken care of,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4876 ;; unless strict was set.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4877 (allout-flag-region (point) (allout-snug-back) nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4878 (when allout-show-bodies
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4879 (goto-char (car to-reveal))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4880 (allout-show-current-entry)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4881 (while to-reveal
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4882 (goto-char (car to-reveal))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4883 (allout-flag-region (save-excursion (allout-snug-back) (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4884 (progn (search-forward "\n" nil t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4885 (1- (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4886 nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4887 (when allout-show-bodies
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4888 (goto-char (car to-reveal))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4889 (allout-show-current-entry))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4890 (setq to-reveal (cdr to-reveal)))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4891 ;; Compensate for `save-excursion's maintenance of point
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4892 ;; within invisible text:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4893 (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
4894 ;;;_ > 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
4895 (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
4896 "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
4897
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4898 Useful for coherently exposing to a random point in a hidden region."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4899 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4900 (save-excursion
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4901 (let ((inhibit-field-text-motion t)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4902 (orig-pt (point))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4903 (orig-pref (allout-goto-prefix-doublechecked))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4904 (last-at (point))
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4905 (bag-it 0))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4906 (while (or (> bag-it 1) (allout-hidden-p))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4907 (while (allout-hidden-p)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4908 (move-beginning-of-line 1)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4909 (if (allout-hidden-p) (forward-char -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4910 (if (= last-at (setq last-at (point)))
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4911 ;; Oops, we're not making any progress! Show the current topic
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4912 ;; completely, and try one more time here, if we haven't already.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4913 (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
4914 (allout-show-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4915 (goto-char orig-pt)
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4916 (setq bag-it (1+ bag-it))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4917 (if (> bag-it 1)
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4918 (error "allout-show-to-offshoot: %s"
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4919 "Stumped by aberrant nesting.")))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
4920 (if (> bag-it 0) (setq bag-it 0))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4921 (allout-show-children)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
4922 (goto-char orig-pref)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4923 (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
4924 (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
4925 (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
4926 ;;;_ > 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
4927 (defun allout-hide-current-entry ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4928 "Hide the body directly following this heading."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4929 (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
4930 (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4931 (save-excursion
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4932 (let ((inhibit-field-text-motion t))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
4933 (end-of-line))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4934 (allout-flag-region (point)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4935 (progn (allout-end-of-entry) (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4936 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
4937 ;;;_ > 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
4938 (defun allout-show-current-entry (&optional arg)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4939 "Show body following current heading, or hide entry with universal argument."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4940
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4941 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4942 (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
4943 (allout-hide-current-entry)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4944 (save-excursion (allout-show-to-offshoot))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4945 (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
4946 (allout-flag-region (point)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4947 (progn (allout-end-of-entry t) (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4948 nil)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4949 )))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4950 ;;;_ > 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
4951 (defun allout-show-current-subtree (&optional arg)
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4952 "Show everything within the current topic.
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
4953 With a repeat-count, 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
4954 (interactive "P")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4955 (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
4956 (if (<= (allout-current-depth) 0)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4957 ;; 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
4958 (if (not (allout-next-heading))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
4959 (error "No topics")
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4960 ;; got to first, outermost topic -- set to expose it and siblings:
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
4961 (message "Above outermost topic -- exposing all.")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4962 (allout-flag-region (point-min)(point-max) nil))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4963 (allout-beginning-of-current-line)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4964 (if (not arg)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4965 (allout-flag-current-subtree 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
4966 (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
4967 (allout-expose-topic '(* :))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4968 ;;;_ > allout-current-topic-collapsed-p (&optional include-single-liners)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4969 (defun allout-current-topic-collapsed-p (&optional include-single-liners)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4970 "True if the currently visible containing topic is already collapsed.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4971
70673
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
4972 Single line topics intrinsically can be considered as being both
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
4973 collapsed and uncollapsed. If optional INCLUDE-SINGLE-LINERS is
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
4974 true, then single-line topics are considered to be collapsed. By
798fa39b6207 2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents: 70616
diff changeset
4975 default, they are treated as being uncollapsed."
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4976 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4977 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4978 (and
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4979 ;; Is the topic all on one line (allowing for trailing blank line)?
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4980 (>= (progn (allout-back-to-current-heading)
112119
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
4981 (let ((inhibit-field-text-motion t))
48f5ac42611a Reconcile with changes in line movement behavior for long text lines
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112044
diff changeset
4982 (move-end-of-line 1))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4983 (point))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4984 (allout-end-of-current-subtree (not (looking-at "\n\n"))))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4985
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4986 (or include-single-liners
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
4987 (progn (backward-char 1) (allout-hidden-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
4988 ;;;_ > 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
4989 (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
4990 "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
4991
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4992 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
4993 and its siblings.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4994
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4995 If optional arg JUST-CLOSE is non-nil, do not close the parent or
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4996 siblings, even if the target topic is already closed."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4997
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4998 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4999 (let* ((from (point))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5000 (sibs-msg "Top-level topic already closed -- closing siblings...")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5001 (current-exposed (not (allout-current-topic-collapsed-p t))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5002 (cond (current-exposed (allout-flag-current-subtree t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5003 (just-close nil)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5004 ((allout-ascend) (allout-hide-current-subtree))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5005 (t (goto-char 0)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5006 (message sibs-msg)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5007 (allout-goto-prefix-doublechecked)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5008 (allout-expose-topic '(0 :))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5009 (message (concat sibs-msg " Done."))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5010 (goto-char from)))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5011 ;;;_ > allout-toggle-current-subtree-exposure
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5012 (defun allout-toggle-current-subtree-exposure ()
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5013 "Show or hide the current subtree depending on its current state."
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5014 ;; thanks to tassilo for suggesting this.
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5015 (interactive)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5016 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5017 (allout-back-to-heading)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5018 (if (allout-hidden-p (point-at-eol))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5019 (allout-show-current-subtree)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5020 (allout-hide-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
5021 ;;;_ > 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
5022 (defun allout-show-current-branches ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5023 "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
5024 (interactive)
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5025 (let ((inhibit-field-text-motion t))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5026 (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
5027 (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
5028 ;;;_ > 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
5029 (defun allout-hide-current-leaves ()
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5030 "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
5031 (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
5032 (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
5033 (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
5034 (point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5035
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5036 ;;;_ - 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
5037 ;;;_ > 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
5038 (defun allout-show-all ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5039 "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
5040 (interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5041 (message "Exposing entire buffer...")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5042 (allout-flag-region (point-min) (point-max) nil)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5043 (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
5044 ;;;_ > 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
5045 (defun allout-hide-bodies ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5046 "Hide all of buffer except headings."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5047 (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
5048 (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
5049 ;;;_ > 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
5050 (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
5051 "Hide all body lines in the region, but not headings."
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5052 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5053 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5054 (save-restriction
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5055 (narrow-to-region start end)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5056 (goto-char (point-min))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5057 (let ((inhibit-field-text-motion t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5058 (while (not (eobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5059 (end-of-line)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5060 (allout-flag-region (point) (allout-end-of-entry) t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5061 (if (not (eobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5062 (forward-char
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5063 (if (looking-at "\n\n")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5064 2 1)))))))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5065
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5066 ;;;_ > 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
5067 (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
5068 "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
5069
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5070 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
5071 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
5072 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
5073 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
5074
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5075 Cursor is left at start position.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5076
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5077 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
5078
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5079 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
5080
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5081 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
5082 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
5083
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5084 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
5085 subtopics of the current topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5086
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5087 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
5088 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
5089 explicit specs following the `:'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5090
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5091 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
5092
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5093 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
5094 - 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
5095 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
5096 that level.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5097 - 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
5098 number, but do not force already opened subtopics to be closed.
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5099 - 0 means to close topic -- hide all offspring.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5100 : - `repeat'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5101 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
5102 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
5103 on the list. Ie, apply to all topics at level but the last
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5104 ones. (Only first of multiple colons at same level is
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5105 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
5106 * - 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
5107 + - 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
5108 - - 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
5109
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5110 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
5111 \(allout-expose-topic '(-1 : 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5112 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
5113 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
5114 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
5115 \(allout-expose-topic '(-1 () : 1 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5116 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
5117 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
5118 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
5119 \(allout-expose-topic '(-2 : -1 *))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5120 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
5121 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
5122 last and completely open the last one."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5123
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5124 (interactive "xExposure spec: ")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5125 (if (not (listp spec))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5126 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
5127 (let ((depth (allout-depth))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5128 (max-pos 0)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5129 prev-elem curr-elem
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5130 stay)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5131 (while spec
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5132 (setq prev-elem curr-elem
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5133 curr-elem (car spec)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5134 spec (cdr spec))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5135 (cond ; Do current element:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5136 ((null curr-elem) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5137 ((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
5138 (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
5139 (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
5140 (setq max-pos allout-recent-end-of-subtree)))
73201
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
5141 ((eq curr-elem '+)
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
5142 (if (not (allout-hidden-p))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
5143 (save-excursion (allout-hide-current-subtree t)))
16a7031b0447 (allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents: 73003
diff changeset
5144 (allout-show-current-branches)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5145 (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
5146 (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
5147 ((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
5148 ((eq curr-elem ':)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5149 (setq stay t)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5150 ;; 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
5151 ;; w.r.t. remaining siblings:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5152 (let ((residue ; = # of sibs not covered by remaining spec
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5153 ;; 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
5154 (- (length (allout-chart-siblings))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5155 (length spec))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5156 (if (< 0 residue)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5157 ;; Some residue -- cover it with prev-elem:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5158 (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
5159 spec)))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5160 ((numberp curr-elem)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5161 (if (and (>= 0 curr-elem) (not (allout-hidden-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
5162 (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
5163 (if (> 0 curr-elem)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5164 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
5165 (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
5166 (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
5167 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
5168 (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
5169 (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
5170 (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
5171 (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
5172 ((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
5173 (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
5174 (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
5175 (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
5176 (cond (stay (setq stay nil))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5177 ((listp (car spec)) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5178 ((> max-pos (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5179 ;; 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
5180 (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
5181 (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
5182 ((allout-next-sibling depth))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5183 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
5184 ;;;_ > 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
5185 (defun allout-old-expose-topic (spec &rest followers)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5186
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5187 "Deprecated. Use `allout-expose-topic' (with different schema
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5188 format) instead.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5189
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5190 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
5191
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5192 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
5193 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
5194
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5195 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
5196 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
5197 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
5198 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
5199 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
5200
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5201 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
5202
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5203 - 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
5204 - 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
5205 absolute value of the number.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5206 - 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
5207 - 0 just closes
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5208 - `*' completely opens the topic, including bodies.
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5209 - `+' shows all the sub headers, but not the bodies
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5210 - `-' 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
5211
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5212 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
5213 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
5214 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
5215 for the corresponding offspring of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5216
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
5217 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
5218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5219 (interactive "xExposure spec: ")
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5220 (let ((inhibit-field-text-motion t)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5221 (depth (allout-current-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5222 max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5223 (cond ((null spec) nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5224 ((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
5225 (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
5226 (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
5227 (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
5228 ((numberp spec)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5229 (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
5230 (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
5231 (end-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5232 (if (or (not max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5233 (> (point) max-pos))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5234 (setq max-pos (point)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5235 (if (> 0 spec)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5236 (setq spec (* -1 spec)))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5237 (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
5238 (allout-show-children spec)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5239 ((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
5240 ;(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
5241 ; (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
5242 ; (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
5243 (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
5244 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
5245 (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
5246 (setq spec (cdr spec))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5247 (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
5248 (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
5249 (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
5250 (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
5251 (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
5252 (setq max-pos got)))))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5253 (while (and followers
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5254 (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
5255 (progn (goto-char max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5256 (setq max-pos nil)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5257 (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
5258 (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
5259 (allout-old-expose-topic (car followers))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5260 (setq followers (cdr followers)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5261 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
5262 ;;;_ > 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
5263 (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
5264 "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
5265 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
5266 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
5267
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5268 Cursor is left at start position.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5269
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5270 Use this instead of obsolete `allout-exposure'.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5271
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5272 Examples:
61969
38ca28ee68d6 (allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents: 59996
diff changeset
5273 \(allout-new-exposure (-1 () () () 1) 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5274 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
5275 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
5276 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
5277 \(allout-new-exposure : -1 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5278 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
5279 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
5280 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
5281 \(allout-new-exposure -2 : -1 *)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5282 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
5283 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
5284 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
5285 (list 'save-excursion
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5286 '(if (not (or (allout-goto-prefix-doublechecked)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5287 (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
5288 (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
5289 (list 'allout-expose-topic (list 'quote spec))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5290
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5291 ;;;_ #7 Systematic outline presentation -- copying, printing, flattening
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5292
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5293 ;;;_ - Mapping and processing of topics
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5294 ;;;_ ( 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
5295 ;;;_ > 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
5296 (defun allout-stringify-flat-index (flat-index &optional context)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5297 "Convert list representing section/subsection/... to document string.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5298
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5299 Optional arg CONTEXT indicates interior levels to include."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5300 (let ((delim ".")
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
5301 result
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5302 numstr
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5303 (context-depth (or (and context 2) 1)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5304 ;; Take care of the explicit context:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5305 (while (> context-depth 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5306 (setq numstr (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5307 flat-index (cdr flat-index)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5308 result (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5309 (cons delim (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5310 (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5311 context-depth (if flat-index (1- context-depth) 0)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5312 (setq delim " ")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5313 ;; Take care of the indentation:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5314 (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5315 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5316 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5317 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5318 (cons delim
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5319 (cons (make-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5320 (1+ (truncate (if (zerop (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5321 1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5322 (log10 (car flat-index)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5323 ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5324 result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5325 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5326 ;; Dispose of single extra delim:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5327 (setq result (cdr result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5328 (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
5329 ;;;_ > 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
5330 (defun allout-stringify-flat-index-plain (flat-index)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5331 "Convert list representing section/subsection/... to document string."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5332 (let ((delim ".")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5333 result)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5334 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5335 (setq result (cons (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5336 (if result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5337 (cons delim result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5338 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5339 (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
5340 ;;;_ > 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
5341 (defun allout-stringify-flat-index-indented (flat-index)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5342 "Convert list representing section/subsection/... to document string."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5343 (let ((delim ".")
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
5344 result
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5345 numstr)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5346 ;; Take care of the explicit context:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5347 (setq numstr (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5348 flat-index (cdr flat-index)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5349 result (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5350 (cons delim (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5351 (cons numstr result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5352 (setq delim " ")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5353 ;; Take care of the indentation:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5354 (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5355 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5356 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5357 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5358 (cons delim
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5359 (cons (make-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5360 (1+ (truncate (if (zerop (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5361 1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5362 (log10 (car flat-index)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5363 ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5364 result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5365 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5366 ;; Dispose of single extra delim:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5367 (setq result (cdr result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5368 (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
5369 ;;;_ > 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
5370 (defun allout-listify-exposed (&optional start end format)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5371
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5372 "Produce a list representing exposed topics in current region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5373
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5374 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
5375 the subject region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5376
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5377 Optional START and END indicate bounds of region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5378
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
5379 Optional arg, FORMAT, designates an alternate presentation form for
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5380 the prefix:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5381
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5382 list -- Present prefix as numeric section.subsection..., starting with
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5383 section indicated by the list, innermost nesting first.
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5384 `indent' (symbol) -- Convert header prefixes to all white space,
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5385 except for distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5386
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5387 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
5388 header and body. The elements of that list are:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5389
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5390 - a number representing the depth of the topic,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5391 - a string representing the header-prefix, including trailing whitespace and
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5392 bullet.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5393 - a string representing the bullet character,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5394 - 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
5395 portion of the topic entry."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5396
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5397 (interactive "r")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5398 (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5399 (let*
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5400 ((inhibit-field-text-motion t)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5401 ;; state vars:
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5402 strings prefix result depth new-depth out gone-out bullet beg
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5403 next done)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5404
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5405 (goto-char start)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5406 (beginning-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5407 ;; Goto initial topic, and register preceeding stuff, if any:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5408 (if (> (allout-goto-prefix-doublechecked) start)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5409 ;; First topic follows beginning point -- register preliminary stuff:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5410 (setq result (list (list 0 "" nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5411 (buffer-substring start (1- (point)))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5412 (while (and (not done)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5413 (not (eobp)) ; Loop until we've covered the region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5414 (not (> (point) end)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5415 (setq depth allout-recent-depth ; Current topics 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
5416 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
5417 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
5418 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
5419 (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
5420 (not (allout-next-visible-heading 1)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5421 (setq new-depth allout-recent-depth)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5422 (setq gone-out out
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5423 out (< new-depth depth))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5424 (beginning-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5425 (setq next (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5426 (goto-char beg)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5427 (setq strings nil)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5428 (while (> next (point)) ; Get all the exposed text in
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5429 (setq strings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5430 (cons (buffer-substring
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5431 beg
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5432 ;To hidden text or end of line:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5433 (progn
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5434 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5435 (allout-back-to-visible-text)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5436 strings))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5437 (when (< (point) next) ; Resume from after hid text, if any.
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
5438 (line-move 1)
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
5439 (beginning-of-line))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5440 (setq beg (point)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5441 ;; Accumulate list for this topic:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5442 (setq strings (nreverse strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5443 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5444 (cons
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5445 (if format
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5446 (let ((special (if (string-match
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5447 (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
5448 allout-distinctive-bullets-string)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5449 bullet)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5450 (cond ((listp format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5451 (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
5452 (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
5453 (allout-stringify-flat-index format
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5454 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
5455 (allout-stringify-flat-index-plain
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5456 format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5457 strings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5458 special))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5459 ((eq format 'indent)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5460 (if special
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5461 (list depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5462 (concat (make-string (1+ depth) ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5463 (substring prefix -1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5464 strings)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5465 (list depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5466 (make-string depth ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5467 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
5468 (t (error "allout-listify-exposed: %s %s"
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5469 "invalid format" format))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5470 (list depth prefix strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5471 result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5472 ;; Reasses format, if any:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5473 (if (and format (listp format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5474 (cond ((= new-depth depth)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5475 (setq format (cons (1+ (car format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5476 (cdr format))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5477 ((> new-depth depth) ; descending -- assume by 1:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5478 (setq format (cons 1 format)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5479 (t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5480 ; Pop the residue:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5481 (while (< new-depth depth)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5482 (setq format (cdr format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5483 (setq depth (1- depth)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5484 ; And increment the current one:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5485 (setq format
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5486 (cons (1+ (or (car format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5487 -1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5488 (cdr format)))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5489 ;; 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
5490 (nreverse result))))
87407
25c8924964c6 (allout-region-active-p): Renamed from my-region-active-p. Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents: 87160
diff changeset
5491 ;;;_ > allout-region-active-p ()
25c8924964c6 (allout-region-active-p): Renamed from my-region-active-p. Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents: 87160
diff changeset
5492 (defmacro allout-region-active-p ()
87943
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
5493 (cond ((fboundp 'use-region-p) '(use-region-p))
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
5494 ((fboundp 'region-active-p) '(region-active-p))
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
5495 (t 'mark-active)))
4fb8430d030b (allout-keybindings-list): In initial setting, express
Ken Manheimer <ken.manheimer@gmail.com>
parents: 87649
diff changeset
5496 ;;_ > allout-process-exposed (&optional func from to frombuf
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5497 ;;; 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
5498 (defun allout-process-exposed (&optional func from to frombuf tobuf
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5499 format start-num)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5500 "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
5501
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5502 All args are options; default values itemized below.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5503
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5504 Apply FUNCTION to exposed portions FROM position TO position in buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5505 FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5506 alternate presentation form:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5507
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5508 `flat' -- Present prefix as numeric section.subsection..., starting with
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
5509 section indicated by the START-NUM, innermost nesting first.
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5510 X`flat-indented' -- Prefix is like `flat' for first topic at each
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5511 X level, but subsequent topics have only leaf topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5512 X number, padded with blanks to line up with first.
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5513 `indent' (symbol) -- Convert header prefixes to all white space,
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5514 except for distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5515
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5516 Defaults:
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5517 FUNCTION: `allout-insert-listified'
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5518 FROM: region start, if region active, else start of buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5519 TO: region end, if region active, else end of buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5520 FROMBUF: current buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5521 TOBUF: buffer name derived: \"*current-buffer-name exposed*\"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5522 FORMAT: nil"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5523
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5524 ; Resolve arguments,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5525 ; 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
5526 (if (not func) (setq func 'allout-insert-listified))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5527 (if (not (and from to))
87407
25c8924964c6 (allout-region-active-p): Renamed from my-region-active-p. Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents: 87160
diff changeset
5528 (if (allout-region-active-p)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5529 (setq from (region-beginning) to (region-end))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5530 (setq from (point-min) to (point-max))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5531 (if frombuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5532 (if (not (bufferp frombuf))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5533 ;; Specified but not a buffer -- get it:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5534 (let ((got (get-buffer frombuf)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5535 (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
5536 (error (concat "allout-process-exposed: source buffer "
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5537 frombuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5538 " not found."))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5539 (setq frombuf got))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5540 ;; not specified -- default it:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5541 (setq frombuf (current-buffer)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5542 (if tobuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5543 (if (not (bufferp tobuf))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5544 (setq tobuf (get-buffer-create tobuf)))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5545 ;; not specified -- default it:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5546 (setq tobuf (concat "*" (buffer-name frombuf) " exposed*")))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5547 (if (listp format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5548 (nreverse format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5549
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5550 (let* ((listified
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5551 (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
5552 (allout-listify-exposed from to format))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5553 (set-buffer tobuf)
84855
5b7295004fd1 (produce-allout-mode-map, allout-process-exposed):
Juanma Barranquero <lekktu@gmail.com>
parents: 78492
diff changeset
5554 (mapc func listified)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5555 (pop-to-buffer tobuf)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5556
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5557 ;;;_ - 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
5558 ;;;_ > 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
5559 (defun allout-insert-listified (listified)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5560 "Insert contents of listified outline portion in current buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5561
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
5562 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
5563
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5564 \`(depth prefix text)'
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5565
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5566 or \`(depth prefix text bullet-plus)'
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5567
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5568 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
5569 (setq listified (cdr listified))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5570 (let ((prefix (prog1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5571 (car listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5572 (setq listified (cdr listified))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5573 (text (prog1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5574 (car listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5575 (setq listified (cdr listified))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5576 (bullet-plus (car listified)))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5577 (insert prefix)
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5578 (if bullet-plus (insert (concat " " bullet-plus)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5579 (while text
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5580 (insert (car text))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5581 (if (setq text (cdr text))
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5582 (insert "\n")))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5583 (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
5584 ;;;_ > 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
5585 (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
5586 "Duplicate exposed portions of current outline to another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5587
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5588 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
5589
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5590 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
5591
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5592 Optional second arg TOBUF is target buffer name.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5593
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5594 Optional third arg FORMAT, if non-nil, symbolically designates an
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5595 alternate presentation format for the outline:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5596
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5597 `flat' - Convert topic header prefixes to numeric
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5598 section.subsection... identifiers.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5599 `indent' - Convert header prefixes to all white space, except for
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5600 distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5601 `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
5602 the full path, the rest have only the section number
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5603 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
5604
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5605 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5606 (if (not tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5607 (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
5608 (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
5609 (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
5610 (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
5611 (buf (current-buffer))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5612 (start-list ()))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5613 (if (eq format 'flat)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5614 (setq format (if arg (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5615 (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
5616 (allout-topic-flat-index))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5617 '(1))))
105994
009383a57ce8 * x-dnd.el (x-dnd-maybe-call-test-function):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105372
diff changeset
5618 (with-current-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
5619 (allout-process-exposed 'allout-insert-listified
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5620 beg
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5621 end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5622 (current-buffer)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5623 tobuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5624 format start-list)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5625 (goto-char (point-min))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5626 (pop-to-buffer buf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5627 (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
5628 ;;;_ > 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
5629 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5630 "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
5631
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5632 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
5633 `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
5634
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5635 Use `allout-indented-exposed-to-buffer' for indented presentation.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5636
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5637 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
5638
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
5639 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
5640 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
5641 used verbatim."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5642 (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
5643 (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
5644 ;;;_ > 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
5645 (defun allout-indented-exposed-to-buffer (&optional arg tobuf)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5646 "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
5647
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5648 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
5649 `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
5650
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5651 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
5652
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5653 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
5654
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
5655 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
5656 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
5657 used verbatim."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5658 (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
5659 (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
5660
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5661 ;;;_ - 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
5662 ;;;_ > 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
5663 (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
5664 "Return copy of STRING for literal reproduction across LaTeX processing.
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5665 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
5666 string across LaTeX processing."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5667 (mapconcat (function
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5668 (lambda (char)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5669 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5670 (concat "\\char" (number-to-string char) "{}"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5671 ((= char ?\n) "\\\\")
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5672 (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
5673 string
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5674 ""))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5675 ;;;_ > 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
5676 (defun allout-latex-verbatim-quote-curr-line ()
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5677 "Express line for exact (literal) representation across LaTeX processing.
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5678
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5679 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
5680 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
5681 environment. Leaves point at the end of the line."
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5682 (let ((inhibit-field-text-motion t))
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5683 (beginning-of-line)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
5684 (let ((beg (point))
111537
b8d806986840 Restore clobbered allout.el changes.
Glenn Morris <rgm@gnu.org>
parents: 111535
diff changeset
5685 (end (point-at-eol)))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5686 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5687 (while (re-search-forward "\\\\"
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5688 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5689 end ; bounded by end-of-line
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5690 1) ; no matches, move to end & return nil
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5691 (goto-char (match-beginning 2))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5692 (insert "\\")
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5693 (setq end (1+ end))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
5694 (goto-char (1+ (match-end 2))))))))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
5695 ;;;_ > 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
5696 (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
5697 "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
5698 ;; 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
5699 ;; 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
5700 (set-buffer buffer)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5701 (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
5702 "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
5703 (page-numbering (if allout-number-pages
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5704 "\\pagestyle{empty}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5705 ""))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5706 (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
5707 allout-title-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5708 (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
5709 allout-label-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5710 (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
5711 allout-head-line-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5712 (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
5713 allout-body-line-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5714 (setlength (format "%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5715 "\\newlength{\\stepsize}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5716 "\\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
5717 allout-indent
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5718 "}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5719 (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
5720 "\\newcommand{\\OneHeadLine}[3]{%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5721 "\\noindent%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5722 "\\hspace*{#2\\stepsize}%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5723 "\\labelcmd{#1}\\hspace*{.2cm}"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5724 "\\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
5725 allout-line-skip
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5726 "]\n}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5727 (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
5728 "\\newcommand{\\OneBodyLine}[2]{%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5729 "\\noindent%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5730 "\\hspace*{#1\\stepsize}%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5731 "\\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
5732 allout-line-skip
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5733 "]\n}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5734 (begindoc "\\begin{document}\n\\begin{center}\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5735 (title (format "%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5736 "\\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
5737 (allout-latex-verb-quote (if allout-title
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5738 (condition-case 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
5739 (eval allout-title)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5740 (error "<unnamed buffer>"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5741 "Unnamed Outline"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5742 "}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5743 "\\end{center}\n\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5744 (hsize "\\hsize = 7.5 true in\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5745 (hoffset "\\hoffset = -1.5 true in\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5746 (vspace "\\vspace{.1cm}\n\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5747 (insert (concat doc-style
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5748 page-numbering
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5749 titlecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5750 labelcmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5751 headlinecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5752 bodylinecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5753 setlength
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5754 oneheadline
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5755 onebodyline
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5756 begindoc
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5757 title
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5758 hsize
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5759 hoffset
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5760 vspace)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5761 )))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
5762 ;;;_ > 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
5763 (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
5764 "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
5765 (set-buffer buffer)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5766 (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
5767 ;;;_ > 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
5768 (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
5769 "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
5770
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5771 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
5772 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
5773 (let* ((head-line (if text (car text)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5774 (body-lines (cdr text))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5775 (curr-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5776 body-content bop)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5777 ; Do the head line:
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
5778 (insert (concat "\\OneHeadLine{\\verb\1 "
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5779 (allout-latex-verb-quote bullet)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5780 "\1}{"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5781 depth
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5782 "}{\\verb\1 "
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5783 (if head-line
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5784 (allout-latex-verb-quote head-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5785 "")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5786 "\1}\n"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5787 (if (not body-lines)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5788 nil
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5789 ;;(insert "\\beginlines\n")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5790 (insert "\\begin{verbatim}\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5791 (while body-lines
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5792 (setq curr-line (car body-lines))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5793 (if (and (not body-content)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5794 (not (string-match "^\\s-*$" curr-line)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5795 (setq body-content t))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5796 ; Mangle any occurrences of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5797 ; "\end{verbatim}" in text,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5798 ; it's special:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5799 (if (and body-content
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5800 (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
5801 (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
5802 ">"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5803 (substring curr-line bop))))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5804 ;;(insert "|" (car body-lines) "|")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5805 (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
5806 (allout-latex-verbatim-quote-curr-line)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5807 (insert "\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5808 (setq body-lines (cdr body-lines)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5809 (if body-content
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5810 (setq body-content nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5811 (forward-char -1)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5812 (insert "\\ ")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5813 (forward-char 1))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5814 ;;(insert "\\endlines\n")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5815 (insert "\\end{verbatim}\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5816 )))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5817 ;;;_ > 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
5818 (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
5819 "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
5820 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
5821 with \"*\" prepended and \" latex-formed*\" appended.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5822
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5823 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
5824
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5825 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5826 (if (not tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5827 (setq tobuf
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5828 (get-buffer-create (concat "*" (buffer-name) " latexified*"))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5829 (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
5830 (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
5831 (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
5832 (buf (current-buffer)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5833 (set-buffer tobuf)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5834 (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
5835 (allout-insert-latex-header tobuf)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5836 (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
5837 (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
5838 beg
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5839 end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5840 buf
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5841 tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5842 (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
5843 (allout-insert-latex-trailer tobuf)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5844 (goto-char (point-min))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5845 (pop-to-buffer buf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5846 (goto-char start-pt)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5847
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5848 ;;;_ #8 Encryption
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5849 ;;;_ > allout-toggle-current-subtree-encryption (&optional keymode-cue)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5850 (defun allout-toggle-current-subtree-encryption (&optional keymode-cue)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5851 "Encrypt clear or decrypt encoded topic text.
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5852
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5853 Allout uses emacs 'epg' libary to perform encryption. Symmetric
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5854 and keypair encryption are supported. All encryption is ascii
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5855 armored.
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5856
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5857 Entry encryption defaults to symmetric key mode unless keypair
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5858 recipients are associated with the file \(see
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5859 `epa-file-encrypt-to') or the function is invoked with a
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5860 \(KEYMODE-CUE) universal argument greater than 1.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5861
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5862 When encrypting, KEYMODE-CUE universal argument greater than 1
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5863 causes prompting for recipients for public-key keypair
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5864 encryption. Selecting no recipients results in symmetric key
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5865 encryption.
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5866
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5867 Further, encrypting with a KEYMODE-CUE universal argument greater
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5868 than 4 - eg, preceded by a doubled Ctrl-U - causes association of
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5869 the specified recipients with the file, replacing those currently
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5870 associated with it. This can be used to deassociate any
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5871 recipients with the file, by selecting no recipients in the
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5872 dialog.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5873
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5874 Encrypted topic's bullets are set to a `~' to signal that the
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5875 contents of the topic (body and subtopics, but not heading) is
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5876 pending encryption or encrypted. `*' asterisk immediately after
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5877 the bullet signals that the body is encrypted, its absence means
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5878 the topic is meant to be encrypted but is not currently. When a
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5879 file with topics pending encryption is saved, topics pending
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5880 encryption are encrypted. See allout-encrypt-unencrypted-on-saves
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5881 for auto-encryption specifics.
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5882
74987
3a115c11d329 (allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents: 74864
diff changeset
5883 \*NOTE WELL* that automatic encryption that happens during saves will
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5884 default to symmetric encryption -- you must deliberately (re)encrypt key-pair
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5885 encrypted topics if you want them to continue to use the key-pair cipher.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5886
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5887 Level-one topics, with prefix consisting solely of an `*' asterisk, cannot be
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5888 encrypted. If you want to encrypt the contents of a top-level topic, use
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5889 \\[allout-shift-in] to increase its depth."
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5890 (interactive "P")
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5891 (save-excursion
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5892 (allout-back-to-current-heading)
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5893 (allout-toggle-subtree-encryption keymode-cue)))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5894 ;;;_ > allout-toggle-subtree-encryption (&optional keymode-cue)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5895 (defun allout-toggle-subtree-encryption (&optional keymode-cue)
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
5896 "Encrypt clear text or decrypt encoded topic contents (body and subtopics.)
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5897
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5898 Entry encryption defaults to symmetric key mode unless keypair
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5899 recipients are associated with the file \(see
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5900 `epa-file-encrypt-to') or the function is invoked with a
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5901 \(KEYMODE-CUE) universal argument greater than 1.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5902
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5903 When encrypting, KEYMODE-CUE universal argument greater than 1
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5904 causes prompting for recipients for public-key keypair
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5905 encryption. Selecting no recipients results in symmetric key
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5906 encryption.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5907
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5908 Further, encrypting with a KEYMODE-CUE universal argument greater
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5909 than 4 - eg, preceded by a doubled Ctrl-U - causes association of
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5910 the specified recipients with the file, replacing those currently
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5911 associated with it. This can be used to deassociate any
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5912 recipients with the file, by selecting no recipients in the
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5913 dialog.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5914
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5915 Encryption and decryption uses the emacs epg library.
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5916
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
5917 Encrypted text will be ascii-armored.
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5918
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5919 See `allout-toggle-current-subtree-encryption' for more details."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5920
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5921 (interactive "P")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5922 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5923 (allout-end-of-prefix t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5924
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5925 (if (= allout-recent-depth 1)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5926 (error (concat "Cannot encrypt or decrypt level 1 topics -"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5927 " shift it in to make it encryptable")))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5928
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5929 (let* ((allout-buffer (current-buffer))
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5930 ;; Assess location:
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
5931 (bullet-pos allout-recent-prefix-beginning)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5932 (after-bullet-pos (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5933 (was-encrypted
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5934 (progn (if (= (point-max) after-bullet-pos)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5935 (error "no body to encrypt"))
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5936 (allout-encrypted-topic-p)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5937 (was-collapsed (if (not (search-forward "\n" nil t))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5938 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5939 (backward-char 1)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5940 (allout-hidden-p)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5941 (subtree-beg (1+ (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5942 (subtree-end (allout-end-of-subtree))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5943 (subject-text (buffer-substring-no-properties subtree-beg
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5944 subtree-end))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5945 (subtree-end-char (char-after (1- subtree-end)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5946 (subtree-trailing-char (char-after subtree-end))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
5947 ;; kluge -- result-text needs to be nil, but we also want to
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5948 ;; check for the error condition
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5949 (result-text (if (or (string= "" subject-text)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5950 (string= "\n" subject-text))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5951 (error "No topic contents to %scrypt"
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5952 (if was-encrypted "de" "en"))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5953 nil))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5954 ;; Assess key parameters:
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5955 (was-coding-system buffer-file-coding-system))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5956
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5957 (when (not was-encrypted)
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5958 ;; ensure that non-ascii chars pending encryption are noticed before
95241
54b3c5554f6f Spelling fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
5959 ;; they're encrypted, so the coding system is set to accommodate
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5960 ;; them.
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5961 (setq buffer-file-coding-system
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
5962 (allout-select-safe-coding-system subtree-beg subtree-end))
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5963 ;; if the coding system for the text being encrypted is different
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5964 ;; than that prevailing, then there a real risk that the coding
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5965 ;; system can't be noticed by emacs when the file is visited. to
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5966 ;; mitigate that, offer to preserve the coding system using a file
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5967 ;; local variable.
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5968 (if (and (not (equal buffer-file-coding-system
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5969 was-coding-system))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5970 (yes-or-no-p
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5971 (format (concat "Register coding system %s as file local"
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5972 " var? Necessary when only encrypted text"
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5973 " is in that coding system. ")
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5974 buffer-file-coding-system)))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5975 (allout-adjust-file-variable "buffer-file-coding-system"
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
5976 buffer-file-coding-system)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5977
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5978 (setq result-text
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5979 (allout-encrypt-string subject-text was-encrypted
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
5980 (current-buffer) keymode-cue))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5981
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5982 ;; Replace the subtree with the processed product.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5983 (allout-unprotected
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5984 (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5985 (set-buffer allout-buffer)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5986 (delete-region subtree-beg subtree-end)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5987 (insert result-text)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5988 (if was-collapsed
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5989 (allout-flag-region (1- subtree-beg) (point) t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5990 ;; adjust trailing-blank-lines to preserve topic spacing:
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5991 (if (not was-encrypted)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5992 (if (and (= subtree-end-char ?\n)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5993 (= subtree-trailing-char ?\n))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5994 (insert subtree-trailing-char)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5995 ;; Ensure that the item has an encrypted-entry bullet:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5996 (if (not (string= (buffer-substring-no-properties
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5997 (1- after-bullet-pos) after-bullet-pos)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5998 allout-topic-encryption-bullet))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5999 (progn (goto-char (1- after-bullet-pos))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6000 (delete-char 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6001 (insert allout-topic-encryption-bullet)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6002 (if was-encrypted
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6003 ;; Remove the is-encrypted bullet qualifier:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6004 (progn (goto-char after-bullet-pos)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6005 (delete-char 1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6006 ;; Add the is-encrypted bullet qualifier:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6007 (goto-char after-bullet-pos)
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6008 (insert "*"))))
73003
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
6009 (run-hook-with-args 'allout-structure-added-hook
ec72ab6f5541 * allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents: 72917
diff changeset
6010 bullet-pos subtree-end))))
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6011 ;;;_ > allout-encrypt-string (text decrypt allout-buffer keymode-cue
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6012 ;;; &optional rejected)
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6013 (defun allout-encrypt-string (text decrypt allout-buffer keymode-cue
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6014 &optional rejected)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6015 "Encrypt or decrypt message TEXT.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6016
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6017 Returns the resulting string, or nil if the transformation fails.
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6018
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6019 If DECRYPT is true (default false), then decrypt instead of encrypt.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6020
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6021 ALLOUT-BUFFER identifies the buffer containing the text.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6022
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6023 Entry encryption defaults to symmetric key mode unless keypair
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6024 recipients are associated with the file \(see
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6025 `epa-file-encrypt-to') or the function is invoked with a
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6026 \(KEYMODE-CUE) universal argument greater than 1.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6027
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6028 When encrypting, KEYMODE-CUE universal argument greater than 1
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6029 causes prompting for recipients for public-key keypair
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6030 encryption. Selecting no recipients results in symmetric key
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6031 encryption.
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6032
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6033 Further, encrypting with a KEYMODE-CUE universal argument greater
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6034 than 4 - eg, preceded by a doubled Ctrl-U - causes association of
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6035 the specified recipients with the file, replacing those currently
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6036 associated with it. This can be used to deassociate any
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6037 recipients with the file, by selecting no recipients in the
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6038 dialog.
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6039
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6040 Optional REJECTED is for internal use, to convey the number of
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6041 rejections due to matches against
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6042 `allout-encryption-ciphertext-rejection-regexps', as limited by
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6043 `allout-encryption-ciphertext-rejection-ceiling'.
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6044
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6045 NOTE: A few GnuPG v2 versions improperly preserve incorrect
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6046 symmetric decryption keys, preventing entry of the correct key on
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6047 subsequent decryption attempts until the cache times-out. That
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6048 can take several minutes. \(Decryption of other entries is not
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6049 affected.) Upgrade your EasyPG version, if you can, and you can
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6050 deliberately clear your gpg-agent's cache by sending it a '-HUP'
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6051 signal."
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6052
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6053 (require 'epg)
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6054 (require 'epa)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6055
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6056 (let* ((epg-context (let* ((context (epg-make-context nil t)))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6057 (epg-context-set-passphrase-callback
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6058 context #'epa-passphrase-callback-function)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6059 context))
74011
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
6060 (encoding (with-current-buffer allout-buffer
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
6061 buffer-file-coding-system))
cce8c092567f (allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents: 73763
diff changeset
6062 (multibyte (with-current-buffer allout-buffer
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6063 enable-multibyte-characters))
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6064 ;; "sanitization" avoids encryption results that are outline structure.
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6065 (sani-regexps 'allout-encryption-plaintext-sanitization-regexps)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6066 (strip-plaintext-regexps (if (not decrypt)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6067 (allout-get-configvar-values
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6068 sani-regexps)))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6069 (rejection-regexps 'allout-encryption-ciphertext-rejection-regexps)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6070 (reject-ciphertext-regexps (if (not decrypt)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6071 (allout-get-configvar-values
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6072 rejection-regexps)))
72367
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6073 (rejected (or rejected 0))
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6074 (rejections-left (- allout-encryption-ciphertext-rejection-ceiling
12fa9bdadf0a (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents: 72050
diff changeset
6075 rejected))
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6076 (keypair-mode (cond (decrypt 'decrypting)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6077 ((<= (prefix-numeric-value keymode-cue) 1)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6078 'default)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6079 ((<= (prefix-numeric-value keymode-cue) 4)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6080 'prompt)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6081 ((> (prefix-numeric-value keymode-cue) 4)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6082 'prompt-save)))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6083 (keypair-message (concat "Select encryption recipients.\n"
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6084 "Symmetric encryption is done if no"
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6085 " recipients are selected. "))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6086 (encrypt-to (and (boundp 'epa-file-encrypt-to) epa-file-encrypt-to))
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6087 recipients
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6088 massaged-text
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6089 result-text
76204
b5b902938a0a (allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents: 75347
diff changeset
6090 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6091
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6092 ;; Massage the subject text for encoding and filtering.
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6093 (with-temp-buffer
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6094 (insert text)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6095 ;; convey the text characteristics of the original buffer:
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6096 (allout-set-buffer-multibyte multibyte)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6097 (when encoding
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6098 (set-buffer-file-coding-system encoding)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6099 (if (not decrypt)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6100 (encode-coding-region (point-min) (point-max) encoding)))
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6101
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6102 ;; remove sanitization regexps matches before encrypting:
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6103 (when (and strip-plaintext-regexps (not decrypt))
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6104 (dolist (re strip-plaintext-regexps)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6105 (let ((re (if (listp re) (car re) re))
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6106 (replacement (if (listp re) (cadr re) "")))
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6107 (goto-char (point-min))
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6108 (save-match-data
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6109 (while (re-search-forward re nil t)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6110 (replace-match replacement nil nil))))))
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6111 (setq massaged-text (buffer-substring-no-properties (point-min)
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6112 (point-max))))
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6113 ;; determine key mode and, if keypair, recipients:
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6114 (setq recipients
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6115 (case keypair-mode
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6116
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6117 (decrypting nil)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6118
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6119 (default (if encrypt-to (epg-list-keys epg-context encrypt-to)))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6120
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6121 ((prompt prompt-save)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6122 (save-window-excursion
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6123 (epa-select-keys epg-context keypair-message)))))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6124
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6125 (setq result-text
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6126 (if decrypt
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6127 (epg-decrypt-string epg-context
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6128 (encode-coding-string massaged-text
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6129 (or encoding 'utf-8)))
112186
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
6130 (replace-regexp-in-string "\n$" ""
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
6131 (epg-encrypt-string epg-context
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
6132 (encode-coding-string massaged-text
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
6133 (or encoding 'utf-8))
705e5c9bc06a allout.el: Add 2011 to the file copyright.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 112129
diff changeset
6134 recipients))))
111982
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6135
f2d8b7a80f04 partial checking with substantial progress towards epg passphrase
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111981
diff changeset
6136 ;; validate result -- non-empty
111984
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6137 (if (not result-text)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6138 (error "%scryption failed." (if decrypt "De" "En")))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6139
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6140
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6141 (when (eq keypair-mode 'prompt-save)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6142 ;; set epa-file-encrypt-to in the buffer:
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6143 (setq epa-file-encrypt-to (mapcar (lambda (key)
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6144 (epg-user-id-string
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6145 (car (epg-key-user-id-list key))))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6146 recipients))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6147 ;; change the file variable:
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6148 (allout-adjust-file-variable "epa-file-encrypt-to" epa-file-encrypt-to))
f5276a518424 respect epa-file-encrypt-to, defaulting to it when encrypting, if set, and
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111983
diff changeset
6149
111983
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6150 (cond
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6151 ;; Retry (within limit) if ciphertext contains rejections:
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6152 ((and (not decrypt)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6153 ;; Check for disqualification of this ciphertext:
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6154 (let ((regexps reject-ciphertext-regexps)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6155 reject-it)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6156 (while (and regexps (not reject-it))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6157 (setq reject-it (string-match (car regexps) result-text))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6158 (pop regexps))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6159 reject-it))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6160 (setq rejections-left (1- rejections-left))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6161 (if (<= rejections-left 0)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6162 (error (concat "Ciphertext rejected too many times"
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6163 " (%s), per `%s'")
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6164 allout-encryption-ciphertext-rejection-ceiling
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6165 'allout-encryption-ciphertext-rejection-regexps)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6166 ;; try again (gpg-agent may have the key cached):
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6167 (allout-encrypt-string text decrypt allout-buffer keypair-mode
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6168 (1+ rejected))))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6169
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6170 ;; Barf if encryption yields extraordinary control chars:
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6171 ((and (not decrypt)
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6172 (string-match "[\C-a\C-k\C-o-\C-z\C-@]"
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6173 result-text))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6174 (error (concat "Encryption produced non-armored text, which"
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6175 "conflicts with allout mode -- reconfigure!")))
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6176
a348c631aeb8 - replace pgg with epg/epa - working version, with no calls to pgg.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111982
diff changeset
6177 (t result-text))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6178 ;;;_ > allout-encrypted-topic-p ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6179 (defun allout-encrypted-topic-p ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6180 "True if the current topic is encryptable and encrypted."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6181 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6182 (allout-end-of-prefix t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6183 (and (string= (buffer-substring-no-properties (1- (point)) (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6184 allout-topic-encryption-bullet)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6185 (save-match-data (looking-at "\\*")))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6186 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6187 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6188 ;;;_ > allout-next-topic-pending-encryption (&optional except-mark)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6189 (defun allout-next-topic-pending-encryption (&optional except-mark)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6190 "Return the point of the next topic pending encryption, or nil if none.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6191
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6192 EXCEPT-MARK identifies a point whose containing topics should be excluded
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6193 from encryption. This supports 'except-current mode of
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6194 `allout-encrypt-unencrypted-on-saves'.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6195
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
6196 Such a topic has the `allout-topic-encryption-bullet' without an
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6197 immediately following '*' that would mark the topic as being encrypted. It
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6198 must also have content."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6199 (let (done got content-beg)
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6200 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6201 (while (not done)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6202
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6203 (if (not (re-search-forward
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6204 (format "\\(\\`\\|\n\\)%s *%s[^*]"
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6205 (regexp-quote allout-header-prefix)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6206 (regexp-quote allout-topic-encryption-bullet))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6207 nil t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6208 (setq got nil
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6209 done t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6210 (goto-char (setq got (match-beginning 0)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6211 (if (save-match-data (looking-at "\n"))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6212 (forward-char 1))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6213 (setq got (point)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6214
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6215 (cond ((not got)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6216 (setq done t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6217
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6218 ((not (search-forward "\n"))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6219 (setq got nil
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6220 done t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6221
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6222 ((eobp)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6223 (setq got nil
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6224 done t))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6225
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6226 (t
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6227 (setq content-beg (point))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6228 (backward-char 1)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6229 (allout-end-of-subtree)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6230 (if (or (<= (point) content-beg)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6231 (and except-mark
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6232 (<= content-beg except-mark)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6233 (>= (point) except-mark)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6234 ;; Continue looking
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6235 (setq got nil)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6236 ;; Got it!
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6237 (setq done t)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6238 )
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6239 )
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6240 (if got
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6241 (goto-char got))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6242 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6243 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6244 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6245 ;;;_ > allout-encrypt-decrypted (&optional except-mark)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6246 (defun allout-encrypt-decrypted (&optional except-mark)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6247 "Encrypt topics pending encryption except those containing exemption point.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6248
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6249 EXCEPT-MARK identifies a point whose containing topics should be excluded
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6250 from encryption. This supports the `except-current' mode of
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6251 `allout-encrypt-unencrypted-on-saves'.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6252
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6253 If a topic that is currently being edited was encrypted, we return a list
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6254 containing the location of the topic and the location of the cursor just
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6255 before the topic was encrypted. This can be used, eg, to decrypt the topic
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6256 and exactly resituate the cursor if this is being done as part of a file
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6257 save. See `allout-encrypt-unencrypted-on-saves' for more info."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6258
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6259 (interactive "p")
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6260 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6261 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6262 (let* ((current-mark (point-marker))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6263 (current-mark-position (marker-position current-mark))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6264 was-modified
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6265 bo-subtree
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6266 editing-topic editing-point)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6267 (goto-char (point-min))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6268 (while (allout-next-topic-pending-encryption except-mark)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6269 (setq was-modified (buffer-modified-p))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6270 (when (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6271 (and (boundp 'allout-encrypt-unencrypted-on-saves)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6272 allout-encrypt-unencrypted-on-saves
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6273 (setq bo-subtree (re-search-forward "$"))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6274 (not (allout-hidden-p))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6275 (>= current-mark (point))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6276 (allout-end-of-current-subtree)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6277 (<= current-mark (point))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6278 (setq editing-topic (point)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6279 ;; we had to wait for this 'til now so prior topics are
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6280 ;; encrypted, any relevant text shifts are in place:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6281 editing-point (- current-mark-position
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6282 (count-trailing-whitespace-region
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6283 bo-subtree current-mark-position))))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6284 (allout-toggle-subtree-encryption)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6285 (if (not was-modified)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6286 (set-buffer-modified-p nil))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6287 )
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6288 (if (not was-modified)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6289 (set-buffer-modified-p nil))
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6290 (if editing-topic (list editing-topic editing-point))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6291 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6292 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6293 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6294 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6295
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6296 ;;;_ #9 miscellaneous
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6297 ;;;_ : Mode:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6298 ;;;_ > outlineify-sticky ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6299 ;; outlinify-sticky is correct spelling; provide this alias for sticklers:
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6300 ;;;###autoload
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6301 (defalias 'outlinify-sticky 'outlineify-sticky)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
6302 ;;;###autoload
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6303 (defun outlineify-sticky (&optional arg)
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
6304 "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
6305
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
6306 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
6307 setup for auto-startup."
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6308
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6309 (interactive "P")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6310
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6311 (if (allout-mode-p) (allout-mode)) ; deactivate so we can re-activate...
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6312 (allout-mode)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6313
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6314 (save-excursion
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6315 (goto-char (point-min))
73660
4a5c7b0a29cc 2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents: 73315
diff changeset
6316 (if (allout-goto-prefix)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
6317 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
6318 (allout-open-topic 2)
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6319 (insert (concat "Dummy outline topic header -- see"
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6320 "`allout-mode' docstring: `^Hm'."))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6321 (allout-adjust-file-variable
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
6322 "allout-layout" (or allout-layout '(-1 : 0))))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6323 ;;;_ > allout-file-vars-section-data ()
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6324 (defun allout-file-vars-section-data ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6325 "Return data identifying the file-vars section, or nil if none.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6326
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6327 Returns a list of the form (BEGINNING-POINT PREFIX-STRING SUFFIX-STRING)."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6328 ;; minimally gleaned from emacs 21.4 files.el hack-local-variables function.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6329 (let (beg prefix suffix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6330 (save-excursion
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6331 (goto-char (point-max))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6332 (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6333 (if (let ((case-fold-search t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6334 (not (search-forward "Local Variables:" nil t)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6335 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6336 (setq beg (- (point) 16))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6337 (setq suffix (buffer-substring-no-properties
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6338 (point)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6339 (progn (if (search-forward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6340 (forward-char -1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6341 (point))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6342 (setq prefix (buffer-substring-no-properties
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6343 (progn (if (search-backward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6344 (forward-char 1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6345 (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6346 beg))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6347 (list beg prefix suffix))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6348 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6349 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6350 )
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6351 ;;;_ > allout-adjust-file-variable (varname value)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6352 (defun allout-adjust-file-variable (varname value)
73763
89b9e8184350 (allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents: 73660
diff changeset
6353 "Adjust the setting of an Emacs file variable named VARNAME to VALUE.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6354
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6355 This activity is inhibited if either `enable-local-variables'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6356 `allout-enable-file-variable-adjustment' are nil.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6357
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6358 When enabled, an entry for the variable is created if not already present,
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6359 or changed if established with a different value. The section for the file
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6360 variables, itself, is created if not already present. When created, the
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
6361 section lines (including the section line) exist as second-level topics in
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6362 a top-level topic at the end of the file.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6363
73763
89b9e8184350 (allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents: 73660
diff changeset
6364 `enable-local-variables' must be true for any of this to happen."
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6365 (if (not (and enable-local-variables
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6366 allout-enable-file-variable-adjustment))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6367 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6368 (save-excursion
72050
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
6369 (let ((inhibit-field-text-motion t)
d79208e62ea9 (allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents: 71915
diff changeset
6370 (section-data (allout-file-vars-section-data))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6371 beg prefix suffix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6372 (if section-data
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6373 (setq beg (car section-data)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6374 prefix (cadr section-data)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6375 suffix (car (cddr section-data)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6376 ;; create the section
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6377 (goto-char (point-max))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6378 (open-line 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6379 (allout-open-topic 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6380 (end-of-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6381 (insert "Local emacs vars.\n")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6382 (allout-open-topic 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6383 (setq beg (point)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6384 suffix ""
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6385 prefix (buffer-substring-no-properties (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6386 (beginning-of-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6387 (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6388 beg))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6389 (goto-char beg)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6390 (insert "Local variables:\n")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6391 (allout-open-topic 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6392 (insert "End:\n")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6393 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6394 ;; look for existing entry or create one, leaving point for insertion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6395 ;; of new value:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6396 (goto-char beg)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6397 (allout-show-to-offshoot)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6398 (if (search-forward (concat "\n" prefix varname ":") nil t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6399 (let* ((value-beg (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6400 (line-end (progn (if (search-forward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6401 (forward-char -1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6402 (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6403 (value-end (- line-end (length suffix))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6404 (if (> value-end value-beg)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6405 (delete-region value-beg value-end)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6406 (end-of-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6407 (open-line 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6408 (forward-line 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6409 (insert (concat prefix varname ":")))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6410 (insert (format " %S%s" value suffix))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6411 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6412 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6413 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6414 )
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6415 ;;;_ > allout-get-configvar-values (varname)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6416 (defun allout-get-configvar-values (configvar-name)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6417 "Return a list of values of the symbols in list bound to CONFIGVAR-NAME.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6418
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6419 The user is prompted for removal of symbols that are unbound, and they
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6420 otherwise are ignored.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6421
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6422 CONFIGVAR-NAME should be the name of the configuration variable,
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6423 not its value."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6424
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6425 (let ((configvar-value (symbol-value configvar-name))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6426 got)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6427 (dolist (sym configvar-value)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6428 (if (not (boundp sym))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6429 (if (yes-or-no-p (format "%s entry `%s' is unbound -- remove it? "
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6430 configvar-name sym))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6431 (delq sym (symbol-value configvar-name)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6432 (push (symbol-value sym) got)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6433 (reverse got)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6434 ;;;_ : Topics:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6435 ;;;_ > allout-mark-topic ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6436 (defun allout-mark-topic ()
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6437 "Put the region around topic currently containing point."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6438 (interactive)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6439 (let ((inhibit-field-text-motion t))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6440 (beginning-of-line))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6441 (allout-goto-prefix-doublechecked)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6442 (push-mark (point))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6443 (allout-end-of-current-subtree)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6444 (exchange-point-and-mark))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6445 ;;;_ : UI:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6446 ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6447 (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
6448 "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
6449
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6450 Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6451
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6452 (let ((new-prompt prompt)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6453 got)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6454
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6455 (while (not got)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6456 (message "%s" new-prompt)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6457
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6458 ;; 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
6459 ;; treatment for `?' character. (Oughta use minibuffer keymap instead.)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6460 (setq got
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6461 (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
6462
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6463 (setq got
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6464 (cond ((string-match (regexp-quote got) string) got)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6465 ((and do-defaulting (string= got "\r"))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6466 ;; Return empty string to default:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6467 "")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6468 ((string= got "\C-g") (signal 'quit nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6469 (t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6470 (setq new-prompt (concat prompt
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6471 got
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6472 " ...pick from: "
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6473 string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6474 ""))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6475 nil))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6476 ;; got something out of loop -- return it:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
6477 got)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6478 )
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6479 ;;;_ : Strings:
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6480 ;;;_ > regexp-sans-escapes (string)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6481 (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
6482 "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
6483
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6484 Representations of actual backslashes -- '\\\\\\\\' -- are left as a
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6485 single backslash.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6486
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6487 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
6488
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6489 (if (string= regexp "")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6490 ""
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6491 ;; 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
6492 ;; backslash, or else to nil:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6493 (setq successive-backslashes
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6494 (if (= (aref regexp 0) ?\\)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6495 (if successive-backslashes (1+ successive-backslashes) 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6496 nil))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6497 (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
6498 ;; Include first char:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6499 (concat (substring regexp 0 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6500 (regexp-sans-escapes (substring regexp 1)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6501 ;; Exclude first char, but maintain count:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6502 (regexp-sans-escapes (substring regexp 1) successive-backslashes))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6503 ;;;_ > count-trailing-whitespace-region (beg end)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6504 (defun count-trailing-whitespace-region (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6505 "Return number of trailing whitespace chars between BEG and END.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6506
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6507 If BEG is bigger than END we return 0."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6508 (if (> beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6509 0
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6510 (save-match-data
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6511 (save-excursion
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6512 (goto-char beg)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6513 (let ((count 0))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6514 (while (re-search-forward "[ ][ ]*$" end t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6515 (goto-char (1+ (match-beginning 2)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6516 (setq count (1+ count)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6517 count)))))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6518 ;;;_ > allout-format-quote (string)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6519 (defun allout-format-quote (string)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6520 "Return a copy of string with all \"%\" characters doubled."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6521 (apply 'concat
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6522 (mapcar (lambda (char) (if (= char ?%) "%%" (char-to-string char)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6523 string)))
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6524 ;;;_ : lists
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6525 ;;;_ > allout-flatten (list)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6526 (defun allout-flatten (list)
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6527 "Return a list of all atoms in list."
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6528 ;; classic.
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6529 (cond ((null list) nil)
72917
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
6530 ((atom (car list)) (cons (car list) (allout-flatten (cdr list))))
17942cb3949e (allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents: 72873
diff changeset
6531 (t (append (allout-flatten (car list)) (allout-flatten (cdr list))))))
79915
e54d9b453e0e (allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 79721
diff changeset
6532 ;;;_ : Compatibility:
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6533 ;;;_ : xemacs undo-in-progress provision:
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6534 (unless (boundp 'undo-in-progress)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6535 (defvar undo-in-progress nil
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6536 "Placeholder defvar for XEmacs compatibility from allout.el.")
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6537 (defadvice undo-more (around allout activate)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6538 ;; This defadvice used only in emacs that lack undo-in-progress, eg xemacs.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6539 (let ((undo-in-progress t)) ad-do-it)))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6540
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6541 ;;;_ > allout-mark-marker to accommodate divergent emacsen:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6542 (defun allout-mark-marker (&optional force buffer)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6543 "Accommodate the different signature for `mark-marker' across Emacsen.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6544
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6545 XEmacs takes two optional args, while mainline GNU Emacs does not,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6546 so pass them along when appropriate."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6547 (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6548 (apply 'mark-marker force buffer)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6549 (mark-marker)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6550 ;;;_ > subst-char-in-string if necessary
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6551 (if (not (fboundp 'subst-char-in-string))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6552 (defun subst-char-in-string (fromchar tochar string &optional inplace)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6553 "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6554 Unless optional argument INPLACE is non-nil, return a new string."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6555 (let ((i (length string))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6556 (newstr (if inplace string (copy-sequence string))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6557 (while (> i 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6558 (setq i (1- i))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6559 (if (eq (aref newstr i) fromchar)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6560 (aset newstr i tochar)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6561 newstr)))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6562 ;;;_ > wholenump if necessary
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6563 (if (not (fboundp 'wholenump))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6564 (defalias 'wholenump 'natnump))
72873
b42e98d06749 * allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents: 72367
diff changeset
6565 ;;;_ > remove-overlays if necessary
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6566 (if (not (fboundp 'remove-overlays))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6567 (defun remove-overlays (&optional beg end name val)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6568 "Clear BEG and END of overlays whose property NAME has value VAL.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6569 Overlays might be moved and/or split.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6570 BEG and END default respectively to the beginning and end of buffer."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6571 (unless beg (setq beg (point-min)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6572 (unless end (setq end (point-max)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6573 (if (< end beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6574 (setq beg (prog1 end (setq end beg))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6575 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6576 (dolist (o (overlays-in beg end))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6577 (when (eq (overlay-get o name) val)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6578 ;; Either push this overlay outside beg...end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6579 ;; or split it to exclude beg...end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6580 ;; or delete it entirely (if it is contained in beg...end).
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6581 (if (< (overlay-start o) beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6582 (if (> (overlay-end o) end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6583 (progn
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6584 (move-overlay (copy-overlay o)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6585 (overlay-start o) beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6586 (move-overlay o end (overlay-end o)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6587 (move-overlay o (overlay-start o) beg))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6588 (if (> (overlay-end o) end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6589 (move-overlay o end (overlay-end o))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6590 (delete-overlay o)))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6591 )
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6592 ;;;_ > copy-overlay if necessary -- xemacs ~ 21.4
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6593 (if (not (fboundp 'copy-overlay))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6594 (defun copy-overlay (o)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6595 "Return a copy of overlay O."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6596 (let ((o1 (make-overlay (overlay-start o) (overlay-end o)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6597 ;; FIXME: there's no easy way to find the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6598 ;; insertion-type of the two markers.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6599 (overlay-buffer o)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6600 (props (overlay-properties o)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6601 (while props
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6602 (overlay-put o1 (pop props) (pop props)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6603 o1)))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6604 ;;;_ > add-to-invisibility-spec if necessary -- xemacs ~ 21.4
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6605 (if (not (fboundp 'add-to-invisibility-spec))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6606 (defun add-to-invisibility-spec (element)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6607 "Add ELEMENT to `buffer-invisibility-spec'.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6608 See documentation for `buffer-invisibility-spec' for the kind of elements
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6609 that can be added."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6610 (if (eq buffer-invisibility-spec t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6611 (setq buffer-invisibility-spec (list t)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6612 (setq buffer-invisibility-spec
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6613 (cons element buffer-invisibility-spec))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6614 ;;;_ > remove-from-invisibility-spec if necessary -- xemacs ~ 21.4
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6615 (if (not (fboundp 'remove-from-invisibility-spec))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6616 (defun remove-from-invisibility-spec (element)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6617 "Remove ELEMENT from `buffer-invisibility-spec'."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6618 (if (consp buffer-invisibility-spec)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6619 (setq buffer-invisibility-spec (delete element
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6620 buffer-invisibility-spec)))))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6621 ;;;_ > move-beginning-of-line if necessary -- older emacs, xemacs
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6622 (if (not (fboundp 'move-beginning-of-line))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6623 (defun move-beginning-of-line (arg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6624 "Move point to beginning of current line as displayed.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6625 \(This disregards invisible newlines such as those
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6626 which are part of the text that an image rests on.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6627
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6628 With argument ARG not nil or 1, move forward ARG - 1 lines first.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6629 If point reaches the beginning or end of buffer, it stops there.
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
6630 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6631 (interactive "p")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6632 (or arg (setq arg 1))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6633 (if (/= arg 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6634 (condition-case nil (line-move (1- arg)) (error nil)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6635
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6636 ;; Move to beginning-of-line, ignoring fields and invisibles.
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6637 (skip-chars-backward "^\n")
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6638 (while (and (not (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6639 (let ((prop
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6640 (get-char-property (1- (point)) 'invisible)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6641 (if (eq buffer-invisibility-spec t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6642 prop
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6643 (or (memq prop buffer-invisibility-spec)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6644 (assq prop buffer-invisibility-spec)))))
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6645 (goto-char (if (featurep 'xemacs)
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6646 (previous-property-change (point))
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6647 (previous-char-property-change (point))))
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6648 (skip-chars-backward "^\n"))
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6649 (vertical-motion 0))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6650 )
111445
56b71cddc9c5 Replace still more end-of-line etc with line-end-position, etc.
Glenn Morris <rgm@gnu.org>
parents: 108209
diff changeset
6651 ;;;_ > move-end-of-line if necessary -- Emacs < 22.1, xemacs
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6652 (if (not (fboundp 'move-end-of-line))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6653 (defun move-end-of-line (arg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6654 "Move point to end of current line as displayed.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6655 \(This disregards invisible newlines such as those
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6656 which are part of the text that an image rests on.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6657
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6658 With argument ARG not nil or 1, move forward ARG - 1 lines first.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6659 If point reaches the beginning or end of buffer, it stops there.
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
6660 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6661 (interactive "p")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6662 (or arg (setq arg 1))
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6663 (let (done)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6664 (while (not done)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6665 (let ((newpos
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6666 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6667 (let ((goal-column 0))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6668 (and (condition-case nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6669 (or (line-move arg) t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6670 (error nil))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6671 (not (bobp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6672 (progn
85769
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6673 (while
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6674 (and
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6675 (not (bobp))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6676 (let ((prop
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6677 (get-char-property (1- (point))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6678 'invisible)))
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6679 (if (eq buffer-invisibility-spec t)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6680 prop
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6681 (or (memq prop
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6682 buffer-invisibility-spec)
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6683 (assq prop
de8ef384c3ef * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85114
diff changeset
6684 buffer-invisibility-spec)))))
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6685 (goto-char
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6686 (previous-char-property-change (point))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6687 (backward-char 1)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6688 (point)))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6689 (goto-char newpos)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6690 (if (and (> (point) newpos)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6691 (eq (preceding-char) ?\n))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6692 (backward-char 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6693 (if (and (> (point) newpos) (not (eobp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6694 (not (eq (following-char) ?\n)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6695 ;; If we skipped something intangible
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6696 ;; and now we're not really at eol,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6697 ;; keep going.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6698 (setq arg 1)
70244
ccd02e1ca0e3 Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 70225
diff changeset
6699 (setq done t)))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6700 )
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6701 ;;;_ > allout-next-single-char-property-change -- alias unless lacking
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6702 (defalias 'allout-next-single-char-property-change
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6703 (if (fboundp 'next-single-char-property-change)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6704 'next-single-char-property-change
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6705 'next-single-property-change)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6706 ;; No docstring because xemacs defalias doesn't support it.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6707 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6708 ;;;_ > allout-previous-single-char-property-change -- alias unless lacking
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6709 (defalias 'allout-previous-single-char-property-change
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6710 (if (fboundp 'previous-single-char-property-change)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6711 'previous-single-char-property-change
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6712 'previous-single-property-change)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6713 ;; No docstring because xemacs defalias doesn't support it.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6714 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6715 ;;;_ > allout-set-buffer-multibyte
112027
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6716 (if (fboundp 'set-buffer-multibyte)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6717 (defalias 'allout-set-buffer-multibyte 'set-buffer-multibyte)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6718 (with-no-warnings
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6719 ;; this definition is used only in older or alternative emacs, where
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6720 ;; the setting is our only recourse.
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6721 (defun allout-set-buffer-multibyte (is-multibyte)
a23f5102654d (allout-v18/19-file-var-hack): Obsolete, remove.
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111989
diff changeset
6722 (set enable-multibyte-characters is-multibyte))))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6723 ;;;_ > allout-select-safe-coding-system
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6724 (defalias 'allout-select-safe-coding-system
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6725 (if (fboundp 'select-safe-coding-system)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6726 'select-safe-coding-system
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6727 'detect-coding-region)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6728 )
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6729 ;;;_ > allout-substring-no-properties
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6730 ;; define as alias first, so byte compiler is happy.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6731 (defalias 'allout-substring-no-properties 'substring-no-properties)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6732 ;; then supplant with definition if underlying alias absent.
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6733 (if (not (fboundp 'substring-no-properties))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6734 (defun allout-substring-no-properties (string &optional start end)
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6735 (substring string (or start 0) end))
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6736 )
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6737
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6738 ;;;_ #10 Unfinished
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
6739 ;;;_ > 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
6740 (defun allout-bullet-isearch (&optional bullet)
74381
cba6f2b24720 Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents: 74011
diff changeset
6741 "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
6742 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6743 (if (not bullet)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6744 (setq bullet (solicit-char-in-string
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6745 "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
6746 (regexp-sans-escapes allout-bullets-string))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
6747
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6748 (let ((isearch-regexp t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6749 (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
6750 allout-header-prefix
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6751 "[ \t]*"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6752 bullet)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6753 (isearch-repeat 'forward)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
6754 (isearch-mode t)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6755
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6756 ;;;_ #11 Unit tests -- this should be last item before "Provide"
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6757 ;;;_ > allout-run-unit-tests ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6758 (defun allout-run-unit-tests ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6759 "Run the various allout unit tests."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6760 (message "Running allout tests...")
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6761 (allout-test-resumptions)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6762 (message "Running allout tests... Done.")
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6763 (sit-for .5))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6764 ;;;_ : test resumptions:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6765 ;;;_ > allout-tests-obliterate-variable (name)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6766 (defun allout-tests-obliterate-variable (name)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6767 "Completely unbind variable with NAME."
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6768 (if (local-variable-p name (current-buffer)) (kill-local-variable name))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6769 (while (boundp name) (makunbound name)))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6770 ;;;_ > allout-test-resumptions ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6771 (defvar allout-tests-globally-unbound nil
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6772 "Fodder for allout resumptions tests -- defvar just for byte compiler.")
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6773 (defvar allout-tests-globally-true nil
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6774 "Fodder for allout resumptions tests -- defvar just for byte compiler.")
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6775 (defvar allout-tests-locally-true nil
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6776 "Fodder for allout resumptions tests -- defvar just for byte compiler.")
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6777 (defun allout-test-resumptions ()
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6778 "Exercise allout resumptions."
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6779 ;; for each resumption case, we also test that the right local/global
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6780 ;; scopes are affected during resumption effects:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6781
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6782 ;; ensure that previously unbound variables return to the unbound state.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6783 (with-temp-buffer
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6784 (allout-tests-obliterate-variable 'allout-tests-globally-unbound)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6785 (allout-add-resumptions '(allout-tests-globally-unbound t))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6786 (assert (not (default-boundp 'allout-tests-globally-unbound)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6787 (assert (local-variable-p 'allout-tests-globally-unbound (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6788 (assert (boundp 'allout-tests-globally-unbound))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6789 (assert (equal allout-tests-globally-unbound t))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6790 (allout-do-resumptions)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6791 (assert (not (local-variable-p 'allout-tests-globally-unbound
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6792 (current-buffer))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6793 (assert (not (boundp 'allout-tests-globally-unbound))))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6794
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6795 ;; ensure that variable with prior global value is resumed
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6796 (with-temp-buffer
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6797 (allout-tests-obliterate-variable 'allout-tests-globally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6798 (setq allout-tests-globally-true t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6799 (allout-add-resumptions '(allout-tests-globally-true nil))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6800 (assert (equal (default-value 'allout-tests-globally-true) t))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6801 (assert (local-variable-p 'allout-tests-globally-true (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6802 (assert (equal allout-tests-globally-true nil))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6803 (allout-do-resumptions)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6804 (assert (not (local-variable-p 'allout-tests-globally-true
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6805 (current-buffer))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6806 (assert (boundp 'allout-tests-globally-true))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6807 (assert (equal allout-tests-globally-true t)))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6808
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6809 ;; ensure that prior local value is resumed
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6810 (with-temp-buffer
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6811 (allout-tests-obliterate-variable 'allout-tests-locally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6812 (set (make-local-variable 'allout-tests-locally-true) t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6813 (assert (not (default-boundp 'allout-tests-locally-true))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6814 nil (concat "Test setup mistake -- variable supposed to"
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6815 " not have global binding, but it does."))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6816 (assert (local-variable-p 'allout-tests-locally-true (current-buffer))
79939
f87999df3305 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 79920
diff changeset
6817 nil (concat "Test setup mistake -- variable supposed to have"
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6818 " local binding, but it lacks one."))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6819 (allout-add-resumptions '(allout-tests-locally-true nil))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6820 (assert (not (default-boundp 'allout-tests-locally-true)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6821 (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6822 (assert (equal allout-tests-locally-true nil))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6823 (allout-do-resumptions)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6824 (assert (boundp 'allout-tests-locally-true))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6825 (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6826 (assert (equal allout-tests-locally-true t))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6827 (assert (not (default-boundp 'allout-tests-locally-true))))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6828
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6829 ;; ensure that last of multiple resumptions holds, for various scopes.
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6830 (with-temp-buffer
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6831 (allout-tests-obliterate-variable 'allout-tests-globally-unbound)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6832 (allout-tests-obliterate-variable 'allout-tests-globally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6833 (setq allout-tests-globally-true t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6834 (allout-tests-obliterate-variable 'allout-tests-locally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6835 (set (make-local-variable 'allout-tests-locally-true) t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6836 (allout-add-resumptions '(allout-tests-globally-unbound t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6837 '(allout-tests-globally-true nil)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6838 '(allout-tests-locally-true nil))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6839 (allout-add-resumptions '(allout-tests-globally-unbound 2)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6840 '(allout-tests-globally-true 3)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6841 '(allout-tests-locally-true 4))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6842 ;; reestablish many of the basic conditions are maintained after re-add:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6843 (assert (not (default-boundp 'allout-tests-globally-unbound)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6844 (assert (local-variable-p 'allout-tests-globally-unbound (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6845 (assert (equal allout-tests-globally-unbound 2))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6846 (assert (default-boundp 'allout-tests-globally-true))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6847 (assert (local-variable-p 'allout-tests-globally-true (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6848 (assert (equal allout-tests-globally-true 3))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6849 (assert (not (default-boundp 'allout-tests-locally-true)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6850 (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6851 (assert (equal allout-tests-locally-true 4))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6852 (allout-do-resumptions)
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6853 (assert (not (local-variable-p 'allout-tests-globally-unbound
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6854 (current-buffer))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6855 (assert (not (boundp 'allout-tests-globally-unbound)))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6856 (assert (not (local-variable-p 'allout-tests-globally-true
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6857 (current-buffer))))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6858 (assert (boundp 'allout-tests-globally-true))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6859 (assert (equal allout-tests-globally-true t))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6860 (assert (boundp 'allout-tests-locally-true))
111535
c7ebfc6cd27a (allout-keybindings), (allout-bind-keys), (allout-keybindings-binding),
Ken Manheimer <ken.manheimer@gmail.com>
parents: 111445
diff changeset
6861 (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
71893
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6862 (assert (equal allout-tests-locally-true t))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6863 (assert (not (default-boundp 'allout-tests-locally-true))))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6864
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6865 ;; ensure that deliberately unbinding registered variables doesn't foul things
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6866 (with-temp-buffer
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6867 (allout-tests-obliterate-variable 'allout-tests-globally-unbound)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6868 (allout-tests-obliterate-variable 'allout-tests-globally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6869 (setq allout-tests-globally-true t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6870 (allout-tests-obliterate-variable 'allout-tests-locally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6871 (set (make-local-variable 'allout-tests-locally-true) t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6872 (allout-add-resumptions '(allout-tests-globally-unbound t)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6873 '(allout-tests-globally-true nil)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6874 '(allout-tests-locally-true nil))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6875 (allout-tests-obliterate-variable 'allout-tests-globally-unbound)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6876 (allout-tests-obliterate-variable 'allout-tests-globally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6877 (allout-tests-obliterate-variable 'allout-tests-locally-true)
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6878 (allout-do-resumptions))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6879 )
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6880 ;;;_ % Run unit tests if `allout-run-unit-tests-after-load' is true:
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6881 (when allout-run-unit-tests-on-load
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6882 (allout-run-unit-tests))
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6883
bb3316be643e Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents: 71625
diff changeset
6884 ;;;_ #12 Provide
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
6885 (provide 'allout)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6886
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6887 ;;;_* Local emacs vars.
69124
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6888 ;; The following `allout-layout' local variable setting:
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6889 ;; - closes all topics from the first topic to just before the third-to-last,
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6890 ;; - shows the children of the third to last (config vars)
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6891 ;; - and the second to last (code section),
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6892 ;; - and closes the last topic (this local-variables section).
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6893 ;;Local variables:
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6894 ;;allout-layout: (0 : -1 -1 0)
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6895 ;;End:
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
6896
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
6897 ;;; allout.el ends here