Mercurial > emacs
annotate lisp/allout.el @ 80645:6b0ef5d1c3de
*** empty log message ***
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Mon, 28 Jul 2008 03:56:41 +0000 |
parents | 1279685cd822 |
children |
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 |
64762
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64474
diff
changeset
|
3 ;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, |
79721 | 4 ;; 2005, 2006, 2007, 2008 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 | 8 ;; Created: Dec 1991 -- first release to usenet |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
9 ;; Version: 2.2.1 |
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 | 12 |
13 ;; This file is part of GNU Emacs. | |
14 | |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
15 ;; GNU Emacs is free software; you can redistribute it and/or modify |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
16 ;; it under the terms of the GNU General Public License as published by |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
76204
diff
changeset
|
17 ;; the Free Software Foundation; either version 3, or (at your option) |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
18 ;; any later version. |
3430 | 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 |
14169 | 26 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 27 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
28 ;; Boston, MA 02110-1301, USA. | |
3430 | 29 |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
30 ;;; Commentary: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
31 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
32 ;; 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
|
33 ;; and manipulation beyond standard emacs outline mode. Some features: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
34 ;; |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
35 ;; - 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
|
36 ;; - 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
|
37 ;; 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
|
38 ;; - Incremental search with dynamic exposure and reconcealment of text |
79939 | 39 ;; - 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
|
40 ;; outlining, for code-folding editing. (Allout code itself is to try it; |
79939 | 41 ;; 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
|
42 ;; emacs local file variables need to be enabled when the |
79939 | 43 ;; 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
|
44 ;; - Configurable per-file initial exposure settings |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
45 ;; - 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
|
46 ;; 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
|
47 ;; (using a stashed encrypted dummy string) and user-supplied hint |
74864
e97d916ee47b
(allout-encrypt-string): Inhibit use of agent within
Chong Yidong <cyd@stupidchicken.com>
parents:
74381
diff
changeset
|
48 ;; maintenance. (See allout-toggle-current-subtree-encryption docstring. |
e97d916ee47b
(allout-encrypt-string): Inhibit use of agent within
Chong Yidong <cyd@stupidchicken.com>
parents:
74381
diff
changeset
|
49 ;; Currently only GnuPG encryption is supported, and integration |
e97d916ee47b
(allout-encrypt-string): Inhibit use of agent within
Chong Yidong <cyd@stupidchicken.com>
parents:
74381
diff
changeset
|
50 ;; with gpg-agent is not yet implemented.) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
51 ;; - Automatic topic-number maintenance |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
52 ;; - "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
|
53 ;; 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
|
54 ;; - 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
|
55 ;; outline styles |
79939 | 56 ;; - 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
|
57 ;; 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
|
58 ;; 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
|
59 ;; indentation of their topic header. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
60 ;; |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
61 ;; and more. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
62 ;; |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
63 ;; 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
|
64 ;; mode. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
65 ;; |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
66 ;; 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
|
67 ;; http://myriadicity.net/Sundry/EmacsAllout . |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
68 ;; |
29490 | 69 ;; 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
|
70 ;; 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
|
71 ;; 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
|
72 ;; activation of allout-mode. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
73 ;; |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
74 ;; 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
|
75 ;; `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
|
76 ;; `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
|
77 ;; 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
|
78 ;; |
79939 | 79 ;; Note -- the lines beginning with `;;;_' are outline topic headers. |
71625 | 80 ;; 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
|
81 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
82 ;; 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
|
83 |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
84 ;;; Code: |
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
85 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
86 ;;;_* Dependency autoloads |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
87 (require 'overlay) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
88 (eval-when-compile |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
89 ;; Most of the requires here are for stuff covered by autoloads. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
90 ;; Since just byte-compiling doesn't trigger autoloads, so that |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
91 ;; "function not found" warnings would occur without these requires. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
92 (progn |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
93 (require 'pgg) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
94 (require 'pgg-gpg) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
95 (require 'overlay) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
96 ;; `cl' is required for `assert'. `assert' is not covered by a standard |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
97 ;; autoload, but it is a macro, so that eval-when-compile is sufficient |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
98 ;; to byte-compile it in, or to do the require when the buffer evalled. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
99 (require 'cl) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
100 )) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
101 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
102 ;;;_* USER CUSTOMIZATION VARIABLES: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
103 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
104 ;;;_ > defgroup allout |
21088 | 105 (defgroup allout nil |
106 "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
|
107 :prefix "allout-" |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
108 :group 'outlines) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
109 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
110 ;;;_ + 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
|
111 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
112 ;;;_ = 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
|
113 (defcustom allout-auto-activation nil |
79939 | 114 "*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
|
115 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
116 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
|
117 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
|
118 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
|
119 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
|
120 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
121 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
|
122 \(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
|
123 `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
|
124 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
125 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
|
126 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
|
127 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
128 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
|
129 auto-layout is not. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
130 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
131 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
|
132 enabled. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
133 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
134 See the docstring for `allout-init' for the proper interface to |
29490 | 135 this variable." |
136 :type '(choice (const :tag "On" t) | |
137 (const :tag "Ask about layout" "ask") | |
138 (const :tag "Mode only" "activate") | |
139 (const :tag "Off" nil)) | |
140 :group 'allout) | |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
141 ;;;_ = allout-default-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
142 (defcustom allout-default-layout '(-2 : 0) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
143 "*Default allout outline layout specification. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
144 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
145 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
|
146 `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
|
147 layout specifications. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
148 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
149 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
|
150 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
|
151 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
|
152 `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
|
153 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
154 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
|
155 |
79939 | 156 INTEGER -- dictate the relative depth to open the corresponding topic(s), |
157 where: | |
158 -- negative numbers force the topic to be closed before opening | |
159 to the absolute value of the number, so all siblings are open | |
160 only to that level. | |
161 -- positive numbers open to the relative depth indicated by the | |
162 number, but do not force already opened subtopics to be closed. | |
163 -- 0 means to close topic -- hide all subitems. | |
164 : -- repeat spec -- apply the preceeding element to all siblings at | |
165 current level, *up to* those siblings that would be covered by specs | |
166 following the `:' on the list. Ie, apply to all topics at level but | |
167 trailing ones accounted for by trailing specs. (Only the first of | |
168 multiple colons at the same level is honored -- later ones are ignored.) | |
169 * -- completely exposes the topic, including bodies | |
170 + -- exposes all subtopics, but not the bodies | |
171 - -- exposes the body of the corresponding topic, but not subtopics | |
172 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
|
173 corresponding item(s) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
174 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
175 Examples: |
79939 | 176 (-2 : 0) |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
177 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
|
178 grandchildren, but completely collapse the final top-level topic. |
79939 | 179 (-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
|
180 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
|
181 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
|
182 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
|
183 completely close the last topic. |
79939 | 184 (-2 : -1 *) |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
185 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
|
186 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
|
187 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
|
188 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
189 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
|
190 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
191 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
|
192 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
|
193 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
|
194 :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
|
195 :group 'allout) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
196 ;;;_ : allout-layout-type |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
197 (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
|
198 "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
|
199 :type '(repeat |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
200 (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
|
201 (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
|
202 (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
|
203 (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
|
204 (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
|
205 (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
|
206 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
207 ;;;_ = 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
|
208 (defcustom allout-show-bodies nil |
29490 | 209 "*If non-nil, show entire body when exposing a topic, rather than |
210 just the header." | |
211 :type 'boolean | |
212 :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
|
213 (make-variable-buffer-local 'allout-show-bodies) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
214 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
215 (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
|
216 (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
|
217 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
218 ;;;_ = 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
|
219 (defcustom allout-beginning-of-line-cycles t |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
220 "*If non-nil, \\[allout-beginning-of-line] will cycle through smart-placement options. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
221 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
222 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
|
223 follows a different command. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
224 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
225 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
|
226 advance as follows: |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
227 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
228 - 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
|
229 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
|
230 - 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
|
231 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
|
232 - 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
|
233 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
|
234 - 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
|
235 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
|
236 - 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
|
237 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
|
238 - 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
|
239 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
|
240 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
241 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
|
242 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
|
243 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
|
244 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
245 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
|
246 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
|
247 repeated calls." |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
248 :type 'boolean :group 'allout) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
249 ;;;_ = 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
|
250 (defcustom allout-end-of-line-cycles t |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
251 "*If non-nil, \\[allout-end-of-line] will cycle through smart-placement options. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
252 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
253 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
|
254 follows a different command. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
255 |
79939 | 256 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
|
257 advance as follows: |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
258 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
259 - 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
|
260 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
|
261 - 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
|
262 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
|
263 - 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
|
264 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
|
265 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
266 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
|
267 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
|
268 cycling back to start. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
269 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
270 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
|
271 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
|
272 calls." |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
273 :type 'boolean :group 'allout) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
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-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
|
276 (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
|
277 ;; 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
|
278 ;; one cannot use regular expressions to match varying header prefixes. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
279 "*Leading string which helps distinguish topic headers. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
280 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
281 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
|
282 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
|
283 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
|
284 character, which is typically set to the `allout-primary-bullet'." |
21088 | 285 :type 'string |
286 :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
|
287 (make-variable-buffer-local 'allout-header-prefix) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
288 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
289 (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
|
290 ;;;_ = 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
|
291 (defcustom allout-primary-bullet "*" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
292 "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
|
293 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
294 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
|
295 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
|
296 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
|
297 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
298 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
|
299 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
|
300 and `allout-distinctive-bullets-string' for the range of available |
21088 | 301 bullets." |
302 :type 'string | |
303 :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
|
304 (make-variable-buffer-local 'allout-primary-bullet) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
305 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
306 (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
|
307 ;;;_ = 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
|
308 (defcustom allout-plain-bullets-string ".," |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
309 "*The bullets normally used in outline topic prefixes. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
310 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
311 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
|
312 bullets. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
313 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
314 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
|
315 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
316 Outline mode has to be reactivated in order for changes to the value |
21088 | 317 of this var to take effect." |
318 :type 'string | |
319 :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
|
320 (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
|
321 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
322 (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
|
323 ;;;_ = 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
|
324 (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
325 "*Persistent outline header bullets used to distinguish special topics. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
326 |
76204
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
327 These bullets are distinguish topics with particular character. |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
328 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
|
329 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
|
330 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
|
331 |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
332 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
|
333 otherwise automatically rebulleted, so their marking is |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
334 persistent until deliberately changed. Their significance is |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
335 purely by convention, however. Some conventions suggest |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
336 themselves: |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
337 |
79939 | 338 `(' - open paren -- an aside or incidental point |
339 `?' - question mark -- uncertain or outright question | |
340 `!' - exclamation point/bang -- emphatic | |
341 `[' - open square bracket -- meta-note, about item instead of item's subject | |
342 `\"' - double quote -- a quotation or other citation | |
343 `=' - equal sign -- an assignement, equating a name with some connotation | |
344 `^' - carat -- relates to something above | |
76204
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
345 |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
346 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
|
347 |
79939 | 348 `+' - plus -- pending consideration, completion |
349 `_' - underscore -- done, completed | |
350 `&' - ampersand -- addendum, furthermore | |
76204
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
351 |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
352 \(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
|
353 software. By default: |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
354 |
79939 | 355 `~' marks encryptable topics -- see `allout-topic-encryption-bullet' |
356 `#' 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
|
357 |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
358 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
|
359 bullets. |
29490 | 360 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
361 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
|
362 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
|
363 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
364 DO NOT include the close-square-bracket, `]', on either of the bullet |
21088 | 365 strings." |
366 :type 'string | |
367 :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
|
368 (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
|
369 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
370 (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
|
371 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
372 ;;;_ = allout-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
|
373 (defcustom allout-use-mode-specific-leader t |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
374 "*When non-nil, use mode-specific topic-header prefixes. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
375 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
376 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
|
377 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
|
378 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
|
379 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
|
380 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
381 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
|
382 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
|
383 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
384 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
|
385 alist, then use comment-start string, if any, then use default (`.'). |
29490 | 386 \(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
|
387 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
388 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
|
389 `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
|
390 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
391 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
|
392 `allout-primary-bullet' unaltered. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
393 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
394 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
|
395 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
|
396 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
|
397 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
|
398 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
|
399 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
|
400 `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
|
401 undesired.]" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
402 :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
|
403 (const allout-mode-leaders) |
21088 | 404 (const comment-start)) |
405 :group 'allout) | |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
406 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
407 (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
|
408 '(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
|
409 (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
|
410 ;;;_ = 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
|
411 (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
|
412 "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
|
413 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
414 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
|
415 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
|
416 `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
|
417 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
418 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
|
419 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
|
420 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
|
421 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
|
422 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
423 ;;;_ = 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
|
424 (defcustom allout-old-style-prefixes nil |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
425 "*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
|
426 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
427 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
|
428 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
|
429 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
|
430 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
431 Whatever the setting of this variable, both old and new style prefixes |
21088 | 432 are always respected by the topic maneuvering functions." |
433 :type 'boolean | |
434 :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
|
435 (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
|
436 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
437 (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
|
438 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) |
79939 | 439 ;;;_ = 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
|
440 (defcustom allout-stylish-prefixes t |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
441 "*Do fancy stuff with topic prefix bullets according to level, etc. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
442 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
443 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
|
444 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
|
445 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
|
446 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
|
447 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
448 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
|
449 prefixes: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
450 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
451 * Top level |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
452 .* A topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
453 . + One level 3 subtopic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
454 . . One level 4 subtopic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
455 . . A second 4 subtopic |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
456 . + Another level 3 subtopic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
457 . #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
|
458 . #2 Another |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
459 . ! 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
|
460 . #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
|
461 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
462 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
|
463 numbered and other distinctive bullets retained): |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
464 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
465 * Top level |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
466 .* A topic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
467 . * One level 3 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
468 . * One level 4 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
469 . * A second 4 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
470 . * Another level 3 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
471 . #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
|
472 . #2 Another |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
473 . ! 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
|
474 . #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
|
475 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
476 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
|
477 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
|
478 this variable setting. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
479 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
480 The setting of this var is not relevant when `allout-old-style-prefixes' |
21088 | 481 is non-nil." |
482 :type 'boolean | |
483 :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
|
484 (make-variable-buffer-local 'allout-stylish-prefixes) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
485 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
486 (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
|
487 (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
|
488 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
489 ;;;_ = 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
|
490 (defcustom allout-numbered-bullet "#" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
491 "*String designating bullet of topics that have auto-numbering; nil for none. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
492 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
493 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
|
494 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
|
495 to \"#\", you can set it to a bullet of your choice. A nil value |
21088 | 496 disables numbering maintenance." |
497 :type '(choice (const nil) string) | |
498 :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
|
499 (make-variable-buffer-local 'allout-numbered-bullet) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
500 ;;;###autoload |
70673
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
501 (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
|
502 (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
|
503 'string-or-null-p |
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
504 '(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
|
505 ;;;_ = 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
|
506 (defcustom allout-file-xref-bullet "@" |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
507 "*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
|
508 |
29490 | 509 Set this var to the bullet you want to use for file cross-references." |
21088 | 510 :type '(choice (const nil) string) |
511 :group 'allout) | |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
512 ;;;###autoload |
70673
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
513 (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
|
514 (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
|
515 'string-or-null-p |
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
516 '(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
|
517 ;;;_ = 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
|
518 (defcustom allout-presentation-padding 2 |
29490 | 519 "*Presentation-format white-space padding factor, for greater indent." |
520 :type 'integer | |
521 :group 'allout) | |
522 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
523 (make-variable-buffer-local 'allout-presentation-padding) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
524 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
525 (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
|
526 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
527 ;;;_ = allout-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
|
528 (defcustom allout-abbreviate-flattened-numbering nil |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
529 "*If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic |
29490 | 530 numbers to minimal amount with some context. Otherwise, entire |
531 numbers are always used." | |
532 :type 'boolean | |
533 :group 'allout) | |
534 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
535 ;;;_ + 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
|
536 ;;;_ - 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
|
537 (defcustom allout-number-pages nil |
21088 | 538 "*Non-nil turns on page numbering for LaTeX formatting of an outline." |
539 :type 'boolean | |
540 :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
|
541 ;;;_ - 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
|
542 (defcustom allout-label-style "\\large\\bf" |
21088 | 543 "*Font and size of labels for LaTeX formatting of an outline." |
544 :type 'string | |
545 :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
|
546 ;;;_ - 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
|
547 (defcustom allout-head-line-style "\\large\\sl " |
21088 | 548 "*Font and size of entries for LaTeX formatting of an outline." |
549 :type 'string | |
550 :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
|
551 ;;;_ - 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
|
552 (defcustom allout-body-line-style " " |
21088 | 553 "*Font and size of entries for LaTeX formatting of an outline." |
554 :type 'string | |
555 :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
|
556 ;;;_ - 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
|
557 (defcustom allout-title-style "\\Large\\bf" |
21088 | 558 "*Font and size of titles for LaTeX formatting of an outline." |
559 :type 'string | |
560 :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
|
561 ;;;_ - allout-title |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
562 (defcustom allout-title '(or buffer-file-name (buffer-name)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
563 "*Expression to be evaluated to determine the title for LaTeX |
21088 | 564 formatted copy." |
565 :type 'sexp | |
566 :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
|
567 ;;;_ - 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
|
568 (defcustom allout-line-skip ".05cm" |
21088 | 569 "*Space between lines for LaTeX formatting of an outline." |
570 :type 'string | |
571 :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
|
572 ;;;_ - 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
|
573 (defcustom allout-indent ".3cm" |
21088 | 574 "*LaTeX formatted depth-indent spacing." |
575 :type 'string | |
576 :group 'allout) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
577 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
578 ;;;_ + Topic encryption |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
579 ;;;_ = allout-encryption group |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
580 (defgroup allout-encryption nil |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
581 "Settings for topic encryption features of allout outliner." |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
582 :group 'allout) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
583 ;;;_ = allout-topic-encryption-bullet |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
584 (defcustom allout-topic-encryption-bullet "~" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
585 "*Bullet signifying encryption of the entry's body." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
586 :type '(choice (const nil) string) |
80250
1279685cd822
(allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents:
79940
diff
changeset
|
587 :version "22.1" |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
588 :group 'allout-encryption) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
589 ;;;_ = allout-passphrase-verifier-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
590 (defcustom allout-passphrase-verifier-handling t |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
591 "*Enable use of symmetric encryption passphrase verifier if non-nil. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
592 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
593 See the docstring for the `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
|
594 variable for details about allout ajustment of file variables." |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
595 :type 'boolean |
80250
1279685cd822
(allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents:
79940
diff
changeset
|
596 :version "22.1" |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
597 :group 'allout-encryption) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
598 (make-variable-buffer-local 'allout-passphrase-verifier-handling) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
599 ;;;_ = allout-passphrase-hint-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
600 (defcustom allout-passphrase-hint-handling 'always |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
601 "*Dictate outline encryption passphrase reminder handling: |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
602 |
79939 | 603 always -- always show reminder when prompting |
604 needed -- show reminder on passphrase entry failure | |
605 disabled -- never present or adjust reminder | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
606 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
607 See the docstring for the `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
|
608 variable for details about allout ajustment of file variables." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
609 :type '(choice (const always) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
610 (const needed) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
611 (const disabled)) |
80250
1279685cd822
(allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents:
79940
diff
changeset
|
612 :version "22.1" |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
613 :group 'allout-encryption) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
614 (make-variable-buffer-local 'allout-passphrase-hint-handling) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
615 ;;;_ = allout-encrypt-unencrypted-on-saves |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
616 (defcustom allout-encrypt-unencrypted-on-saves t |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
617 "*When saving, should topics pending encryption be encrypted? |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
618 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
619 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
|
620 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
|
621 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
622 - 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
|
623 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
|
624 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
|
625 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
|
626 encrypted.) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
627 Auto-saves will use the \"All except current topic\" mode if this |
79939 | 628 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
|
629 - 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
|
630 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
|
631 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
|
632 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
|
633 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
|
634 - 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
|
635 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
636 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
|
637 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
|
638 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
|
639 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
|
640 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
|
641 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
642 :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
|
643 (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
|
644 (const :tag "No" nil)) |
80250
1279685cd822
(allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents:
79940
diff
changeset
|
645 :version "22.1" |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
646 :group 'allout-encryption) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
647 (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
|
648 |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
649 ;;;_ + Developer |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
650 ;;;_ = allout-developer group |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
651 (defgroup allout-developer nil |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
652 "Settings for topic encryption features of allout outliner." |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
653 :group 'allout) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
654 ;;;_ = 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
|
655 (defcustom allout-run-unit-tests-on-load nil |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
656 "*When non-nil, unit tests will be run at end of loading the allout module. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
657 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
658 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
|
659 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
660 \(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
|
661 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
|
662 compilation.) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
663 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
664 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
|
665 :type 'boolean |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
666 :group 'allout-developer) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
667 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
668 ;;;_ + Miscellaneous customization |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
669 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
670 ;;;_ = allout-command-prefix |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
671 (defcustom allout-command-prefix "\C-c " |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
672 "*Key sequence to be used as prefix for outline mode command key bindings. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
673 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
674 Default is '\C-c<space>'; just '\C-c' is more short-and-sweet, if you're |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
675 willing to let allout use a bunch of \C-c keybindings." |
29490 | 676 :type 'string |
677 :group 'allout) | |
678 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
679 ;;;_ = allout-keybindings-list |
79939 | 680 ;;; You have to reactivate allout-mode -- `(allout-mode t)' -- to |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
681 ;;; institute changes to this var. |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
682 (defvar allout-keybindings-list () |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
683 "*List of `allout-mode' key / function bindings, for `allout-mode-map'. |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
684 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
685 String or vector key will be prefaced with `allout-command-prefix', |
29490 | 686 unless optional third, non-nil element is present.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
687 (setq allout-keybindings-list |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
688 '( |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
689 ; Motion commands: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
690 ("\C-n" allout-next-visible-heading) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
691 ("\C-p" allout-previous-visible-heading) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
692 ("\C-u" allout-up-current-level) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
693 ("\C-f" allout-forward-current-level) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
694 ("\C-b" allout-backward-current-level) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
695 ("\C-a" allout-beginning-of-current-entry) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
696 ("\C-e" allout-end-of-entry) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
697 ; Exposure commands: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
698 ("\C-i" allout-show-children) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
699 ("\C-s" allout-show-current-subtree) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
700 ("\C-h" allout-hide-current-subtree) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
701 ("h" 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
|
702 ("\C-o" allout-show-current-entry) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
703 ("!" allout-show-all) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
704 ("x" allout-toggle-current-subtree-encryption) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
705 ; Alteration commands: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
706 (" " allout-open-sibtopic) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
707 ("." allout-open-subtopic) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
708 ("," allout-open-supertopic) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
709 ("'" allout-shift-in) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
710 (">" allout-shift-in) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
711 ("<" allout-shift-out) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
712 ("\C-m" allout-rebullet-topic) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
713 ("*" allout-rebullet-current-heading) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
714 ("#" allout-number-siblings) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
715 ("\C-k" allout-kill-line t) |
73003
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
716 ("\M-k" allout-copy-line-as-kill 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
|
717 ("\C-y" allout-yank t) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
718 ("\M-y" allout-yank-pop t) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
719 ("\C-k" allout-kill-topic) |
73003
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
720 ("\M-k" allout-copy-topic-as-kill) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
721 ; Miscellaneous commands: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
722 ;([?\C-\ ] allout-mark-topic) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
723 ("@" 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
|
724 ("=c" allout-copy-exposed-to-buffer) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
725 ("=i" allout-indented-exposed-to-buffer) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
726 ("=t" allout-latexify-exposed) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
727 ("=p" allout-flatten-exposed-to-buffer))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
728 |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
729 ;;;_ = 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
|
730 (defcustom allout-inhibit-auto-fill nil |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
731 "*If non-nil, auto-fill will be inhibited in the allout buffers. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
732 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
733 You can customize this setting to set it for all allout buffers, or set it |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
734 in individual buffers if you want to inhibit auto-fill only in particular |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
735 buffers. (You could use a function on `allout-mode-hook' to inhibit |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
736 auto-fill according, eg, to the major mode.) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
737 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
738 If you don't set this and auto-fill-mode is enabled, allout will use the |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
739 value that `normal-auto-fill-function', if any, when allout mode starts, or |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
740 else allout's special hanging-indent maintaining auto-fill function, |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
741 `allout-auto-fill'." |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
742 :type 'boolean |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
743 :group 'allout) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
744 (make-variable-buffer-local '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
|
745 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
746 ;;;_ = allout-use-hanging-indents |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
747 (defcustom allout-use-hanging-indents t |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
748 "*If non-nil, topic body text auto-indent defaults to indent of the header. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
749 Ie, it is indented to be just past the header prefix. This is |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
750 relevant mostly for use with `indented-text-mode', or other situations |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
751 where auto-fill occurs." |
21088 | 752 :type 'boolean |
753 :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
|
754 (make-variable-buffer-local 'allout-use-hanging-indents) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
755 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
756 (put 'allout-use-hanging-indents 'safe-local-variable |
70673
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
757 (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
|
758 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
759 ;;;_ = 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
|
760 (defcustom allout-reindent-bodies (if allout-use-hanging-indents |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
761 'text) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
762 "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
763 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
764 When active, topic body lines that are indented even with or beyond |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
765 their topic header are reindented to correspond with depth shifts of |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
766 the header. |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
767 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
768 A value of t enables reindent in non-programming-code buffers, ie |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
769 those that do not have the variable `comment-start' set. A value of |
21088 | 770 `force' enables reindent whether or not `comment-start' is set." |
771 :type '(choice (const nil) (const t) (const text) (const force)) | |
772 :group 'allout) | |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
773 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
774 (make-variable-buffer-local 'allout-reindent-bodies) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
775 ;;;###autoload |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
776 (put 'allout-reindent-bodies 'safe-local-variable |
70616
b69cce4ff5a0
2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70256
diff
changeset
|
777 '(lambda (x) (memq x '(nil t text force)))) |
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 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
779 ;;;_ = 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
|
780 (defcustom allout-enable-file-variable-adjustment t |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
781 "*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
|
782 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
783 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
|
784 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
|
785 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
786 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
|
787 is nil. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
788 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
789 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
|
790 For details, see `allout-toggle-current-subtree-encryption's docstring." |
21088 | 791 :type 'boolean |
792 :group 'allout) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
793 (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
|
794 |
79939 | 795 ;;;_* 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
|
796 |
29490 | 797 ;;;_ #1 Internal Outline Formatting and Configuration |
798 ;;;_ : 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
|
799 ;;;_ = allout-version |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
800 (defvar allout-version "2.2.1" |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
801 "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
|
802 ;;;_ > 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
|
803 (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
|
804 "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
|
805 (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
|
806 (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
|
807 (if here (insert msg)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
808 (message "%s" msg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
809 msg)) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
810 ;;;_ : 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
|
811 ;;;_ = allout-mode |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
812 (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
|
813 (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
|
814 ;;;_ = allout-layout nil |
79939 | 815 (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
|
816 "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
|
817 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
818 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
|
819 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
|
820 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
|
821 `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
|
822 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
823 \*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
|
824 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
|
825 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
826 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
|
827 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
|
828 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
829 ;;;Local variables: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
830 ;;;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
|
831 ;;;End: |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
832 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
833 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
|
834 \(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
|
835 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
|
836 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
|
837 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
838 `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
|
839 `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
|
840 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
|
841 (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
|
842 ;;;###autoload |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
843 (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
|
844 '(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
|
845 |
29490 | 846 ;;;_ : 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
|
847 ;;;_ = 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
|
848 (defvar allout-regexp "" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
849 "*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
|
850 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
851 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
|
852 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
|
853 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
|
854 (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
|
855 ;;;_ = 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
|
856 (defvar allout-bullets-string "" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
857 "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
|
858 |
79939 | 859 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
|
860 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
|
861 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
|
862 (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
|
863 ;;;_ = 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
|
864 (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
|
865 "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
|
866 (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
|
867 ;;;_ = allout-depth-specific-regexp |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
868 (defvar allout-depth-specific-regexp "" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
869 "*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
|
870 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
871 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
|
872 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
|
873 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
|
874 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
875 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
|
876 `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
|
877 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
|
878 topic prefix to be matched.") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
879 (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
|
880 ;;;_ = allout-depth-one-regexp |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
881 (defvar allout-depth-one-regexp "" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
882 "*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
|
883 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
884 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
|
885 `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
|
886 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
|
887 topic prefix to be matched.") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
888 (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
|
889 ;;;_ = 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
|
890 (defvar allout-line-boundary-regexp () |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
891 "`allout-regexp' with outline style beginning-of-line anchor. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
892 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
893 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
|
894 (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
|
895 ;;;_ = 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
|
896 (defvar allout-bob-regexp () |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
897 "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
|
898 (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
|
899 ;;;_ = 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
|
900 (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
|
901 "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
|
902 (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
|
903 ;;;_ = 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
|
904 (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
|
905 "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
|
906 (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
|
907 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
908 ;;;_ = allout-doublecheck-at-and-shallower |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
909 (defconst allout-doublecheck-at-and-shallower 2 |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
910 "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
|
911 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
912 Verified with `allout-aberrant-container-p'. This check's usefulness is |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
913 limited to shallow depths, because the determination of aberrance |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
914 is according to the mistaken item being followed by a legitimate item of |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
915 excessively greater depth.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
916 ;;;_ 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
|
917 (defun allout-reset-header-lead (header-lead) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
918 "*Reset the leading string used to identify topic headers." |
3430 | 919 (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
|
920 (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
|
921 (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
|
922 (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
|
923 ;;;_ 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
|
924 (defun allout-lead-with-comment-string (&optional header-lead) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
925 "*Set the topic-header leading string to specified string. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
926 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
927 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
|
928 language comments. Returns the leading string." |
3430 | 929 |
930 (interactive "P") | |
931 (if (not (stringp header-lead)) | |
932 (setq header-lead (read-string | |
933 "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
|
934 (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
|
935 (allout-reset-header-lead header-lead) |
3430 | 936 header-lead) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
937 ;;;_ > 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
|
938 (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
|
939 "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
|
940 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
941 Works according to settings of: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
942 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
943 `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
|
944 `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
|
945 `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
|
946 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
|
947 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
948 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
|
949 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
|
950 (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
|
951 (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
|
952 (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
|
953 '(allout-mode-leaders |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
954 comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
955 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
|
956 allout-use-mode-specific-leader |
79939 | 957 ;; 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
|
958 t))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
959 (leader |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
960 (cond |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
961 ((not use-leader) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
962 ;; Use the explicitly designated leader: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
963 ((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
|
964 (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
|
965 ;; 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
|
966 (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
|
967 ;; ... 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
|
968 (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
|
969 comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
970 ;; Use comment-start, maybe tripled, and with |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
971 ;; underscore: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
972 (concat |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
973 (if (string= " " |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
974 (substring comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
975 (1- (length comment-start)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
976 ;; 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
|
977 (substring comment-start 0 -1) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
978 (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
|
979 ;; ... and append underscore, whichever: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
980 "_"))))))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
981 (if (not leader) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
982 nil |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
983 (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
|
984 (if (not allout-old-style-prefixes) |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
985 ;; setting allout-primary-bullet makes the top level topics use -- |
79939 | 986 ;; 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
|
987 (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
|
988 allout-header-prefix))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
989 (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
|
990 '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
|
991 ;;;_ > 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
|
992 (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
|
993 "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
|
994 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
995 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
|
996 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
|
997 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
|
998 (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
|
999 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
|
1000 (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
|
1001 (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
|
1002 ;;;_ > 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
|
1003 (defun set-allout-regexp () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1004 "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
|
1005 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1006 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
|
1007 `allout-distinctive-bullets-string'. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1008 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1009 Also refresh various data structures that hinge on the regexp." |
3430 | 1010 |
1011 (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
|
1012 ;; 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
|
1013 (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
|
1014 (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
|
1015 '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
|
1016 'allout-primary-bullet)) |
3430 | 1017 cur-string |
1018 cur-len | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1019 cur-char |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1020 index) |
3430 | 1021 (while strings |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1022 (setq index 0) |
3430 | 1023 (setq cur-len (length (setq cur-string (symbol-value (car strings))))) |
1024 (while (< index cur-len) | |
1025 (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
|
1026 (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
|
1027 (concat allout-bullets-string |
3430 | 1028 (cond |
1029 ; Single dash would denote a | |
1030 ; sequence, repeated denotes | |
1031 ; a dash: | |
1032 ((eq cur-char ?-) "--") | |
1033 ; literal close-square-bracket | |
1034 ; doesn't work right in the | |
1035 ; expr, exclude it: | |
1036 ((eq cur-char ?\]) "") | |
1037 (t (regexp-quote (char-to-string cur-char)))))) | |
1038 (setq index (1+ index))) | |
1039 (setq strings (cdr strings))) | |
1040 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1041 ;; 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
|
1042 (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
|
1043 (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
|
1044 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1045 (let (new-part old-part) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1046 (setq new-part (concat "\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1047 (regexp-quote allout-header-prefix) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1048 "[ \t]*" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1049 ;; 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
|
1050 "[" allout-bullets-string "]" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1051 "\\)") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1052 old-part (concat "\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1053 (regexp-quote allout-primary-bullet) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1054 "\\|" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1055 (regexp-quote allout-header-prefix) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1056 "\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1057 "+" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1058 " ?[^" allout-primary-bullet "]") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1059 allout-regexp (concat new-part |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1060 "\\|" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1061 old-part |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1062 "\\|\^l") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1063 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1064 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
|
1065 "\\|" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1066 "\n" old-part) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1067 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1068 allout-bob-regexp (concat "\\`" new-part |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1069 "\\|" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1070 "\\`" old-part)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1071 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1072 (setq allout-depth-specific-regexp |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1073 (concat "\\(^\\|\\`\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1074 "\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1075 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1076 ;; new-style spacers-then-bullet string: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1077 "\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1078 (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
|
1079 " \\{%s\\}" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1080 "[" (allout-format-quote allout-bullets-string) "]" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1081 "\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1082 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1083 ;; 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
|
1084 (if (< 0 allout-header-subtraction) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1085 "" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1086 (concat "\\|\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1087 (allout-format-quote |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1088 (regexp-quote allout-primary-bullet)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1089 (allout-format-quote |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1090 (regexp-quote allout-primary-bullet)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1091 (allout-format-quote |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1092 (regexp-quote allout-primary-bullet)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1093 "\\{%s\\}" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1094 ;; disqualify greater depths: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1095 "[^" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1096 (allout-format-quote allout-primary-bullet) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1097 "]\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1098 )) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1099 "\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1100 )) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1101 (setq allout-depth-one-regexp |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1102 (concat "\\(^\\|\\`\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1103 "\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1104 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1105 "\\(" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1106 (regexp-quote allout-header-prefix) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1107 ;; 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
|
1108 ;; intervening whitespace: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1109 " *" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1110 (concat "[^ " allout-bullets-string "]") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1111 "\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1112 (if (< 0 allout-header-subtraction) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1113 ;; 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
|
1114 ;; 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
|
1115 "" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1116 (concat "\\|" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1117 (regexp-quote allout-primary-bullet) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1118 ;; disqualify deeper primary-bullet sequences: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1119 "[^" allout-primary-bullet "]")) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1120 "\\)" |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1121 )))) |
29490 | 1122 ;;;_ : Key bindings |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1123 ;;;_ = allout-mode-map |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1124 (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.") |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1125 ;;;_ > produce-allout-mode-map (keymap-alist &optional base-map) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1126 (defun produce-allout-mode-map (keymap-list &optional base-map) |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
1127 "Produce keymap for use as `allout-mode-map', from KEYMAP-LIST. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1128 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1129 Built on top of optional BASE-MAP, or empty sparse map if none specified. |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
1130 See doc string for `allout-keybindings-list' for format of binding list." |
29490 | 1131 (let ((map (or base-map (make-sparse-keymap))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1132 (pref (list allout-command-prefix))) |
29490 | 1133 (mapcar (function |
1134 (lambda (cell) | |
1135 (let ((add-pref (null (cdr (cdr cell)))) | |
1136 (key-suff (list (car cell)))) | |
1137 (apply 'define-key | |
1138 (list map | |
1139 (apply 'concat (if add-pref | |
1140 (append pref key-suff) | |
1141 key-suff)) | |
1142 (car (cdr cell))))))) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1143 keymap-list) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1144 map)) |
29490 | 1145 ;;;_ : Menu bar |
54952
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
1146 (defvar allout-mode-exposure-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
1147 (defvar allout-mode-editing-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
1148 (defvar allout-mode-navigation-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
1149 (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
|
1150 (defun produce-allout-mode-menubar-entries () |
29490 | 1151 (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
|
1152 (easy-menu-define allout-mode-exposure-menu |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1153 allout-mode-map |
29490 | 1154 "Allout outline exposure menu." |
1155 '("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
|
1156 ["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
|
1157 ["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
|
1158 ["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
|
1159 ["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
|
1160 ["Hide Leaves" allout-hide-current-leaves t] |
29490 | 1161 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1162 ["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
|
1163 (easy-menu-define allout-mode-editing-menu |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1164 allout-mode-map |
29490 | 1165 "Allout outline editing menu." |
1166 '("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
|
1167 ["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
|
1168 ["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
|
1169 ["Open Supertopic" allout-open-supertopic t] |
29490 | 1170 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1171 ["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
|
1172 ["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
|
1173 ["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
|
1174 ["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
|
1175 ["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
|
1176 "----" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1177 ["Toggle Topic Encryption" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1178 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
|
1179 (> (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
|
1180 (easy-menu-define allout-mode-navigation-menu |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1181 allout-mode-map |
29490 | 1182 "Allout outline navigation menu." |
1183 '("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
|
1184 ["Next Visible Heading" allout-next-visible-heading t] |
29490 | 1185 ["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
|
1186 allout-previous-visible-heading t] |
29490 | 1187 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1188 ["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
|
1189 ["Forward Current Level" allout-forward-current-level t] |
29490 | 1190 ["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
|
1191 allout-backward-current-level t] |
29490 | 1192 "----" |
1193 ["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
|
1194 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
|
1195 ["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
|
1196 ["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
|
1197 (easy-menu-define allout-mode-misc-menu |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1198 allout-mode-map |
29490 | 1199 "Allout outlines miscellaneous bindings." |
1200 '("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
|
1201 ["Version" allout-version t] |
29490 | 1202 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1203 ["Duplicate Exposed" allout-copy-exposed-to-buffer t] |
29490 | 1204 ["Duplicate Exposed, numbered" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
1205 allout-flatten-exposed-to-buffer t] |
29490 | 1206 ["Duplicate Exposed, indented" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
1207 allout-indented-exposed-to-buffer t] |
29490 | 1208 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1209 ["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
|
1210 ["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
|
1211 ;;;_ : 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
|
1212 ;;;_ = 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
|
1213 (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
|
1214 "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
|
1215 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1216 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
|
1217 (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
|
1218 ;;;_ > 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
|
1219 (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
|
1220 "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
|
1221 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1222 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
|
1223 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1224 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
|
1225 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
|
1226 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
|
1227 |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1228 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
|
1229 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
|
1230 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
|
1231 as described further below. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1232 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1233 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
|
1234 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
|
1235 existing value. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1236 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1237 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
|
1238 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
|
1239 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
|
1240 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1241 Extension, and resumptions in general, should not be used for hook |
79939 | 1242 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
|
1243 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1244 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
|
1245 (while pairs |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1246 (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
|
1247 (name (car pair)) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1248 (value (cadr pair)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1249 (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
|
1250 (caddr pair))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1251 prior-value) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1252 (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
|
1253 (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
|
1254 name (type-of name))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1255 (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
|
1256 (symbol-value name) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1257 (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
|
1258 (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
|
1259 ;; Not already added as a resumption, create the prior setting entry. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1260 (if (local-variable-p name) |
79939 | 1261 ;; 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
|
1262 (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
|
1263 ;; 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
|
1264 ;; 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
|
1265 (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
|
1266 (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
|
1267 (if qualifier |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1268 (cond ((eq qualifier 'extend) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1269 (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
|
1270 (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
|
1271 (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
|
1272 ((eq qualifier 'append) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1273 (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
|
1274 (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
|
1275 (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
|
1276 (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
|
1277 qualifier))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1278 (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
|
1279 ;;;_ > allout-do-resumptions () |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1280 (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
|
1281 "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
|
1282 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1283 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
|
1284 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
|
1285 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1286 (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
|
1287 (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
|
1288 (name (car pair)) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1289 (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
|
1290 (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
|
1291 ;; 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
|
1292 (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
|
1293 ;; 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
|
1294 (set name (car value-cell)))))) |
29490 | 1295 ;;;_ : 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
|
1296 ;;;_ > allout-unprotected (expr) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1297 (defmacro allout-unprotected (expr) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1298 "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
|
1299 `(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
|
1300 (inhibit-field-text-motion t)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1301 ,expr)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1302 ;;;_ = allout-mode-hook |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1303 (defvar allout-mode-hook nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1304 "*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
|
1305 ;;;_ = 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
|
1306 (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
|
1307 "*Hook that's run when allout mode ends.") |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1308 ;;;_ = allout-exposure-category |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1309 (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
|
1310 "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
|
1311 ;;;_ x allout-view-change-hook |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1312 (defvar allout-view-change-hook nil |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1313 "*(Deprecated) A hook run after allout outline exposure changes. |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1314 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1315 Switch to using `allout-exposure-change-hook' instead. Both hooks are |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1316 currently respected, but the other conveys the details of the exposure |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1317 change via explicit parameters, and this one will eventually be disabled in |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1318 a subsequent allout version.") |
70616
b69cce4ff5a0
2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70256
diff
changeset
|
1319 ;;;_ = allout-exposure-change-hook |
b69cce4ff5a0
2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70256
diff
changeset
|
1320 (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
|
1321 "*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
|
1322 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1323 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
|
1324 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1325 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
|
1326 |
79939 | 1327 - FROM -- integer indicating the point at the start of the change. |
1328 - TO -- integer indicating the point of the end of the change. | |
1329 - 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
|
1330 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1331 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
|
1332 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1333 This hook is replacing `allout-view-change-hook', which is being deprecated |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1334 and eventually will not be invoked.") |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1335 ;;;_ = allout-structure-added-hook |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1336 (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
|
1337 "*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
|
1338 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1339 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
|
1340 |
79939 | 1341 - NEW-START -- integer indicating position of start of the first new item. |
1342 - NEW-END -- integer indicating position of end of the last new item. | |
1343 | |
1344 Some edits that introduce new 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
|
1345 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
|
1346 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1347 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
|
1348 ;;;_ = allout-structure-deleted-hook |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1349 (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
|
1350 "*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
|
1351 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1352 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
|
1353 |
79939 | 1354 - DEPTH -- integer indicating the depth of the subtree that was deleted. |
1355 - REMOVED-FROM -- integer indicating the point where the subtree was removed. | |
1356 | |
1357 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
|
1358 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
|
1359 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1360 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
|
1361 ;;;_ = allout-structure-shifted-hook |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1362 (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
|
1363 "*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
|
1364 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1365 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
|
1366 |
79939 | 1367 - DEPTH-CHANGE -- integer indicating depth increase, negative for decrease |
1368 - START -- integer indicating the start point of the shifted parent item. | |
1369 | |
1370 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
|
1371 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
|
1372 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1373 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
|
1374 ;;;_ = allout-outside-normal-auto-fill-function |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1375 (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
|
1376 "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
|
1377 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1378 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
|
1379 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
|
1380 (make-variable-buffer-local 'allout-outside-normal-auto-fill-function) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1381 ;;;_ = file-var-bug hack |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1382 (defvar allout-v18/19-file-var-hack nil |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1383 "Horrible hack used to prevent invalid multiple triggering of outline |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
1384 mode from prop-line file-var activation. Used by `allout-mode' function |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1385 to track repeats.") |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1386 ;;;_ = allout-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1387 (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
|
1388 "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
|
1389 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
|
1390 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1391 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
|
1392 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
|
1393 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
|
1394 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
|
1395 search attacks. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1396 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1397 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
|
1398 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
|
1399 `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
|
1400 (make-variable-buffer-local 'allout-passphrase-verifier-string) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
1401 ;;;###autoload |
70225
81a284d45346
(allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70002
diff
changeset
|
1402 (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
|
1403 ;;;_ = allout-passphrase-hint-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1404 (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
|
1405 "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
|
1406 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1407 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
|
1408 the reminder is deployed. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1409 |
73763
89b9e8184350
(allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents:
73660
diff
changeset
|
1410 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
|
1411 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
|
1412 `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
|
1413 (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
|
1414 (setq-default allout-passphrase-hint-string "") |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
1415 ;;;###autoload |
70225
81a284d45346
(allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70002
diff
changeset
|
1416 (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
|
1417 ;;;_ = allout-after-save-decrypt |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1418 (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
|
1419 "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
|
1420 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1421 - 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
|
1422 - 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
|
1423 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1424 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
|
1425 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
|
1426 (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
|
1427 ;;;_ = 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
|
1428 (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
|
1429 "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
|
1430 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1431 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
|
1432 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
|
1433 prior to encryption. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1434 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1435 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
|
1436 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1437 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
|
1438 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
|
1439 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
|
1440 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
|
1441 (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
|
1442 ;;;_ = 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
|
1443 (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
|
1444 "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
|
1445 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1446 This is for the sake of redoing encryption in cases where the ciphertext |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
1447 incidentally contains strings that would disrupt mode operation -- |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1448 for example, a line that happens to look like an allout-mode topic prefix. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1449 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1450 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
|
1451 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1452 The encryption will be retried up to |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1453 `allout-encryption-ciphertext-rejection-limit' times, after which an error |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1454 is raised.") |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1455 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1456 (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
|
1457 ;;;_ = 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
|
1458 (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
|
1459 "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
|
1460 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1461 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
|
1462 (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
|
1463 ;;;_ > allout-mode-p () |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1464 ;; Must define this macro above any uses, or byte compilation will lack |
79939 | 1465 ;; 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
|
1466 (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
|
1467 "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
|
1468 'allout-mode) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1469 ;;;_ > 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
|
1470 (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
|
1471 "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
|
1472 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1473 (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
|
1474 (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
|
1475 (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
|
1476 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1477 (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
|
1478 'except-current) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1479 (point-marker)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1480 (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
|
1481 (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
|
1482 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1483 (message "auto-encrypting pending topics") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1484 (sit-for 0) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1485 (condition-case failure |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1486 (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
|
1487 (allout-encrypt-decrypted except-mark)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1488 (error (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1489 (message |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1490 "allout-write-file-hook-handler suppressing error %s" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1491 failure) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1492 (sit-for 2)))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1493 )) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1494 nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1495 ;;;_ > 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
|
1496 (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
|
1497 "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
|
1498 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1499 (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
|
1500 ;; 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
|
1501 (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
|
1502 (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
|
1503 ;;;_ > allout-after-saves-handler () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1504 (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
|
1505 "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
|
1506 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1507 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
|
1508 the save. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1509 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1510 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
|
1511 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
|
1512 (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
|
1513 (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
|
1514 allout-after-save-decrypt)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1515 t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1516 (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
|
1517 (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
|
1518 (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
|
1519 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1520 (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
|
1521 (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
|
1522 (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
|
1523 ) |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
1524 ;;;_ = allout-inhibit-aberrance-doublecheck nil |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
1525 ;; 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
|
1526 ;; 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
|
1527 ;; 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
|
1528 ;; 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
|
1529 ;; 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
|
1530 ;; almost never be needed, however. |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
1531 (defvar allout-inhibit-aberrance-doublecheck nil |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
1532 "Internal state, for momentarily inhibits aberrance doublecheck. |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
1533 |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
1534 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
|
1535 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
|
1536 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1537 ;;;_ #2 Mode activation |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1538 ;;;_ = 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
|
1539 (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
|
1540 "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
|
1541 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
|
1542 (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
|
1543 ;;;_ > 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
|
1544 (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
|
1545 "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
|
1546 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1547 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
|
1548 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1549 - nil (or no argument) deactivate auto-activation/layout; |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1550 - `activate', enable auto-activation only; |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1551 - `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
|
1552 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
|
1553 - `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
|
1554 - 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
|
1555 any confirmation check. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1556 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1557 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
|
1558 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
|
1559 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
|
1560 `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
|
1561 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1562 `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
|
1563 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
|
1564 setting. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1565 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1566 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
|
1567 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
|
1568 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1569 \(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
|
1570 \(allout-init t)" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1571 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1572 (interactive) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1573 (if (interactive-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1574 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1575 (setq mode |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1576 (completing-read |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1577 (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
|
1578 "(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
|
1579 '(("nil")("full")("activate")("deactivate") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1580 ("ask") ("report") ("")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1581 nil |
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 (if (string= mode "") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1584 (setq mode 'report) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1585 (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
|
1586 (let |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1587 ;; 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
|
1588 ((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
|
1589 (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
|
1590 'find-file-hook |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1591 '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
|
1592 (curr-mode 'allout-auto-activation)) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1593 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1594 (cond ((not mode) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1595 (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
|
1596 (delq hook (symbol-value find-file-hook-var-name))) |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1597 (if (interactive-p) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1598 (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
|
1599 ((eq mode 'report) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1600 (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
|
1601 (allout-init nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1602 ;; 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
|
1603 (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
|
1604 (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
|
1605 (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
|
1606 (cond ((eq mode 'activate) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1607 (message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1608 "Outline mode auto-activation enabled.") |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1609 'activate) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1610 ((eq mode 'report) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1611 ;; 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
|
1612 (allout-init mode)) |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1613 ((eq mode 'ask) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1614 (message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1615 (concat "Outline mode auto-activation and " |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1616 "-layout (upon confirmation) enabled.")) |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1617 'ask) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1618 ((message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1619 "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
|
1620 '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
|
1621 ;;;_ > 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
|
1622 (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
|
1623 "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
|
1624 (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
|
1625 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
|
1626 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
|
1627 allout-mode-misc-menu)) |
29490 | 1628 cur) |
1629 (while menus | |
1630 (setq cur (car menus) | |
1631 menus (cdr menus)) | |
1632 (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
|
1633 ;;;_ > allout-overlay-preparations |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1634 (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
|
1635 "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
|
1636 (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
|
1637 (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
|
1638 (put 'allout-exposure-category 'evaporate t) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1639 ;; XXX 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
|
1640 ;; latter would be sufficient, but it seems that a separate behavior -- |
79939 | 1641 ;; the _transient_ opening of invisible text during isearch -- is keyed to |
1642 ;; 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
|
1643 ;; property controls the isearch _arrival_ behavior. This is the case at |
80250
1279685cd822
(allout-topic-encryption-bullet)
Glenn Morris <rgm@gnu.org>
parents:
79940
diff
changeset
|
1644 ;; 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
|
1645 (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
|
1646 'allout-isearch-end-handler) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1647 (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
|
1648 (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
|
1649 (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
|
1650 '(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
|
1651 (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
|
1652 '(allout-overlay-interior-modification-handler))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1653 ;;;_ > allout-mode (&optional toggle) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1654 ;;;_ : Defun: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1655 ;;;###autoload |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1656 (defun allout-mode (&optional toggle) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1657 ;;;_ . Doc string: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1658 "Toggle minor mode for controlling exposure and editing of text outlines. |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1659 \\<allout-mode-map> |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1660 |
78492
7c8949dbfa0d
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78236
diff
changeset
|
1661 Optional prefix argument TOGGLE forces the mode to re-initialize |
7c8949dbfa0d
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78236
diff
changeset
|
1662 if it is positive, otherwise it turns the mode off. Allout |
7c8949dbfa0d
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78236
diff
changeset
|
1663 outline mode always runs as a minor mode. |
29490 | 1664 |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
1665 Allout outline mode provides extensive outline oriented formatting and |
29490 | 1666 manipulation. It enables structural editing of outlines, as well as |
1667 navigation and exposure. It also is specifically aimed at | |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1668 accommodating syntax-sensitive text like programming languages. (For |
29490 | 1669 an example, see the allout code itself, which is organized as an allout |
1670 outline.) | |
1671 | |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1672 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
|
1673 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1674 - 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
|
1675 repositioning, promotion/demotion, cut, and paste |
29490 | 1676 - 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
|
1677 - adjustable format, so programming code can be developed in outline-structure |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1678 - easy topic encryption and decryption |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1679 - \"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
|
1680 - 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
|
1681 - independent extensibility, using comprehensive exposure and authoring hooks |
29490 | 1682 |
1683 and many other features. | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1684 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1685 Below is a description of the key bindings, and then explanation of |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
1686 special `allout-mode' features and terminology. See also the outline |
29490 | 1687 menubar additions for quick reference to many of the features, and see |
54458
a0176bcc103f
(allout-mode): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
54223
diff
changeset
|
1688 the docstring of the function `allout-init' for instructions on |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1689 priming your emacs session for automatic activation of `allout-mode'. |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1690 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1691 The bindings are dictated by the customizable `allout-keybindings-list' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1692 variable. We recommend customizing `allout-command-prefix' to use just |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1693 `\\C-c' as the command prefix, if the allout bindings don't conflict with |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1694 any personal bindings you have on \\C-c. In any case, outline structure |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1695 navigation and authoring is simplified by positioning the cursor on an |
79939 | 1696 item's bullet character, the \"hot-spot\" -- then you can invoke allout |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1697 commands with just the un-prefixed, un-control-shifted command letters. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1698 This is described further in the HOT-SPOT Operation section. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1699 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1700 Exposure Control: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1701 ---------------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1702 \\[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
|
1703 \\[allout-show-children] `allout-show-children' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1704 \\[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
|
1705 \\[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
|
1706 \\[allout-show-all] `allout-show-all' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1707 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1708 Navigation: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1709 ---------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1710 \\[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
|
1711 \\[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
|
1712 \\[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
|
1713 \\[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
|
1714 \\[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
|
1715 \\[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
|
1716 \\[allout-beginning-of-current-entry] `allout-beginning-of-current-entry' (alternately, goes to hot-spot) |
79939 | 1717 \\[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
|
1718 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
|
1719 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
|
1720 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1721 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1722 Topic Header Production: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1723 ----------------------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1724 \\[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
|
1725 \\[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
|
1726 \\[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
|
1727 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1728 Topic Level and Prefix Adjustment: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1729 --------------------------------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1730 \\[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
|
1731 \\[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
|
1732 \\[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
|
1733 current topic |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1734 \\[allout-rebullet-topic] `allout-rebullet-topic' Reconcile bullets of topic and |
79939 | 1735 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
|
1736 are alternated according to nesting depth. |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
1737 \\[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
|
1738 the offspring are not affected. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1739 With repeat count, revoke numbering. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1740 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1741 Topic-oriented Killing and Yanking: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1742 ---------------------------------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1743 \\[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
|
1744 \\[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
|
1745 \\[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
|
1746 \\[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
|
1747 \\[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
|
1748 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
|
1749 heading (ie, prefix sans text). |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1750 \\[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
|
1751 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1752 Topic-oriented Encryption: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1753 ------------------------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1754 \\[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
|
1755 Encrypt/Decrypt topic content |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1756 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1757 Misc commands: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1758 ------------- |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1759 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
|
1760 and establish a default file-var setting |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1761 for `allout-layout'. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1762 \\[allout-mark-topic] `allout-mark-topic' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1763 \\[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
|
1764 Duplicate outline, sans concealed text, to |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1765 buffer with name derived from derived from that |
79939 | 1766 of current buffer -- \"*BUFFERNAME exposed*\". |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1767 \\[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
|
1768 Like above 'copy-exposed', but convert topic |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1769 prefixes to section.subsection... numeric |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1770 format. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1771 \\[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
|
1772 auto-activation. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1773 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1774 Topic Encryption |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1775 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1776 Outline mode supports gpg encryption of topics, with support for |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1777 symmetric and key-pair modes, passphrase timeout, passphrase |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1778 consistency checking, user-provided hinting for symmetric key |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1779 mode, and auto-encryption of topics pending encryption on save. |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1780 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1781 Topics pending encryption are, by default, automatically |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1782 encrypted during file saves. If the contents of the topic |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1783 containing the cursor was encrypted for a save, it is |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1784 automatically decrypted for continued editing. |
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 The aim of these measures is reliable topic privacy while |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1787 preventing accidents like neglected encryption before saves, |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1788 forgetting which passphrase was used, and other practical |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1789 pitfalls. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1790 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1791 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
|
1792 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
|
1793 for details. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1794 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1795 HOT-SPOT Operation |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1796 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1797 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
|
1798 navigation and exposure control. |
3430 | 1799 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1800 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
|
1801 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
|
1802 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
|
1803 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
|
1804 \(\\[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
|
1805 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1806 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
|
1807 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
|
1808 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
|
1809 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
|
1810 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
|
1811 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1812 In allout-mode, the normal beginning-of-line command (\\[allout-beginning-of-line]]) is |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1813 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
|
1814 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
|
1815 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
|
1816 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
|
1817 \(\\[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
|
1818 at the beginning of the current entry. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1819 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1820 Extending Allout |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1821 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1822 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
|
1823 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
|
1824 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
|
1825 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1826 `allout-mode-hook' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1827 `allout-mode-deactivate-hook' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1828 `allout-exposure-change-hook' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1829 `allout-structure-added-hook' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1830 `allout-structure-deleted-hook' |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1831 `allout-structure-shifted-hook' |
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 Terminology |
3430 | 1834 |
79939 | 1835 Topic hierarchy constituents -- TOPICS and SUBTOPICS: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1836 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1837 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
|
1838 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
|
1839 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
|
1840 CURRENT ITEM: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1841 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
|
1842 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
|
1843 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
|
1844 called the: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1845 LEVEL: The same as DEPTH. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1846 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1847 ANCESTORS: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1848 Those ITEMs whose TOPICs contain an ITEM. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1849 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
|
1850 of the ITEM. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1851 OFFSPRING: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1852 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
|
1853 SUBTOPIC: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1854 An OFFSPRING of its ANCESTOR TOPICs. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1855 CHILD: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1856 An immediate SUBTOPIC of its PARENT. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1857 SIBLINGS: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1858 TOPICs having the same PARENT and DEPTH. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1859 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1860 Topic text constituents: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1861 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1862 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
|
1863 text. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1864 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
|
1865 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
|
1866 BODY: Same as ENTRY. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1867 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
|
1868 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
|
1869 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
|
1870 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
|
1871 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
|
1872 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
|
1873 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
|
1874 the PREFIX. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1875 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1876 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
|
1877 of the ITEM. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1878 PREFIX-LEAD: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1879 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
|
1880 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
|
1881 `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
|
1882 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1883 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
|
1884 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
|
1885 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
|
1886 (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
|
1887 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
|
1888 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
|
1889 docstring for more detail. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1890 PREFIX-PADDING: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1891 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
|
1892 bullet, determining the ITEM's DEPTH. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1893 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
|
1894 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
|
1895 `allout-distinctive-bullets-string'. When creating a TOPIC, |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
1896 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
|
1897 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
|
1898 provide a universal argugment \(\\[universal-argument]) to the |
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
1899 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
|
1900 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
|
1901 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
|
1902 more details. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1903 EXPOSURE: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1904 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
|
1905 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
|
1906 CONCEALED: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1907 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
|
1908 text is represented by \"...\" ellipses. |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1909 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
1910 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
|
1911 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
|
1912 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
|
1913 ;;;_ . Code |
3430 | 1914 (interactive "P") |
1915 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1916 (let* ((active (and (not (equal major-mode 'outline)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1917 (allout-mode-p))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1918 ; Massage universal-arg `toggle' val: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1919 (toggle (and toggle |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1920 (or (and (listp toggle)(car toggle)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1921 toggle))) |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
1922 ; Activation specifically demanded? |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1923 (explicit-activation (and toggle |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1924 (or (symbolp toggle) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1925 (and (wholenump toggle) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1926 (not (zerop toggle)))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1927 ;; allout-mode already called once during this complex command? |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1928 (same-complex-command (eq allout-v18/19-file-var-hack |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1929 (car command-history))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1930 (write-file-hook-var-name (cond ((boundp 'write-file-functions) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1931 'write-file-functions) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1932 ((boundp 'write-file-hooks) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1933 'write-file-hooks) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1934 (t 'local-write-file-hooks))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1935 do-layout |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1936 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1937 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1938 ; See comments below re v19.18,.19 bug. |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1939 (setq allout-v18/19-file-var-hack (car command-history)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1940 |
3430 | 1941 (cond |
1942 | |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
1943 ;; Provision for v19.18, 19.19 bug -- |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1944 ;; Emacs v 19.18, 19.19 file-var code invokes prop-line-designated |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1945 ;; modes twice when file is visited. We have to avoid toggling mode |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1946 ;; off on second invocation, so we detect it as best we can, and |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1947 ;; skip everything. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1948 ((and same-complex-command ; Still in same complex command |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1949 ; as last time `allout-mode' invoked. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1950 active ; Already activated. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1951 (not explicit-activation) ; Prop-line file-vars don't have args. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1952 (string-match "^19.1[89]" ; Bug only known to be in v19.18 and |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1953 emacs-version)); 19.19. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1954 t) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1955 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1956 ;; Deactivation: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1957 ((and (not explicit-activation) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1958 (or active toggle)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1959 ; Activation not explicitly |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1960 ; requested, and either in |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1961 ; active state or *de*activation |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1962 ; specifically requested: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1963 (setq allout-explicitly-deactivated t) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1964 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1965 (allout-do-resumptions) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1966 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1967 (remove-from-invisibility-spec '(allout . t)) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1968 (remove-hook 'pre-command-hook 'allout-pre-command-business t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1969 (remove-hook 'post-command-hook 'allout-post-command-business t) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1970 (remove-hook 'before-change-functions 'allout-before-change-handler t) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1971 (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1972 (remove-hook write-file-hook-var-name 'allout-write-file-hook-handler t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1973 (remove-hook 'auto-save-hook 'allout-auto-save-hook-handler t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1974 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1975 (remove-overlays (point-min) (point-max) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1976 'category 'allout-exposure-category) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1977 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1978 (setq allout-mode nil) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1979 (run-hooks 'allout-mode-deactivate-hook)) |
3430 | 1980 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1981 ;; Activation: |
3430 | 1982 ((not active) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1983 (setq allout-explicitly-deactivated nil) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1984 (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
|
1985 ;; 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
|
1986 (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
|
1987 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
1988 (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
|
1989 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
1990 (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
|
1991 (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
|
1992 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1993 (set-allout-regexp) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1994 (allout-add-resumptions |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1995 '(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
|
1996 allout-line-boundary-regexp |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1997 extend) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
1998 '(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
|
1999 allout-bob-regexp |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2000 extend)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2001 |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2002 ;; Produce map from current version of allout-keybindings-list: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2003 (allout-setup-mode-map) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2004 (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
|
2005 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2006 ;; Include on minor-mode-map-alist, if not already there: |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2007 (if (not (member '(allout-mode . allout-mode-map) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2008 minor-mode-map-alist)) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2009 (setq minor-mode-map-alist |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2010 (cons '(allout-mode . allout-mode-map) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2011 minor-mode-map-alist))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2012 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2013 (add-to-invisibility-spec '(allout . t)) |
76204
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
2014 |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2015 (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
|
2016 (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
|
2017 (add-hook 'post-command-hook 'allout-post-command-business nil t) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2018 (add-hook 'before-change-functions 'allout-before-change-handler |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2019 nil t) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2020 (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
|
2021 (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
|
2022 nil t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2023 (add-hook 'auto-save-hook 'allout-auto-save-hook-handler |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2024 nil t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2025 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2026 ;; 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
|
2027 ;; 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
|
2028 ;; 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
|
2029 ;; etc.) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2030 (if (and auto-fill-function (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
|
2031 ;; allout-auto-fill will use the stashed values and so forth. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2032 (allout-add-resumptions '(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
|
2033 (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
|
2034 auto-fill-function) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2035 ;; 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
|
2036 ;; filling is active: |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2037 (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
|
2038 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
|
2039 '(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
|
2040 ;; 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
|
2041 (list 'paragraph-start |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2042 (concat paragraph-start "\\|^\\(" |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2043 allout-regexp "\\)")) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2044 (list 'paragraph-separate |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2045 (concat paragraph-separate "\\|^\\(" |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2046 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
|
2047 (or (assq 'allout-mode minor-mode-alist) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2048 (setq minor-mode-alist |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
2049 (cons '(allout-mode " Allout") minor-mode-alist))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2050 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2051 (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
|
2052 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2053 (if allout-layout |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2054 (setq do-layout t)) |
3430 | 2055 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2056 (setq allout-mode t) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2057 (run-hooks 'allout-mode-hook)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2058 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2059 ;; Reactivation: |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
2060 ((setq do-layout t) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2061 (allout-infer-body-reindent)) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2062 ) ;; end of activation-mode cases. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2063 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2064 ;; Do auto layout if warranted: |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2065 (let ((use-layout (if (listp allout-layout) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2066 allout-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2067 allout-default-layout))) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2068 (if (and do-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2069 allout-auto-activation |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2070 use-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2071 (and (not (eq allout-auto-activation 'activate)) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2072 (if (eq allout-auto-activation 'ask) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2073 (if (y-or-n-p (format "Expose %s with layout '%s'? " |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2074 (buffer-name) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2075 use-layout)) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2076 t |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2077 (message "Skipped %s layout." (buffer-name)) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2078 nil) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2079 t))) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2080 (save-excursion |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2081 (message "Adjusting '%s' exposure..." (buffer-name)) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2082 (goto-char 0) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2083 (allout-this-or-next-heading) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2084 (condition-case err |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2085 (progn |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2086 (apply 'allout-expose-topic (list use-layout)) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2087 (message "Adjusting '%s' exposure... done." (buffer-name))) |
79939 | 2088 ;; Problem applying exposure -- notify user, but don't |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2089 ;; interrupt, eg, file visit: |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2090 (error (message "%s" (car (cdr err))) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
2091 (sit-for 1)))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2092 allout-mode |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2093 ) ; let* |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2094 ) ; defun |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2095 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2096 (defun allout-setup-mode-map () |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2097 "Establish allout-mode bindings." |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2098 (setq-default allout-mode-map |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2099 (produce-allout-mode-map allout-keybindings-list)) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2100 (setq allout-mode-map |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2101 (produce-allout-mode-map allout-keybindings-list)) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2102 (substitute-key-definition 'beginning-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2103 'allout-beginning-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2104 allout-mode-map global-map) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2105 (substitute-key-definition 'move-beginning-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2106 'allout-beginning-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2107 allout-mode-map global-map) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2108 (substitute-key-definition 'end-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2109 'allout-end-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2110 allout-mode-map global-map) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2111 (substitute-key-definition 'move-end-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2112 'allout-end-of-line |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2113 allout-mode-map global-map) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2114 (fset 'allout-mode-map allout-mode-map)) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2115 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2116 ;; ensure that allout-mode-map has some setting even if allout-mode hasn't |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2117 ;; been invoked: |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2118 (allout-setup-mode-map) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2119 |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2120 ;;;_ > allout-minor-mode |
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2121 (defalias 'allout-minor-mode 'allout-mode) |
68956
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
2122 |
79920
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2123 ;;;_ > allout-unload-function |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2124 (defun allout-unload-function () |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2125 "Unload the allout outline library." |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2126 (save-current-buffer |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2127 (dolist (buffer (buffer-list)) |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2128 (set-buffer buffer) |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2129 (when allout-mode (allout-mode -1)))) |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2130 ;; continue standard unloading |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2131 nil) |
5096ade2d1f5
(allout-unload-function): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
79915
diff
changeset
|
2132 |
68956
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
2133 ;;;_ - Position Assessment |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
2134 ;;;_ > allout-hidden-p (&optional pos) |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
2135 (defsubst allout-hidden-p (&optional pos) |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
2136 "Non-nil if the character after point is invisible." |
70616
b69cce4ff5a0
2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70256
diff
changeset
|
2137 (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
|
2138 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2139 ;;;_ > 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
|
2140 ;;; &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2141 (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
|
2142 &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2143 "Shift the overlay so stuff inserted in front of it are excluded." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2144 (if after |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2145 (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
|
2146 ;;;_ > 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
|
2147 ;;; &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2148 (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
|
2149 &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2150 "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
|
2151 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2152 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
|
2153 `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
|
2154 reclosing the opened text. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2155 |
79939 | 2156 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
|
2157 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
|
2158 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2159 (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
|
2160 (let ((start (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2161 (ol-start (overlay-start ol)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2162 (ol-end (overlay-end ol)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2163 first) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2164 (goto-char beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2165 (while (< (point) end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2166 (when (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2167 (allout-show-to-offshoot) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2168 (if (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2169 (save-excursion (forward-char 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2170 (allout-show-to-offshoot))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2171 (when (not first) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2172 (setq first (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2173 (goto-char (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2174 (next-property-change (1+ (point)) nil end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2175 (next-char-property-change (1+ (point)) end)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2176 (when first |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2177 (goto-char first) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2178 (condition-case nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2179 (if (not |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2180 (yes-or-no-p |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2181 (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
|
2182 (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
|
2183 " \\[keyboard-quit] also reconceals) ")))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2184 (progn (goto-char start) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2185 (error "Concealed-text change refused."))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2186 (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
|
2187 (allout-flag-region ol-start ol-end t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2188 (error "Concealed-text change abandoned, text reconcealed.")))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2189 (goto-char start)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2190 ;;;_ > allout-before-change-handler (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2191 (defun allout-before-change-handler (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2192 "Protect against changes to invisible text. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2193 |
79939 | 2194 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
|
2195 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2196 (if (and (allout-mode-p) undo-in-progress (allout-hidden-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2197 (allout-show-to-offshoot)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2198 |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2199 ;; 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
|
2200 ;; 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
|
2201 (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
|
2202 ;; 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
|
2203 (save-excursion |
78915
e7a2828a162d
(allout-before-change-handler): Replace got-char by goto-char.
Martin Rudalics <rudalics@gmx.at>
parents:
78492
diff
changeset
|
2204 (goto-char beg) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2205 (let ((overlay (allout-get-invisibility-overlay))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2206 (allout-overlay-interior-modification-handler |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2207 overlay nil beg end nil))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2208 ;;;_ > allout-isearch-end-handler (&optional overlay) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2209 (defun allout-isearch-end-handler (&optional overlay) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2210 "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
|
2211 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2212 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
|
2213 `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
|
2214 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
|
2215 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2216 (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
|
2217 (allout-show-to-offshoot))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2218 |
79939 | 2219 ;;;_ #3 Internal Position State-Tracking -- "allout-recent-*" funcs |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2220 ;;; All the basic outline functions that directly do string matches to |
3430 | 2221 ;;; evaluate heading prefix location set the variables |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2222 ;;; `allout-recent-prefix-beginning' and `allout-recent-prefix-end' |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2223 ;;; when successful. Functions starting with `allout-recent-' all |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2224 ;;; use this state, providing the means to avoid redundant searches |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2225 ;;; for just-established data. This optimization can provide |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2226 ;;; 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
|
2227 ;;;_ = 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
|
2228 (defvar allout-recent-prefix-beginning 0 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2229 "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
|
2230 (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
|
2231 ;;;_ = 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
|
2232 (defvar allout-recent-prefix-end 0 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2233 "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
|
2234 (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
|
2235 ;;;_ = allout-recent-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2236 (defvar allout-recent-depth 0 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2237 "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
|
2238 (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
|
2239 ;;;_ = 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
|
2240 (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
|
2241 "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
|
2242 (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
|
2243 ;;;_ > allout-prefix-data () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2244 (defsubst allout-prefix-data () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2245 "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
|
2246 |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
2247 For reference by `allout-recent' funcs. Return |
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
2248 the new value of `allout-recent-prefix-beginning'." |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2249 (setq allout-recent-prefix-end (or (match-end 1) (match-end 2)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2250 allout-recent-prefix-beginning (or (match-beginning 1) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2251 (match-beginning 2)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2252 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
|
2253 allout-recent-prefix-beginning |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2254 allout-header-subtraction))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2255 allout-recent-prefix-beginning) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2256 ;;;_ > nullify-allout-prefix-data () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2257 (defsubst nullify-allout-prefix-data () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2258 "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
|
2259 (setq allout-recent-prefix-end (point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2260 allout-recent-prefix-beginning (point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2261 allout-recent-depth 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2262 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
|
2263 ;;;_ > allout-recent-depth () |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2264 (defsubst allout-recent-depth () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2265 "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
|
2266 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2267 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
|
2268 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
|
2269 `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
|
2270 to return the current depth." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2271 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2272 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
|
2273 ;;;_ > allout-recent-prefix () |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2274 (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
|
2275 "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
|
2276 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2277 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
|
2278 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
|
2279 `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
|
2280 to return the current prefix." |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2281 (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
|
2282 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
|
2283 ;;;_ > 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
|
2284 (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
|
2285 "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
|
2286 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2287 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
|
2288 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
|
2289 `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
|
2290 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
|
2291 '(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
|
2292 allout-recent-prefix-end)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2293 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2294 ;;;_ #4 Navigation |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2295 |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2296 ;;;_ - Position Assessment |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2297 ;;;_ : Location Predicates |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2298 ;;;_ > allout-do-doublecheck () |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2299 (defsubst allout-do-doublecheck () |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2300 "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
|
2301 (and |
79939 | 2302 ;; 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
|
2303 ;; 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
|
2304 (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
|
2305 ;; 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
|
2306 (<= 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
|
2307 ;;;_ > allout-aberrant-container-p () |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2308 (defun allout-aberrant-container-p () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2309 "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
|
2310 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2311 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
|
2312 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
|
2313 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2314 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
|
2315 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
|
2316 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2317 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
|
2318 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
|
2319 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
|
2320 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2321 ;; 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
|
2322 ;; 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
|
2323 ;; 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
|
2324 ;; 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
|
2325 ;; 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
|
2326 ;; 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
|
2327 ;; 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
|
2328 ;; actually connected with their prospective context. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2329 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2330 (let ((depth (allout-depth)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2331 (start-point (point)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2332 done aberrant) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2333 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2334 (while (and (not done) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2335 (re-search-forward allout-line-boundary-regexp nil 0)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2336 (allout-prefix-data) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2337 (goto-char allout-recent-prefix-beginning) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2338 (cond |
79939 | 2339 ;; sibling -- continue: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2340 ((eq allout-recent-depth depth)) |
79939 | 2341 ;; first offspring is excessive -- aberrant: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2342 ((> allout-recent-depth (1+ depth)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2343 (setq done t aberrant t)) |
79939 | 2344 ;; next non-sibling is lower-depth -- not aberrant: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2345 (t (setq done t))))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2346 (if aberrant |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2347 aberrant |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2348 (goto-char start-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2349 ;; recalibrate allout-recent-* |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2350 (allout-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2351 nil))) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2352 ;;;_ > 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
|
2353 (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
|
2354 "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
|
2355 |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2356 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
|
2357 (save-excursion |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2358 (allout-beginning-of-current-line) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2359 (and (looking-at allout-regexp) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2360 (allout-prefix-data) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2361 (or (not (allout-do-doublecheck)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2362 (not (allout-aberrant-container-p)))))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2363 ;;;_ > allout-on-heading-p () |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2364 (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
|
2365 ;;;_ > 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 (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
|
2367 "True if point is located where current topic prefix ends, heading begins." |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2368 (and (save-excursion (let ((inhibit-field-text-motion t)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2369 (beginning-of-line)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2370 (looking-at allout-regexp)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
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 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2377 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
|
2378 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2379 Like `allout-current-depth', but respects hidden as well as visible topics." |
29490 | 2380 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2381 (let ((start-point (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2382 (if (and (allout-goto-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2383 (not (< start-point (point)))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2384 allout-recent-depth |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2385 (progn |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2386 ;; Oops, no prefix, nullify it: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2387 (nullify-allout-prefix-data) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2388 ;; ... and return 0: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2389 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
|
2390 ;;;_ > allout-current-depth () |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2391 (defun allout-current-depth () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2392 "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
|
2393 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2394 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
|
2395 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2396 (if (allout-back-to-current-heading) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2397 (max 1 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2398 (- allout-recent-prefix-end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2399 allout-recent-prefix-beginning |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2400 allout-header-subtraction)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2401 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
|
2402 ;;;_ > 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
|
2403 (defun allout-get-current-prefix () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2404 "Topic prefix of the current topic." |
3430 | 2405 (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
|
2406 (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
|
2407 (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
|
2408 ;;;_ > 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
|
2409 (defun allout-get-bullet () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2410 "Return bullet of containing topic (visible or not)." |
3430 | 2411 (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
|
2412 (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
|
2413 (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
|
2414 ;;;_ > 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
|
2415 (defun allout-current-bullet () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2416 "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
|
2417 (condition-case nil |
3430 | 2418 (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
|
2419 (allout-back-to-current-heading) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2420 (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
|
2421 allout-recent-prefix-end)) |
3430 | 2422 ;; 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
|
2423 (args-out-of-range nil)) |
3430 | 2424 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2425 ;;;_ > 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
|
2426 (defun allout-get-prefix-bullet (prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2427 "Return the bullet of the header prefix string PREFIX." |
3430 | 2428 ;; Doesn't make sense if we're old-style prefixes, but this just |
2429 ;; 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
|
2430 (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
|
2431 (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
|
2432 ;;;_ > 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
|
2433 (defun allout-sibling-index (&optional depth) |
29490 | 2434 "Item number of this prospective topic among its siblings. |
2435 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2436 If optional arg DEPTH is greater than current depth, then we're |
29490 | 2437 opening a new level, and return 0. |
2438 | |
2439 If less than this depth, ascend to that depth and count..." | |
2440 | |
2441 (save-excursion | |
2442 (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
|
2443 ((or (null depth) (= depth (allout-depth))) |
29490 | 2444 (let ((index 1)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2445 (while (allout-previous-sibling allout-recent-depth nil) |
29490 | 2446 (setq index (1+ index))) |
2447 index)) | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2448 ((< 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
|
2449 (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
|
2450 (allout-sibling-index)) |
29490 | 2451 (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
|
2452 ;;;_ > 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
|
2453 (defun allout-topic-flat-index () |
29490 | 2454 "Return a list indicating point's numeric section.subsect.subsubsect... |
2455 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
|
2456 (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
|
2457 (next-index (allout-sibling-index depth)) |
29490 | 2458 (rev-sibls nil)) |
2459 (while (> next-index 0) | |
2460 (setq rev-sibls (cons next-index rev-sibls)) | |
2461 (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
|
2462 (setq next-index (allout-sibling-index depth))) |
29490 | 2463 rev-sibls) |
2464 ) | |
3430 | 2465 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2466 ;;;_ - Navigation routines |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2467 ;;;_ > allout-beginning-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2468 (defun allout-beginning-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2469 "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
|
2470 |
71915
9315116570f0
(allout-run-unit-tests-on-load): Rectified docstring grammar.
Nick Roberts <nickrob@snap.net.nz>
parents:
71893
diff
changeset
|
2471 ;; 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
|
2472 ;; 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
|
2473 (let ((inhibit-field-text-motion t)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2474 (move-beginning-of-line 1) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2475 (beginning-of-line) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2476 (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
|
2477 (beginning-of-line) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2478 (if (or (allout-hidden-p) (not (bolp))) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2479 (forward-char -1))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2480 ;;;_ > allout-end-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2481 (defun allout-end-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2482 "Move to the end of line, past concealed text if any." |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
2483 ;; XXX 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
|
2484 ;; `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
|
2485 ;; `move-beginning-of-line'. |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2486 (let ((inhibit-field-text-motion t)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2487 (end-of-line) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2488 (while (allout-hidden-p) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2489 (end-of-line) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
2490 (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
|
2491 ;;;_ > allout-beginning-of-line () |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2492 (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
|
2493 "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
|
2494 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2495 (interactive) |
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 (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
|
2498 (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
|
2499 (move-beginning-of-line 1) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2500 (allout-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2501 (let ((beginning-of-body |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2502 (save-excursion |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2503 (while (and (allout-do-doublecheck) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2504 (allout-aberrant-container-p) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2505 (allout-previous-visible-heading 1))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2506 (allout-beginning-of-current-entry) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2507 (point)))) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2508 (cond ((= (current-column) 0) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2509 (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
|
2510 ((< (point) beginning-of-body) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2511 (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
|
2512 ((= (point) beginning-of-body) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2513 (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
|
2514 (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
|
2515 (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
|
2516 ;; 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
|
2517 (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
|
2518 ;;;_ > allout-end-of-line () |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2519 (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
|
2520 "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
|
2521 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2522 (interactive) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2523 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2524 (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
|
2525 (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
|
2526 (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
|
2527 (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
|
2528 (allout-end-of-entry) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2529 (point)))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2530 (cond ((not (eolp)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2531 (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
|
2532 ((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
|
2533 (forward-char -1) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2534 (allout-hidden-p))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2535 (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
|
2536 (allout-show-current-entry) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2537 (allout-show-children) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2538 (allout-end-of-entry)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2539 ((>= (point) end-of-entry) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2540 (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
|
2541 (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
|
2542 (t (allout-end-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
|
2543 ;;;_ > 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
|
2544 (defsubst allout-next-heading () |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2545 "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
|
2546 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2547 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
|
2548 |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
2549 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
|
2550 (if (looking-at allout-regexp) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
2551 (forward-char 1)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2552 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2553 (when (re-search-forward allout-line-boundary-regexp nil 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2554 (allout-prefix-data) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2555 (and (allout-do-doublecheck) |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2556 ;; this will set allout-recent-* on the first non-aberrant topic, |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2557 ;; whether it's the current one or one that disqualifies it: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2558 (allout-aberrant-container-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2559 (goto-char allout-recent-prefix-beginning))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2560 ;;;_ > 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
|
2561 (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
|
2562 "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
|
2563 ;; 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
|
2564 ;; and usable by allout-mode. |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2565 (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
|
2566 ;;;_ > allout-previous-heading () |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2567 (defun allout-previous-heading () |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2568 "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
|
2569 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2570 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
|
2571 |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
2572 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
|
2573 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2574 (if (bobp) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2575 nil |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2576 (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
|
2577 ;; 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
|
2578 (allout-goto-prefix) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2579 (when (or (re-search-backward allout-line-boundary-regexp nil 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2580 (looking-at allout-bob-regexp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2581 (goto-char (allout-prefix-data)) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2582 (if (and (allout-do-doublecheck) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2583 (allout-aberrant-container-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2584 (or (allout-previous-heading) |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2585 (and (goto-char start-point) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2586 ;; recalibrate allout-recent-*: |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2587 (allout-depth) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2588 nil)) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2589 (point)))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2590 ;;;_ > allout-get-invisibility-overlay () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2591 (defun allout-get-invisibility-overlay () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2592 "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
|
2593 (let ((overlays (overlays-at (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2594 got) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2595 (while (and overlays (not got)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2596 (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
|
2597 (setq got (car overlays)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2598 (pop overlays))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2599 got)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2600 ;;;_ > allout-back-to-visible-text () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2601 (defun allout-back-to-visible-text () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2602 "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
|
2603 (if (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2604 (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
|
2605 (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2606 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2607 ;;;_ - Subtree Charting |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2608 ;;;_ " 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
|
2609 ;;; 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
|
2610 ;;; |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2611 ;;; 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
|
2612 ;;; 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
|
2613 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2614 ;;;_ > 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
|
2615 (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
|
2616 "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
|
2617 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2618 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
|
2619 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
|
2620 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2621 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
|
2622 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
|
2623 |
73201
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
2624 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
|
2625 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2626 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
|
2627 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2628 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
|
2629 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
|
2630 for their elaborate manipulations. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2631 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2632 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
|
2633 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
|
2634 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
|
2635 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
|
2636 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
|
2637 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
|
2638 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2639 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
|
2640 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
|
2641 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
|
2642 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2643 (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
|
2644 chart curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2645 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2646 (if original ; Just starting? |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2647 ; Register initial settings and |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2648 ; 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
|
2649 (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
|
2650 (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
|
2651 (if visible |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2652 (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
|
2653 (allout-next-heading)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2654 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2655 ;; 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
|
2656 ;; 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
|
2657 ;; the typically quite constrained Emacs max-lisp-eval-depth. |
29490 | 2658 ;; |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2659 ;; 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
|
2660 ;; operation rather than recursing for lower levels. Bah. |
29490 | 2661 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2662 (while (and (not (eobp)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2663 ; Still within original topic? |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2664 (< 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
|
2665 (cond ((= prev-depth curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2666 ;; 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
|
2667 (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
|
2668 (if (and levels (<= levels 1)) |
79939 | 2669 ;; 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
|
2670 (or (allout-next-sibling curr-depth) |
79939 | 2671 ;; 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
|
2672 ;; 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
|
2673 (while (and (<= curr-depth |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2674 allout-recent-depth) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2675 (if visible |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2676 (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
|
2677 (allout-next-heading))))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2678 (if visible |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2679 (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
|
2680 (allout-next-heading)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2681 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2682 ((and (< prev-depth curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2683 (or (not levels) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2684 (> levels 0))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2685 ;; 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
|
2686 (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
|
2687 (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
|
2688 (1- levels)) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2689 visible |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2690 orig-depth |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2691 curr-depth) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2692 chart)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2693 ;; ... then continue with this one. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2694 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2695 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2696 ;; ... 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
|
2697 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2698 ))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2699 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2700 (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
|
2701 ; the original level. Position |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2702 ; to the end of it: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2703 (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
|
2704 (and (= (preceding-char) ?\n) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2705 (= (aref (buffer-substring (max 1 (- (point) 3)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2706 (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2707 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2708 ?\n) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2709 (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
|
2710 (setq allout-recent-end-of-subtree (point)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2711 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2712 chart ; (nreverse chart) not necessary, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2713 ; and maybe not preferable. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2714 )) |
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 ;;;_ > 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
|
2716 (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
|
2717 "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
|
2718 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
|
2719 for an explanation of charts." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2720 (save-excursion |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2721 (when (allout-goto-prefix-doublechecked) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2722 (let ((chart (list (point)))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2723 (while (allout-next-sibling) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2724 (setq chart (cons (point) chart))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2725 (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
|
2726 ;;;_ > 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
|
2727 (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
|
2728 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2729 "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
|
2730 |
73201
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
2731 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
|
2732 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2733 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
|
2734 start point." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2735 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2736 (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
|
2737 (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
|
2738 chart) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2739 (setq here (car chart)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2740 (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
|
2741 (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
|
2742 depth |
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
2743 (1- depth))))) |
79939 | 2744 ;; 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
|
2745 ;; more depth to go: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2746 (if further (setq result (append further result))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2747 (setq chart (cdr chart))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2748 (goto-char here) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2749 (if (allout-hidden-p) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2750 (setq result (cons here result))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2751 (setq chart (cdr chart)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2752 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
|
2753 ;;;_ 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
|
2754 ;; (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
|
2755 ;; "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
|
2756 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2757 ;; 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
|
2758 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2759 ;; 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
|
2760 ;; 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
|
2761 ;; 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
|
2762 ;; 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
|
2763 ;; 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
|
2764 ;; 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
|
2765 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2766 ;; 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
|
2767 ;; 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
|
2768 ;; exposed reside. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2769 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2770 ;; - 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
|
2771 ;; 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
|
2772 ;; 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
|
2773 ;; - 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
|
2774 ;; opened. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2775 ;; - 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
|
2776 ;; 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
|
2777 ;; exposure:" |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2778 ;; (while spec |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2779 ;; (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
|
2780 ;; ) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2781 ;; ) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2782 ;; (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
|
2783 ;; ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2784 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2785 ;;;_ - 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
|
2786 ;;;_ > 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
|
2787 (defun allout-goto-prefix () |
29490 | 2788 "Put point at beginning of immediately containing outline topic. |
2789 | |
2790 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
|
2791 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2792 Not sensitive to topic visibility. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2793 |
46161
29f1f32aee5b
(outline-goto-prefix): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
44182
diff
changeset
|
2794 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
|
2795 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2796 (let (done) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2797 (while (and (not done) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2798 (search-backward "\n" nil 1)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2799 (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
|
2800 (if (looking-at allout-regexp) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2801 (setq done (allout-prefix-data)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2802 (forward-char -1))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2803 (if (bobp) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2804 (cond ((looking-at allout-regexp) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2805 (allout-prefix-data)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2806 ((allout-next-heading)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2807 (done)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2808 done))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2809 ;;;_ > allout-goto-prefix-doublechecked () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2810 (defun allout-goto-prefix-doublechecked () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2811 "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
|
2812 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2813 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
|
2814 `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
|
2815 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
|
2816 `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
|
2817 (if (allout-goto-prefix) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2818 (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
|
2819 (allout-aberrant-container-p)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2820 (allout-previous-heading) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2821 (point)))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2822 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2823 ;;;_ > 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
|
2824 (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
|
2825 "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
|
2826 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2827 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
|
2828 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
|
2829 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2830 (if (not (allout-goto-prefix-doublechecked)) |
3430 | 2831 nil |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2832 (goto-char allout-recent-prefix-end) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2833 (if ignore-decorations |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2834 t |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2835 (while (looking-at "[0-9]") (forward-char 1)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2836 (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1))) |
3430 | 2837 ;; 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
|
2838 (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
|
2839 ;;;_ > 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
|
2840 (defun allout-current-bullet-pos () |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2841 "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
|
2842 |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2843 (if (not (allout-current-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2844 nil |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2845 (1- 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
|
2846 ;;;_ > 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
|
2847 (defun allout-back-to-current-heading () |
73315
df3186ae0953
* allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents:
73201
diff
changeset
|
2848 "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
|
2849 |
df3186ae0953
* allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents:
73201
diff
changeset
|
2850 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
|
2851 |
df3186ae0953
* allout.el (allout-back-to-current-heading): Base on lower-level
Chong Yidong <cyd@stupidchicken.com>
parents:
73201
diff
changeset
|
2852 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
|
2853 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
|
2854 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2855 (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
|
2856 (let ((bol-point (point))) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2857 (if (allout-goto-prefix-doublechecked) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2858 (if (<= (point) bol-point) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2859 (if (interactive-p) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2860 (allout-end-of-prefix) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2861 (point)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2862 (goto-char (point-min)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
2863 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
|
2864 ;;;_ > 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
|
2865 (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
|
2866 ;;;_ > allout-pre-next-prefix () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2867 (defun allout-pre-next-prefix () |
3430 | 2868 "Skip forward to just before the next heading line. |
2869 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2870 Returns that character position." |
3430 | 2871 |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2872 (if (allout-next-heading) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
2873 (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
|
2874 ;;;_ > 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
|
2875 (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
|
2876 "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
|
2877 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2878 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
|
2879 visible topic. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2880 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2881 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
|
2882 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
|
2883 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
|
2884 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2885 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
|
2886 (interactive "P") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2887 (if current |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2888 (allout-back-to-current-heading) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2889 (allout-goto-prefix-doublechecked)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2890 (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
|
2891 (allout-next-heading) |
3430 | 2892 (while (and (not (eobp)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2893 (> 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
|
2894 (allout-next-heading)) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2895 (if (eobp) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2896 (allout-end-of-entry) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
2897 (forward-char -1)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2898 (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
|
2899 (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
|
2900 (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
|
2901 ;;;_ > 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
|
2902 (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
|
2903 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2904 "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
|
2905 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2906 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
|
2907 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
|
2908 excluded as delimiting whitespace between topics. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2909 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2910 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
|
2911 (interactive) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2912 (allout-end-of-subtree t include-trailing-blank)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2913 ;;;_ > allout-beginning-of-current-entry () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2914 (defun allout-beginning-of-current-entry () |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2915 "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
|
2916 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2917 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
|
2918 \(See `allout-mode' doc string for details of hot-spot operation.)" |
3430 | 2919 (interactive) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2920 (let ((start-point (point))) |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2921 (move-beginning-of-line 1) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2922 (if (< 0 (allout-current-depth)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2923 (goto-char allout-recent-prefix-end) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2924 (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
|
2925 (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2926 (if (and (interactive-p) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2927 (= (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
|
2928 (goto-char (allout-current-bullet-pos))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2929 ;;;_ > allout-end-of-entry (&optional inclusive) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2930 (defun allout-end-of-entry (&optional inclusive) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2931 "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
|
2932 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2933 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
|
2934 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
|
2935 collapsed." |
3430 | 2936 (interactive) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2937 (allout-pre-next-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2938 (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
|
2939 (forward-char -1)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2940 (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
|
2941 ;;;_ > 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
|
2942 (defun allout-end-of-current-heading () |
29490 | 2943 (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
|
2944 (allout-beginning-of-current-entry) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2945 (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
|
2946 (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
|
2947 (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
|
2948 ;;;_ > allout-get-body-text () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2949 (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
|
2950 "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
|
2951 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2952 (allout-end-of-prefix) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2953 (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
|
2954 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2955 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2956 (let ((pre-body (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2957 (if (not pre-body) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2958 nil |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2959 (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
|
2960 (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
|
2961 (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
|
2962 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2963 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2964 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2965 ) |
3430 | 2966 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2967 ;;;_ - 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
|
2968 ;;;_ > 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
|
2969 (defun allout-ascend-to-depth (depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2970 "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
|
2971 (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
|
2972 (let (last-ascended) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2973 (while (and (< depth allout-recent-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2974 (setq last-ascended (allout-ascend)))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2975 (goto-char allout-recent-prefix-beginning) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2976 (if (interactive-p) (allout-end-of-prefix)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
2977 (and last-ascended 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
|
2978 ;;;_ > allout-ascend () |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2979 (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
|
2980 "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
|
2981 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2982 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
|
2983 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
|
2984 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
|
2985 (if dont-move-if-unsuccessful |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2986 (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
|
2987 (prog1 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2988 (if (allout-beginning-of-level) |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
2989 (let ((bolevel (point)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
2990 (bolevel-depth allout-recent-depth)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
2991 (allout-previous-heading) |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2992 (cond ((< allout-recent-depth bolevel-depth) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2993 allout-recent-depth) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2994 ((= allout-recent-depth bolevel-depth) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2995 (if dont-move-if-unsuccessful |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2996 (goto-char dont-move-if-unsuccessful)) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2997 (allout-depth) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2998 nil) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
2999 (t |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
3000 ;; 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
|
3001 (goto-char bolevel) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
3002 (allout-depth) |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
3003 nil)))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3004 (if (interactive-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
|
3005 ;;;_ > 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
|
3006 (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
|
3007 "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
|
3008 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3009 Returning depth if successful, nil if not." |
3430 | 3010 (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
|
3011 (start-depth (allout-depth))) |
3430 | 3012 (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
|
3013 (and (> (allout-depth) 0) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3014 (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
|
3015 (allout-next-heading) ; ... go further |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3016 (< 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
|
3017 (if (and (> (allout-depth) 0) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3018 (= allout-recent-depth depth)) |
3430 | 3019 depth |
3020 (goto-char start-point) | |
3021 nil)) | |
3022 ) | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3023 ;;;_ > allout-up-current-level (arg) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3024 (defun allout-up-current-level (arg) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3025 "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
|
3026 (interactive "p") |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3027 (let ((start-point (point))) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3028 (allout-back-to-current-heading) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3029 (if (not (allout-ascend)) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3030 (progn (goto-char start-point) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3031 (error "Can't ascend past outermost level")) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3032 (if (interactive-p) (allout-end-of-prefix)) |
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
3033 allout-recent-prefix-beginning))) |
3430 | 3034 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3035 ;;;_ - 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
|
3036 ;;;_ > 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
|
3037 (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
|
3038 "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
|
3039 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3040 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
|
3041 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3042 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
|
3043 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3044 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
|
3045 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3046 (if (if backward (bobp) (eobp)) |
3430 | 3047 nil |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3048 (let ((target-depth (or depth (allout-depth))) |
3430 | 3049 (start-point (point)) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
3050 (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
|
3051 (count 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3052 leaping |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3053 last-depth) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3054 (while (and |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3055 ;; 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
|
3056 (not leaping) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3057 ;; not at limit: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3058 (not (if backward (bobp) (eobp))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3059 ;; still traversable: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3060 (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
|
3061 ;; we're below the target depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3062 (> (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
|
3063 (setq count (1+ count)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3064 (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
|
3065 (setq leaping t))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3066 (cond (leaping |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3067 (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
|
3068 (progn |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3069 (goto-char start-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3070 (if depth (allout-depth) target-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3071 nil))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3072 ((and (not (eobp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3073 (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
|
3074 (= 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
|
3075 (not (= start-prefix-beginning |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
3076 allout-recent-prefix-beginning))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3077 allout-recent-prefix-beginning) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3078 (t |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3079 (goto-char start-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3080 (if depth (allout-depth) target-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3081 nil))))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3082 ;;;_ > 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
|
3083 (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
|
3084 "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
|
3085 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3086 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
|
3087 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3088 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
|
3089 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3090 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
|
3091 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3092 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
|
3093 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
3094 - 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
|
3095 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
|
3096 - 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
|
3097 some extra navigation |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3098 - 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
|
3099 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3100 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
|
3101 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
|
3102 `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
|
3103 situation." |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3104 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3105 (if (if backward (bobp) (eobp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3106 nil |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3107 (let* ((start-point (point)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3108 (target-depth (or depth (allout-depth))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3109 (search-whitespace-regexp nil) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3110 (depth-biased (- target-depth 2)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3111 (expression (if (<= target-depth 1) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3112 allout-depth-one-regexp |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3113 (format allout-depth-specific-regexp |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3114 depth-biased depth-biased))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3115 found |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3116 done) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3117 (while (not done) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3118 (setq found (if backward |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3119 (re-search-backward expression nil 'to-limit) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3120 (forward-char 1) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3121 (re-search-forward expression nil 'to-limit))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3122 (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
|
3123 (setq found nil)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3124 (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
|
3125 (if (not found) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3126 (progn (goto-char start-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3127 nil) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3128 ;; rationale: if any intervening items were at a lower depth, we |
79939 | 3129 ;; 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
|
3130 ;; 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
|
3131 ;; 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
|
3132 (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
|
3133 (if (< allout-recent-depth target-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3134 ;; 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
|
3135 (progn |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3136 (goto-char start-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3137 (allout-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3138 nil) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3139 (goto-char found) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3140 ;; locate cursor and set allout-recent-*: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3141 (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
|
3142 ;;;_ > 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
|
3143 (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
|
3144 "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
|
3145 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3146 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
|
3147 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3148 Optional BACKWARD reverses direction. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3149 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3150 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
|
3151 (allout-next-sibling depth (not backward)) |
3430 | 3152 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3153 ;;;_ > 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
|
3154 (defun allout-snug-back () |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
3155 "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
|
3156 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3157 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
|
3158 (if (or (bobp) (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3159 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3160 (forward-char -1)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3161 (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
|
3162 nil |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3163 (forward-char -1)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3164 (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
|
3165 ;;;_ > allout-beginning-of-level () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3166 (defun allout-beginning-of-level () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3167 "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
|
3168 (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
|
3169 ;;;_ > 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
|
3170 (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
|
3171 "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
|
3172 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3173 (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
|
3174 (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
|
3175 (prog1 allout-recent-depth |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3176 (if (interactive-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
|
3177 ;;;_ > 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
|
3178 (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
|
3179 "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
|
3180 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3181 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
|
3182 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3183 (interactive "p") |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
3184 (let* ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
3185 (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
|
3186 (step (if backward -1 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3187 prev got) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3188 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3189 (while (> arg 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3190 (while (and |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3191 ;; Boundary condition: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3192 (not (if backward (bobp)(eobp))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3193 ;; 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
|
3194 (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
|
3195 (error nil)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3196 (allout-beginning-of-current-line)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3197 ;; Deal with apparent header line: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3198 (if (not (looking-at allout-regexp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3199 ;; not a header line, keep looking: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3200 t |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3201 (allout-prefix-data) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
3202 (if (and (allout-do-doublecheck) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3203 (allout-aberrant-container-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3204 ;; skip this aberrant prospective header line: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3205 t |
79939 | 3206 ;; this prospective headerline qualifies -- register: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3207 (setq got allout-recent-prefix-beginning) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3208 ;; and break the loop: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3209 nil)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3210 ;; 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
|
3211 (if got (setq prev got)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3212 (setq arg (1- arg))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3213 (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
|
3214 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3215 (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
|
3216 (goto-char prev) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3217 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3218 ((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
|
3219 ;;;_ > 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
|
3220 (defun allout-previous-visible-heading (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3221 "Move to the previous heading line. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3222 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3223 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
|
3224 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
|
3225 matches)." |
3430 | 3226 (interactive "p") |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3227 (prog1 (allout-next-visible-heading (- arg)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3228 (if (interactive-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
|
3229 ;;;_ > 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
|
3230 (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
|
3231 "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
|
3232 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3233 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
|
3234 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3235 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
|
3236 (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
|
3237 (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
|
3238 (start-arg arg) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3239 (backward (> 0 arg))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3240 (if (= 0 start-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3241 (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
|
3242 (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
|
3243 (allout-back-to-current-heading) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3244 (while (and (not (zerop arg)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3245 (if backward |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3246 (allout-previous-sibling) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3247 (allout-next-sibling))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3248 (setq arg (1- arg))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3249 (if (not (interactive-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3250 nil |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3251 (allout-end-of-prefix) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3252 (if (not (zerop arg)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3253 (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
|
3254 (if backward "first" "last") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3255 allout-recent-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3256 (- (abs start-arg) arg) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3257 (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
|
3258 ;;;_ > 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
|
3259 (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
|
3260 "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
|
3261 (interactive "p") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3262 (if (interactive-p) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3263 (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
|
3264 (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
|
3265 (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
|
3266 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3267 ;;;_ #5 Alteration |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3268 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3269 ;;;_ - 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
|
3270 ;;;_ = 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
|
3271 (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
|
3272 "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
|
3273 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3274 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
|
3275 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
|
3276 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
|
3277 are mapped to the command of the corresponding control-key on the |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3278 `allout-mode-map'.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3279 (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
|
3280 ;;;_ = allout-command-counter |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3281 (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
|
3282 "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
|
3283 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3284 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
|
3285 coordinating with allout activity.") |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3286 (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
|
3287 ;;;_ > 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
|
3288 (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
|
3289 "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
|
3290 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3291 - 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
|
3292 outline commands. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3293 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3294 - 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
|
3295 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3296 ; 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
|
3297 (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
|
3298 nil |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3299 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3300 (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
|
3301 allout-after-save-decrypt) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3302 (allout-after-saves-handler)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3303 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3304 ;; 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
|
3305 (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
|
3306 (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
|
3307 (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
|
3308 (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
|
3309 )) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3310 ;;;_ > 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
|
3311 (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
|
3312 "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
|
3313 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3314 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
|
3315 topic bullet character. |
49962
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
3316 |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
3317 When the cursor is on the bullet character, self-insert characters are |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
3318 reinterpreted as the corresponding control-character in the |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
3319 `allout-mode-map'. The `allout-mode' `post-command-hook' insures that |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
3320 the cursor which has moved as a result of such reinterpretation is |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
3321 positioned on the bullet character of the destination topic. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3322 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
3323 The upshot is that you can get easy, single (ie, unmodified) key |
29490 | 3324 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
|
3325 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
|
3326 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
|
3327 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
|
3328 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3329 (if (not (allout-mode-p)) |
29490 | 3330 nil |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3331 ;; Increment allout-command-counter |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3332 (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
|
3333 ;; Do hot-spot navigation. |
29490 | 3334 (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
|
3335 (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
|
3336 (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
|
3337 ;;;_ > 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
|
3338 (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
|
3339 "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
|
3340 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3341 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
|
3342 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
|
3343 this-command accordingly. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3344 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3345 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
|
3346 (interactive) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3347 (let* ((key-string (if (numberp last-command-char) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3348 (char-to-string last-command-char))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3349 (key-num (cond ((numberp last-command-char) last-command-char) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3350 ;; 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
|
3351 ((and (fboundp 'characterp) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3352 (apply 'characterp (list last-command-char))) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3353 (apply 'char-to-int (list last-command-char))) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3354 (t 0))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3355 mapped-binding) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3356 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3357 (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
|
3358 nil |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3359 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3360 (if (and |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3361 ;; exclude control chars and escape: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3362 (<= 33 key-num) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3363 (setq mapped-binding |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3364 (or (and (assoc key-string allout-keybindings-list) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3365 ;; translate literal membership on list: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3366 (cadr (assoc key-string allout-keybindings-list))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3367 ;; translate as a keybinding: |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3368 (key-binding (concat allout-command-prefix |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3369 (char-to-string |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3370 (if (and (<= 97 key-num) ; "a" |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3371 (>= 122 key-num)) ; "z" |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3372 (- key-num 96) key-num))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3373 t)))) |
79939 | 3374 ;; 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
|
3375 (setq allout-post-goto-bullet t) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3376 ;; accept-defaults nil, or else we'll get allout-item-icon-key-handler. |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3377 (setq mapped-binding (key-binding (char-to-string key-num)))) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3378 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3379 (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
|
3380 (setq mapped-binding |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3381 (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
|
3382 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3383 (if mapped-binding |
71915
9315116570f0
(allout-run-unit-tests-on-load): Rectified docstring grammar.
Nick Roberts <nickrob@snap.net.nz>
parents:
71893
diff
changeset
|
3384 (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
|
3385 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3386 ;;;_ > 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
|
3387 (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
|
3388 "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
|
3389 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3390 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
|
3391 (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
|
3392 (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
|
3393 allout-layout) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3394 (allout-mode t))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3395 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3396 ;;;_ - 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
|
3397 ;;;_ > 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
|
3398 (defun allout-solicit-alternate-bullet (depth &optional current-bullet) |
3430 | 3399 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3400 "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
|
3401 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3402 Offer one suitable for current depth DEPTH as default." |
3430 | 3403 |
29490 | 3404 (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
|
3405 (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
|
3406 (sans-escapes (regexp-sans-escapes allout-bullets-string)) |
29490 | 3407 choice) |
3408 (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
|
3409 (goto-char (allout-current-bullet-pos)) |
29490 | 3410 (setq choice (solicit-char-in-string |
3411 (format "Select bullet: %s ('%s' default): " | |
3412 sans-escapes | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3413 (substring-no-properties default-bullet)) |
29490 | 3414 sans-escapes |
3415 t))) | |
3416 (message "") | |
3430 | 3417 (if (string= choice "") default-bullet choice)) |
3418 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3419 ;;;_ > 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
|
3420 (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
|
3421 "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
|
3422 (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
|
3423 ;;;_ > 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
|
3424 (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
|
3425 "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
|
3426 (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
|
3427 (string= allout-numbered-bullet |
3430 | 3428 (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
|
3429 (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
|
3430 (allout-get-bullet))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3431 ;;;_ > 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
|
3432 (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
|
3433 "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
|
3434 (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
|
3435 (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
|
3436 (if prefix |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3437 (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
|
3438 (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
|
3439 ;;;_ > 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
|
3440 (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
|
3441 "Return outline topic bullet suited to optional DEPTH, or current depth." |
3430 | 3442 ;; 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
|
3443 (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
|
3444 (char-to-string (aref allout-plain-bullets-string |
3430 | 3445 (% (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
|
3446 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
|
3447 allout-primary-bullet) |
3430 | 3448 ) |
3449 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3450 ;;;_ - 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
|
3451 ;;;_ > 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
|
3452 (defun allout-make-topic-prefix (&optional prior-bullet |
3430 | 3453 new |
3454 depth | |
3455 solicit | |
3456 number-control | |
3457 index) | |
3458 ;; Depth null means use current depth, non-null means we're either | |
3459 ;; opening a new topic after current topic, lower or higher, or we're | |
3460 ;; changing level of current topic. | |
3461 ;; Solicit dominates specified bullet-char. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3462 ;;;_ . Doc string: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3463 "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
|
3464 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3465 All the arguments are optional. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3466 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3467 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
|
3468 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
|
3469 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
|
3470 for instance. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3471 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3472 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
|
3473 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
|
3474 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
|
3475 sibling is one. The implication otherwise is that the current topic |
79939 | 3476 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
|
3477 bullet or previous sibling. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3478 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3479 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
|
3480 the current topics' depth. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3481 |
29490 | 3482 If SOLICIT is non-nil, then the choice of bullet is solicited from |
3483 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
|
3484 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
|
3485 distinction or depth) is offered. (This overrides other options, |
29490 | 3486 including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the |
3487 context-specific bullet is used. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3488 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3489 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
|
3490 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
|
3491 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
|
3492 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
|
3493 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3494 \(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
|
3495 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3496 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
|
3497 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
|
3498 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
|
3499 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
|
3500 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
|
3501 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
|
3502 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
|
3503 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
|
3504 index for each successive sibling)." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3505 ;;;_ . Code: |
3430 | 3506 ;; The options are ordered in likely frequence of use, most common |
3507 ;; highest, least lowest. Ie, more likely to be doing prefix | |
3508 ;; adjustments than soliciting, and yet more than numbering. | |
3509 ;; Current prefix is least dominant, but most likely to be commonly | |
3510 ;; specified... | |
3511 | |
3512 (let* (body | |
3513 numbering | |
3514 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
|
3515 (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
|
3516 (header-lead allout-header-prefix) |
3430 | 3517 (bullet-char |
3518 | |
3519 ;; Getting value for bullet char is practically the whole job: | |
3520 | |
3521 (cond | |
79939 | 3522 ; 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
|
3523 ((<= depth 1) (setq header-lead "") allout-primary-bullet) |
3430 | 3524 ; 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
|
3525 (allout-old-style-prefixes |
79939 | 3526 ;; Cheat -- make body the whole thing, null out header-lead and |
3430 | 3527 ;; bullet-char: |
3528 (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
|
3529 (string-to-char allout-primary-bullet))) |
3430 | 3530 (setq header-lead "") |
3531 "") | |
3532 | |
3533 ;; (Neither level 1 nor old-style, so we're space padding. | |
3534 ;; Sneak it in the condition of the next case, whatever it is.) | |
3535 | |
3536 ;; Solicitation overrides numbering and other cases: | |
3537 ((progn (setq body (make-string (- depth 2) ?\ )) | |
3538 ;; The actual condition: | |
3539 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
|
3540 (let* ((got (allout-solicit-alternate-bullet depth solicit))) |
3430 | 3541 ;; 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
|
3542 (setq numbering (and allout-numbered-bullet |
3430 | 3543 (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
|
3544 (string= got allout-numbered-bullet))) |
3430 | 3545 ;; Now return what we got, regardless: |
3546 got)) | |
3547 | |
3548 ;; 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
|
3549 ((and allout-numbered-bullet number-control) |
3430 | 3550 (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
|
3551 allout-numbered-bullet |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3552 (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
|
3553 (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
|
3554 prior-bullet))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3555 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
|
3556 (allout-bullet-for-depth depth)))) |
3430 | 3557 |
3558 ;;; Neither soliciting nor controlled numbering ;;; | |
3559 ;;; (may be controlled denumbering, tho) ;;; | |
3560 | |
3561 ;; Check wrt previous sibling: | |
3562 ((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
|
3563 (<= 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
|
3564 allout-numbered-bullet ; ... & numbering enabled |
3430 | 3565 (not denumbering) |
3566 (let ((sibling-bullet | |
3567 (save-excursion | |
3568 ;; 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
|
3569 (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 (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
|
3571 (allout-get-bullet)))) |
3430 | 3572 (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
|
3573 (string= allout-numbered-bullet sibling-bullet)) |
3430 | 3574 (setq numbering sibling-bullet))))) |
3575 | |
3576 ;; Distinctive prior bullet? | |
3577 ((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
|
3578 (allout-distinctive-bullet prior-bullet) |
3430 | 3579 ;; 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
|
3580 (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
|
3581 (string= prior-bullet allout-numbered-bullet))) |
3430 | 3582 ;; or numbered, and not denumbering: |
3583 (setq numbering (not denumbering))) | |
3584 ;; Here 'tis: | |
3585 prior-bullet)) | |
3586 | |
3587 ;; 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
|
3588 ((allout-bullet-for-depth depth))))) |
3430 | 3589 |
3590 (concat header-lead | |
3591 body | |
3592 bullet-char | |
3593 (if numbering | |
3594 (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
|
3595 (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
|
3596 ((allout-sibling-index)))))) |
3430 | 3597 ) |
3598 ) | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3599 ;;;_ > 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
|
3600 (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
|
3601 "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
|
3602 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3603 New topic is situated after current one, unless optional flag BEFORE |
79939 | 3604 is non-nil, or unless current line is completely empty -- lacking even |
3605 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
|
3606 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3607 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
|
3608 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
|
3609 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
|
3610 case.) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3611 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3612 If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. |
29490 | 3613 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3614 Nuances: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3615 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3616 - 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
|
3617 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
|
3618 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3619 - 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
|
3620 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
|
3621 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
|
3622 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
|
3623 deliberately dividing topic bodies. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3624 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3625 - 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
|
3626 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
|
3627 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
|
3628 single-spacing is used. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3629 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3630 - 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
|
3631 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
|
3632 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
|
3633 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
|
3634 from there." |
3430 | 3635 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3636 (allout-beginning-of-current-line) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
3637 (let* ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
3638 (depth (+ (allout-current-depth) relative-depth)) |
3430 | 3639 (opening-on-blank (if (looking-at "^\$") |
3640 (not (setq before nil)))) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3641 ;; bunch o vars set while computing ref-topic |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3642 opening-numbered |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3643 ref-depth |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3644 ref-bullet |
3430 | 3645 (ref-topic (save-excursion |
3646 (cond ((< relative-depth 0) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3647 (allout-ascend-to-depth depth)) |
3430 | 3648 ((>= relative-depth 1) nil) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3649 (t (allout-back-to-current-heading))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3650 (setq ref-depth allout-recent-depth) |
29490 | 3651 (setq ref-bullet |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3652 (if (> allout-recent-prefix-end 1) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3653 (allout-recent-bullet) |
29490 | 3654 "")) |
3430 | 3655 (setq opening-numbered |
3656 (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
|
3657 (and allout-numbered-bullet |
3430 | 3658 (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
|
3659 (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
|
3660 (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
|
3661 allout-numbered-bullet)))) |
3430 | 3662 (point))) |
3663 dbl-space | |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3664 doing-beginning |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3665 start end) |
3430 | 3666 |
3667 (if (not opening-on-blank) | |
3668 ; Positioning and vertical | |
79939 | 3669 ; padding -- only if not |
3430 | 3670 ; opening-on-blank: |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3671 (progn |
3430 | 3672 (goto-char ref-topic) |
3673 (setq dbl-space ; Determine double space action: | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3674 (or (and (<= relative-depth 0) ; not descending; |
3430 | 3675 (save-excursion |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3676 ;; at b-o-b or preceded by a blank line? |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3677 (or (> 0 (forward-line -1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3678 (looking-at "^\\s-*$") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3679 (bobp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3680 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3681 ;; succeeded by a blank line? |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3682 (allout-end-of-current-subtree) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3683 (looking-at "\n\n"))) |
3430 | 3684 (and (= ref-depth 1) |
3685 (or before | |
3686 (= depth 1) | |
3687 (save-excursion | |
3688 ;; Don't already have following | |
3689 ;; vertical padding: | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3690 (not (allout-pre-next-prefix))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3691 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3692 ;; Position to prior heading, if inserting backwards, and not |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3693 ;; going outwards: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3694 (if (and before (>= relative-depth 0)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3695 (progn (allout-back-to-current-heading) |
3430 | 3696 (setq doing-beginning (bobp)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3697 (if (not (bobp)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3698 (allout-previous-heading))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3699 (if (and before (bobp)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3700 (open-line 1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3701 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3702 (if (<= relative-depth 0) |
3430 | 3703 ;; Not going inwards, don't snug up: |
3704 (if doing-beginning | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3705 (if (not dbl-space) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3706 (open-line 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3707 (open-line 2)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3708 (if before |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3709 (progn (end-of-line) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3710 (allout-pre-next-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3711 (while (and (= ?\n (following-char)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3712 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3713 (forward-char 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3714 (allout-hidden-p))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3715 (forward-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3716 (if (not (looking-at "^$")) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3717 (open-line 1))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3718 (allout-end-of-current-subtree) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3719 (if (looking-at "\n\n") (forward-char 1)))) |
79939 | 3720 ;; Going inwards -- double-space if first offspring is |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3721 ;; double-spaced, otherwise snug up. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3722 (allout-end-of-entry) |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
3723 (if (eobp) |
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
3724 (newline 1) |
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
3725 (line-move 1)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3726 (allout-beginning-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3727 (backward-char 1) |
3430 | 3728 (if (bolp) |
3729 ;; Blank lines between current header body and next | |
79939 | 3730 ;; header -- get to last substantive (non-white-space) |
3430 | 3731 ;; line in body: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3732 (progn (setq dbl-space t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3733 (re-search-backward "[^ \t\n]" nil t))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3734 (if (looking-at "\n\n") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3735 (setq dbl-space t)) |
3430 | 3736 (if (save-excursion |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3737 (allout-next-heading) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3738 (when (> allout-recent-depth ref-depth) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3739 ;; This is an offspring. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3740 (forward-line -1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3741 (looking-at "^\\s-*$"))) |
3430 | 3742 (progn (forward-line 1) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3743 (open-line 1) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3744 (forward-line 1))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3745 (allout-end-of-current-line)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3746 |
3430 | 3747 ;;(if doing-beginning (goto-char doing-beginning)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3748 (if (not (bobp)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3749 ;; We insert a newline char rather than using open-line to |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3750 ;; avoid rear-stickiness inheritence of read-only property. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3751 (progn (if (and (not (> depth ref-depth)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3752 (not before)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3753 (open-line 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3754 (if (and (not dbl-space) (> depth ref-depth)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3755 (newline 1) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3756 (if dbl-space |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3757 (open-line 1) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3758 (if (not before) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3759 (newline 1))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3760 (if (and dbl-space (not (> relative-depth 0))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3761 (newline 1)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3762 (if (and (not (eobp)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3763 (or (not (bolp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3764 (and (not (bobp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3765 ;; bolp doesnt detect concealed |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3766 ;; trailing newlines, compensate: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3767 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3768 (forward-char -1) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3769 (allout-hidden-p))))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3770 (forward-char 1)))) |
3430 | 3771 )) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3772 (setq start (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3773 (insert (concat (allout-make-topic-prefix opening-numbered t depth) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3774 " ")) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3775 (setq end (1+ (point))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3776 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3777 (allout-rebullet-heading (and offer-recent-bullet ref-bullet) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3778 depth nil nil t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3779 (if (> relative-depth 0) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3780 (save-excursion (goto-char ref-topic) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3781 (allout-show-children))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3782 (end-of-line) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3783 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
3784 (run-hook-with-args 'allout-structure-added-hook start end) |
3430 | 3785 ) |
3786 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3787 ;;;_ > 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
|
3788 (defun allout-open-subtopic (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3789 "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
|
3790 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3791 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
|
3792 prior to the current one." |
3430 | 3793 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3794 (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
|
3795 ;;;_ > 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
|
3796 (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
|
3797 "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
|
3798 |
29490 | 3799 Positive universal arg means to use the bullet of the prior sibling. |
3800 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3801 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
|
3802 one." |
3430 | 3803 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3804 (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
|
3805 ;;;_ > 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
|
3806 (defun allout-open-supertopic (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3807 "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
|
3808 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3809 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
|
3810 topic prior to the current one." |
3430 | 3811 |
3812 (interactive "p") | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3813 (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
|
3814 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3815 ;;;_ - Outline Alteration |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3816 ;;;_ : 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
|
3817 ;;;_ = 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
|
3818 (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
|
3819 "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
|
3820 ;;;_ > 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
|
3821 (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
|
3822 "`allout-mode' autofill function. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3823 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3824 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
|
3825 `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
|
3826 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3827 (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
|
3828 (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
|
3829 ;; Check for topic header indentation: |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3830 (save-excursion |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3831 (beginning-of-line) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3832 (if (looking-at allout-regexp) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3833 ;; ... construct indentation to account for |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3834 ;; length of topic prefix: |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3835 (make-string (progn (allout-end-of-prefix) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3836 (current-column)) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3837 ?\ ))))) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3838 (use-auto-fill-function (or 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
|
3839 auto-fill-function |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3840 'do-auto-fill))) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
3841 (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
|
3842 (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
|
3843 ;;;_ > 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
|
3844 (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
|
3845 "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
|
3846 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3847 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
|
3848 be accommodated. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3849 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3850 Note that refill of indented paragraphs is not done." |
3430 | 3851 |
3852 (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
|
3853 (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3854 (let* ((new-margin (current-column)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3855 excess old-indent-begin old-indent-end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3856 ;; 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
|
3857 ;; *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
|
3858 ;; 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
|
3859 (old-margin (+ old-depth (- new-margin new-depth)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3860 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3861 ;; 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
|
3862 (allout-unprotected |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3863 (save-match-data |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3864 (while |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3865 (and (re-search-forward "\n\\(\\s-*\\)" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3866 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3867 t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3868 ;; Register the indent data, before we reset the |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3869 ;; 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
|
3870 (setq old-indent-begin (match-beginning 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3871 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
|
3872 (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
|
3873 (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
|
3874 old-margin))) |
79939 | 3875 ;; 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
|
3876 nil |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
3877 ;; 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
|
3878 ;; reindent it, preserving its existing indentation |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3879 ;; beyond the old margin: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3880 (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
|
3881 (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
|
3882 ;;;_ > 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
|
3883 (defun allout-rebullet-current-heading (arg) |
29490 | 3884 "Solicit new bullet for current visible heading." |
3885 (interactive "p") | |
3886 (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
|
3887 (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
|
3888 from to |
29490 | 3889 (backwards (if (< arg 0) |
3890 (setq arg (* arg -1))))) | |
3891 (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
|
3892 (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
|
3893 (allout-end-of-prefix) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3894 (setq from allout-recent-prefix-beginning |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3895 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
|
3896 (allout-rebullet-heading t ;;; solicit |
29490 | 3897 nil ;;; depth |
3898 nil ;;; number-control | |
3899 nil ;;; index | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3900 t) ;;; do-successors |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3901 (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
|
3902 from to t)) |
29490 | 3903 (setq arg (1- arg)) |
3904 (if (<= arg 0) | |
3905 nil | |
3906 (setq initial-col nil) ; Override positioning back to init col | |
3907 (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
|
3908 (allout-next-visible-heading 1) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3909 (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
|
3910 (allout-next-visible-heading -1)))) |
29490 | 3911 (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
|
3912 (cond (on-bullet (goto-char (allout-current-bullet-pos))) |
29490 | 3913 (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
|
3914 ;;;_ > 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
|
3915 (defun allout-rebullet-heading (&optional solicit |
3430 | 3916 new-depth |
3917 number-control | |
3918 index | |
3919 do-successors) | |
3920 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3921 "Adjust bullet of current topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3922 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3923 All args are optional. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3924 |
29490 | 3925 If SOLICIT is non-nil, then the choice of bullet is solicited from |
3926 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
|
3927 default, otherwise the one suited to the context (according to |
29490 | 3928 distinction or depth) is offered. If non-nil, then the |
3929 context-specific bullet is just used. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3930 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3931 Second arg DEPTH forces the topic prefix to that depth, regardless |
29490 | 3932 of the topic's current depth. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3933 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3934 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
|
3935 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
|
3936 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
|
3937 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
|
3938 of the fourth arg, INDEX. |
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
3939 |
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
3940 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
|
3941 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
|
3942 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
|
3943 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
|
3944 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
|
3945 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
|
3946 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
|
3947 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3948 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
|
3949 siblings. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3950 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3951 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
|
3952 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
|
3953 this function." |
3430 | 3954 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3955 (let* ((current-depth (allout-depth)) |
3430 | 3956 (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
|
3957 (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
|
3958 (me allout-recent-prefix-end) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
3959 (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
|
3960 (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
|
3961 (new-prefix (allout-make-topic-prefix current-bullet |
3430 | 3962 nil |
3963 new-depth | |
3964 solicit | |
3965 number-control | |
3966 index))) | |
3967 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3968 ;; Is new one is identical to old? |
3430 | 3969 (if (and (= current-depth new-depth) |
3970 (string= current-bullet | |
3971 (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
|
3972 ;; Nothing to do: |
3430 | 3973 t |
3974 | |
3975 ;; New prefix probably different from old: | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3976 ; 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
|
3977 (allout-unprotected (delete-region mb me)) |
3430 | 3978 (goto-char mb) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3979 ; Dispense with number if |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3980 ; numbered-bullet prefix: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3981 (if (and allout-numbered-bullet |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3982 (string= allout-numbered-bullet current-bullet) |
3430 | 3983 (looking-at "[0-9]+")) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3984 (allout-unprotected |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3985 (delete-region (match-beginning 0)(match-end 0)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3986 |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
3987 ;; 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
|
3988 (if has-annotation |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
3989 (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
|
3990 new-prefix)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
3991 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3992 ; 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
|
3993 (allout-unprotected (insert new-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3994 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3995 ;; 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
|
3996 (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
|
3997 (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
|
3998 (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
|
3999 (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
|
4000 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4001 ;; 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
|
4002 ;; caller elected for it: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4003 (if do-successors |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4004 (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
|
4005 (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
|
4006 (setq index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4007 (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
|
4008 ((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
|
4009 (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
|
4010 (allout-rebullet-heading nil ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4011 new-depth ;;; new-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4012 number-control;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4013 index ;;; index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4014 nil))))) ;;;(dont!)do-successors |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4015 ) ; (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
|
4016 ) ; let* ((current-depth (allout-depth))...) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4017 ) ; 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
|
4018 ;;;_ > allout-rebullet-topic (arg) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4019 (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
|
4020 "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
|
4021 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4022 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
|
4023 |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
4024 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
|
4025 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
|
4026 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
|
4027 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
|
4028 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
|
4029 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4030 With repeat count, shift topic depth by that amount." |
3430 | 4031 (interactive "P") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4032 (let ((start-col (current-column))) |
3430 | 4033 (save-excursion |
4034 ;; Normalize arg: | |
4035 (cond ((null arg) (setq arg 0)) | |
4036 ((listp arg) (setq arg (car arg)))) | |
4037 ;; Fill the user in, in case we're shifting a big topic: | |
4038 (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
|
4039 (allout-back-to-current-heading) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4040 (if (<= (+ allout-recent-depth arg) 0) |
3430 | 4041 (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
|
4042 (allout-rebullet-topic-grunt arg nil nil nil nil sans-offspring) |
3430 | 4043 (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
|
4044 (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
|
4045 ;;;_ > 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
|
4046 (defun allout-rebullet-topic-grunt (&optional relative-depth |
3430 | 4047 starting-depth |
4048 starting-point | |
4049 index | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4050 do-successors |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4051 sans-offspring) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4052 "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
|
4053 \(visible or not). |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4054 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4055 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
|
4056 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4057 All arguments are optional. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4058 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4059 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
|
4060 topic that amount. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4061 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4062 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
|
4063 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
|
4064 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4065 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
|
4066 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
|
4067 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
|
4068 \"containment discontinuity\", where the depth difference between |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
4069 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
|
4070 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4071 ;; 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
|
4072 ;; need simplification with refactoring. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4073 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4074 (if (and sans-offspring |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4075 relative-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4076 (< relative-depth 0)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4077 (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
|
4078 " would cause containment discontinuity."))) |
3430 | 4079 |
4080 (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
|
4081 (new-depth (allout-depth)) |
3430 | 4082 (starting-depth (or starting-depth new-depth)) |
4083 (on-starting-call (null starting-point)) | |
4084 (index (or index | |
4085 ;; Leave index null on starting call, so rebullet-heading | |
4086 ;; calculates it at what might be new depth: | |
4087 (and (or (zerop relative-depth) | |
4088 (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
|
4089 (allout-sibling-index)))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4090 (starting-index index) |
3430 | 4091 (moving-outwards (< 0 relative-depth)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4092 (starting-point (or starting-point (point))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4093 (local-point (point))) |
3430 | 4094 |
4095 ;; Sanity check for excessive promotion done only on starting call: | |
4096 (and on-starting-call | |
4097 moving-outwards | |
4098 (> 0 (+ starting-depth relative-depth)) | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4099 (error "Attempt to shift topic out beyond level 1")) |
3430 | 4100 |
4101 (cond ((= starting-depth new-depth) | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4102 ;; 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
|
4103 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4104 ;; 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
|
4105 ;; 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
|
4106 ;; 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
|
4107 (if (>= relative-depth 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4108 (allout-rebullet-heading nil |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4109 (+ starting-depth relative-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4110 nil ;;; number |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4111 index |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4112 nil)) ;;; do-successors |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4113 (when (not sans-offspring) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4114 ;; ... 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
|
4115 (setq index 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4116 (allout-next-heading) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4117 (while (and (not (eobp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4118 (< starting-depth (allout-depth))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4119 (setq index (1+ index)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4120 (allout-rebullet-topic-grunt relative-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4121 (1+ starting-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4122 starting-point |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4123 index))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4124 (when (< relative-depth 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4125 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4126 (goto-char local-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4127 (allout-rebullet-heading nil ;;; solicit |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4128 (+ starting-depth relative-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4129 nil ;;; number |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4130 starting-index |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4131 nil)))) ;;; do-successors |
3430 | 4132 |
4133 ((< starting-depth new-depth) | |
79939 | 4134 ;; Rare case -- subtopic more than one level deeper than parent. |
3430 | 4135 ;; 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
|
4136 (allout-rebullet-topic-grunt relative-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4137 new-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4138 starting-point |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4139 index |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4140 sans-offspring))) |
3430 | 4141 |
4142 (if on-starting-call | |
4143 (progn | |
4144 ;; Rectify numbering of former siblings of the adjusted topic, | |
4145 ;; if topic has changed depth | |
4146 (if (or do-successors | |
4147 (and (not (zerop relative-depth)) | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4148 (or (= allout-recent-depth starting-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4149 (= allout-recent-depth (+ starting-depth |
3430 | 4150 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
|
4151 (allout-rebullet-heading nil nil nil nil t)) |
3430 | 4152 ;; Now rectify numbering of new siblings of the adjusted topic, |
4153 ;; if depth has been changed: | |
4154 (progn (goto-char starting-point) | |
4155 (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
|
4156 (allout-rebullet-heading nil nil nil nil t))))) |
3430 | 4157 ) |
4158 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4159 ;;;_ > 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
|
4160 (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
|
4161 "Renumber siblings at current depth. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4162 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4163 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
|
4164 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4165 Returns final depth." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4166 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4167 ;; 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
|
4168 ;; 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
|
4169 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4170 (let ((ascender (allout-depth)) |
29490 | 4171 was-eobp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4172 (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
|
4173 (allout-depth) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4174 (>= allout-recent-depth depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4175 (>= ascender depth)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4176 ; Skip over all topics at |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4177 ; lesser depths, which can not |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4178 ; have been disturbed: |
29490 | 4179 (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
|
4180 (> 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
|
4181 (allout-next-heading)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4182 ; Prime ascender for ascension: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4183 (setq ascender (1- allout-recent-depth)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4184 (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
|
4185 (allout-rebullet-heading nil ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4186 nil ;;; depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4187 nil ;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4188 nil ;;; index |
29490 | 4189 t)) ;;; do-successors |
4190 (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
|
4191 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
|
4192 ;;;_ > 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
|
4193 (defun allout-number-siblings (&optional denumber) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4194 "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
|
4195 |
79939 | 4196 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
|
4197 topic and its siblings. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4198 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4199 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
|
4200 rebulleting each topic at this level." |
3430 | 4201 |
4202 (interactive "P") | |
4203 | |
4204 (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
|
4205 (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
|
4206 (allout-beginning-of-level) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4207 (let ((depth allout-recent-depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4208 (index (if (not denumber) 1)) |
3430 | 4209 (use-bullet (equal '(16) denumber)) |
4210 (more t)) | |
4211 (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
|
4212 (allout-rebullet-heading use-bullet ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4213 depth ;;; depth |
3430 | 4214 t ;;; number-control |
4215 index ;;; index | |
4216 nil) ;;; do-successors | |
4217 (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
|
4218 (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
|
4219 ;;;_ > 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
|
4220 (defun allout-shift-in (arg) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4221 "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
|
4222 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4223 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
|
4224 `allout-shift-out', instead. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4225 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4226 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
|
4227 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
|
4228 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
|
4229 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4230 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
|
4231 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
|
4232 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
|
4233 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
|
4234 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
|
4235 |
3430 | 4236 (interactive "p") |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4237 (if (< arg 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4238 (allout-shift-out (* arg -1)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4239 ;; refuse to create a containment discontinuity: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4240 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4241 (allout-back-to-current-heading) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4242 (if (not (bobp)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4243 (let* ((current-depth allout-recent-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4244 (start-point (point)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4245 (predecessor-depth (progn |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4246 (forward-char -1) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4247 (allout-goto-prefix-doublechecked) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4248 (if (< (point) start-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4249 allout-recent-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4250 0)))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4251 (if (and (> predecessor-depth 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4252 (> (1+ current-depth) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4253 (1+ predecessor-depth))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4254 (error (concat "Disallowed shift deeper than" |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4255 " containing topic's children.")) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4256 (allout-back-to-current-heading) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4257 (if (< allout-recent-depth (1+ current-depth)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4258 (allout-show-children)))))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4259 (let ((where (point))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4260 (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
|
4261 (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
|
4262 ;;;_ > 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
|
4263 (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
|
4264 "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
|
4265 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
|
4266 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4267 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
|
4268 `allout-shift-in', instead. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4269 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4270 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
|
4271 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
|
4272 the item. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4273 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4274 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
|
4275 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
|
4276 subtopics into siblings of the item." |
3430 | 4277 (interactive "p") |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4278 (if (< arg 0) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4279 (allout-shift-in (* arg -1)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4280 ;; Get proper exposure in this area: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4281 (save-excursion (if (allout-ascend) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4282 (allout-show-children))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4283 ;; 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
|
4284 ;; their sibling: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4285 (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
|
4286 (save-excursion (allout-next-sibling))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4287 (allout-show-children)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4288 (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
|
4289 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4290 (if (> arg 1) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4291 ;; 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
|
4292 (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
|
4293 (if (listp (car children-chart)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4294 ;; whoops: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4295 (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
|
4296 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4297 (dolist (child-point children-chart) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4298 (goto-char child-point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4299 (allout-shift-out 1)))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4300 (allout-rebullet-topic (* arg -1)))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4301 (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
|
4302 ;;;_ : 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
|
4303 ;;;_ > 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
|
4304 (defun allout-kill-line (&optional arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4305 "Kill line, adjusting subsequent lines suitably for outline mode." |
3430 | 4306 |
4307 (interactive "*P") | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4308 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4309 (if (or (not (allout-mode-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4310 (not (bolp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4311 (not (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
|
4312 ;; Just do a regular kill: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4313 (kill-line arg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4314 ;; Ah, have to watch out for adjustments: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4315 (let* ((beg (point)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4316 end |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4317 (beg-hidden (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4318 (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
|
4319 (setq end (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4320 (allout-hidden-p))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4321 (depth (allout-depth))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4322 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4323 (allout-annotate-hidden beg end) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4324 (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
|
4325 (allout-unprotected (kill-line arg)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4326 (kill-line arg)) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4327 (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
|
4328 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4329 (if allout-numbered-bullet |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4330 (save-excursion ; Renumber subsequent topics if needed: |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4331 (if (not (looking-at allout-regexp)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4332 (allout-next-heading)) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4333 (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
|
4334 (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
|
4335 ;;;_ > 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
|
4336 (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
|
4337 "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
|
4338 (interactive) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4339 (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
|
4340 (condition-case nil |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4341 (allout-kill-line) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4342 (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
|
4343 ;;;_ > 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
|
4344 (defun allout-kill-topic () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4345 "Kill topic together with subtopics. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4346 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4347 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
|
4348 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4349 - 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
|
4350 - 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
|
4351 - 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
|
4352 previous one. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4353 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4354 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
|
4355 `allout-yank-processing' for exposure recovery." |
3430 | 4356 |
4357 (interactive) | |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4358 (let* ((inhibit-field-text-motion t) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4359 (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
|
4360 end |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4361 (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
|
4362 (allout-end-of-current-subtree) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4363 (if (and (/= (current-column) 0) (not (eobp))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4364 (forward-char 1)) |
3430 | 4365 (if (not (eobp)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4366 (if (and (looking-at "\n") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4367 (or (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4368 (or (not (allout-next-heading)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4369 (= depth allout-recent-depth))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4370 (and (> (- beg (point-min)) 3) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4371 (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
|
4372 (forward-char 1))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4373 |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4374 (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
|
4375 (unwind-protect |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4376 (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
|
4377 (if buffer-read-only |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4378 ;; 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
|
4379 (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
|
4380 |
3430 | 4381 (save-excursion |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4382 (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
|
4383 (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
|
4384 ;;;_ > 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
|
4385 (defun allout-copy-topic-as-kill () |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
4386 "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
|
4387 (interactive) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4388 (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
|
4389 (condition-case nil |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4390 (allout-kill-topic) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4391 (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
|
4392 ;;;_ > allout-annotate-hidden (begin end) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4393 (defun allout-annotate-hidden (begin end) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4394 "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
|
4395 |
73003
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4396 (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
|
4397 (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
|
4398 (allout-deannotate-hidden begin end) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4399 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4400 (goto-char begin) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4401 (let (done next prev overlay) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4402 (while (not done) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4403 ;; 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
|
4404 (if (not (allout-hidden-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4405 (setq next |
73003
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4406 (max (1+ (point)) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4407 (next-single-char-property-change (point) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4408 'invisible |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
4409 nil end)))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4410 (if (or (not next) (eq prev next)) |
79939 | 4411 ;; 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
|
4412 (setq done t) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4413 (goto-char next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4414 (setq prev next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4415 (if (not (allout-hidden-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4416 ;; 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
|
4417 (setq done t) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4418 (setq overlay (allout-get-invisibility-overlay)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4419 (setq next (overlay-end overlay) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4420 prev next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4421 ;; 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
|
4422 (when next |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4423 (goto-char next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4424 (allout-unprotected |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4425 (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
|
4426 (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
|
4427 'allout-was-hidden t))))))))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4428 (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
|
4429 ;;;_ > 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
|
4430 (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
|
4431 "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
|
4432 |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4433 (allout-unprotected |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4434 (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
|
4435 (buffer-undo-list t)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4436 ;(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
|
4437 ))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4438 ;;;_ > allout-hide-by-annotation (begin end) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4439 (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
|
4440 "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
|
4441 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4442 (goto-char begin) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4443 (let ((was-modified (buffer-modified-p)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4444 done next prev) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4445 (while (not done) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4446 ;; 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
|
4447 (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
|
4448 (setq next (next-single-char-property-change (point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4449 'allout-was-hidden |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4450 nil end))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4451 (if (or (not next) (eq prev next)) |
79939 | 4452 ;; 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
|
4453 (setq done t) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4454 (goto-char next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4455 (setq prev next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4456 (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
|
4457 ;; still not at start of annotation. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4458 (setq done t) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4459 ;; advance to just after end of this annotation: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4460 (setq next (next-single-char-property-change (point) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4461 'allout-was-hidden |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4462 nil end)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4463 (overlay-put (make-overlay prev next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4464 '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
|
4465 (allout-deannotate-hidden prev next) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4466 (setq prev next) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4467 (if next (goto-char next))))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4468 (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
|
4469 ;;;_ > 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
|
4470 (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
|
4471 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4472 "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
|
4473 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4474 Does depth adjustment of yanked topics, when: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4475 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4476 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
|
4477 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
|
4478 topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4479 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
4480 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
|
4481 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4482 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
|
4483 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
|
4484 header into which it's being yanked. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4485 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4486 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
|
4487 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
|
4488 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
|
4489 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4490 (interactive "*P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4491 ; Get to beginning, leaving |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4492 ; region around subject: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4493 (if (< (allout-mark-marker t) (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4494 (exchange-point-and-mark)) |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4495 (let* ((subj-beg (point)) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4496 (into-bol (bolp)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4497 (subj-end (allout-mark-marker t)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4498 ;; 'resituate' if yanking an entire topic into topic header: |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4499 (resituate (and (let ((allout-inhibit-aberrance-doublecheck t)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4500 (allout-e-o-prefix-p)) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4501 (looking-at allout-regexp) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4502 (allout-prefix-data))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4503 ;; `rectify-numbering' if resituating (where several topics may |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4504 ;; be resituating) or yanking a topic into a topic slot (bol): |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4505 (rectify-numbering (or resituate |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4506 (and into-bol (looking-at allout-regexp))))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4507 (if resituate |
79939 | 4508 ;; Yanking a topic into the start of a topic -- reconcile to fit: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4509 (let* ((inhibit-field-text-motion t) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4510 (prefix-len (if (not (match-end 1)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4511 1 |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4512 (- (match-end 1) subj-beg))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4513 (subj-depth allout-recent-depth) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4514 (prefix-bullet (allout-recent-bullet)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4515 (adjust-to-depth |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4516 ;; Nil if adjustment unnecessary, otherwise depth to which |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4517 ;; adjustment should be made: |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4518 (save-excursion |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4519 (and (goto-char subj-end) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4520 (eolp) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4521 (goto-char subj-beg) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4522 (and (looking-at allout-regexp) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4523 (progn |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4524 (beginning-of-line) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4525 (not (= (point) subj-beg))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4526 (looking-at allout-regexp) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4527 (allout-prefix-data)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4528 allout-recent-depth))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4529 (more t)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4530 (setq rectify-numbering allout-numbered-bullet) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4531 (if adjust-to-depth |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4532 ; Do the adjustment: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4533 (progn |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4534 (save-restriction |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4535 (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
|
4536 ; Trim off excessive blank |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4537 ; line at end, if any: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4538 (goto-char (point-max)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4539 (if (looking-at "^$") |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4540 (allout-unprotected (delete-char -1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4541 ; Work backwards, with each |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4542 ; shallowest level, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4543 ; successively excluding the |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4544 ; last processed topic from |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4545 ; the narrow region: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4546 (while more |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4547 (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4548 ; go as high as we can in each bunch: |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
4549 (while (allout-ascend t)) |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4550 (save-excursion |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4551 (allout-unprotected |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4552 (allout-rebullet-topic-grunt (- adjust-to-depth |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4553 subj-depth))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4554 (allout-depth)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4555 (if (setq more (not (bobp))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4556 (progn (widen) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4557 (forward-char -1) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4558 (narrow-to-region subj-beg (point)))))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4559 ;; Preserve new bullet if it's a distinctive one, otherwise |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4560 ;; use old one: |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4561 (if (string-match (regexp-quote prefix-bullet) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4562 allout-distinctive-bullets-string) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4563 ; Delete from bullet of old to |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4564 ; before bullet of new: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4565 (progn |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4566 (beginning-of-line) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4567 (allout-unprotected |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4568 (delete-region (point) subj-beg)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4569 (set-marker (allout-mark-marker t) subj-end) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4570 (goto-char subj-beg) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4571 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4572 ; Delete base subj prefix, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4573 ; leaving old one: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4574 (allout-unprotected |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4575 (progn |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4576 (delete-region (point) (+ (point) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4577 prefix-len |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4578 (- adjust-to-depth |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
4579 subj-depth))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4580 ; and delete residual subj |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4581 ; prefix digits and space: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4582 (while (looking-at "[0-9]") (delete-char 1)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4583 (if (looking-at " ") (delete-char 1)))))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4584 (exchange-point-and-mark)))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4585 (if rectify-numbering |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4586 (progn |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4587 (save-excursion |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4588 ; Give some preliminary feedback: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4589 (message "... reconciling numbers") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4590 ; ... and renumber, in case necessary: |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4591 (goto-char subj-beg) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4592 (if (allout-goto-prefix-doublechecked) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4593 (allout-unprotected |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4594 (allout-rebullet-heading nil ;;; solicit |
73660
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4595 (allout-depth) ;;; depth |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4596 nil ;;; number-control |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4597 nil ;;; index |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4598 t))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4599 (message "")))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4600 (if (or into-bol resituate) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4601 (allout-hide-by-annotation (point) (allout-mark-marker t)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4602 (allout-deannotate-hidden (allout-mark-marker t) (point))) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4603 (if (not resituate) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4604 (exchange-point-and-mark)) |
4a5c7b0a29cc
2006-11-03 Ken Manheimer <ken.manheimer@gmail.com>
Kim F. Storm <storm@cua.dk>
parents:
73315
diff
changeset
|
4605 (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
|
4606 ;;;_ > 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
|
4607 (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
|
4608 "`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
|
4609 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
4610 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
|
4611 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4612 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
|
4613 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
|
4614 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
4615 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
|
4616 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
|
4617 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
|
4618 topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4619 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4620 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
|
4621 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
|
4622 header into which it's being yanked. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4623 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4624 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
|
4625 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
|
4626 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
|
4627 exactly like normal yanks. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4628 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
4629 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
|
4630 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
|
4631 |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
4632 `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
|
4633 works with normal `yank' in non-outline buffers." |
3430 | 4634 |
4635 (interactive "*P") | |
4636 (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
|
4637 (allout-unprotected |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4638 (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
|
4639 (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
|
4640 (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
|
4641 ;;;_ > 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
|
4642 (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
|
4643 "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
|
4644 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4645 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
|
4646 |
79939 | 4647 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
|
4648 by pops to non-distinctive yanks. Bug..." |
3430 | 4649 |
4650 (interactive "*p") | |
4651 (setq this-command 'yank) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4652 (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
|
4653 (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
|
4654 (allout-yank-processing))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4655 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4656 ;;;_ - Specialty bullet functions |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4657 ;;;_ : 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
|
4658 ;;;_ > 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
|
4659 (defun allout-resolve-xref () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4660 "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
|
4661 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4662 \(Works according to setting of `allout-file-xref-bullet')." |
3430 | 4663 (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
|
4664 (if (not allout-file-xref-bullet) |
3430 | 4665 (error |
79939 | 4666 "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
|
4667 (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
|
4668 (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
|
4669 allout-file-xref-bullet) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4670 (let ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4671 file-name) |
3430 | 4672 (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
|
4673 (let* ((text-start allout-recent-prefix-end) |
15663
4f762e6ae80a
(outline-resolve-xref): Do not mistake a blank line
Karl Heuer <kwzh@gnu.org>
parents:
14416
diff
changeset
|
4674 (heading-end (progn (end-of-line) (point)))) |
3430 | 4675 (goto-char text-start) |
4676 (setq file-name | |
4677 (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t) | |
4678 (buffer-substring (match-beginning 1) (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
|
4679 (setq file-name (expand-file-name file-name)) |
3430 | 4680 (if (or (file-exists-p file-name) |
4681 (if (file-writable-p file-name) | |
4682 (y-or-n-p (format "%s not there, create one? " | |
4683 file-name)) | |
4684 (error "%s not found and can't be created" file-name))) | |
4685 (condition-case failure | |
4686 (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
|
4687 (error failure)) |
3430 | 4688 (error "%s not found" file-name)) |
4689 ) | |
4690 ) | |
4691 ) | |
4692 ) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4693 |
29490 | 4694 ;;;_ #6 Exposure Control |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4695 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4696 ;;;_ - Fundamental |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4697 ;;;_ > 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
|
4698 (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
|
4699 "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
|
4700 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4701 Exposure-change hook `allout-exposure-change-hook' is run with the same |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
4702 arguments as this function, after the exposure changes are made. (The old |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4703 `allout-view-change-hook' is being deprecated, and eventually will not be |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
4704 invoked.)" |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4705 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4706 ;; 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
|
4707 (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
|
4708 (when flag |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4709 (let ((o (make-overlay from to))) |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
4710 (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
|
4711 (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
|
4712 (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
|
4713 (while props |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4714 (overlay-put o (pop props) (pop props))))))) |
70616
b69cce4ff5a0
2006-05-12 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70256
diff
changeset
|
4715 (run-hooks 'allout-view-change-hook) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4716 (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
|
4717 ;;;_ > 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
|
4718 (defun allout-flag-current-subtree (flag) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4719 "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
|
4720 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4721 (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
|
4722 (allout-back-to-current-heading) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4723 (let ((inhibit-field-text-motion t)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4724 (end-of-line)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4725 (allout-flag-region (point) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4726 ;; Exposing must not leave trailing blanks hidden, |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4727 ;; 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
|
4728 ;; can use flag's inverse as the |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4729 ;; include-trailing-blank cue: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4730 (allout-end-of-current-subtree (not flag)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4731 flag))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4732 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4733 ;;;_ - Topic-specific |
71893
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
4734 ;;;_ > allout-show-entry () |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
4735 (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
|
4736 "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
|
4737 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4738 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
|
4739 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
|
4740 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
|
4741 the exposure." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4742 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4743 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4744 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4745 (let (beg end) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4746 (allout-goto-prefix-doublechecked) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4747 (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
|
4748 (setq end (allout-pre-next-prefix)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4749 (allout-flag-region beg end nil) |
29490 | 4750 (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
|
4751 ;;;_ > 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
|
4752 (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
|
4753 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4754 "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
|
4755 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
4756 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
|
4757 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4758 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
|
4759 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
|
4760 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4761 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
|
4762 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
|
4763 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
|
4764 it. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4765 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4766 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
|
4767 point of non-opened subtree?)" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4768 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4769 (interactive "p") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4770 (let ((start-point (point))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4771 (if (and (not strict) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4772 (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4773 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4774 (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
|
4775 ; expose it. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4776 ;; 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
|
4777 ;; infinite regress: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4778 (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
|
4779 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4780 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4781 (allout-beginning-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4782 (save-restriction |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4783 (let* (depth |
73201
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
4784 ;; 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
|
4785 ;; 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
|
4786 (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
|
4787 ((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
|
4788 (t level))) |
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
4789 (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
|
4790 (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
|
4791 ;; interactive, show discontinuous children: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4792 (and chart |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4793 (interactive-p) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4794 (save-excursion |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4795 (allout-back-to-current-heading) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4796 (setq depth (allout-current-depth)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4797 (and (allout-next-heading) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4798 (> allout-recent-depth |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4799 (1+ depth)))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4800 (message |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4801 "Discontinuous offspring; use `%s %s'%s." |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4802 (substitute-command-keys |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4803 "\\[universal-argument]") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4804 (substitute-command-keys |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4805 "\\[allout-shift-out]") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4806 " to elevate them.") |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4807 (allout-chart-to-reveal |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4808 chart (- allout-recent-depth depth)))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4809 (goto-char start-point) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4810 (when (and strict (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4811 ;; 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
|
4812 ;; unless strict was set. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4813 (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
|
4814 (when allout-show-bodies |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4815 (goto-char (car to-reveal)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4816 (allout-show-current-entry))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4817 (while to-reveal |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4818 (goto-char (car to-reveal)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4819 (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
|
4820 (progn (search-forward "\n" nil t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4821 (1- (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4822 nil) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4823 (when allout-show-bodies |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4824 (goto-char (car to-reveal)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4825 (allout-show-current-entry)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4826 (setq to-reveal (cdr to-reveal))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4827 ;; 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
|
4828 ;; within invisible text: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4829 (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
|
4830 ;;;_ > 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
|
4831 (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
|
4832 "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
|
4833 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4834 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
|
4835 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4836 (save-excursion |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4837 (let ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4838 (orig-pt (point)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4839 (orig-pref (allout-goto-prefix-doublechecked)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4840 (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
|
4841 (bag-it 0)) |
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
4842 (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
|
4843 (while (allout-hidden-p) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4844 (move-beginning-of-line 1) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4845 (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
|
4846 (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
|
4847 ;; 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
|
4848 ;; 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
|
4849 (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
|
4850 (allout-show-current-subtree) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4851 (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
|
4852 (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
|
4853 (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
|
4854 (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
|
4855 "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
|
4856 (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
|
4857 (allout-show-children) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4858 (goto-char orig-pref))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4859 (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
|
4860 (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
|
4861 (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
|
4862 ;;;_ > 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
|
4863 (defun allout-hide-current-entry () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4864 "Hide the body directly following this heading." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4865 (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
|
4866 (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4867 (save-excursion |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4868 (let ((inhibit-field-text-motion t)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4869 (end-of-line)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4870 (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
|
4871 (progn (allout-end-of-entry) (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4872 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
|
4873 ;;;_ > 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
|
4874 (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
|
4875 "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
|
4876 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4877 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4878 (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
|
4879 (allout-hide-current-entry) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4880 (save-excursion (allout-show-to-offshoot)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4881 (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
|
4882 (allout-flag-region (point) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4883 (progn (allout-end-of-entry t) (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4884 nil) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4885 ))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4886 ;;;_ > 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
|
4887 (defun allout-show-current-subtree (&optional arg) |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
4888 "Show everything within the current topic. |
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
4889 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
|
4890 (interactive "P") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4891 (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
|
4892 (if (<= (allout-current-depth) 0) |
79939 | 4893 ;; 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
|
4894 (if (not (allout-next-heading)) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
4895 (error "No topics") |
79939 | 4896 ;; got to first, outermost topic -- set to expose it and siblings: |
4897 (message "Above outermost topic -- exposing all.") | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4898 (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
|
4899 (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
|
4900 (if (not arg) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4901 (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
|
4902 (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
|
4903 (allout-expose-topic '(* :)))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4904 ;;;_ > 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
|
4905 (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
|
4906 "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
|
4907 |
70673
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
4908 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
|
4909 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
|
4910 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
|
4911 default, they are treated as being uncollapsed." |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4912 (save-excursion |
70673
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
4913 (and |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4914 ;; Is the topic all on one line (allowing for trailing blank line)? |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4915 (>= (progn (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
|
4916 (move-end-of-line 1) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4917 (point)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4918 (allout-end-of-current-subtree (not (looking-at "\n\n")))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
4919 |
70673
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
4920 (or include-single-liners |
798fa39b6207
2006-05-16 Ken Manheimer <ken.manheimer@gmail.com>
Reiner Steib <Reiner.Steib@gmx.de>
parents:
70616
diff
changeset
|
4921 (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
|
4922 ;;;_ > 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
|
4923 (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
|
4924 "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
|
4925 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4926 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
|
4927 and its siblings. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4928 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4929 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
|
4930 siblings, even if the target topic is already closed." |
3430 | 4931 |
4932 (interactive) | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4933 (let* ((from (point)) |
79939 | 4934 (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
|
4935 (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
|
4936 (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
|
4937 (just-close nil) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4938 ((allout-ascend) (allout-hide-current-subtree)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4939 (t (goto-char 0) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4940 (message sibs-msg) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
4941 (allout-goto-prefix-doublechecked) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4942 (allout-expose-topic '(0 :)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4943 (message (concat sibs-msg " Done.")))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4944 (goto-char from))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4945 ;;;_ > 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
|
4946 (defun allout-show-current-branches () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4947 "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
|
4948 (interactive) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4949 (let ((inhibit-field-text-motion t)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4950 (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
|
4951 (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
|
4952 ;;;_ > 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
|
4953 (defun allout-hide-current-leaves () |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4954 "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
|
4955 (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
|
4956 (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
|
4957 (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
|
4958 (point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4959 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4960 ;;;_ - 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
|
4961 ;;;_ > 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
|
4962 (defun allout-show-all () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4963 "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
|
4964 (interactive) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4965 (message "Exposing entire buffer...") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4966 (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
|
4967 (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
|
4968 ;;;_ > 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
|
4969 (defun allout-hide-bodies () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4970 "Hide all of buffer except headings." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4971 (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
|
4972 (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
|
4973 ;;;_ > 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
|
4974 (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
|
4975 "Hide all body lines in the region, but not headings." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4976 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4977 (save-restriction |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4978 (narrow-to-region start end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4979 (goto-char (point-min)) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4980 (let ((inhibit-field-text-motion t)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4981 (while (not (eobp)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4982 (end-of-line) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4983 (allout-flag-region (point) (allout-end-of-entry) t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4984 (if (not (eobp)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4985 (forward-char |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4986 (if (looking-at "\n\n") |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
4987 2 1)))))))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4988 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4989 ;;;_ > 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
|
4990 (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
|
4991 "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
|
4992 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4993 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
|
4994 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
|
4995 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
|
4996 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
|
4997 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4998 Cursor is left at start position. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4999 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5000 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
|
5001 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5002 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
|
5003 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5004 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
|
5005 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
|
5006 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5007 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
|
5008 subtopics of the current topic. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5009 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5010 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
|
5011 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
|
5012 explicit specs following the `:'. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5013 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5014 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
|
5015 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5016 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
|
5017 - 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
|
5018 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
|
5019 that level. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5020 - 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
|
5021 number, but do not force already opened subtopics to be closed. |
79939 | 5022 - 0 means to close topic -- hide all offspring. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5023 : - `repeat' |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5024 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
|
5025 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
|
5026 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
|
5027 ones. (Only first of multiple colons at same level is |
79939 | 5028 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
|
5029 * - 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
|
5030 + - 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
|
5031 - - 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
|
5032 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5033 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
|
5034 \(allout-expose-topic '(-1 : 0)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5035 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
|
5036 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
|
5037 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
|
5038 \(allout-expose-topic '(-1 () : 1 0)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5039 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
|
5040 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
|
5041 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
|
5042 \(allout-expose-topic '(-2 : -1 *)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5043 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
|
5044 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
|
5045 last and completely open the last one." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5046 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5047 (interactive "xExposure spec: ") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5048 (if (not (listp spec)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5049 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
|
5050 (let ((depth (allout-depth)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5051 (max-pos 0) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5052 prev-elem curr-elem |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5053 stay) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5054 (while spec |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5055 (setq prev-elem curr-elem |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5056 curr-elem (car spec) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5057 spec (cdr spec)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5058 (cond ; Do current element: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5059 ((null curr-elem) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5060 ((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
|
5061 (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
|
5062 (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
|
5063 (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
|
5064 ((eq curr-elem '+) |
16a7031b0447
(allout-expose-topic): Rectify implementation of "+" spec, so that bodies are
Eli Zaretskii <eliz@gnu.org>
parents:
73003
diff
changeset
|
5065 (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
|
5066 (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
|
5067 (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
|
5068 (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
|
5069 (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
|
5070 ((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
|
5071 ((eq curr-elem ':) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5072 (setq stay t) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5073 ;; 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
|
5074 ;; w.r.t. remaining siblings: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5075 (let ((residue ; = # of sibs not covered by remaining spec |
79939 | 5076 ;; 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
|
5077 (- (length (allout-chart-siblings)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5078 (length spec)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5079 (if (< 0 residue) |
79939 | 5080 ;; 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
|
5081 (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
|
5082 spec))))))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5083 ((numberp curr-elem) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5084 (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
|
5085 (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
|
5086 (if (> 0 curr-elem) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5087 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
|
5088 (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
|
5089 (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
|
5090 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
|
5091 (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
|
5092 (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
|
5093 (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
|
5094 (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
|
5095 ((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
|
5096 (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
|
5097 (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
|
5098 (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
|
5099 (cond (stay (setq stay nil)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5100 ((listp (car spec)) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5101 ((> max-pos (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5102 ;; 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
|
5103 (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
|
5104 (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
|
5105 ((allout-next-sibling depth)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5106 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
|
5107 ;;;_ > 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
|
5108 (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
|
5109 |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5110 "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
|
5111 format) instead. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5112 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5113 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
|
5114 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5115 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
|
5116 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
|
5117 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5118 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
|
5119 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
|
5120 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
|
5121 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
|
5122 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
|
5123 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5124 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
|
5125 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5126 - 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
|
5127 - 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
|
5128 absolute value of the number. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5129 - 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
|
5130 - 0 just closes |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5131 - `*' completely opens the topic, including bodies. |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5132 - `+' shows all the sub headers, but not the bodies |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5133 - `-' 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
|
5134 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5135 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
|
5136 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
|
5137 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
|
5138 for the corresponding offspring of the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5139 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
5140 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
|
5141 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5142 (interactive "xExposure spec: ") |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5143 (let ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5144 (depth (allout-current-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5145 max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5146 (cond ((null spec) nil) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5147 ((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
|
5148 (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
|
5149 (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
|
5150 (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
|
5151 ((numberp spec) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5152 (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
|
5153 (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
|
5154 (end-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5155 (if (or (not max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5156 (> (point) max-pos)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5157 (setq max-pos (point))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5158 (if (> 0 spec) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5159 (setq spec (* -1 spec))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5160 (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
|
5161 (allout-show-children spec))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5162 ((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
|
5163 ;(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
|
5164 ; (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
|
5165 ; (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
|
5166 (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
|
5167 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
|
5168 (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
|
5169 (setq spec (cdr spec)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5170 (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
|
5171 (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
|
5172 (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
|
5173 (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
|
5174 (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
|
5175 (setq max-pos got))))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5176 (while (and followers |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5177 (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
|
5178 (progn (goto-char max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5179 (setq max-pos nil))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5180 (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
|
5181 (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
|
5182 (allout-old-expose-topic (car followers)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5183 (setq followers (cdr followers))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5184 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
|
5185 ;;;_ > 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
|
5186 (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
|
5187 "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
|
5188 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
|
5189 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
|
5190 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5191 Cursor is left at start position. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5192 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5193 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
|
5194 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5195 Examples: |
61969
38ca28ee68d6
(allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents:
59996
diff
changeset
|
5196 \(allout-new-exposure (-1 () () () 1) 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5197 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
|
5198 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
|
5199 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
|
5200 \(allout-new-exposure : -1 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5201 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
|
5202 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
|
5203 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
|
5204 \(allout-new-exposure -2 : -1 *) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5205 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
|
5206 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
|
5207 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
|
5208 (list 'save-excursion |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5209 '(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
|
5210 (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
|
5211 (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
|
5212 (list 'allout-expose-topic (list 'quote spec)))) |
29490 | 5213 |
79939 | 5214 ;;;_ #7 Systematic outline presentation -- copying, printing, flattening |
29490 | 5215 |
5216 ;;;_ - Mapping and processing of topics | |
5217 ;;;_ ( 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
|
5218 ;;;_ > 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
|
5219 (defun allout-stringify-flat-index (flat-index &optional context) |
29490 | 5220 "Convert list representing section/subsection/... to document string. |
5221 | |
5222 Optional arg CONTEXT indicates interior levels to include." | |
5223 (let ((delim ".") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
5224 result |
29490 | 5225 numstr |
5226 (context-depth (or (and context 2) 1))) | |
5227 ;; Take care of the explicit context: | |
5228 (while (> context-depth 0) | |
5229 (setq numstr (int-to-string (car flat-index)) | |
5230 flat-index (cdr flat-index) | |
5231 result (if flat-index | |
5232 (cons delim (cons numstr result)) | |
5233 (cons numstr result)) | |
5234 context-depth (if flat-index (1- context-depth) 0))) | |
5235 (setq delim " ") | |
5236 ;; Take care of the indentation: | |
5237 (if flat-index | |
5238 (progn | |
5239 (while flat-index | |
5240 (setq result | |
5241 (cons delim | |
5242 (cons (make-string | |
5243 (1+ (truncate (if (zerop (car flat-index)) | |
5244 1 | |
5245 (log10 (car flat-index))))) | |
5246 ? ) | |
5247 result))) | |
5248 (setq flat-index (cdr flat-index))) | |
5249 ;; Dispose of single extra delim: | |
5250 (setq result (cdr result)))) | |
5251 (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
|
5252 ;;;_ > 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
|
5253 (defun allout-stringify-flat-index-plain (flat-index) |
29490 | 5254 "Convert list representing section/subsection/... to document string." |
5255 (let ((delim ".") | |
5256 result) | |
5257 (while flat-index | |
5258 (setq result (cons (int-to-string (car flat-index)) | |
5259 (if result | |
5260 (cons delim result)))) | |
5261 (setq flat-index (cdr flat-index))) | |
5262 (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
|
5263 ;;;_ > 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
|
5264 (defun allout-stringify-flat-index-indented (flat-index) |
29490 | 5265 "Convert list representing section/subsection/... to document string." |
5266 (let ((delim ".") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
5267 result |
29490 | 5268 numstr) |
5269 ;; Take care of the explicit context: | |
5270 (setq numstr (int-to-string (car flat-index)) | |
5271 flat-index (cdr flat-index) | |
5272 result (if flat-index | |
5273 (cons delim (cons numstr result)) | |
5274 (cons numstr result))) | |
5275 (setq delim " ") | |
5276 ;; Take care of the indentation: | |
5277 (if flat-index | |
5278 (progn | |
5279 (while flat-index | |
5280 (setq result | |
5281 (cons delim | |
5282 (cons (make-string | |
5283 (1+ (truncate (if (zerop (car flat-index)) | |
5284 1 | |
5285 (log10 (car flat-index))))) | |
5286 ? ) | |
5287 result))) | |
5288 (setq flat-index (cdr flat-index))) | |
5289 ;; Dispose of single extra delim: | |
5290 (setq result (cdr result)))) | |
5291 (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
|
5292 ;;;_ > 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
|
5293 (defun allout-listify-exposed (&optional start end format) |
29490 | 5294 |
5295 "Produce a list representing exposed topics in current region. | |
5296 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5297 This list can then be used by `allout-process-exposed' to manipulate |
29490 | 5298 the subject region. |
5299 | |
5300 Optional START and END indicate bounds of region. | |
5301 | |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
5302 Optional arg, FORMAT, designates an alternate presentation form for |
29490 | 5303 the prefix: |
5304 | |
79939 | 5305 list -- Present prefix as numeric section.subsection..., starting with |
29490 | 5306 section indicated by the list, innermost nesting first. |
79939 | 5307 `indent' (symbol) -- Convert header prefixes to all white space, |
29490 | 5308 except for distinctive bullets. |
5309 | |
5310 The elements of the list produced are lists that represents a topic | |
5311 header and body. The elements of that list are: | |
5312 | |
5313 - a number representing the depth of the topic, | |
5314 - a string representing the header-prefix, including trailing whitespace and | |
5315 bullet. | |
5316 - a string representing the bullet character, | |
5317 - and a series of strings, each containing one line of the exposed | |
5318 portion of the topic entry." | |
5319 | |
5320 (interactive "r") | |
5321 (save-excursion | |
5322 (let* | |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5323 ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5324 ;; state vars: |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5325 strings prefix result depth new-depth out gone-out bullet beg |
29490 | 5326 next done) |
5327 | |
5328 (goto-char start) | |
5329 (beginning-of-line) | |
5330 ;; 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
|
5331 (if (> (allout-goto-prefix-doublechecked) start) |
79939 | 5332 ;; First topic follows beginning point -- register preliminary stuff: |
29490 | 5333 (setq result (list (list 0 "" nil |
5334 (buffer-substring start (1- (point))))))) | |
5335 (while (and (not done) | |
5336 (not (eobp)) ; Loop until we've covered the region. | |
5337 (not (> (point) end))) | |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5338 (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
|
5339 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
|
5340 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
|
5341 beg (progn (allout-end-of-prefix t) (point))) ; and beginning. |
29490 | 5342 (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
|
5343 (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
|
5344 (setq new-depth allout-recent-depth) |
29490 | 5345 (setq gone-out out |
5346 out (< new-depth depth)) | |
5347 (beginning-of-line) | |
5348 (setq next (point)) | |
5349 (goto-char beg) | |
5350 (setq strings nil) | |
5351 (while (> next (point)) ; Get all the exposed text in | |
5352 (setq strings | |
5353 (cons (buffer-substring | |
5354 beg | |
5355 ;To hidden text or end of line: | |
5356 (progn | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5357 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5358 (allout-back-to-visible-text))) |
29490 | 5359 strings)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5360 (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
|
5361 (line-move 1) |
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
5362 (beginning-of-line)) |
29490 | 5363 (setq beg (point))) |
5364 ;; Accumulate list for this topic: | |
5365 (setq strings (nreverse strings)) | |
5366 (setq result | |
5367 (cons | |
5368 (if format | |
5369 (let ((special (if (string-match | |
5370 (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
|
5371 allout-distinctive-bullets-string) |
29490 | 5372 bullet))) |
5373 (cond ((listp format) | |
5374 (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
|
5375 (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
|
5376 (allout-stringify-flat-index format |
29490 | 5377 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
|
5378 (allout-stringify-flat-index-plain |
29490 | 5379 format)) |
5380 strings | |
5381 special)) | |
5382 ((eq format 'indent) | |
5383 (if special | |
5384 (list depth | |
5385 (concat (make-string (1+ depth) ? ) | |
5386 (substring prefix -1)) | |
5387 strings) | |
5388 (list depth | |
5389 (make-string depth ? ) | |
5390 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
|
5391 (t (error "allout-listify-exposed: %s %s" |
29490 | 5392 "invalid format" format)))) |
5393 (list depth prefix strings)) | |
5394 result)) | |
5395 ;; Reasses format, if any: | |
5396 (if (and format (listp format)) | |
5397 (cond ((= new-depth depth) | |
5398 (setq format (cons (1+ (car format)) | |
5399 (cdr format)))) | |
79939 | 5400 ((> new-depth depth) ; descending -- assume by 1: |
29490 | 5401 (setq format (cons 1 format))) |
5402 (t | |
5403 ; Pop the residue: | |
5404 (while (< new-depth depth) | |
5405 (setq format (cdr format)) | |
5406 (setq depth (1- depth))) | |
5407 ; And increment the current one: | |
5408 (setq format | |
5409 (cons (1+ (or (car format) | |
5410 -1)) | |
5411 (cdr format))))))) | |
5412 ;; Put the list with first at front, to last at back: | |
5413 (nreverse result)))) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5414 ;;;_ > my-region-active-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5415 (defmacro my-region-active-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5416 (if (fboundp 'region-active-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5417 '(region-active-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5418 'mark-active)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5419 ;;;_ > allout-process-exposed (&optional func from to frombuf |
29490 | 5420 ;;; 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
|
5421 (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
|
5422 format start-num) |
29490 | 5423 "Map function on exposed parts of current topic; results to another buffer. |
5424 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5425 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
|
5426 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5427 Apply FUNCTION to exposed portions FROM position TO position in buffer |
29490 | 5428 FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an |
5429 alternate presentation form: | |
5430 | |
79939 | 5431 `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
|
5432 section indicated by the START-NUM, innermost nesting first. |
79939 | 5433 X`flat-indented' -- Prefix is like `flat' for first topic at each |
29490 | 5434 X level, but subsequent topics have only leaf topic |
5435 X number, padded with blanks to line up with first. | |
79939 | 5436 `indent' (symbol) -- Convert header prefixes to all white space, |
29490 | 5437 except for distinctive bullets. |
5438 | |
5439 Defaults: | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5440 FUNCTION: `allout-insert-listified' |
29490 | 5441 FROM: region start, if region active, else start of buffer |
5442 TO: region end, if region active, else end of buffer | |
5443 FROMBUF: current buffer | |
5444 TOBUF: buffer name derived: \"*current-buffer-name exposed*\" | |
5445 FORMAT: nil" | |
5446 | |
5447 ; Resolve arguments, | |
5448 ; 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
|
5449 (if (not func) (setq func 'allout-insert-listified)) |
29490 | 5450 (if (not (and from to)) |
5451 (if (my-region-active-p) | |
5452 (setq from (region-beginning) to (region-end)) | |
5453 (setq from (point-min) to (point-max)))) | |
5454 (if frombuf | |
5455 (if (not (bufferp frombuf)) | |
79939 | 5456 ;; Specified but not a buffer -- get it: |
29490 | 5457 (let ((got (get-buffer frombuf))) |
5458 (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
|
5459 (error (concat "allout-process-exposed: source buffer " |
29490 | 5460 frombuf |
5461 " not found.")) | |
5462 (setq frombuf got)))) | |
79939 | 5463 ;; not specified -- default it: |
29490 | 5464 (setq frombuf (current-buffer))) |
5465 (if tobuf | |
5466 (if (not (bufferp tobuf)) | |
5467 (setq tobuf (get-buffer-create tobuf))) | |
79939 | 5468 ;; not specified -- default it: |
29490 | 5469 (setq tobuf (concat "*" (buffer-name frombuf) " exposed*"))) |
5470 (if (listp format) | |
5471 (nreverse format)) | |
5472 | |
5473 (let* ((listified | |
5474 (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
|
5475 (allout-listify-exposed from to format)))) |
29490 | 5476 (set-buffer tobuf) |
5477 (mapcar func listified) | |
5478 (pop-to-buffer tobuf))) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5479 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5480 ;;;_ - 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
|
5481 ;;;_ > 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
|
5482 (defun allout-insert-listified (listified) |
29490 | 5483 "Insert contents of listified outline portion in current buffer. |
5484 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
5485 LISTIFIED is a list representing each topic header and body: |
29490 | 5486 |
5487 \`(depth prefix text)' | |
5488 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5489 or \`(depth prefix text bullet-plus)' |
29490 | 5490 |
5491 If `bullet-plus' is specified, it is inserted just after the entire prefix." | |
5492 (setq listified (cdr listified)) | |
5493 (let ((prefix (prog1 | |
5494 (car listified) | |
5495 (setq listified (cdr listified)))) | |
5496 (text (prog1 | |
5497 (car listified) | |
5498 (setq listified (cdr listified)))) | |
5499 (bullet-plus (car listified))) | |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5500 (insert prefix) |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5501 (if bullet-plus (insert (concat " " bullet-plus))) |
29490 | 5502 (while text |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5503 (insert (car text)) |
29490 | 5504 (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
|
5505 (insert "\n"))) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5506 (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
|
5507 ;;;_ > 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
|
5508 (defun allout-copy-exposed-to-buffer (&optional arg tobuf format) |
29490 | 5509 "Duplicate exposed portions of current outline to another buffer. |
5510 | |
5511 Other buffer has current buffers name with \" exposed\" appended to it. | |
5512 | |
5513 With repeat count, copy the exposed parts of only the current topic. | |
5514 | |
5515 Optional second arg TOBUF is target buffer name. | |
5516 | |
5517 Optional third arg FORMAT, if non-nil, symbolically designates an | |
5518 alternate presentation format for the outline: | |
5519 | |
5520 `flat' - Convert topic header prefixes to numeric | |
5521 section.subsection... identifiers. | |
5522 `indent' - Convert header prefixes to all white space, except for | |
5523 distinctive bullets. | |
5524 `indent-flat' - The best of both - only the first of each level has | |
5525 the full path, the rest have only the section number | |
5526 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
|
5527 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5528 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5529 (if (not tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5530 (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
|
5531 (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
|
5532 (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
|
5533 (end (if arg (allout-end-of-current-subtree) (point-max))) |
29490 | 5534 (buf (current-buffer)) |
5535 (start-list ())) | |
5536 (if (eq format 'flat) | |
5537 (setq format (if arg (save-excursion | |
5538 (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
|
5539 (allout-topic-flat-index)) |
29490 | 5540 '(1)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5541 (save-excursion (set-buffer tobuf)(erase-buffer)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5542 (allout-process-exposed 'allout-insert-listified |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5543 beg |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5544 end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5545 (current-buffer) |
29490 | 5546 tobuf |
5547 format start-list) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5548 (goto-char (point-min)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5549 (pop-to-buffer buf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5550 (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
|
5551 ;;;_ > 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
|
5552 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf) |
29490 | 5553 "Present numeric outline of outline's exposed portions in another buffer. |
5554 | |
79939 | 5555 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
|
5556 `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
|
5557 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5558 Use `allout-indented-exposed-to-buffer' for indented presentation. |
29490 | 5559 |
5560 With repeat count, copy the exposed portions of only current topic. | |
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 Other buffer has current buffer's name with \" exposed\" appended to |
29490 | 5563 it, unless optional second arg TOBUF is specified, in which case it is |
5564 used verbatim." | |
5565 (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
|
5566 (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
|
5567 ;;;_ > 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
|
5568 (defun allout-indented-exposed-to-buffer (&optional arg tobuf) |
29490 | 5569 "Present indented outline of outline's exposed portions in another buffer. |
5570 | |
79939 | 5571 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
|
5572 `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
|
5573 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5574 Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. |
29490 | 5575 |
5576 With repeat count, copy the exposed portions of only current topic. | |
5577 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
5578 Other buffer has current buffer's name with \" exposed\" appended to |
29490 | 5579 it, unless optional second arg TOBUF is specified, in which case it is |
5580 used verbatim." | |
5581 (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
|
5582 (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
|
5583 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5584 ;;;_ - 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
|
5585 ;;;_ > 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
|
5586 (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
|
5587 "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
|
5588 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
|
5589 string across LaTeX processing." |
29490 | 5590 (mapconcat (function |
5591 (lambda (char) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5592 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5593 (concat "\\char" (number-to-string char) "{}")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5594 ((= char ?\n) "\\\\") |
29490 | 5595 (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
|
5596 string |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5597 "")) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5598 ;;;_ > 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
|
5599 (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
|
5600 "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
|
5601 |
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5602 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
|
5603 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
|
5604 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
|
5605 (let ((inhibit-field-text-motion t)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5606 (beginning-of-line) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5607 (let ((beg (point)) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5608 (end (progn (end-of-line)(point)))) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5609 (goto-char beg) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5610 (while (re-search-forward "\\\\" |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5611 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#" |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5612 end ; bounded by end-of-line |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5613 1) ; no matches, move to end & return nil |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5614 (goto-char (match-beginning 2)) |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5615 (insert "\\") |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
5616 (setq end (1+ end)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5617 (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
|
5618 ;;;_ > 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
|
5619 (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
|
5620 "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
|
5621 ;; 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
|
5622 ;; 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
|
5623 (set-buffer buffer) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5624 (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
|
5625 "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
|
5626 (page-numbering (if allout-number-pages |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5627 "\\pagestyle{empty}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5628 "")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5629 (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
|
5630 allout-title-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5631 (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
|
5632 allout-label-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5633 (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
|
5634 allout-head-line-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5635 (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
|
5636 allout-body-line-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5637 (setlength (format "%s%s%s%s" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5638 "\\newlength{\\stepsize}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5639 "\\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
|
5640 allout-indent |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5641 "}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5642 (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
|
5643 "\\newcommand{\\OneHeadLine}[3]{%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5644 "\\noindent%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5645 "\\hspace*{#2\\stepsize}%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5646 "\\labelcmd{#1}\\hspace*{.2cm}" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5647 "\\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
|
5648 allout-line-skip |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5649 "]\n}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5650 (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
|
5651 "\\newcommand{\\OneBodyLine}[2]{%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5652 "\\noindent%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5653 "\\hspace*{#1\\stepsize}%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5654 "\\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
|
5655 allout-line-skip |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5656 "]\n}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5657 (begindoc "\\begin{document}\n\\begin{center}\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5658 (title (format "%s%s%s%s" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5659 "\\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
|
5660 (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
|
5661 (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
|
5662 (eval allout-title) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5663 (error "<unnamed buffer>")) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5664 "Unnamed Outline")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5665 "}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5666 "\\end{center}\n\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5667 (hsize "\\hsize = 7.5 true in\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5668 (hoffset "\\hoffset = -1.5 true in\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5669 (vspace "\\vspace{.1cm}\n\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5670 (insert (concat doc-style |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5671 page-numbering |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5672 titlecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5673 labelcmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5674 headlinecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5675 bodylinecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5676 setlength |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5677 oneheadline |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5678 onebodyline |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5679 begindoc |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5680 title |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5681 hsize |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5682 hoffset |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5683 vspace) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5684 ))) |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
5685 ;;;_ > 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
|
5686 (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
|
5687 "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
|
5688 (set-buffer buffer) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5689 (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
|
5690 ;;;_ > 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
|
5691 (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
|
5692 "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
|
5693 |
29490 | 5694 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
|
5695 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
|
5696 (let* ((head-line (if text (car text))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5697 (body-lines (cdr text)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5698 (curr-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5699 body-content bop) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5700 ; Do the head line: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
5701 (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
|
5702 (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
|
5703 "\1}{" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5704 depth |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5705 "}{\\verb\1 " |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5706 (if head-line |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5707 (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
|
5708 "") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5709 "\1}\n")) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5710 (if (not body-lines) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5711 nil |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5712 ;;(insert "\\beginlines\n") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5713 (insert "\\begin{verbatim}\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5714 (while body-lines |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5715 (setq curr-line (car body-lines)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5716 (if (and (not body-content) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5717 (not (string-match "^\\s-*$" curr-line))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5718 (setq body-content t)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5719 ; Mangle any occurrences of |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5720 ; "\end{verbatim}" in text, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5721 ; it's special: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5722 (if (and body-content |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5723 (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
|
5724 (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
|
5725 ">" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5726 (substring curr-line bop)))) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5727 ;;(insert "|" (car body-lines) "|") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5728 (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
|
5729 (allout-latex-verbatim-quote-curr-line) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5730 (insert "\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5731 (setq body-lines (cdr body-lines))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5732 (if body-content |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5733 (setq body-content nil) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5734 (forward-char -1) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5735 (insert "\\ ") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5736 (forward-char 1)) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5737 ;;(insert "\\endlines\n") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5738 (insert "\\end{verbatim}\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5739 ))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5740 ;;;_ > 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
|
5741 (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
|
5742 "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
|
5743 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
|
5744 with \"*\" prepended and \" latex-formed*\" appended. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5745 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5746 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
|
5747 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5748 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5749 (if (not tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5750 (setq tobuf |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5751 (get-buffer-create (concat "*" (buffer-name) " latexified*")))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5752 (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
|
5753 (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
|
5754 (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
|
5755 (buf (current-buffer))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5756 (set-buffer tobuf) |
3430 | 5757 (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
|
5758 (allout-insert-latex-header tobuf) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5759 (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
|
5760 (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
|
5761 beg |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5762 end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5763 buf |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5764 tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5765 (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
|
5766 (allout-insert-latex-trailer tobuf) |
3430 | 5767 (goto-char (point-min)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5768 (pop-to-buffer buf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5769 (goto-char start-pt))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5770 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5771 ;;;_ #8 Encryption |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5772 ;;;_ > allout-toggle-current-subtree-encryption (&optional fetch-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5773 (defun allout-toggle-current-subtree-encryption (&optional fetch-pass) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5774 "Encrypt clear or decrypt encoded text of visibly-containing topic's contents. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5775 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5776 Optional FETCH-PASS universal argument provokes key-pair encryption with |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5777 single universal argument. With doubled universal argument (value = 16), |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5778 it forces prompting for the passphrase regardless of availability from the |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5779 passphrase cache. With no universal argument, the appropriate passphrase |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5780 is obtained from the cache, if available, else from the user. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5781 |
74987
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
5782 Only GnuPG encryption is supported. |
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
5783 |
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
5784 \*NOTE WELL* that the encrypted text must be ascii-armored. For gnupg |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5785 encryption, include the option ``armor'' in your ~/.gnupg/gpg.conf file. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5786 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5787 Both symmetric-key and key-pair encryption is implemented. Symmetric is |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5788 the default, use a single (x4) universal argument for keypair mode. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5789 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5790 Encrypted topic's bullet is set to a `~' to signal that the contents of the |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5791 topic (body and subtopics, but not heading) is pending encryption or |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5792 encrypted. `*' asterisk immediately after the bullet signals that the body |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5793 is encrypted, its' absence means the topic is meant to be encrypted but is |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5794 not. When a file with topics pending encryption is saved, topics pending |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5795 encryption are encrypted. See allout-encrypt-unencrypted-on-saves for |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5796 auto-encryption specifics. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5797 |
74987
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
5798 \*NOTE WELL* that automatic encryption that happens during saves will |
79939 | 5799 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
|
5800 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
|
5801 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5802 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
|
5803 encrypted. If you want to encrypt the contents of a top-level topic, use |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5804 \\[allout-shift-in] to increase its depth. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5805 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5806 Passphrase Caching |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5807 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5808 The encryption passphrase is solicited if not currently available in the |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5809 passphrase cache from a recent encryption action. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5810 |
74987
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
5811 The solicited passphrase is retained for reuse in a cache, if enabled. See |
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
5812 `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry' for details. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5813 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5814 Symmetric Passphrase Hinting and Verification |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5815 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5816 If the file previously had no associated passphrase, or had a different |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5817 passphrase than specified, the user is prompted to repeat the new one for |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5818 corroboration. A random string encrypted by the new passphrase is set on |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5819 the buffer-specific variable `allout-passphrase-verifier-string', for |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5820 confirmation of the passphrase when next obtained, before encrypting or |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5821 decrypting anything with it. This helps avoid mistakenly shifting between |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5822 keys. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5823 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5824 If allout customization var `allout-passphrase-verifier-handling' is |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5825 non-nil, an entry for `allout-passphrase-verifier-string' and its value is |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5826 added to an Emacs 'local variables' section at the end of the file, which |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5827 is created if necessary. That setting is for retention of the passphrase |
73763
89b9e8184350
(allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents:
73660
diff
changeset
|
5828 verifier across Emacs sessions. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5829 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5830 Similarly, `allout-passphrase-hint-string' stores a user-provided reminder |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5831 about their passphrase, and `allout-passphrase-hint-handling' specifies |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5832 when the hint is presented, or if passphrase hints are disabled. If |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5833 enabled (see the `allout-passphrase-hint-handling' docstring for details), |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5834 the hint string is stored in the local-variables section of the file, and |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5835 solicited whenever the passphrase is changed." |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5836 (interactive "P") |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5837 (save-excursion |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5838 (allout-back-to-current-heading) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5839 (allout-toggle-subtree-encryption fetch-pass) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5840 ) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5841 ) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5842 ;;;_ > allout-toggle-subtree-encryption (&optional fetch-pass) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5843 (defun allout-toggle-subtree-encryption (&optional fetch-pass) |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5844 "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
|
5845 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5846 Optional FETCH-PASS universal argument provokes key-pair encryption with |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
5847 single universal argument. With doubled universal argument (value = 16), |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5848 it forces prompting for the passphrase regardless of availability from the |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5849 passphrase cache. With no universal argument, the appropriate passphrase |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5850 is obtained from the cache, if available, else from the user. |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5851 |
74864
e97d916ee47b
(allout-encrypt-string): Inhibit use of agent within
Chong Yidong <cyd@stupidchicken.com>
parents:
74381
diff
changeset
|
5852 Currently only GnuPG encryption is supported, and integration |
e97d916ee47b
(allout-encrypt-string): Inhibit use of agent within
Chong Yidong <cyd@stupidchicken.com>
parents:
74381
diff
changeset
|
5853 with gpg-agent is not yet implemented. |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5854 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5855 \**NOTE WELL** that the encrypted text must be ascii-armored. For gnupg |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5856 encryption, include the option ``armor'' in your ~/.gnupg/gpg.conf file. |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5857 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5858 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
|
5859 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5860 (interactive "P") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5861 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5862 (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
|
5863 |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5864 (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
|
5865 (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
|
5866 " 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
|
5867 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5868 (let* ((allout-buffer (current-buffer)) |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5869 ;; Assess location: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5870 (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
|
5871 (after-bullet-pos (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5872 (was-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5873 (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
|
5874 (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
|
5875 (allout-encrypted-topic-p))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5876 (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
|
5877 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5878 (backward-char 1) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5879 (allout-hidden-p))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5880 (subtree-beg (1+ (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5881 (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
|
5882 (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
|
5883 subtree-end)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5884 (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
|
5885 (subtree-trailing-char (char-after subtree-end)) |
79939 | 5886 ;; 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
|
5887 ;; check for the error condition |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5888 (result-text (if (or (string= "" subject-text) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5889 (string= "\n" subject-text)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5890 (error "No topic contents to %scrypt" |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5891 (if was-encrypted "de" "en")) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5892 nil)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5893 ;; Assess key parameters: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5894 (key-info (or |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5895 ;; detect the type by which it is already encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5896 (and was-encrypted |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5897 (allout-encrypted-key-info subject-text)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5898 (and (member fetch-pass '(4 (4))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5899 '(keypair nil)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5900 '(symmetric nil))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5901 (for-key-type (car key-info)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5902 (for-key-identity (cadr key-info)) |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5903 (fetch-pass (and fetch-pass (member fetch-pass '(16 (16))))) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5904 (was-coding-system buffer-file-coding-system)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5905 |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5906 (when (not was-encrypted) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5907 ;; ensure that non-ascii chars pending encryption are noticed before |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5908 ;; they're encrypted, so the coding system is set to accomodate |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5909 ;; them. |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5910 (setq buffer-file-coding-system |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5911 (select-safe-coding-system subtree-beg subtree-end)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5912 ;; 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
|
5913 ;; 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
|
5914 ;; 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
|
5915 ;; 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
|
5916 ;; local variable. |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5917 (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
|
5918 was-coding-system)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5919 (yes-or-no-p |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5920 (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
|
5921 " var? Necessary when only encrypted text" |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5922 " is in that coding system. ") |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5923 buffer-file-coding-system))) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
5924 (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
|
5925 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
|
5926 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5927 (setq result-text |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5928 (allout-encrypt-string subject-text was-encrypted |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5929 (current-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5930 for-key-type for-key-identity fetch-pass)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5931 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5932 ;; 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
|
5933 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5934 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5935 (set-buffer allout-buffer) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5936 (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
|
5937 (insert result-text) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5938 (if was-collapsed |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5939 (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
|
5940 ;; 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
|
5941 (if (not was-encrypted) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5942 (if (and (= subtree-end-char ?\n) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5943 (= subtree-trailing-char ?\n)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5944 (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
|
5945 ;; 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
|
5946 (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
|
5947 (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
|
5948 allout-topic-encryption-bullet)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5949 (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
|
5950 (delete-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5951 (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
|
5952 (if was-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5953 ;; 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
|
5954 (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
|
5955 (delete-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5956 ;; 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
|
5957 (goto-char after-bullet-pos) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
5958 (insert "*")))) |
73003
ec72ab6f5541
* allout.el (allout-unprotected): Let inhibit-read-only only when
Chong Yidong <cyd@stupidchicken.com>
parents:
72917
diff
changeset
|
5959 (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
|
5960 bullet-pos subtree-end)))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5961 ;;;_ > allout-encrypt-string (text decrypt allout-buffer key-type for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5962 ;;; fetch-pass &optional retried verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5963 ;;; passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5964 (defun allout-encrypt-string (text decrypt allout-buffer key-type for-key |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
5965 fetch-pass &optional retried rejected |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
5966 verifying passphrase) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5967 "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
|
5968 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5969 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
|
5970 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5971 FETCH-PASS (default false) forces fresh prompting for the passphrase. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5972 |
79939 | 5973 KEY-TYPE, either `symmetric' or `keypair', specifies which type |
5974 of cypher to use. | |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5975 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5976 FOR-KEY is human readable identification of the first of the user's |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5977 eligible secret keys a keypair decryption targets, or else nil. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5978 |
79939 | 5979 Optional RETRIED is for internal use -- conveys the number of failed keys |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5980 that have been solicited in sequence leading to this current call. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5981 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5982 Optional PASSPHRASE enables explicit delivery of the decryption passphrase, |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5983 for verification purposes. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5984 |
79939 | 5985 Optional REJECTED is for internal use -- conveys the number of |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
5986 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
|
5987 `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
|
5988 `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
|
5989 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5990 Returns the resulting string, or nil if the transformation fails." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5991 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5992 (require 'pgg) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5993 |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5994 (if (not (fboundp 'pgg-encrypt-symmetric)) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5995 (error "Allout encryption depends on a newer version of pgg")) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5996 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5997 (let* ((scheme (upcase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5998 (format "%s" (or pgg-scheme pgg-default-scheme "GPG")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5999 (for-key (and (equal key-type 'keypair) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6000 (or for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6001 (split-string (read-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6002 (format "%s message recipients: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6003 scheme)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6004 "[ \t,]+")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6005 (target-prompt-id (if (equal key-type 'keypair) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6006 (if (= (length for-key) 1) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6007 (car for-key) for-key) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6008 (buffer-name allout-buffer))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6009 (target-cache-id (format "%s-%s" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6010 key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6011 (if (equal key-type 'keypair) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6012 target-prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6013 (or (buffer-file-name allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6014 target-prompt-id)))) |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6015 (encoding (with-current-buffer allout-buffer |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6016 buffer-file-coding-system)) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6017 (multibyte (with-current-buffer allout-buffer |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6018 enable-multibyte-characters)) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6019 (strip-plaintext-regexps |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6020 (if (not decrypt) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6021 (allout-get-configvar-values |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6022 '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
|
6023 (reject-ciphertext-regexps |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6024 (if (not decrypt) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6025 (allout-get-configvar-values |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6026 '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
|
6027 (rejected (or rejected 0)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6028 (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
|
6029 rejected)) |
74864
e97d916ee47b
(allout-encrypt-string): Inhibit use of agent within
Chong Yidong <cyd@stupidchicken.com>
parents:
74381
diff
changeset
|
6030 result-text status |
76204
b5b902938a0a
(allout-encrypt-string): Remove inhibition
Nick Roberts <nickrob@snap.net.nz>
parents:
75347
diff
changeset
|
6031 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6032 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6033 (if (and fetch-pass (not passphrase)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6034 ;; Force later fetch by evicting passphrase from the cache. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6035 (pgg-remove-passphrase-from-cache target-cache-id t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6036 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6037 (catch 'encryption-failed |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6038 |
74987
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
6039 ;; We handle only symmetric-key passphrase caching. |
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
6040 (if (and (not passphrase) |
3a115c11d329
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
Eli Zaretskii <eliz@gnu.org>
parents:
74864
diff
changeset
|
6041 (not (equal key-type 'keypair))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6042 (setq passphrase (allout-obtain-passphrase for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6043 target-cache-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6044 target-prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6045 key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6046 allout-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6047 retried fetch-pass))) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6048 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6049 (with-temp-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6050 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6051 (insert text) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6052 |
74011
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6053 ;; convey the text characteristics of the original buffer: |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6054 (set-buffer-multibyte multibyte) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6055 (when encoding |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6056 (set-buffer-file-coding-system encoding) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6057 (if (not decrypt) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6058 (encode-coding-region (point-min) (point-max) encoding))) |
cce8c092567f
(allout-doublecheck-at-and-shallower): Clarify docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
73763
diff
changeset
|
6059 |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6060 (when (and strip-plaintext-regexps (not decrypt)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6061 (dolist (re strip-plaintext-regexps) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6062 (let ((re (if (listp re) (car re) re)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6063 (replacement (if (listp re) (cadr re) ""))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6064 (goto-char (point-min)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6065 (while (re-search-forward re nil t) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6066 (replace-match replacement nil nil))))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6067 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6068 (cond |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6069 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6070 ;; symmetric: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6071 ((equal key-type 'symmetric) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6072 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6073 (if decrypt |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6074 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6075 (pgg-decrypt (point-min) (point-max) passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6076 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6077 (pgg-encrypt-symmetric (point-min) (point-max) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6078 passphrase))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6079 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6080 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6081 (pgg-situate-output (point-min) (point-max)) |
79939 | 6082 ;; failed -- handle passphrase caching |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6083 (if verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6084 (throw 'encryption-failed nil) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6085 (pgg-remove-passphrase-from-cache target-cache-id t) |
79939 | 6086 (error "Symmetric-cipher %scryption failed -- %s" |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6087 (if decrypt "de" "en") |
79939 | 6088 "try again with different passphrase")))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6089 |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
6090 ;; encrypt `keypair': |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6091 ((not decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6092 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6093 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6094 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6095 (pgg-encrypt for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6096 nil (point-min) (point-max) passphrase)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6097 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6098 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6099 (pgg-situate-output (point-min) (point-max)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6100 (error (pgg-remove-passphrase-from-cache target-cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6101 (error "encryption failed")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6102 |
79940
b113c474ec50
More trivial doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
79939
diff
changeset
|
6103 ;; decrypt `keypair': |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6104 (t |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6105 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6106 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6107 (pgg-decrypt (point-min) (point-max) passphrase)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6108 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6109 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6110 (pgg-situate-output (point-min) (point-max)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6111 (error (pgg-remove-passphrase-from-cache target-cache-id t) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6112 (error "decryption failed"))))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6113 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6114 (setq result-text |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6115 (buffer-substring-no-properties |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6116 1 (- (point-max) (if decrypt 0 1)))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6117 ) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6118 |
79939 | 6119 ;; validate result -- non-empty |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6120 (cond ((not result-text) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6121 (if verifying |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6122 nil |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6123 ;; transform was fruitless, retry w/new passphrase. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6124 (pgg-remove-passphrase-from-cache target-cache-id t) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6125 (allout-encrypt-string text decrypt allout-buffer |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6126 key-type for-key nil |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6127 (if retried (1+ retried) 1) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6128 rejected verifying nil))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6129 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6130 ;; Retry (within limit) if ciphertext contains rejections: |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6131 ((and (not decrypt) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6132 ;; Check for disqualification of this ciphertext: |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6133 (let ((regexps reject-ciphertext-regexps) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6134 reject-it) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6135 (while (and regexps (not reject-it)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6136 (setq reject-it (string-match (car regexps) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6137 result-text)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6138 (pop regexps)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6139 reject-it)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6140 (setq rejections-left (1- rejections-left)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6141 (if (<= rejections-left 0) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6142 (error (concat "Ciphertext rejected too many times" |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6143 " (%s), per `%s'") |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6144 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
|
6145 '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
|
6146 (allout-encrypt-string text decrypt allout-buffer |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6147 key-type for-key nil |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6148 retried (1+ rejected) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6149 verifying passphrase))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6150 ;; Barf if encryption yields extraordinary control chars: |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6151 ((and (not decrypt) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6152 (string-match "[\C-a\C-k\C-o-\C-z\C-@]" |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6153 result-text)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6154 (error (concat "Encryption produced non-armored text, which" |
79939 | 6155 "conflicts with allout mode -- reconfigure!"))) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6156 |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6157 ;; valid result and just verifying or non-symmetric: |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6158 ((or verifying (not (equal key-type 'symmetric))) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6159 (if (or verifying decrypt) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6160 (pgg-add-passphrase-to-cache target-cache-id |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6161 passphrase t)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6162 result-text) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6163 |
79939 | 6164 ;; valid result and regular symmetric -- "register" |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6165 ;; passphrase with mnemonic aids/cache. |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6166 (t |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6167 (set-buffer allout-buffer) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6168 (if passphrase |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6169 (pgg-add-passphrase-to-cache target-cache-id |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6170 passphrase t)) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6171 (allout-update-passphrase-mnemonic-aids for-key passphrase |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6172 allout-buffer) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6173 result-text) |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6174 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6175 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6176 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6177 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6178 ;;;_ > allout-obtain-passphrase (for-key cache-id prompt-id key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6179 ;;; allout-buffer retried fetch-pass) |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
6180 (defun allout-obtain-passphrase (for-key cache-id prompt-id key-type |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6181 allout-buffer retried fetch-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6182 "Obtain passphrase for a key from the cache or else from the user. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6183 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6184 When obtaining from the user, symmetric-cipher passphrases are verified |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6185 against either, if available and enabled, a random string that was |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6186 encrypted against the passphrase, or else against repeated entry by the |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6187 user for corroboration. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6188 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6189 FOR-KEY is the key for which the passphrase is being obtained. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6190 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6191 CACHE-ID is the cache id of the key for the passphrase. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6192 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6193 PROMPT-ID is the id for use when prompting the user. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6194 |
79939 | 6195 KEY-TYPE is either `symmetric' or `keypair'. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6196 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6197 ALLOUT-BUFFER is the buffer containing the entry being en/decrypted. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6198 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6199 RETRIED is the number of this attempt to obtain this passphrase. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6200 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6201 FETCH-PASS causes the passphrase to be solicited from the user, regardless |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6202 of the availability of a cached copy." |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6203 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6204 (if (not (equal key-type 'symmetric)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6205 ;; do regular passphrase read on non-symmetric passphrase: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6206 (pgg-read-passphrase (format "%s passphrase%s: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6207 (upcase (format "%s" (or pgg-scheme |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6208 pgg-default-scheme |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6209 "GPG"))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6210 (if prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6211 (format " for %s" prompt-id) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6212 "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6213 cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6214 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6215 ;; Symmetric hereon: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6216 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6217 (save-excursion |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6218 (set-buffer allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6219 (let* ((hint (if (and (not (string= allout-passphrase-hint-string "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6220 (or (equal allout-passphrase-hint-handling 'always) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6221 (and (equal allout-passphrase-hint-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6222 'needed) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6223 retried))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6224 (format " [%s]" allout-passphrase-hint-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6225 "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6226 (retry-message (if retried (format " (%s retry)" retried) "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6227 (prompt-sans-hint (format "'%s' symmetric passphrase%s: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6228 prompt-id retry-message)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6229 (full-prompt (format "'%s' symmetric passphrase%s%s: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6230 prompt-id hint retry-message)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6231 (prompt full-prompt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6232 (verifier-string (allout-get-encryption-passphrase-verifier)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6233 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6234 (cached (and (not fetch-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6235 (pgg-read-passphrase-from-cache cache-id t))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6236 (got-pass (or cached |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6237 (pgg-read-passphrase full-prompt cache-id t))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6238 confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6239 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6240 (if (not got-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6241 nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6242 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6243 ;; Duplicate our handle on the passphrase so it's not clobbered by |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6244 ;; deactivate-passwd memory clearing: |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6245 (setq got-pass (copy-sequence got-pass)) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6246 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6247 (cond (verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6248 (save-window-excursion |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6249 (if (allout-encrypt-string verifier-string 'decrypt |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6250 allout-buffer 'symmetric |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6251 for-key nil 0 0 'verifying |
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6252 (copy-sequence got-pass)) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6253 (setq confirmation (format "%s" got-pass)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6254 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6255 (if (and (not confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6256 (if (yes-or-no-p |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6257 (concat "Passphrase differs from established" |
79939 | 6258 " -- use new one instead? ")) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6259 ;; deactivate password for subsequent |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6260 ;; confirmation: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6261 (progn |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6262 (pgg-remove-passphrase-from-cache cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6263 (setq prompt prompt-sans-hint) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6264 nil) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6265 t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6266 (progn (pgg-remove-passphrase-from-cache cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6267 (error "Wrong passphrase.")))) |
79939 | 6268 ;; No verifier string -- force confirmation by repetition of |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6269 ;; (new) passphrase: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6270 ((or fetch-pass (not cached)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6271 (pgg-remove-passphrase-from-cache cache-id t)))) |
79939 | 6272 ;; confirmation vs new input -- doing pgg-read-passphrase will do the |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6273 ;; right thing, in either case: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6274 (if (not confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6275 (setq confirmation |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6276 (pgg-read-passphrase (concat prompt |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6277 " ... confirm spelling: ") |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6278 cache-id t))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6279 (prog1 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6280 (if (equal got-pass confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6281 confirmation |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6282 (if (yes-or-no-p (concat "spelling of original and" |
79939 | 6283 " confirmation differ -- retry? ")) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6284 (progn (setq retried (if retried (1+ retried) 1)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6285 (pgg-remove-passphrase-from-cache cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6286 ;; recurse to this routine: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6287 (pgg-read-passphrase prompt-sans-hint cache-id t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6288 (pgg-remove-passphrase-from-cache cache-id t) |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6289 (error "Confirmation failed.")))))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6290 ;;;_ > allout-encrypted-topic-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6291 (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
|
6292 "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
|
6293 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6294 (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
|
6295 (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
|
6296 allout-topic-encryption-bullet) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6297 (looking-at "\\*")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6298 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6299 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6300 ;;;_ > allout-encrypted-key-info (text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6301 ;; XXX gpg-specific, alas |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6302 (defun allout-encrypted-key-info (text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6303 "Return a pair of the key type and identity of a recipient's secret key. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6304 |
79939 | 6305 The key type is one of `symmetric' or `keypair'. |
6306 | |
6307 If `keypair', and some of the user's secret keys are among those for which | |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
6308 the message was encoded, return the identity of the first. Otherwise, |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6309 return nil for the second item of the pair. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6310 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6311 An error is raised if the text is not encrypted." |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6312 (require 'pgg-parse) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6313 (save-excursion |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6314 (with-temp-buffer |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6315 (insert text) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6316 (let* ((parsed-armor (pgg-parse-armor-region (point-min) (point-max))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6317 (type (if (pgg-gpg-symmetric-key-p parsed-armor) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6318 'symmetric |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6319 'keypair)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6320 secret-keys first-secret-key for-key-owner) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6321 (if (equal type 'keypair) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6322 (setq secret-keys (pgg-gpg-lookup-all-secret-keys) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6323 first-secret-key (pgg-gpg-select-matching-key parsed-armor |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6324 secret-keys) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6325 for-key-owner (and first-secret-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6326 (pgg-gpg-lookup-key-owner |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6327 first-secret-key)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6328 (list type (pgg-gpg-key-id-from-key-owner for-key-owner)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6329 ) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6330 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6331 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6332 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6333 ;;;_ > allout-create-encryption-passphrase-verifier (passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6334 (defun allout-create-encryption-passphrase-verifier (passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6335 "Encrypt random message for later validation of symmetric key's passphrase." |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6336 ;; use 20 random ascii characters, across the entire ascii range. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6337 (random t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6338 (let ((spew (make-string 20 ?\0))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6339 (dotimes (i (length spew)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6340 (aset spew i (1+ (random 254)))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6341 (allout-encrypt-string spew nil (current-buffer) 'symmetric |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6342 nil nil 0 0 passphrase)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6343 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6344 ;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
6345 ;;; outline-buffer) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6346 (defun allout-update-passphrase-mnemonic-aids (for-key passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6347 outline-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6348 "Update passphrase verifier and hint strings if necessary. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6349 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6350 See `allout-passphrase-verifier-string' and `allout-passphrase-hint-string' |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6351 settings. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6352 |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
6353 PASSPHRASE is the passphrase being mnemonicized. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6354 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6355 OUTLINE-BUFFER is the buffer of the outline being adjusted. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6356 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6357 These are used to help the user keep track of the passphrase they use for |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6358 symmetric encryption in the file. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6359 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6360 Behavior is governed by `allout-passphrase-verifier-handling', |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6361 `allout-passphrase-hint-handling', and also, controlling whether the values |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6362 are preserved on Emacs local file variables, |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6363 `allout-enable-file-variable-adjustment'." |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6364 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6365 ;; If passphrase doesn't agree with current verifier: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6366 ;; - adjust the verifier |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6367 ;; - if passphrase hint handling is enabled, adjust the passphrase hint |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6368 ;; - if file var settings are enabled, adjust the file vars |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6369 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6370 (let* ((new-verifier-needed (not (allout-verify-passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6371 for-key passphrase outline-buffer))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6372 (new-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6373 (if new-verifier-needed |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6374 ;; Collapse to a single line and enclose in string quotes: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6375 (subst-char-in-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6376 ?\n ?\C-a (allout-create-encryption-passphrase-verifier |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6377 passphrase)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6378 new-hint) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6379 (when new-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6380 ;; do the passphrase hint first, since it's interactive |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6381 (when (and allout-passphrase-hint-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6382 (not (equal allout-passphrase-hint-handling 'disabled))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6383 (setq new-hint |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6384 (read-from-minibuffer "Passphrase hint to jog your memory: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6385 allout-passphrase-hint-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6386 (when (not (string= new-hint allout-passphrase-hint-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6387 (setq allout-passphrase-hint-string new-hint) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6388 (allout-adjust-file-variable "allout-passphrase-hint-string" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6389 allout-passphrase-hint-string))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6390 (when allout-passphrase-verifier-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6391 (setq allout-passphrase-verifier-string new-verifier-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6392 (allout-adjust-file-variable "allout-passphrase-verifier-string" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6393 allout-passphrase-verifier-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6394 ) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6395 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6396 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6397 ;;;_ > allout-get-encryption-passphrase-verifier () |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6398 (defun allout-get-encryption-passphrase-verifier () |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6399 "Return text of the encrypt passphrase verifier, unmassaged, or nil if none. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6400 |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
6401 Derived from value of `allout-passphrase-verifier-string'." |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6402 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6403 (let ((verifier-string (and (boundp 'allout-passphrase-verifier-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6404 allout-passphrase-verifier-string))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6405 (if verifier-string |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6406 ;; Return it uncollapsed |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6407 (subst-char-in-string ?\C-a ?\n verifier-string)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6408 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6409 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6410 ;;;_ > allout-verify-passphrase (key passphrase allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6411 (defun allout-verify-passphrase (key passphrase allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6412 "True if passphrase successfully decrypts verifier, nil otherwise. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6413 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6414 \"Otherwise\" includes absence of passphrase verifier." |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6415 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6416 (set-buffer allout-buffer) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6417 (and (boundp 'allout-passphrase-verifier-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6418 allout-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
6419 (allout-encrypt-string (allout-get-encryption-passphrase-verifier) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6420 'decrypt allout-buffer 'symmetric |
72367
12fa9bdadf0a
(allout-prior-bindings, allout-added-bindings): Remove, after long deprecation.
Eli Zaretskii <eliz@gnu.org>
parents:
72050
diff
changeset
|
6421 key nil 0 0 'verifying passphrase) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6422 t))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6423 ;;;_ > 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
|
6424 (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
|
6425 "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
|
6426 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6427 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
|
6428 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
|
6429 `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
|
6430 |
79915
e54d9b453e0e
(allout-prefix-data): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
6431 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
|
6432 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
|
6433 must also have content." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6434 (let (done got content-beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6435 (while (not done) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6436 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6437 (if (not (re-search-forward |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6438 (format "\\(\\`\\|\n\\)%s *%s[^*]" |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6439 (regexp-quote allout-header-prefix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6440 (regexp-quote allout-topic-encryption-bullet)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6441 nil t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6442 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6443 done t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6444 (goto-char (setq got (match-beginning 0))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6445 (if (looking-at "\n") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6446 (forward-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6447 (setq got (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6448 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6449 (cond ((not got) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6450 (setq done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6451 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6452 ((not (search-forward "\n")) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6453 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6454 done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6455 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6456 ((eobp) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6457 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6458 done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6459 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6460 (t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6461 (setq content-beg (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6462 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6463 (allout-end-of-subtree) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6464 (if (or (<= (point) content-beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6465 (and except-mark |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6466 (<= content-beg except-mark) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6467 (>= (point) except-mark))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6468 ;; Continue looking |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6469 (setq got nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6470 ;; Got it! |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6471 (setq done t))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6472 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6473 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6474 (if got |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6475 (goto-char got)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6476 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6477 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6478 ;;;_ > 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
|
6479 (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
|
6480 "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
|
6481 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6482 EXCEPT-MARK identifies a point whose containing topics should be excluded |
79939 | 6483 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
|
6484 `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
|
6485 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6486 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
|
6487 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
|
6488 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
|
6489 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
|
6490 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
|
6491 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6492 (interactive "p") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6493 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6494 (let* ((current-mark (point-marker)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6495 (current-mark-position (marker-position current-mark)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6496 was-modified |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6497 bo-subtree |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6498 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
|
6499 (goto-char (point-min)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6500 (while (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
|
6501 (setq was-modified (buffer-modified-p)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6502 (when (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6503 (and (boundp 'allout-encrypt-unencrypted-on-saves) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6504 allout-encrypt-unencrypted-on-saves |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6505 (setq bo-subtree (re-search-forward "$")) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6506 (not (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6507 (>= current-mark (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6508 (allout-end-of-current-subtree) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6509 (<= current-mark (point)))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6510 (setq editing-topic (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6511 ;; 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
|
6512 ;; 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
|
6513 editing-point (- current-mark-position |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6514 (count-trailing-whitespace-region |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6515 bo-subtree current-mark-position)))) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
6516 (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
|
6517 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6518 (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
|
6519 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6520 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6521 (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
|
6522 (if editing-topic (list editing-topic editing-point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6523 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6524 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6525 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6526 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6527 ;;;_ #9 miscellaneous |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6528 ;;;_ : Mode: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6529 ;;;_ > outlineify-sticky () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6530 ;; 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
|
6531 ;;;###autoload |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6532 (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
|
6533 ;;;###autoload |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6534 (defun outlineify-sticky (&optional arg) |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
6535 "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
|
6536 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
6537 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
|
6538 setup for auto-startup." |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6539 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6540 (interactive "P") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6541 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
6542 (allout-mode t) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6543 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6544 (save-excursion |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6545 (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
|
6546 (if (allout-goto-prefix) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
6547 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
|
6548 (allout-open-topic 2) |
79939 | 6549 (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
|
6550 "`allout-mode' docstring: `^Hm'.")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6551 (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
|
6552 "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
|
6553 ;;;_ > 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
|
6554 (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
|
6555 "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
|
6556 |
79939 | 6557 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
|
6558 ;; 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
|
6559 (let (beg prefix suffix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6560 (save-excursion |
3430 | 6561 (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
|
6562 (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
|
6563 (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
|
6564 (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
|
6565 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6566 (setq beg (- (point) 16)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6567 (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
|
6568 (point) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6569 (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
|
6570 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6571 (point)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6572 (setq prefix (buffer-substring-no-properties |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6573 (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
|
6574 (forward-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6575 (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6576 beg)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6577 (list beg prefix suffix)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6578 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6579 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6580 ) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6581 ;;;_ > 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
|
6582 (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
|
6583 "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
|
6584 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6585 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
|
6586 `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
|
6587 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6588 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
|
6589 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
|
6590 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
|
6591 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
|
6592 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
|
6593 |
73763
89b9e8184350
(allout-adjust-file-variable, allout-passphrase-verifier-string,
Juanma Barranquero <lekktu@gmail.com>
parents:
73660
diff
changeset
|
6594 `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
|
6595 (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
|
6596 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
|
6597 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6598 (save-excursion |
72050
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
6599 (let ((inhibit-field-text-motion t) |
d79208e62ea9
(allout-unprotected, allout-e-o-prefix-p)
Eli Zaretskii <eliz@gnu.org>
parents:
71915
diff
changeset
|
6600 (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
|
6601 beg prefix suffix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6602 (if section-data |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6603 (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
|
6604 prefix (cadr section-data) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6605 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
|
6606 ;; create the section |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6607 (goto-char (point-max)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6608 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6609 (allout-open-topic 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6610 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6611 (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
|
6612 (allout-open-topic 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6613 (setq beg (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6614 suffix "" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6615 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
|
6616 (beginning-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6617 (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6618 beg)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6619 (goto-char beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6620 (insert "Local variables:\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6621 (allout-open-topic 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6622 (insert "End:\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6623 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6624 ;; 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
|
6625 ;; of new value: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6626 (goto-char beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6627 (allout-show-to-offshoot) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6628 (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
|
6629 (let* ((value-beg (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6630 (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
|
6631 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6632 (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6633 (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
|
6634 (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
|
6635 (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
|
6636 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6637 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6638 (forward-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6639 (insert (concat prefix varname ":"))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6640 (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
|
6641 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6642 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6643 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6644 ) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6645 ;;;_ > allout-get-configvar-values (varname) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6646 (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
|
6647 "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
|
6648 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6649 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
|
6650 otherwise are ignored. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6651 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6652 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
|
6653 not its value." |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6654 |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6655 (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
|
6656 got) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6657 (dolist (sym configvar-value) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6658 (if (not (boundp sym)) |
79939 | 6659 (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
|
6660 configvar-name sym)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6661 (delq sym (symbol-value configvar-name))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6662 (push (symbol-value sym) got))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6663 (reverse got))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6664 ;;;_ : Topics: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6665 ;;;_ > allout-mark-topic () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6666 (defun allout-mark-topic () |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6667 "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
|
6668 (interactive) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6669 (let ((inhibit-field-text-motion t)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6670 (beginning-of-line)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6671 (allout-goto-prefix-doublechecked) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6672 (push-mark (point)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6673 (allout-end-of-current-subtree) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6674 (exchange-point-and-mark)) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6675 ;;;_ : UI: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6676 ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting) |
3430 | 6677 (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
|
6678 "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
|
6679 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6680 Optional arg DO-DEFAULTING indicates to accept empty input (CR)." |
3430 | 6681 |
6682 (let ((new-prompt prompt) | |
6683 got) | |
6684 | |
6685 (while (not got) | |
6686 (message "%s" new-prompt) | |
6687 | |
6688 ;; We do our own reading here, so we can circumvent, eg, special | |
29490 | 6689 ;; treatment for `?' character. (Oughta use minibuffer keymap instead.) |
3430 | 6690 (setq got |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6691 (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
|
6692 |
29490 | 6693 (setq got |
6694 (cond ((string-match (regexp-quote got) string) got) | |
6695 ((and do-defaulting (string= got "\r")) | |
6696 ;; Return empty string to default: | |
6697 "") | |
6698 ((string= got "\C-g") (signal 'quit nil)) | |
6699 (t | |
6700 (setq new-prompt (concat prompt | |
6701 got | |
6702 " ...pick from: " | |
6703 string | |
6704 "")) | |
6705 nil)))) | |
79939 | 6706 ;; got something out of loop -- return it: |
29490 | 6707 got) |
3430 | 6708 ) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6709 ;;;_ : Strings: |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6710 ;;;_ > regexp-sans-escapes (string) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6711 (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
|
6712 "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
|
6713 |
79939 | 6714 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
|
6715 single backslash. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6716 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6717 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
|
6718 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6719 (if (string= regexp "") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6720 "" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6721 ;; 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
|
6722 ;; backslash, or else to nil: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6723 (setq successive-backslashes |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6724 (if (= (aref regexp 0) ?\\) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6725 (if successive-backslashes (1+ successive-backslashes) 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6726 nil)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6727 (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
|
6728 ;; Include first char: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6729 (concat (substring regexp 0 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6730 (regexp-sans-escapes (substring regexp 1))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6731 ;; Exclude first char, but maintain count: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6732 (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
|
6733 ;;;_ > count-trailing-whitespace-region (beg end) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6734 (defun count-trailing-whitespace-region (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6735 "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
|
6736 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6737 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
|
6738 (if (> beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6739 0 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6740 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6741 (goto-char beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6742 (let ((count 0)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6743 (while (re-search-forward "[ ][ ]*$" end t) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6744 (goto-char (1+ (match-beginning 2))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6745 (setq count (1+ count))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6746 count)))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6747 ;;;_ > allout-format-quote (string) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6748 (defun allout-format-quote (string) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6749 "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
|
6750 (apply 'concat |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6751 (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
|
6752 string))) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6753 ;;;_ : lists |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6754 ;;;_ > allout-flatten (list) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6755 (defun allout-flatten (list) |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6756 "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
|
6757 ;; classic. |
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6758 (cond ((null list) nil) |
72917
17942cb3949e
(allout-regexp, allout-line-boundary-regexp)
Eli Zaretskii <eliz@gnu.org>
parents:
72873
diff
changeset
|
6759 ((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
|
6760 (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
|
6761 ;;;_ : Compatibility: |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6762 ;;;_ > 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
|
6763 (defun allout-mark-marker (&optional force buffer) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6764 "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
|
6765 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6766 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
|
6767 so pass them along when appropriate." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6768 (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6769 (apply 'mark-marker force buffer) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6770 (mark-marker))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6771 ;;;_ > 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
|
6772 (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
|
6773 (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
|
6774 "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
|
6775 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
|
6776 (let ((i (length string)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6777 (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
|
6778 (while (> i 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6779 (setq i (1- i)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6780 (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
|
6781 (aset newstr i tochar))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
6782 newstr))) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6783 ;;;_ > wholenump if necessary |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6784 (if (not (fboundp 'wholenump)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6785 (defalias 'wholenump 'natnump)) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6786 ;;;_ > remove-overlays if necessary |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6787 (if (not (fboundp 'remove-overlays)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6788 (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
|
6789 "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
|
6790 Overlays might be moved and/or split. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6791 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
|
6792 (unless beg (setq beg (point-min))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6793 (unless end (setq end (point-max))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6794 (if (< end beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6795 (setq beg (prog1 end (setq end beg)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6796 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6797 (dolist (o (overlays-in beg end)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6798 (when (eq (overlay-get o name) val) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6799 ;; Either push this overlay outside beg...end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6800 ;; or split it to exclude beg...end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6801 ;; 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
|
6802 (if (< (overlay-start o) beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6803 (if (> (overlay-end o) end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6804 (progn |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6805 (move-overlay (copy-overlay o) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6806 (overlay-start o) beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6807 (move-overlay o end (overlay-end o))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6808 (move-overlay o (overlay-start o) beg)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6809 (if (> (overlay-end o) end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6810 (move-overlay o end (overlay-end o)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6811 (delete-overlay o))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6812 ) |
79939 | 6813 ;;;_ > 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
|
6814 (if (not (fboundp 'copy-overlay)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6815 (defun copy-overlay (o) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6816 "Return a copy of overlay O." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6817 (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
|
6818 ;; 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
|
6819 ;; insertion-type of the two markers. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6820 (overlay-buffer o))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6821 (props (overlay-properties o))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6822 (while props |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6823 (overlay-put o1 (pop props) (pop props))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6824 o1))) |
79939 | 6825 ;;;_ > 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
|
6826 (if (not (fboundp 'add-to-invisibility-spec)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6827 (defun add-to-invisibility-spec (element) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6828 "Add ELEMENT to `buffer-invisibility-spec'. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6829 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
|
6830 that can be added." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6831 (if (eq buffer-invisibility-spec t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6832 (setq buffer-invisibility-spec (list t))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6833 (setq buffer-invisibility-spec |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6834 (cons element buffer-invisibility-spec)))) |
79939 | 6835 ;;;_ > 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
|
6836 (if (not (fboundp 'remove-from-invisibility-spec)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6837 (defun remove-from-invisibility-spec (element) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6838 "Remove ELEMENT from `buffer-invisibility-spec'." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6839 (if (consp buffer-invisibility-spec) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6840 (setq buffer-invisibility-spec (delete element |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6841 buffer-invisibility-spec))))) |
79939 | 6842 ;;;_ > 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
|
6843 (if (not (fboundp 'move-beginning-of-line)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6844 (defun move-beginning-of-line (arg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6845 "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
|
6846 \(This disregards invisible newlines such as those |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6847 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
|
6848 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6849 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
|
6850 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
|
6851 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
|
6852 (interactive "p") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6853 (or arg (setq arg 1)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6854 (if (/= arg 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6855 (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
|
6856 |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6857 ;; 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
|
6858 (skip-chars-backward "^\n") |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6859 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6860 (goto-char (if (featurep 'xemacs) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6861 (previous-property-change (point)) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6862 (previous-char-property-change (point)))) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6863 (skip-chars-backward "^\n")) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6864 (vertical-motion 0)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6865 ) |
79939 | 6866 ;;;_ > move-end-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
|
6867 (if (not (fboundp 'move-end-of-line)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6868 (defun move-end-of-line (arg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6869 "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
|
6870 \(This disregards invisible newlines such as those |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6871 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
|
6872 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6873 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
|
6874 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
|
6875 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
|
6876 (interactive "p") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6877 (or arg (setq arg 1)) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6878 (let (done) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6879 (while (not done) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6880 (let ((newpos |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6881 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6882 (let ((goal-column 0)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6883 (and (condition-case nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6884 (or (line-move arg) t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6885 (error nil)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6886 (not (bobp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6887 (progn |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6888 (while (and (not (bobp)) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6889 (line-move-invisible-p (1- (point)))) |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6890 (goto-char |
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6891 (previous-char-property-change (point)))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6892 (backward-char 1))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6893 (point))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6894 (goto-char newpos) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6895 (if (and (> (point) newpos) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6896 (eq (preceding-char) ?\n)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6897 (backward-char 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6898 (if (and (> (point) newpos) (not (eobp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6899 (not (eq (following-char) ?\n))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6900 ;; If we skipped something intangible |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6901 ;; 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
|
6902 ;; keep going. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6903 (setq arg 1) |
70244
ccd02e1ca0e3
Remove local autoload declaration for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70225
diff
changeset
|
6904 (setq done t))))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6905 ) |
72873
b42e98d06749
* allout.el (allout-regexp, allout-line-boundary-regexp)
Chong Yidong <cyd@stupidchicken.com>
parents:
72367
diff
changeset
|
6906 ;;;_ > line-move-invisible-p if necessary |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6907 (if (not (fboundp 'line-move-invisible-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6908 (defun line-move-invisible-p (pos) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6909 "Return non-nil if the character after POS is currently invisible." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6910 (let ((prop |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6911 (get-char-property pos 'invisible))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6912 (if (eq buffer-invisibility-spec t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6913 prop |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6914 (or (memq prop buffer-invisibility-spec) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6915 (assq prop buffer-invisibility-spec)))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6916 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6917 ;;;_ #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
|
6918 ;;;_ > 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
|
6919 (defun allout-bullet-isearch (&optional bullet) |
74381
cba6f2b24720
Ken Manheimer <ken.manheimer@gmail.com>:
Kim F. Storm <storm@cua.dk>
parents:
74011
diff
changeset
|
6920 "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
|
6921 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6922 (if (not bullet) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6923 (setq bullet (solicit-char-in-string |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6924 "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
|
6925 (regexp-sans-escapes allout-bullets-string)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
6926 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6927 (let ((isearch-regexp t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6928 (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
|
6929 allout-header-prefix |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6930 "[ \t]*" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6931 bullet))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6932 (isearch-repeat 'forward) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
6933 (isearch-mode t))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
6934 |
79939 | 6935 ;;;_ #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
|
6936 ;;;_ > 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
|
6937 (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
|
6938 "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
|
6939 (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
|
6940 (allout-test-resumptions) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6941 (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
|
6942 (sit-for .5)) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6943 ;;;_ : test resumptions: |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6944 ;;;_ > 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
|
6945 (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
|
6946 "Completely unbind variable with NAME." |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6947 (if (local-variable-p name) (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
|
6948 (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
|
6949 ;;;_ > allout-test-resumptions () |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6950 (defvar allout-tests-globally-unbound nil |
79939 | 6951 "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
|
6952 (defvar allout-tests-globally-true nil |
79939 | 6953 "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
|
6954 (defvar allout-tests-locally-true nil |
79939 | 6955 "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
|
6956 (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
|
6957 "Exercise allout resumptions." |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6958 ;; 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
|
6959 ;; 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
|
6960 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6961 ;; 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
|
6962 (with-temp-buffer |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6963 (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
|
6964 (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
|
6965 (assert (not (default-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
|
6966 (assert (local-variable-p '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
|
6967 (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
|
6968 (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
|
6969 (allout-do-resumptions) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6970 (assert (not (local-variable-p '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
|
6971 (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
|
6972 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6973 ;; 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
|
6974 (with-temp-buffer |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6975 (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
|
6976 (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
|
6977 (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
|
6978 (assert (equal (default-value '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
|
6979 (assert (local-variable-p '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
|
6980 (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
|
6981 (allout-do-resumptions) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6982 (assert (not (local-variable-p '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
|
6983 (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
|
6984 (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
|
6985 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6986 ;; 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
|
6987 (with-temp-buffer |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6988 (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
|
6989 (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
|
6990 (assert (not (default-boundp 'allout-tests-locally-true)) |
79939 | 6991 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
|
6992 " not have global binding, but it does.")) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
6993 (assert (local-variable-p 'allout-tests-locally-true) |
79939 | 6994 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
|
6995 " 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
|
6996 (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
|
6997 (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
|
6998 (assert (local-variable-p '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
|
6999 (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
|
7000 (allout-do-resumptions) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7001 (assert (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
|
7002 (assert (local-variable-p '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
|
7003 (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
|
7004 (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
|
7005 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7006 ;; 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
|
7007 (with-temp-buffer |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7008 (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
|
7009 (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
|
7010 (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
|
7011 (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
|
7012 (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
|
7013 (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
|
7014 '(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
|
7015 '(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
|
7016 (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
|
7017 '(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
|
7018 '(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
|
7019 ;; 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
|
7020 (assert (not (default-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
|
7021 (assert (local-variable-p '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
|
7022 (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
|
7023 (assert (default-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
|
7024 (assert (local-variable-p '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
|
7025 (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
|
7026 (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
|
7027 (assert (local-variable-p '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
|
7028 (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
|
7029 (allout-do-resumptions) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7030 (assert (not (local-variable-p '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
|
7031 (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
|
7032 (assert (not (local-variable-p '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
|
7033 (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
|
7034 (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
|
7035 (assert (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
|
7036 (assert (local-variable-p '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
|
7037 (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
|
7038 (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
|
7039 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7040 ;; 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
|
7041 (with-temp-buffer |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7042 (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
|
7043 (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
|
7044 (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
|
7045 (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
|
7046 (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
|
7047 (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
|
7048 '(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
|
7049 '(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
|
7050 (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
|
7051 (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
|
7052 (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
|
7053 (allout-do-resumptions)) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7054 ) |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7055 ;;;_ % 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
|
7056 (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
|
7057 (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
|
7058 |
bb3316be643e
Require 'cl during byte-compilation/interactive load, for the `assert' macro.
Eli Zaretskii <eliz@gnu.org>
parents:
71625
diff
changeset
|
7059 ;;;_ #12 Provide |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
7060 (provide 'allout) |
3430 | 7061 |
7062 ;;;_* Local emacs vars. | |
69124
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7063 ;; The following `allout-layout' local variable setting: |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7064 ;; - 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
|
7065 ;; - shows the children of the third to last (config vars) |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7066 ;; - and the second to last (code section), |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7067 ;; - and closes the last topic (this local-variables section). |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7068 ;;Local variables: |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7069 ;;allout-layout: (0 : -1 -1 0) |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7070 ;;End: |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7071 |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
7072 ;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
7073 ;;; allout.el ends here |