Mercurial > emacs
annotate lisp/allout.el @ 70235:f90c5558879e
*** empty log message ***
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Wed, 26 Apr 2006 18:19:13 +0000 |
parents | 81a284d45346 |
children | ccd02e1ca0e3 |
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, |
69124
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
4 ;; 2005, 2006 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> |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
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 |
3430 | 11 |
12 ;; This file is part of GNU Emacs. | |
13 | |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
14 ;; 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
|
15 ;; it under the terms of the GNU General Public License as published by |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
16 ;; the Free Software Foundation; either version 2, or (at your option) |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
17 ;; any later version. |
3430 | 18 |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
19 ;; 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
|
20 ;; 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
|
21 ;; 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
|
22 ;; 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
|
23 |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5310
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
14169 | 25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 ;; Boston, MA 02110-1301, USA. | |
3430 | 28 |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
29 ;;; Commentary: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
30 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
31 ;; 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
|
32 ;; and manipulation beyond standard emacs outline mode. Some features: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
33 ;; |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
34 ;; - 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
|
35 ;; - 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
|
36 ;; 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
|
37 ;; - Incremental search with dynamic exposure and reconcealment of text |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
38 ;; - Customizable bullet format - enables programming-language specific |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
39 ;; outlining, for code-folding editing. (Allout code itself is to try it; |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
40 ;; formatted as an outline - do ESC-x eval-current-buffer in allout.el; but |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
41 ;; emacs local file variables need to be enabled when the |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
42 ;; file was visited - see `enable-local-variables'.) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
43 ;; - Configurable per-file initial exposure settings |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
44 ;; - 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
|
45 ;; 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
|
46 ;; (using a stashed encrypted dummy string) and user-supplied hint |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
47 ;; maintenance. (See allout-toggle-current-subtree-encryption docstring.) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
48 ;; - Automatic topic-number maintenance |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
49 ;; - "Hot-spot" operation, for single-keystroke maneuvering and |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
50 ;; exposure control (see the allout-mode docstring) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
51 ;; - Easy rendering of exposed portions into numbered, latex, indented, etc |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
52 ;; outline styles |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
53 ;; - Careful attention to whitespace - enabling blank lines between items |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
54 ;; and maintenance of hanging indentation (in paragraph auto-fill and |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
55 ;; across topic promotion and demotion) of topic bodies consistent with |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
56 ;; indentation of their topic header. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
57 ;; |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
58 ;; and more. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
59 ;; |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
60 ;; See the `allout-mode' function's docstring for an introduction to the |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
61 ;; mode. The development version and helpful notes are available at |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
62 ;; http://myriadicity.net/Sundry/EmacsAllout . |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
63 ;; |
29490 | 64 ;; 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
|
65 ;; the features, and see the docstring of the variable `allout-init' |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
66 ;; for instructions on priming your emacs session for automatic |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
67 ;; activation of allout-mode. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
68 ;; |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
69 ;; 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
|
70 ;; `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
|
71 ;; `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
|
72 ;; 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
|
73 ;; |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
74 ;; Note - the lines beginning with `;;;_' are outline topic headers. |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
75 ;; Just `ESC-x eval-current-buffer' to give it a whirl. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
76 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
77 ;; 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
|
78 |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
79 ;;; Code: |
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
80 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
81 ;;;_* Dependency autoloads |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
82 (require 'overlay) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
83 (eval-when-compile (progn (require 'pgg) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
84 (require 'pgg-gpg) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
85 (require 'overlay) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
86 )) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
87 (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
88 "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
89 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
90 ;;;_* USER CUSTOMIZATION VARIABLES: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
91 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
92 ;;;_ > defgroup allout |
21088 | 93 (defgroup allout nil |
94 "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
|
95 :prefix "allout-" |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
96 :group 'outlines) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
97 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
98 ;;;_ + 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
|
99 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
100 ;;;_ = 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
|
101 (defcustom allout-auto-activation nil |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
102 "*Regulates auto-activation modality of allout outlines - see `allout-init'. |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
103 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
104 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
|
105 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
|
106 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
|
107 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
|
108 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
109 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
|
110 \(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
|
111 `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
|
112 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
113 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
|
114 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
|
115 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
116 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
|
117 auto-layout is not. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
118 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
119 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
|
120 enabled. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
121 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
122 See the docstring for `allout-init' for the proper interface to |
29490 | 123 this variable." |
124 :type '(choice (const :tag "On" t) | |
125 (const :tag "Ask about layout" "ask") | |
126 (const :tag "Mode only" "activate") | |
127 (const :tag "Off" nil)) | |
128 :group 'allout) | |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
129 ;;;_ = allout-default-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
130 (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
|
131 "*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
|
132 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
133 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
|
134 `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
|
135 layout specifications. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
136 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
137 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
|
138 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
|
139 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
|
140 `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
|
141 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
142 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
|
143 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
144 integer - dictate the relative depth to open the corresponding topic(s), |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
145 where: |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
146 - negative numbers force the topic to be closed before opening |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
147 to the absolute value of the number, so all siblings are open |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
148 only to that level. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
149 - positive numbers open to the relative depth indicated by the |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
150 number, but do not force already opened subtopics to be closed. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
151 - 0 means to close topic - hide all subitems. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
152 : - repeat spec - apply the preceeding element to all siblings at |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
153 current level, *up to* those siblings that would be covered by specs |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
154 following the `:' on the list. Ie, apply to all topics at level but |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
155 trailing ones accounted for by trailing specs. \(Only the first of |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
156 multiple colons at the same level is honored - later ones are ignored.) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
157 * - completely exposes the topic, including bodies |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
158 + - exposes all subtopics, but not the bodies |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
159 - - exposes the body of the corresponding topic, but not subtopics |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
160 list - a nested layout spec, to be applied intricately to its |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
161 corresponding item(s) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
162 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
163 Examples: |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
164 '(-2 : 0) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
165 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
|
166 grandchildren, but completely collapse the final top-level topic. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
167 '(-1 () : 1 0) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
168 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
|
169 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
|
170 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
|
171 completely close the last topic. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
172 '(-2 : -1 *) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
173 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
|
174 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
|
175 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
|
176 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
177 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
|
178 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
179 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
|
180 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
|
181 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
|
182 :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
|
183 :group 'allout) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
184 ;;;_ : allout-layout-type |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
185 (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
|
186 "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
|
187 :type '(repeat |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
188 (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
|
189 (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
|
190 (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
|
191 (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
|
192 (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
|
193 (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
|
194 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
195 ;;;_ = 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
|
196 (defcustom allout-show-bodies nil |
29490 | 197 "*If non-nil, show entire body when exposing a topic, rather than |
198 just the header." | |
199 :type 'boolean | |
200 :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
|
201 (make-variable-buffer-local 'allout-show-bodies) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
202 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
203 ;;;_ = 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
|
204 (defcustom allout-header-prefix "." |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
205 "*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
|
206 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
207 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
|
208 header prefix, which mostly have the value of this var at their front. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
209 \(Level 1 topics are exceptions. They consist of only a single |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
210 character, which is typically set to the `allout-primary-bullet'. Many |
21088 | 211 outlines start at level 2 to avoid this discrepancy." |
212 :type 'string | |
213 :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
|
214 (make-variable-buffer-local 'allout-header-prefix) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
215 ;;;_ = 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
|
216 (defcustom allout-primary-bullet "*" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
217 "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
|
218 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
219 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
|
220 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
|
221 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
|
222 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
223 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
|
224 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
|
225 and `allout-distinctive-bullets-string' for the range of available |
21088 | 226 bullets." |
227 :type 'string | |
228 :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
|
229 (make-variable-buffer-local 'allout-primary-bullet) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
230 ;;;_ = 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
|
231 (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
|
232 "*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
|
233 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
234 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
|
235 bullets. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
236 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
237 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
|
238 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
239 Outline mode has to be reactivated in order for changes to the value |
21088 | 240 of this var to take effect." |
241 :type 'string | |
242 :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
|
243 (make-variable-buffer-local 'allout-plain-bullets-string) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
244 ;;;_ = 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
|
245 (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
|
246 "*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
|
247 |
29490 | 248 These bullets are used to distinguish topics from the run-of-the-mill |
249 ones. They are not used in the standard topic headers created by | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
250 the topic-opening, shifting, and rebulleting \(eg, on topic shift, |
29490 | 251 topic paste, blanket rebulleting) routines, but are offered among the |
252 choices for rebulleting. They are not altered by the above automatic | |
253 rebulleting, so they can be used to characterize topics, eg: | |
254 | |
255 `?' question topics | |
256 `\(' parenthetic comment \(with a matching close paren inside) | |
257 `[' meta-note \(with a matching close ] inside) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
258 `\"' a quotation |
29490 | 259 `=' value settings |
260 `~' \"more or less\" | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
261 `^' see above |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
262 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
263 ... for example. (`#' typically has a special meaning to the software, |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
264 according to the value of `allout-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
|
265 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
266 See `allout-plain-bullets-string' for the selection of |
29490 | 267 alternating bullets. |
268 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
269 You must run `set-allout-regexp' in order for outline mode to |
29490 | 270 reconcile to changes of this value. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
271 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
272 DO NOT include the close-square-bracket, `]', on either of the bullet |
21088 | 273 strings." |
274 :type 'string | |
275 :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
|
276 (make-variable-buffer-local 'allout-distinctive-bullets-string) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
277 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
278 ;;;_ = 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
|
279 (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
|
280 "*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
|
281 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
282 Allout outline mode will use the mode-specific `allout-mode-leaders' |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
283 and/or comment-start string, if any, to lead the topic prefix string, |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
284 so topic headers look like comments in the programming language. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
285 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
286 String values are used as they stand. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
287 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
288 Value t means to first check for assoc value in `allout-mode-leaders' |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
289 alist, then use comment-start string, if any, then use default \(`.'). |
29490 | 290 \(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
|
291 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
292 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
|
293 `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
|
294 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
295 Value nil means to always use the default \(`.'). |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
296 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
297 comment-start strings that do not end in spaces are tripled, and an |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
298 `_' underscore is tacked on the end, to distinguish them from regular |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
299 comment strings. comment-start strings that do end in spaces are not |
29490 | 300 tripled, but an underscore is substituted for the space. [This |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
301 presumes that the space is for appearance, not comment syntax. You |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
302 can use `allout-mode-leaders' to override this behavior, when |
21088 | 303 incorrect.]" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
304 :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
|
305 (const allout-mode-leaders) |
21088 | 306 (const comment-start)) |
307 :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
|
308 ;;;_ = 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
|
309 (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
|
310 "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
|
311 |
29490 | 312 Entries will be used instead or in lieu of mode-specific |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
313 comment-start strings. See also `allout-use-mode-specific-leader'. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
314 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
315 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
|
316 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
|
317 character, like an \"_\" underscore, to distinguish the lead string |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
318 from regular comments that start at bol.") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
319 |
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 ;;;_ = 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
|
321 (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
|
322 "*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
|
323 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
324 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
|
325 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
|
326 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
|
327 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
328 Whatever the setting of this variable, both old and new style prefixes |
21088 | 329 are always respected by the topic maneuvering functions." |
330 :type 'boolean | |
331 :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
|
332 (make-variable-buffer-local 'allout-old-style-prefixes) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
333 ;;;_ = allout-stylish-prefixes - alternating bullets |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
334 (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
|
335 "*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
|
336 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
337 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
|
338 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
|
339 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
|
340 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
|
341 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
342 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
|
343 prefixes: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
344 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
345 * Top level |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
346 .* A topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
347 . + One level 3 subtopic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
348 . . One level 4 subtopic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
349 . . A second 4 subtopic |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
350 . + Another level 3 subtopic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
351 . #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
|
352 . #2 Another |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
353 . ! 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
|
354 . #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
|
355 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
356 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
|
357 numbered and other distinctive bullets retained): |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
358 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
359 * Top level |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
360 .* A topic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
361 . * One level 3 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
362 . * One level 4 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
363 . * A second 4 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
364 . * Another level 3 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
365 . #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
|
366 . #2 Another |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
367 . ! 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
|
368 . #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
|
369 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
370 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
|
371 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
|
372 this variable setting. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
373 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
374 The setting of this var is not relevant when `allout-old-style-prefixes' |
21088 | 375 is non-nil." |
376 :type 'boolean | |
377 :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
|
378 (make-variable-buffer-local 'allout-stylish-prefixes) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
379 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
380 ;;;_ = 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
|
381 (defcustom allout-numbered-bullet "#" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
382 "*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
|
383 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
384 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
|
385 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
|
386 to \"#\", you can set it to a bullet of your choice. A nil value |
21088 | 387 disables numbering maintenance." |
388 :type '(choice (const nil) string) | |
389 :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
|
390 (make-variable-buffer-local 'allout-numbered-bullet) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
391 ;;;_ = 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
|
392 (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
|
393 "*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
|
394 |
29490 | 395 Set this var to the bullet you want to use for file cross-references." |
21088 | 396 :type '(choice (const nil) string) |
397 :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
|
398 ;;;_ = 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
|
399 (defcustom allout-presentation-padding 2 |
29490 | 400 "*Presentation-format white-space padding factor, for greater indent." |
401 :type 'integer | |
402 :group 'allout) | |
403 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
404 (make-variable-buffer-local 'allout-presentation-padding) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
405 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
406 ;;;_ = 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
|
407 (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
|
408 "*If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic |
29490 | 409 numbers to minimal amount with some context. Otherwise, entire |
410 numbers are always used." | |
411 :type 'boolean | |
412 :group 'allout) | |
413 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
414 ;;;_ + 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
|
415 ;;;_ - 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
|
416 (defcustom allout-number-pages nil |
21088 | 417 "*Non-nil turns on page numbering for LaTeX formatting of an outline." |
418 :type 'boolean | |
419 :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
|
420 ;;;_ - 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
|
421 (defcustom allout-label-style "\\large\\bf" |
21088 | 422 "*Font and size of labels for LaTeX formatting of an outline." |
423 :type 'string | |
424 :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
|
425 ;;;_ - 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
|
426 (defcustom allout-head-line-style "\\large\\sl " |
21088 | 427 "*Font and size of entries for LaTeX formatting of an outline." |
428 :type 'string | |
429 :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
|
430 ;;;_ - 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
|
431 (defcustom allout-body-line-style " " |
21088 | 432 "*Font and size of entries for LaTeX formatting of an outline." |
433 :type 'string | |
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 ;;;_ - 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
|
436 (defcustom allout-title-style "\\Large\\bf" |
21088 | 437 "*Font and size of titles for LaTeX formatting of an outline." |
438 :type 'string | |
439 :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
|
440 ;;;_ - allout-title |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
441 (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
|
442 "*Expression to be evaluated to determine the title for LaTeX |
21088 | 443 formatted copy." |
444 :type 'sexp | |
445 :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
|
446 ;;;_ - 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
|
447 (defcustom allout-line-skip ".05cm" |
21088 | 448 "*Space between lines for LaTeX formatting of an outline." |
449 :type 'string | |
450 :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
|
451 ;;;_ - 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
|
452 (defcustom allout-indent ".3cm" |
21088 | 453 "*LaTeX formatted depth-indent spacing." |
454 :type 'string | |
455 :group 'allout) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
456 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
457 ;;;_ + Topic encryption |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
458 ;;;_ = allout-topic-encryption-bullet |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
459 (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
|
460 "*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
|
461 :type '(choice (const nil) string) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
462 :group 'allout) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
463 ;;;_ = allout-passphrase-verifier-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
464 (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
|
465 "*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
|
466 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
467 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
|
468 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
|
469 :type 'boolean |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
470 :group 'allout) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
471 (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
|
472 ;;;_ = allout-passphrase-hint-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
473 (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
|
474 "*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
|
475 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
476 always - always show reminder when prompting |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
477 needed - show reminder on passphrase entry failure |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
478 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
|
479 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
480 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
|
481 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
|
482 :type '(choice (const always) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
483 (const needed) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
484 (const disabled)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
485 :group 'allout) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
486 (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
|
487 ;;;_ = allout-encrypt-unencrypted-on-saves |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
488 (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
|
489 "*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
|
490 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
491 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
|
492 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
|
493 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
494 - Yes: encrypt all topics pending encryption, even if it's the one |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
495 currently being edited. \(In that case, the currently edited topic |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
496 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
|
497 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
|
498 encrypted.) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
499 Auto-saves will use the \"All except current topic\" mode if this |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
500 one is selected, to avoid practical difficulties - see below. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
501 - 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
|
502 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
|
503 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
|
504 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
|
505 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
|
506 - 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
|
507 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
508 For practical reasons, auto-saves always use the 'except-current policy |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
509 when auto-encryption is enabled. \(Otherwise, spurious passphrase prompts |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
510 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
|
511 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
|
512 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
|
513 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
514 :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
|
515 (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
|
516 (const :tag "No" nil)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
517 :group 'allout) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
518 (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
|
519 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
520 ;;;_ + Miscellaneous customization |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
521 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
522 ;;;_ = allout-command-prefix |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
523 (defcustom allout-command-prefix "\C-c " |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
524 "*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
|
525 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
526 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
|
527 willing to let allout use a bunch of \C-c keybindings." |
29490 | 528 :type 'string |
529 :group 'allout) | |
530 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
531 ;;;_ = allout-keybindings-list |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
532 ;;; 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
|
533 ;;; 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
|
534 (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
|
535 "*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
|
536 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
537 String or vector key will be prefaced with `allout-command-prefix', |
29490 | 538 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
|
539 (setq allout-keybindings-list |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
540 '( |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
541 ; 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
|
542 ("\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
|
543 ("\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
|
544 ("\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
|
545 ("\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
|
546 ("\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
|
547 ("\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
|
548 ("\C-e" allout-end-of-entry) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
549 ; 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
|
550 ("\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
|
551 ("\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
|
552 ("\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
|
553 ("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
|
554 ("\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
|
555 ("!" allout-show-all) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
556 ("x" allout-toggle-current-subtree-encryption) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
557 ; 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
|
558 (" " 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
|
559 ("." 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
|
560 ("," 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
|
561 ("'" 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
|
562 (">" 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
|
563 ("<" 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
|
564 ("\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
|
565 ("*" 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
|
566 ("#" 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
|
567 ("\C-k" allout-kill-line t) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
568 ("\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
|
569 ("\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
|
570 ("\C-k" allout-kill-topic) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
571 ; 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
|
572 ;([?\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
|
573 ("@" 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
|
574 ("=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
|
575 ("=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
|
576 ("=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
|
577 ("=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
|
578 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
579 ;;;_ = 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
|
580 (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
|
581 "*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
|
582 Ie, it is indented to be just past the header prefix. This is |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
583 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
|
584 where auto-fill occurs." |
21088 | 585 :type 'boolean |
586 :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
|
587 (make-variable-buffer-local 'allout-use-hanging-indents) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
588 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
589 ;;;_ = allout-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
|
590 (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
|
591 'text) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
592 "*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
|
593 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
594 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
|
595 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
|
596 the header. |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
597 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
598 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
|
599 those that do not have the variable `comment-start' set. A value of |
21088 | 600 `force' enables reindent whether or not `comment-start' is set." |
601 :type '(choice (const nil) (const t) (const text) (const force)) | |
602 :group 'allout) | |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
603 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
604 (make-variable-buffer-local 'allout-reindent-bodies) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
605 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
606 ;;;_ = 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
|
607 (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
|
608 "*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
|
609 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
610 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
|
611 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
|
612 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
613 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
|
614 is nil. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
615 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
616 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
|
617 For details, see `allout-toggle-current-subtree-encryption's docstring." |
21088 | 618 :type 'boolean |
619 :group 'allout) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
620 (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
|
621 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
622 ;;;_* CODE - no user customizations below. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
623 |
29490 | 624 ;;;_ #1 Internal Outline Formatting and Configuration |
625 ;;;_ : 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
|
626 ;;;_ = allout-version |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
627 (defvar allout-version "2.2.1" |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
628 "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
|
629 ;;;_ > 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
|
630 (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
|
631 "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
|
632 (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
|
633 (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
|
634 (if here (insert msg)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
635 (message "%s" msg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
636 msg)) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
637 ;;;_ : 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
|
638 ;;;_ = allout-mode |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
639 (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
|
640 (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
|
641 ;;;_ = allout-layout nil |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
642 (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL - see docstring. |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
643 "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
|
644 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
645 In buffers where this is non-nil \(and if `allout-init' has been run, to |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
646 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
|
647 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
|
648 `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
|
649 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
650 \*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
|
651 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
|
652 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
653 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
|
654 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
|
655 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
656 ;;;Local variables: |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
657 ;;;allout-layout: \(0 : -1 -1 0) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
658 ;;;End: |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
659 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
660 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
|
661 \(presuming allout-init was already run), followed by the |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
662 equivalent of `\(allout-expose-topic 0 : -1 -1 0)'. \(This is |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
663 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
|
664 |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
665 `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
|
666 `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
|
667 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
|
668 (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
|
669 ;;;###autoload |
70225
81a284d45346
(allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70002
diff
changeset
|
670 (put 'allout-layout 'safe-local-variable (lambda (x) (or (listp x) (symbolp x)))) |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
671 |
29490 | 672 ;;;_ : 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
|
673 ;;;_ = 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
|
674 (defvar allout-regexp "" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
675 "*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
|
676 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
677 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
|
678 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
|
679 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
|
680 (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
|
681 ;;;_ = 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
|
682 (defvar allout-bullets-string "" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
683 "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
|
684 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
685 This var should *not* be set by the user - it is set by `set-allout-regexp', |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
686 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
|
687 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
|
688 (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
|
689 ;;;_ = 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
|
690 (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
|
691 "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
|
692 (make-variable-buffer-local 'allout-bullets-string-len) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
693 ;;;_ = 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
|
694 (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
|
695 "`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
|
696 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
697 This is properly set when `allout-regexp' is produced by |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
698 `set-allout-regexp', so that (match-beginning 2) and (match-end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
699 2) delimit the prefix.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
700 (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
|
701 ;;;_ = 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
|
702 (defvar allout-bob-regexp () |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
703 "Like `allout-line-boundary-regexp', for headers at beginning of buffer. |
29490 | 704 \(match-beginning 2) and \(match-end 2) delimit the prefix.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
705 (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
|
706 ;;;_ = 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
|
707 (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
|
708 "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
|
709 (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
|
710 ;;;_ = 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
|
711 (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
|
712 "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
|
713 (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
|
714 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
715 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
716 ;;;_ 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
|
717 (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
|
718 "*Reset the leading string used to identify topic headers." |
3430 | 719 (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
|
720 (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
|
721 (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
|
722 (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
|
723 ;;;_ 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
|
724 (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
|
725 "*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
|
726 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
727 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
|
728 language comments. Returns the leading string." |
3430 | 729 |
730 (interactive "P") | |
731 (if (not (stringp header-lead)) | |
732 (setq header-lead (read-string | |
733 "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
|
734 (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
|
735 (allout-reset-header-lead header-lead) |
3430 | 736 header-lead) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
737 ;;;_ > allout-infer-header-lead () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
738 (defun allout-infer-header-lead () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
739 "Determine appropriate `allout-header-prefix'. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
740 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
741 Works according to settings of: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
742 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
743 `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
|
744 `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
|
745 `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
|
746 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
|
747 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
748 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
|
749 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
|
750 (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
|
751 (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
|
752 (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
|
753 '(allout-mode-leaders |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
754 comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
755 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
|
756 allout-use-mode-specific-leader |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
757 ;; Oops - garbled value, equate with effect of 't: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
758 t))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
759 (leader |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
760 (cond |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
761 ((not use-leader) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
762 ;; Use the explicitly designated leader: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
763 ((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
|
764 (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
|
765 ;; 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
|
766 (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
|
767 ;; ... 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
|
768 (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
|
769 comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
770 ;; Use comment-start, maybe tripled, and with |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
771 ;; underscore: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
772 (concat |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
773 (if (string= " " |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
774 (substring comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
775 (1- (length comment-start)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
776 ;; 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
|
777 (substring comment-start 0 -1) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
778 (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
|
779 ;; ... and append underscore, whichever: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
780 "_"))))))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
781 (if (not leader) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
782 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
|
783 (if (string= leader allout-header-prefix) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
784 nil ; no change, nothing to do. |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
785 (setq allout-header-prefix leader) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
786 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
|
787 ;;;_ > 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
|
788 (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
|
789 "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
|
790 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
791 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
|
792 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
|
793 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
|
794 (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
|
795 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
|
796 (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
|
797 (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
|
798 ;;;_ > 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
|
799 (defun set-allout-regexp () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
800 "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
|
801 |
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 Works with respect to `allout-plain-bullets-string' and |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
803 `allout-distinctive-bullets-string'." |
3430 | 804 |
805 (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
|
806 ;; 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
|
807 (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
|
808 (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
|
809 '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
|
810 'allout-primary-bullet)) |
3430 | 811 cur-string |
812 cur-len | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
813 cur-char |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
814 index) |
3430 | 815 (while strings |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
816 (setq index 0) |
3430 | 817 (setq cur-len (length (setq cur-string (symbol-value (car strings))))) |
818 (while (< index cur-len) | |
819 (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
|
820 (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
|
821 (concat allout-bullets-string |
3430 | 822 (cond |
823 ; Single dash would denote a | |
824 ; sequence, repeated denotes | |
825 ; a dash: | |
826 ((eq cur-char ?-) "--") | |
827 ; literal close-square-bracket | |
828 ; doesn't work right in the | |
829 ; expr, exclude it: | |
830 ((eq cur-char ?\]) "") | |
831 (t (regexp-quote (char-to-string cur-char)))))) | |
832 (setq index (1+ index))) | |
833 (setq strings (cdr strings))) | |
834 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
835 ;; 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
|
836 (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
|
837 (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
|
838 ;; Produce the new allout-regexp: |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
839 (setq allout-regexp (concat "\\(\\" |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
840 allout-header-prefix |
3430 | 841 "[ \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
|
842 allout-bullets-string |
3430 | 843 "]\\)\\|\\" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
844 allout-primary-bullet |
3430 | 845 "+\\|\^l")) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
846 (setq allout-line-boundary-regexp |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
847 (concat "\\(\n\\)\\(" 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
|
848 (setq allout-bob-regexp |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
849 (concat "\\(\\`\\)\\(" allout-regexp "\\)")) |
3430 | 850 ) |
29490 | 851 ;;;_ : 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
|
852 ;;;_ = 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
|
853 (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
|
854 ;;;_ > 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
|
855 (defun produce-allout-mode-map (keymap-list &optional base-map) |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
856 "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
|
857 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
858 Built on top of optional BASE-MAP, or empty sparse map if none specified. |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
859 See doc string for allout-keybindings-list for format of binding list." |
29490 | 860 (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
|
861 (pref (list allout-command-prefix))) |
29490 | 862 (mapcar (function |
863 (lambda (cell) | |
864 (let ((add-pref (null (cdr (cdr cell)))) | |
865 (key-suff (list (car cell)))) | |
866 (apply 'define-key | |
867 (list map | |
868 (apply 'concat (if add-pref | |
869 (append pref key-suff) | |
870 key-suff)) | |
871 (car (cdr cell))))))) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
872 keymap-list) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
873 map)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
874 ;;;_ = allout-prior-bindings - being deprecated. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
875 (defvar allout-prior-bindings nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
876 "Variable for use in V18, with allout-added-bindings, for |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
877 resurrecting, on mode deactivation, bindings that existed before |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
878 activation. Being deprecated.") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
879 ;;;_ = allout-added-bindings - being deprecated |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
880 (defvar allout-added-bindings nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
881 "Variable for use in V18, with allout-prior-bindings, for |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
882 resurrecting, on mode deactivation, bindings that existed before |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
883 activation. Being deprecated.") |
29490 | 884 ;;;_ : Menu bar |
54952
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
885 (defvar allout-mode-exposure-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
886 (defvar allout-mode-editing-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
887 (defvar allout-mode-navigation-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
888 (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
|
889 (defun produce-allout-mode-menubar-entries () |
29490 | 890 (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
|
891 (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
|
892 allout-mode-map |
29490 | 893 "Allout outline exposure menu." |
894 '("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
|
895 ["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
|
896 ["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
|
897 ["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
|
898 ["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
|
899 ["Hide Leaves" allout-hide-current-leaves t] |
29490 | 900 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
901 ["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
|
902 (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
|
903 allout-mode-map |
29490 | 904 "Allout outline editing menu." |
905 '("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
|
906 ["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
|
907 ["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
|
908 ["Open Supertopic" allout-open-supertopic t] |
29490 | 909 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
910 ["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
|
911 ["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
|
912 ["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
|
913 ["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
|
914 ["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
|
915 "----" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
916 ["Toggle Topic Encryption" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
917 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
|
918 (> (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
|
919 (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
|
920 allout-mode-map |
29490 | 921 "Allout outline navigation menu." |
922 '("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
|
923 ["Next Visible Heading" allout-next-visible-heading t] |
29490 | 924 ["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
|
925 allout-previous-visible-heading t] |
29490 | 926 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
927 ["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
|
928 ["Forward Current Level" allout-forward-current-level t] |
29490 | 929 ["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
|
930 allout-backward-current-level t] |
29490 | 931 "----" |
932 ["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
|
933 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
|
934 ["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
|
935 ["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
|
936 (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
|
937 allout-mode-map |
29490 | 938 "Allout outlines miscellaneous bindings." |
939 '("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
|
940 ["Version" allout-version t] |
29490 | 941 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
942 ["Duplicate Exposed" allout-copy-exposed-to-buffer t] |
29490 | 943 ["Duplicate Exposed, numbered" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
944 allout-flatten-exposed-to-buffer t] |
29490 | 945 ["Duplicate Exposed, indented" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
946 allout-indented-exposed-to-buffer t] |
29490 | 947 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
948 ["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
|
949 ["Set New Exposure" allout-expose-topic t]))) |
29490 | 950 ;;;_ : Mode-Specific Variable Maintenance Utilities |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
951 ;;;_ = 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
|
952 (defvar allout-mode-prior-settings nil |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
953 "Internal `allout-mode' use; settings to be resumed on mode deactivation.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
954 (make-variable-buffer-local 'allout-mode-prior-settings) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
955 ;;;_ > allout-resumptions (name &optional value) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
956 (defun allout-resumptions (name &optional value) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
957 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
958 "Registers or resumes settings over `allout-mode' activation/deactivation. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
959 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
960 First arg is NAME of variable affected. Optional second arg is list |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
961 containing allout-mode-specific VALUE to be imposed on named |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
962 variable, and to be registered. \(It's a list so you can specify |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
963 registrations of null values.) If no value is specified, the |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
964 registered value is returned (encapsulated in the list, so the caller |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
965 can distinguish nil vs no value), and the registration is popped |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
966 from the list." |
3430 | 967 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
968 (let ((on-list (assq name allout-mode-prior-settings)) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
969 prior-capsule ; By `capsule' i mean a list |
3430 | 970 ; containing a value, so we can |
971 ; distinguish nil from no value. | |
972 ) | |
973 | |
974 (if value | |
975 | |
976 ;; Registering: | |
977 (progn | |
978 (if on-list | |
979 nil ; Already preserved prior value - don't mess with it. | |
980 ;; Register the old value, or nil if previously unbound: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
981 (setq allout-mode-prior-settings |
3430 | 982 (cons (list name |
983 (if (boundp name) (list (symbol-value name)))) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
984 allout-mode-prior-settings))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
985 ; And impose the new value, locally: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
986 (progn (make-local-variable name) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
987 (set name (car value)))) |
3430 | 988 |
989 ;; Relinquishing: | |
990 (if (not on-list) | |
991 | |
992 ;; Oops, not registered - leave it be: | |
993 nil | |
994 | |
995 ;; Some registration: | |
996 ; reestablish it: | |
997 (setq prior-capsule (car (cdr on-list))) | |
998 (if prior-capsule | |
999 (set name (car prior-capsule)) ; Some prior value - reestablish it. | |
1000 (makunbound name)) ; Previously unbound - demolish var. | |
1001 ; Remove registration: | |
1002 (let (rebuild) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1003 (while allout-mode-prior-settings |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1004 (if (not (eq (car allout-mode-prior-settings) |
3430 | 1005 on-list)) |
1006 (setq rebuild | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1007 (cons (car allout-mode-prior-settings) |
3430 | 1008 rebuild))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1009 (setq allout-mode-prior-settings |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1010 (cdr allout-mode-prior-settings))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1011 (setq allout-mode-prior-settings rebuild))))) |
3430 | 1012 ) |
29490 | 1013 ;;;_ : 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
|
1014 ;;;_ > allout-unprotected (expr) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1015 (defmacro allout-unprotected (expr) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1016 "Enable internal outline operations to alter invisible text." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1017 `(let ((inhibit-read-only t)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1018 ,expr)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1019 ;;;_ = allout-mode-hook |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1020 (defvar allout-mode-hook nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1021 "*Hook that's run when allout mode starts.") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1022 ;;;_ = allout-overlay-category |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1023 (defvar allout-overlay-category nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1024 "Symbol for use in allout invisible-text overlays as the category.") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1025 ;;;_ = allout-view-change-hook |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1026 (defvar allout-view-change-hook nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1027 "*Hook that's run after allout outline visibility changes.") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1028 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1029 ;;;_ = allout-outside-normal-auto-fill-function |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1030 (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
|
1031 "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
|
1032 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1033 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
|
1034 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
|
1035 (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
|
1036 ;;;_ = 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
|
1037 (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
|
1038 "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
|
1039 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
|
1040 to track repeats.") |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1041 ;;;_ = allout-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1042 (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
|
1043 "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
|
1044 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
|
1045 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1046 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
|
1047 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
|
1048 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
|
1049 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
|
1050 search attacks. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1051 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1052 The verifier string is retained as an Emacs file variable, as well as in |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1053 the emacs buffer 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
|
1054 `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
|
1055 (make-variable-buffer-local 'allout-passphrase-verifier-string) |
70225
81a284d45346
(allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70002
diff
changeset
|
1056 (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
|
1057 ;;;_ = allout-passphrase-hint-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1058 (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
|
1059 "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
|
1060 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1061 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
|
1062 the reminder is deployed. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1063 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1064 The hint is retained as an Emacs file variable, as well as in the emacs buffer |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1065 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
|
1066 `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
|
1067 (make-variable-buffer-local 'allout-passphrase-hint-string) |
70225
81a284d45346
(allout-layout, allout-passphrase-verifier-string)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
70002
diff
changeset
|
1068 (put 'allout-passphrase-hint-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
|
1069 (setq-default allout-passphrase-hint-string "") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1070 ;;;_ = allout-after-save-decrypt |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1071 (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
|
1072 "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
|
1073 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1074 - 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
|
1075 - 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
|
1076 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1077 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
|
1078 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
|
1079 (make-variable-buffer-local 'allout-after-save-decrypt) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1080 ;;;_ > allout-mode-p () |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1081 ;; Must define this macro above any uses, or byte compilation will lack |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1082 ;; proper def, if file isn't loaded - eg, during emacs build! |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1083 (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
|
1084 "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
|
1085 'allout-mode) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1086 ;;;_ > 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
|
1087 (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
|
1088 "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
|
1089 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1090 (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
|
1091 (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
|
1092 (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
|
1093 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1094 (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
|
1095 'except-current) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1096 (point-marker)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1097 (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
|
1098 (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
|
1099 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1100 (message "auto-encrypting pending topics") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1101 (sit-for 0) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1102 (condition-case failure |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1103 (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
|
1104 (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
|
1105 (error (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1106 (message |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1107 "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
|
1108 failure) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1109 (sit-for 2)))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1110 )) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1111 nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1112 ;;;_ > 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
|
1113 (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
|
1114 "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
|
1115 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1116 (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
|
1117 ;; 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
|
1118 (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
|
1119 (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
|
1120 ;;;_ > allout-after-saves-handler () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1121 (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
|
1122 "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
|
1123 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1124 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
|
1125 the save. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1126 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1127 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
|
1128 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
|
1129 (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
|
1130 (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
|
1131 allout-after-save-decrypt)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1132 t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1133 (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
|
1134 (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
|
1135 (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
|
1136 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1137 (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
|
1138 (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
|
1139 (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
|
1140 ) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1141 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1142 ;;;_ #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
|
1143 ;;;_ = 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
|
1144 (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
|
1145 "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
|
1146 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
|
1147 (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
|
1148 ;;;_ > 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
|
1149 (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
|
1150 "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
|
1151 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1152 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
|
1153 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1154 - nil \(or no argument) deactivate auto-activation/layout; |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1155 - `activate', enable auto-activation only; |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1156 - `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
|
1157 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
|
1158 - `report', just report and return the current auto-activation state; |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1159 - anything else \(eg, t) for auto-activation and auto-layout, without |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1160 any confirmation check. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1161 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1162 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
|
1163 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
|
1164 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
|
1165 `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
|
1166 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1167 `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
|
1168 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
|
1169 setting. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1170 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1171 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
|
1172 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
|
1173 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1174 \(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
|
1175 \(allout-init t)" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1176 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1177 (interactive) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1178 (if (interactive-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1179 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1180 (setq mode |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1181 (completing-read |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1182 (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
|
1183 "(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
|
1184 '(("nil")("full")("activate")("deactivate") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1185 ("ask") ("report") ("")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1186 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1187 t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1188 (if (string= mode "") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1189 (setq mode 'report) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1190 (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
|
1191 (let |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1192 ;; 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
|
1193 ((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
|
1194 (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
|
1195 'find-file-hook |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1196 '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
|
1197 (curr-mode 'allout-auto-activation)) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1198 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1199 (cond ((not mode) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1200 (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
|
1201 (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
|
1202 (if (interactive-p) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1203 (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
|
1204 ((eq mode 'report) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1205 (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
|
1206 (allout-init nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1207 ;; 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
|
1208 (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
|
1209 (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
|
1210 (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
|
1211 (cond ((eq mode 'activate) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1212 (message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1213 "Outline mode auto-activation enabled.") |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1214 'activate) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1215 ((eq mode 'report) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1216 ;; 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
|
1217 (allout-init mode)) |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1218 ((eq mode 'ask) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1219 (message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1220 (concat "Outline mode auto-activation and " |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1221 "-layout \(upon confirmation) enabled.")) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1222 'ask) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1223 ((message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1224 "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
|
1225 '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
|
1226 ;;;_ > 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
|
1227 (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
|
1228 "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
|
1229 (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
|
1230 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
|
1231 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
|
1232 allout-mode-misc-menu)) |
29490 | 1233 cur) |
1234 (while menus | |
1235 (setq cur (car menus) | |
1236 menus (cdr menus)) | |
1237 (easy-menu-add cur)))) | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1238 ;;;_ > allout-set-overlay-category |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1239 (defun allout-set-overlay-category () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1240 "Set the properties of the allout invisible-text overlay." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1241 (setplist 'allout-overlay-category nil) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1242 (put 'allout-overlay-category 'invisible 'allout) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1243 (put 'allout-overlay-category 'evaporate t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1244 ;; XXX We use isearch-open-invisible *and* isearch-mode-end-hook. The |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1245 ;; latter would be sufficient, but it seems that a separate behavior - |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1246 ;; the _transient_ opening of invisible text during isearch - is keyed to |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1247 ;; presence of the isearch-open-invisible property - even though this |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1248 ;; property controls the isearch _arrival_ behavior. This is the case at |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1249 ;; least in emacs 21, 22.0, and xemacs 21.4. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1250 (put 'allout-overlay-category 'isearch-open-invisible |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1251 'allout-isearch-end-handler) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1252 (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1253 (put 'allout-overlay-category 'start-open t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1254 (put 'allout-overlay-category 'insert-in-front-hooks |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1255 '(allout-overlay-insert-in-front-handler))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1256 (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1257 (progn (make-variable-buffer-local 'before-change-functions) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1258 (add-hook 'before-change-functions |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1259 'allout-before-change-handler)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1260 (put 'allout-overlay-category 'modification-hooks |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1261 '(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
|
1262 ;;;_ > allout-mode (&optional toggle) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1263 ;;;_ : Defun: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1264 ;;;###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
|
1265 (defun allout-mode (&optional toggle) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1266 ;;;_ . Doc string: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1267 "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
|
1268 \\<allout-mode-map> |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1269 |
29490 | 1270 Optional arg forces mode to re-initialize iff arg is positive num or |
1271 symbol. Allout outline mode always runs as a minor mode. | |
1272 | |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
1273 Allout outline mode provides extensive outline oriented formatting and |
29490 | 1274 manipulation. It enables structural editing of outlines, as well as |
1275 navigation and exposure. It also is specifically aimed at | |
1276 accommodating syntax-sensitive text like programming languages. \(For | |
1277 an example, see the allout code itself, which is organized as an allout | |
1278 outline.) | |
1279 | |
1280 In addition to outline navigation and exposure, allout includes: | |
1281 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1282 - topic-oriented repositioning, promotion/demotion, cut, and paste |
29490 | 1283 - integral outline exposure-layout |
1284 - incremental search with dynamic exposure and reconcealment of hidden text | |
1285 - automatic topic-number maintenance | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1286 - easy topic encryption and decryption |
29490 | 1287 - \"Hot-spot\" operation, for single-keystroke maneuvering and |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1288 exposure control. \(See the allout-mode docstring.) |
29490 | 1289 |
1290 and many other features. | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1291 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1292 Below is a description of the bindings, and then explanation of |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
1293 special `allout-mode' features and terminology. See also the outline |
29490 | 1294 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
|
1295 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
|
1296 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
|
1297 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1298 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1299 The bindings are dictated by the `allout-keybindings-list' and |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1300 `allout-command-prefix' variables. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1301 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1302 Navigation: Exposure Control: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1303 ---------- ---------------- |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1304 \\[allout-next-visible-heading] allout-next-visible-heading | \\[allout-hide-current-subtree] allout-hide-current-subtree |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1305 \\[allout-previous-visible-heading] allout-previous-visible-heading | \\[allout-show-children] allout-show-children |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1306 \\[allout-up-current-level] allout-up-current-level | \\[allout-show-current-subtree] allout-show-current-subtree |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1307 \\[allout-forward-current-level] allout-forward-current-level | \\[allout-show-current-entry] allout-show-current-entry |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1308 \\[allout-backward-current-level] allout-backward-current-level | \\[allout-show-all] allout-show-all |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1309 \\[allout-end-of-entry] allout-end-of-entry |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1310 \\[allout-beginning-of-current-entry] allout-beginning-of-current-entry, alternately, goes to hot-spot |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1311 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1312 Topic Header Production: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1313 ----------------------- |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1314 \\[allout-open-sibtopic] allout-open-sibtopic Create a new sibling after current topic. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1315 \\[allout-open-subtopic] allout-open-subtopic ... an offspring of current topic. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1316 \\[allout-open-supertopic] allout-open-supertopic ... a sibling of the current topic's parent. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1317 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1318 Topic Level and Prefix Adjustment: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1319 --------------------------------- |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1320 \\[allout-shift-in] allout-shift-in Shift current topic and all offspring deeper. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1321 \\[allout-shift-out] allout-shift-out ... less deep. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1322 \\[allout-rebullet-current-heading] allout-rebullet-current-heading Prompt for alternate bullet for |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1323 current topic. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1324 \\[allout-rebullet-topic] allout-rebullet-topic Reconcile bullets of topic and its offspring |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1325 - distinctive bullets are not changed, others |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1326 alternated according to nesting depth. |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1327 \\[allout-number-siblings] allout-number-siblings Number bullets of topic and siblings - the |
3430 | 1328 offspring are not affected. With repeat |
1329 count, revoke numbering. | |
1330 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1331 Topic-oriented Killing and Yanking: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1332 ---------------------------------- |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1333 \\[allout-kill-topic] allout-kill-topic Kill current topic, including offspring. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1334 \\[allout-kill-line] allout-kill-line Like kill-line, but reconciles numbering, etc. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1335 \\[allout-yank] allout-yank Yank, adjusting depth of yanked topic to |
3430 | 1336 depth of heading if yanking into bare topic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1337 heading (ie, prefix sans text). |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1338 \\[allout-yank-pop] allout-yank-pop Is to allout-yank as yank-pop is to yank |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1339 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1340 Topic-oriented Encryption: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1341 ------------------------- |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1342 \\[allout-toggle-current-subtree-encryption] allout-toggle-current-subtree-encryption Encrypt/Decrypt topic content |
3430 | 1343 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1344 Misc commands: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1345 ------------- |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1346 M-x outlineify-sticky Activate outline mode for current buffer, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1347 and establish a default file-var setting |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1348 for `allout-layout'. |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1349 \\[allout-mark-topic] allout-mark-topic |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1350 \\[allout-copy-exposed-to-buffer] allout-copy-exposed-to-buffer |
29490 | 1351 Duplicate outline, sans concealed text, to |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1352 buffer with name derived from derived from that |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1353 of current buffer - \"*BUFFERNAME exposed*\". |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1354 \\[allout-flatten-exposed-to-buffer] allout-flatten-exposed-to-buffer |
29490 | 1355 Like above 'copy-exposed', but convert topic |
1356 prefixes to section.subsection... numeric | |
1357 format. | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1358 \\[eval-expression] (allout-init t) Setup Emacs session for outline mode |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1359 auto-activation. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1360 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1361 Topic Encryption |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1362 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1363 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
|
1364 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
|
1365 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
|
1366 mode, and auto-encryption of topics pending encryption on save. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1367 \(Topics pending encryption are, by default, automatically |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1368 encrypted during file saves; if you're editing the contents of |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1369 such a topic, it is automatically decrypted for continued |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1370 editing.) The aim is reliable topic privacy while preventing |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1371 accidents like neglected encryption before saves, forgetting |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1372 which passphrase was used, and other practical pitfalls. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1373 |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1374 See `allout-toggle-current-subtree-encryption' function docstring and |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1375 `allout-encrypt-unencrypted-on-saves' customization variable for details. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1376 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1377 HOT-SPOT Operation |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1378 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1379 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
|
1380 navigation and exposure control. |
3430 | 1381 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1382 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
|
1383 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
|
1384 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
|
1385 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
|
1386 \(\\[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
|
1387 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1388 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
|
1389 execute the outline navigation and manipulation commands with a |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1390 single keystroke. Regular navigation keys (eg, \\[forward-char], \\[next-line]) never get |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1391 this special translation, so you can use them to get out of the |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1392 hot-spot and back to normal operation. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1393 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1394 Note that the command `allout-beginning-of-current-entry' \(\\[allout-beginning-of-current-entry]\) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1395 will move to the hot-spot when the cursor is already located at the |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1396 beginning of the current entry, so you usually can hit \\[allout-beginning-of-current-entry] |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1397 twice in a row to get to the hot-spot. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1398 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1399 Terminology |
3430 | 1400 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1401 Topic hierarchy constituents - TOPICS and SUBTOPICS: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1402 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1403 TOPIC: A basic, coherent component of an Emacs outline. It can |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1404 contain and be contained by other topics. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1405 CURRENT topic: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1406 The visible topic most immediately containing the cursor. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1407 DEPTH: The degree of nesting of a topic; it increases with |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1408 containment. Also called the: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1409 LEVEL: The same as DEPTH. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1410 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1411 ANCESTORS: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1412 The topics that contain a topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1413 PARENT: A topic's immediate ancestor. It has a depth one less than |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1414 the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1415 OFFSPRING: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1416 The topics contained by a topic; |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1417 SUBTOPIC: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1418 An immediate offspring of a topic; |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1419 CHILDREN: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1420 The immediate offspring of a topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1421 SIBLINGS: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1422 Topics having the same parent and depth. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1423 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1424 Topic text constituents: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1425 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1426 HEADER: The first line of a topic, include the topic PREFIX and header |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1427 text. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1428 PREFIX: The leading text of a topic which distinguishes it from normal |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1429 text. It has a strict form, which consists of a prefix-lead |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1430 string, padding, and a bullet. The bullet may be followed by a |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1431 number, indicating the ordinal number of the topic among its |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1432 siblings, a space, and then the header text. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1433 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1434 The relative length of the PREFIX determines the nesting depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1435 of the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1436 PREFIX-LEAD: |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1437 The string at the beginning of a topic prefix, normally a `.'. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1438 It can be customized by changing the setting of |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
1439 `allout-header-prefix' and then reinitializing `allout-mode'. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1440 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1441 By setting the prefix-lead to the comment-string of a |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
1442 programming language, you can embed outline structuring in |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1443 program code without interfering with the language processing |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1444 of that code. See `allout-use-mode-specific-leader' |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1445 docstring for more detail. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1446 PREFIX-PADDING: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1447 Spaces or asterisks which separate the prefix-lead and the |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1448 bullet, determining the depth of the topic. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1449 BULLET: A character at the end of the topic prefix, it must be one of |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1450 the characters listed on `allout-plain-bullets-string' or |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1451 `allout-distinctive-bullets-string'. (See the documentation |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1452 for these variables for more details.) The default choice of |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1453 bullet when generating topics varies in a cycle with the depth of |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1454 the topic. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1455 ENTRY: The text contained in a topic before any offspring. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1456 BODY: Same as ENTRY. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1457 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1458 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1459 EXPOSURE: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1460 The state of a topic which determines the on-screen visibility |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1461 of its offspring and contained text. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1462 CONCEALED: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1463 Topics and entry text whose display is inhibited. Contiguous |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1464 units of concealed text is represented by `...' ellipses. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1465 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1466 Concealed topics are effectively collapsed within an ancestor. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1467 CLOSED: A topic whose immediate offspring and body-text is concealed. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1468 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
|
1469 ;;;_ . Code |
3430 | 1470 (interactive "P") |
1471 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1472 (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
|
1473 (allout-mode-p))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1474 ; Massage universal-arg `toggle' val: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1475 (toggle (and toggle |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1476 (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
|
1477 toggle))) |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
1478 ; 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
|
1479 (explicit-activation (and toggle |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1480 (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
|
1481 (and (wholenump toggle) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1482 (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
|
1483 ;; 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
|
1484 (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
|
1485 (car command-history))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1486 (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
|
1487 'write-file-functions) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1488 ((boundp 'write-file-hooks) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1489 'write-file-hooks) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1490 (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
|
1491 do-layout |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1492 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1493 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1494 ; 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
|
1495 (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
|
1496 |
3430 | 1497 (cond |
1498 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1499 ;; 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
|
1500 ;; 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
|
1501 ;; 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
|
1502 ;; 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
|
1503 ;; skip everything. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1504 ((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
|
1505 ; 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
|
1506 active ; Already activated. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1507 (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
|
1508 (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
|
1509 emacs-version)); 19.19. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1510 t) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1511 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1512 ;; Deactivation: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1513 ((and (not explicit-activation) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1514 (or active toggle)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1515 ; Activation not explicitly |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1516 ; requested, and either in |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1517 ; active state or *de*activation |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1518 ; 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
|
1519 (setq allout-explicitly-deactivated t) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1520 (if (string-match "^18\." emacs-version) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1521 ; Revoke those keys that remain |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1522 ; as we set them: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1523 (let ((curr-loc (current-local-map))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1524 (mapcar (function |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1525 (lambda (cell) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1526 (if (eq (lookup-key curr-loc (car cell)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1527 (car (cdr cell))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1528 (define-key curr-loc (car cell) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1529 (assq (car cell) allout-prior-bindings))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1530 allout-added-bindings) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1531 (allout-resumptions 'allout-added-bindings) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1532 (allout-resumptions 'allout-prior-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
|
1533 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1534 (if allout-old-style-prefixes |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1535 (progn |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1536 (allout-resumptions 'allout-primary-bullet) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1537 (allout-resumptions 'allout-old-style-prefixes))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1538 ;;(allout-resumptions 'selective-display) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1539 (remove-from-invisibility-spec '(allout . t)) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1540 (set write-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
|
1541 (delq 'allout-write-file-hook-handler |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1542 (symbol-value write-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
|
1543 (setq auto-save-hook |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1544 (delq '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
|
1545 auto-save-hook)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1546 (allout-resumptions 'paragraph-start) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1547 (allout-resumptions 'paragraph-separate) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1548 (allout-resumptions 'auto-fill-function) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1549 (allout-resumptions 'normal-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
|
1550 (allout-resumptions 'allout-former-auto-filler) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1551 (setq allout-mode nil)) |
3430 | 1552 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1553 ;; Activation: |
3430 | 1554 ((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
|
1555 (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
|
1556 (if allout-old-style-prefixes |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1557 (progn ; Inhibit all the fancy formatting: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1558 (allout-resumptions 'allout-primary-bullet '("*")) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1559 (allout-resumptions 'allout-old-style-prefixes '(())))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1560 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1561 (allout-set-overlay-category) ; Doesn't hurt to redo this. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1562 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1563 (allout-infer-header-lead) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1564 (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
|
1565 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1566 (set-allout-regexp) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1567 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1568 ; Produce map from current version |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1569 ; of allout-keybindings-list: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1570 (if (boundp 'minor-mode-map-alist) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1571 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1572 (progn ; V19, and maybe lucid and |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1573 ; epoch, minor-mode key bindings: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1574 (setq allout-mode-map |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1575 (produce-allout-mode-map allout-keybindings-list)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1576 (produce-allout-mode-menubar-entries) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1577 (fset 'allout-mode-map allout-mode-map) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1578 ; Include on minor-mode-map-alist, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1579 ; if not already there: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1580 (if (not (member '(allout-mode . allout-mode-map) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1581 minor-mode-map-alist)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1582 (setq minor-mode-map-alist |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1583 (cons '(allout-mode . allout-mode-map) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1584 minor-mode-map-alist)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1585 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1586 ; V18 minor-mode key bindings: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1587 ; Stash record of added bindings |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1588 ; for later revocation: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1589 (allout-resumptions 'allout-added-bindings |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1590 (list allout-keybindings-list)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1591 (allout-resumptions 'allout-prior-bindings |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1592 (list (current-local-map))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1593 ; and add them: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1594 (use-local-map (produce-allout-mode-map allout-keybindings-list |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1595 (current-local-map))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1596 ) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1597 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1598 (add-to-invisibility-spec '(allout . t)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1599 (make-local-variable 'line-move-ignore-invisible) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1600 (setq line-move-ignore-invisible 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
|
1601 (add-hook 'pre-command-hook 'allout-pre-command-business) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1602 (add-hook 'post-command-hook 'allout-post-command-business) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1603 (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1604 (add-hook write-file-hook-var-name 'allout-write-file-hook-handler) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1605 (add-hook 'auto-save-hook 'allout-auto-save-hook-handler) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1606 ; Custom auto-fill func, to support |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1607 ; respect for topic headline, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1608 ; hanging-indents, etc: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1609 ;; Register prevailing fill func for use by allout-auto-fill: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1610 (allout-resumptions 'allout-former-auto-filler (list auto-fill-function)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1611 ;; Register allout-auto-fill to be used if filling is active: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1612 (allout-resumptions 'auto-fill-function '(allout-auto-fill)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1613 (allout-resumptions 'allout-outside-normal-auto-fill-function |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1614 (list normal-auto-fill-function)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1615 (allout-resumptions 'normal-auto-fill-function '(allout-auto-fill)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1616 ;; Paragraphs are broken by topic headlines. |
3430 | 1617 (make-local-variable 'paragraph-start) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1618 (allout-resumptions 'paragraph-start |
29490 | 1619 (list (concat paragraph-start "\\|^\\(" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1620 allout-regexp "\\)"))) |
3430 | 1621 (make-local-variable 'paragraph-separate) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1622 (allout-resumptions 'paragraph-separate |
29490 | 1623 (list (concat paragraph-separate "\\|^\\(" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1624 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
|
1625 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1626 (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
|
1627 (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
|
1628 (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
|
1629 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1630 (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
|
1631 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1632 (if allout-layout |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1633 (setq do-layout t)) |
3430 | 1634 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1635 (run-hooks 'allout-mode-hook) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1636 (setq allout-mode t)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1637 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1638 ;; Reactivation: |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1639 ((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
|
1640 (allout-infer-body-reindent)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1641 ) ; cond |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1642 |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1643 (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
|
1644 allout-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1645 allout-default-layout))) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1646 (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
|
1647 allout-auto-activation |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1648 use-layout |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1649 (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
|
1650 (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
|
1651 (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
|
1652 (buffer-name) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1653 use-layout)) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1654 t |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1655 (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
|
1656 nil) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1657 t))) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1658 (save-excursion |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1659 (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
|
1660 (goto-char 0) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1661 (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
|
1662 (condition-case err |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1663 (progn |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1664 (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
|
1665 (message "Adjusting '%s' exposure... done." (buffer-name))) |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1666 ;; Problem applying exposure - notify user, but don't |
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1667 ;; 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
|
1668 (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
|
1669 (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
|
1670 allout-mode |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1671 ) ; let* |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1672 ) ; defun |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
1673 ;;;_ > allout-minor-mode |
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
1674 (defalias 'allout-minor-mode 'allout-mode) |
68956
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1675 |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1676 ;;;_ - Position Assessment |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1677 ;;;_ > allout-hidden-p (&optional pos) |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1678 (defsubst allout-hidden-p (&optional pos) |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1679 "Non-nil if the character after point is invisible." |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1680 (get-char-property (or pos (point)) 'invisible)) |
af2db645bc9d
(allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents:
68953
diff
changeset
|
1681 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1682 ;;;_ > 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
|
1683 ;;; &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1684 (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
|
1685 &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1686 "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
|
1687 (if after |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1688 (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
|
1689 ;;;_ > 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
|
1690 ;;; &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1691 (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
|
1692 &optional prelen) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1693 "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
|
1694 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1695 We expose the invisible text and ask for confirmation. Refusal or |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1696 keyboard-quit abandons the changes, with keyboard-quit additionally |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1697 reclosing the opened text. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1698 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1699 No confirmation is necessary when inhibit-read-only is set - eg, allout |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1700 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
|
1701 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1702 (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
|
1703 (let ((start (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1704 (ol-start (overlay-start ol)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1705 (ol-end (overlay-end ol)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1706 (msg "Change within concealed text disallowed.") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1707 opened |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1708 first) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1709 (goto-char beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1710 (while (< (point) end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1711 (when (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1712 (allout-show-to-offshoot) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1713 (if (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1714 (save-excursion (forward-char 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1715 (allout-show-to-offshoot))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1716 (when (not first) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1717 (setq opened t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1718 (setq first (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1719 (goto-char (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1720 (next-property-change (1+ (point)) nil end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1721 (next-char-property-change (1+ (point)) end)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1722 (when first |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1723 (goto-char first) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1724 (condition-case nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1725 (if (not |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1726 (yes-or-no-p |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1727 (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
|
1728 (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
|
1729 " \\[keyboard-quit] also reconceals) ")))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1730 (progn (goto-char start) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1731 (error "Concealed-text change refused."))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1732 (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
|
1733 (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
|
1734 (error "Concealed-text change abandoned, text reconcealed.")))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1735 (goto-char start)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1736 ;;;_ > allout-before-change-handler (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1737 (defun allout-before-change-handler (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1738 "Protect against changes to invisible text. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1739 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1740 See allout-overlay-interior-modification-handler for details. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1741 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1742 This before-change handler is used only where modification-hooks |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1743 overlay property is not supported." |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
1744 (if (not (allout-mode-p)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1745 nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1746 (allout-overlay-interior-modification-handler nil nil beg end nil))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1747 ;;;_ > allout-isearch-end-handler (&optional overlay) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1748 (defun allout-isearch-end-handler (&optional overlay) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1749 "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
|
1750 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1751 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
|
1752 `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
|
1753 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
|
1754 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1755 (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
|
1756 (allout-show-to-offshoot))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1757 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1758 ;;;_ #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
|
1759 ;;; All the basic outline functions that directly do string matches to |
3430 | 1760 ;;; 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
|
1761 ;;; `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
|
1762 ;;; 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
|
1763 ;;; 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
|
1764 ;;; 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
|
1765 ;;; 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
|
1766 ;;;_ = 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
|
1767 (defvar allout-recent-prefix-beginning 0 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1768 "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
|
1769 (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
|
1770 ;;;_ = 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
|
1771 (defvar allout-recent-prefix-end 0 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1772 "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
|
1773 (make-variable-buffer-local 'allout-recent-prefix-end) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1774 ;;;_ = 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
|
1775 (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
|
1776 "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
|
1777 (make-variable-buffer-local 'allout-recent-end-of-subtree) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1778 ;;;_ > allout-prefix-data (beg end) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1779 (defmacro allout-prefix-data (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
|
1780 "Register allout-prefix state data - BEGINNING and END of prefix. |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1781 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1782 For reference by `allout-recent' funcs. Returns BEGINNING." |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1783 `(setq allout-recent-prefix-end ,end |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1784 allout-recent-prefix-beginning ,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
|
1785 ;;;_ > allout-recent-depth () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1786 (defmacro allout-recent-depth () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1787 "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
|
1788 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1789 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
|
1790 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
|
1791 `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
|
1792 to return the current depth." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1793 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1794 '(max 1 (- allout-recent-prefix-end |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1795 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
|
1796 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
|
1797 ;;;_ > 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
|
1798 (defmacro allout-recent-prefix () |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
1799 "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
|
1800 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1801 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
|
1802 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
|
1803 `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
|
1804 to return the current depth." |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1805 '(buffer-substring allout-recent-prefix-beginning |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1806 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
|
1807 ;;;_ > 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
|
1808 (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
|
1809 "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
|
1810 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1811 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
|
1812 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
|
1813 `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
|
1814 to return the current depth of the most recently matched topic." |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1815 '(buffer-substring (1- allout-recent-prefix-end) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1816 allout-recent-prefix-end)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1817 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1818 ;;;_ #4 Navigation |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1819 |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
1820 ;;;_ - Position Assessment |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1821 ;;;_ : Location Predicates |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1822 ;;;_ > allout-on-current-heading-p () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1823 (defun allout-on-current-heading-p () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1824 "Return non-nil if point is on current visible topics' header line. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1825 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1826 Actually, returns prefix beginning point." |
3430 | 1827 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1828 (allout-beginning-of-current-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
|
1829 (and (looking-at allout-regexp) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1830 (allout-prefix-data (match-beginning 0) (match-end 0))))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1831 ;;;_ > allout-on-heading-p () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1832 (defalias 'allout-on-heading-p 'allout-on-current-heading-p) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1833 ;;;_ > allout-e-o-prefix-p () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1834 (defun allout-e-o-prefix-p () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1835 "True if point is located where current topic prefix ends, heading begins." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1836 (and (save-excursion (beginning-of-line) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1837 (looking-at allout-regexp)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1838 (= (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
|
1839 ;;;_ : 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
|
1840 ;;;_ > allout-depth () |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1841 (defun allout-depth () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1842 "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
|
1843 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1844 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
|
1845 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1846 Like `allout-current-depth', but respects hidden as well as visible topics." |
29490 | 1847 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1848 (let ((start-point (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1849 (if (and (allout-goto-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1850 (not (< start-point (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1851 (allout-recent-depth) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1852 (progn |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1853 ;; Oops, no prefix, zero prefix data: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1854 (allout-prefix-data (point)(point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1855 ;; ... and return 0: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1856 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
|
1857 ;;;_ > allout-current-depth () |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1858 (defun allout-current-depth () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1859 "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
|
1860 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1861 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
|
1862 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1863 (if (allout-back-to-current-heading) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1864 (max 1 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1865 (- allout-recent-prefix-end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1866 allout-recent-prefix-beginning |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1867 allout-header-subtraction)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1868 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
|
1869 ;;;_ > 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
|
1870 (defun allout-get-current-prefix () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1871 "Topic prefix of the current topic." |
3430 | 1872 (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
|
1873 (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
|
1874 (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
|
1875 ;;;_ > 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
|
1876 (defun allout-get-bullet () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1877 "Return bullet of containing topic (visible or not)." |
3430 | 1878 (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
|
1879 (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
|
1880 (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
|
1881 ;;;_ > 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
|
1882 (defun allout-current-bullet () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1883 "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
|
1884 (condition-case nil |
3430 | 1885 (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
|
1886 (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
|
1887 (buffer-substring (- allout-recent-prefix-end 1) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1888 allout-recent-prefix-end)) |
3430 | 1889 ;; Quick and dirty provision, ostensibly for missing bullet: |
29490 | 1890 ('args-out-of-range nil)) |
3430 | 1891 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1892 ;;;_ > 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
|
1893 (defun allout-get-prefix-bullet (prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1894 "Return the bullet of the header prefix string PREFIX." |
3430 | 1895 ;; Doesn't make sense if we're old-style prefixes, but this just |
1896 ;; 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
|
1897 (if (string-match allout-regexp prefix) |
3430 | 1898 (substring prefix (1- (match-end 0)) (match-end 0)))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1899 ;;;_ > 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
|
1900 (defun allout-sibling-index (&optional depth) |
29490 | 1901 "Item number of this prospective topic among its siblings. |
1902 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1903 If optional arg DEPTH is greater than current depth, then we're |
29490 | 1904 opening a new level, and return 0. |
1905 | |
1906 If less than this depth, ascend to that depth and count..." | |
1907 | |
1908 (save-excursion | |
1909 (cond ((and depth (<= depth 0) 0)) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1910 ((or (not depth) (= depth (allout-depth))) |
29490 | 1911 (let ((index 1)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1912 (while (allout-previous-sibling (allout-recent-depth) nil) |
29490 | 1913 (setq index (1+ index))) |
1914 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
|
1915 ((< depth (allout-recent-depth)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1916 (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
|
1917 (allout-sibling-index)) |
29490 | 1918 (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
|
1919 ;;;_ > 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
|
1920 (defun allout-topic-flat-index () |
29490 | 1921 "Return a list indicating point's numeric section.subsect.subsubsect... |
1922 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
|
1923 (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
|
1924 (next-index (allout-sibling-index depth)) |
29490 | 1925 (rev-sibls nil)) |
1926 (while (> next-index 0) | |
1927 (setq rev-sibls (cons next-index rev-sibls)) | |
1928 (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
|
1929 (setq next-index (allout-sibling-index depth))) |
29490 | 1930 rev-sibls) |
1931 ) | |
3430 | 1932 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1933 ;;;_ - Navigation routines |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1934 ;;;_ > allout-beginning-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1935 (defun allout-beginning-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1936 "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
|
1937 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1938 ;; XXX We would use `(move-beginning-of-line 1)', but it gets |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1939 ;; stuck on some hidden newlines, eg at column 80, as of GNU Emacs 22.0.50. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1940 ;; Conversely, `beginning-of-line' can make no progress in other |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1941 ;; situations. Both are necessary, in the order used below. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1942 (move-beginning-of-line 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1943 (beginning-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1944 (while (or (not (bolp)) (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1945 (beginning-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1946 (if (or (allout-hidden-p) (not (bolp))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1947 (forward-char -1)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1948 ;;;_ > allout-end-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1949 (defun allout-end-of-current-line () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1950 "Move to the end of line, past concealed text if any." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1951 ;; XXX This is for symmetry with `allout-beginning-of-current-line' - |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1952 ;; `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
|
1953 ;; `move-beginning-of-line'. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1954 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1955 (while (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1956 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1957 (if (allout-hidden-p) (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
|
1958 ;;;_ > 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
|
1959 (defsubst allout-next-heading () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1960 "Move to the heading for the topic \(possibly invisible) before this one. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1961 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1962 Returns the location of the heading, or nil if none found." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1963 |
29490 | 1964 (if (and (bobp) (not (eobp))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1965 (forward-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1966 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1967 (if (re-search-forward allout-line-boundary-regexp nil 0) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1968 (allout-prefix-data ; Got valid location state - set vars: |
29490 | 1969 (goto-char (or (match-beginning 2) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1970 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
|
1971 (or (match-end 2) allout-recent-prefix-end)))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1972 ;;;_ > 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
|
1973 (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
|
1974 "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
|
1975 ;; 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
|
1976 ;; and usable by allout-mode. |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1977 (if (not (allout-goto-prefix)) (allout-next-heading))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1978 ;;;_ > allout-previous-heading () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1979 (defmacro allout-previous-heading () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1980 "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
|
1981 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1982 Return the location of the beginning of the heading, or nil if not found." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1983 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1984 '(if (bobp) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1985 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
|
1986 (allout-goto-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1987 (if |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1988 ;; searches are unbounded and return nil if failed: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1989 (or (re-search-backward allout-line-boundary-regexp nil 0) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1990 (looking-at allout-bob-regexp)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1991 (progn ; Got valid location state - set vars: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1992 (allout-prefix-data |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1993 (goto-char (or (match-beginning 2) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1994 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
|
1995 (or (match-end 2) allout-recent-prefix-end)))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1996 ;;;_ > allout-get-invisibility-overlay () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1997 (defun allout-get-invisibility-overlay () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
1998 "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
|
1999 (let ((overlays (overlays-at (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2000 got) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2001 (while (and overlays (not got)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2002 (if (equal (overlay-get (car overlays) 'invisible) 'allout) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2003 (setq got (car overlays)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2004 got)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2005 ;;;_ > allout-back-to-visible-text () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2006 (defun allout-back-to-visible-text () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2007 "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
|
2008 (if (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2009 (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
|
2010 (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2011 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2012 ;;;_ - Subtree Charting |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2013 ;;;_ " 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
|
2014 ;;; 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
|
2015 ;;; |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2016 ;;; Use of charts enables efficient navigation of subtrees, by |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2017 ;;; requiring only a single regexp-search based traversal, to scope |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2018 ;;; out the subtopic locations. The chart then serves as the basis |
29490 | 2019 ;;; for assessment or adjustment of the subtree, without redundant |
2020 ;;; traversal of the structure. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2021 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2022 ;;;_ > allout-chart-subtree (&optional levels orig-depth prev-depth) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2023 (defun allout-chart-subtree (&optional levels orig-depth prev-depth) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2024 "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
|
2025 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
2026 Optional argument LEVELS specifies the depth \(relative to start |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2027 depth) for the chart. Subsequent optional args are not for public |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2028 use. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2029 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2030 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
|
2031 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2032 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
|
2033 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
|
2034 for their elaborate manipulations. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2035 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2036 Topics are entered in the chart so the last one is at the car. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2037 The entry for each topic consists of an integer indicating the point |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2038 at the beginning of the topic. Charts for offspring consists of a |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2039 list containing, recursively, the charts for the respective subtopics. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2040 The chart for a topics' offspring precedes the entry for the topic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2041 itself. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2042 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2043 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
|
2044 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
|
2045 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
|
2046 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2047 (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
|
2048 chart curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2049 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2050 (if original ; Just starting? |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2051 ; Register initial settings and |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2052 ; 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
|
2053 (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
|
2054 (or prev-depth (setq prev-depth (1+ orig-depth))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2055 (allout-next-heading))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2056 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2057 ;; 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
|
2058 ;; 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
|
2059 ;; the typically quite constrained Emacs max-lisp-eval-depth. |
29490 | 2060 ;; |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2061 ;; 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
|
2062 ;; operation rather than recursing for lower levels. Bah. |
29490 | 2063 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2064 (while (and (not (eobp)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2065 ; Still within original topic? |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2066 (< 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
|
2067 (cond ((= prev-depth curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2068 ;; Register this one and move on: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2069 (setq chart (cons (point) chart)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2070 (if (and levels (<= levels 1)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2071 ;; 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
|
2072 (or (allout-next-sibling curr-depth) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2073 ;; or no more siblings - proceed to |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2074 ;; 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
|
2075 (while (and (<= curr-depth |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2076 (allout-recent-depth)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2077 (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
|
2078 (allout-next-heading))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2079 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2080 ((and (< prev-depth curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2081 (or (not levels) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2082 (> levels 0))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2083 ;; 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
|
2084 (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
|
2085 (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
|
2086 (1- levels)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2087 orig-depth |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2088 curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2089 chart)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2090 ;; ... then continue with this one. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2091 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2092 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2093 ;; ... 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
|
2094 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2095 ))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2096 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2097 (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
|
2098 ; the original level. Position |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2099 ; to the end of it: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2100 (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
|
2101 (and (= (preceding-char) ?\n) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2102 (= (aref (buffer-substring (max 1 (- (point) 3)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2103 (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2104 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2105 ?\n) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2106 (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
|
2107 (setq allout-recent-end-of-subtree (point)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2108 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2109 chart ; (nreverse chart) not necessary, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2110 ; and maybe not preferable. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2111 )) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2112 ;;;_ > 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
|
2113 (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
|
2114 "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
|
2115 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
|
2116 for an explanation of charts." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2117 (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
|
2118 (if (allout-goto-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2119 (let ((chart (list (point)))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2120 (while (allout-next-sibling) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2121 (setq chart (cons (point) chart))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2122 (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
|
2123 ;;;_ > 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
|
2124 (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
|
2125 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2126 "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
|
2127 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2128 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
|
2129 start point." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2130 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2131 (let (result here) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2132 (while (and (or (eq depth t) (> depth 0)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2133 chart) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2134 (setq here (car chart)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2135 (if (listp here) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2136 (let ((further (allout-chart-to-reveal here (or (eq depth t) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2137 (1- depth))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2138 ;; We're on the start of a subtree - recurse with it, if there's |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2139 ;; more depth to go: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2140 (if further (setq result (append further result))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2141 (setq chart (cdr chart))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2142 (goto-char here) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2143 (if (allout-hidden-p) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2144 (setq result (cons here result))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2145 (setq chart (cdr chart)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2146 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
|
2147 ;;;_ 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
|
2148 ;; (defun allout-chart-spec (chart spec &optional exposing) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2149 ;; "Not yet \(if ever) implemented. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2150 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2151 ;; 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
|
2152 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2153 ;; 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
|
2154 ;; 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
|
2155 ;; 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
|
2156 ;; 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
|
2157 ;; 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
|
2158 ;; 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
|
2159 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2160 ;; 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
|
2161 ;; 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
|
2162 ;; exposed reside. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2163 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2164 ;; - 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
|
2165 ;; 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
|
2166 ;; 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
|
2167 ;; - 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
|
2168 ;; opened. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2169 ;; - Lists signify the beginning and end points of regions that should |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2170 ;; be flagged, and the flag to employ. (For concealment: `\(\?r\)', and |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2171 ;; exposure:" |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2172 ;; (while spec |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2173 ;; (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
|
2174 ;; ) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2175 ;; ) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2176 ;; (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
|
2177 ;; ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2178 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2179 ;;;_ - 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
|
2180 ;;;_ > 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
|
2181 (defun allout-goto-prefix () |
29490 | 2182 "Put point at beginning of immediately containing outline topic. |
2183 | |
2184 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
|
2185 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2186 Not sensitive to topic visibility. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2187 |
46161
29f1f32aee5b
(outline-goto-prefix): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
44182
diff
changeset
|
2188 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
|
2189 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2190 (let (done) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2191 (while (and (not done) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2192 (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
|
2193 (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
|
2194 (if (looking-at allout-regexp) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2195 (setq done (allout-prefix-data (match-beginning 0) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2196 (match-end 0))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2197 (forward-char -1))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2198 (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
|
2199 (cond ((looking-at allout-regexp) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2200 (allout-prefix-data (match-beginning 0)(match-end 0))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2201 ((allout-next-heading)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2202 (done)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2203 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
|
2204 ;;;_ > 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
|
2205 (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
|
2206 "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
|
2207 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2208 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
|
2209 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
|
2210 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2211 (if (not (allout-goto-prefix)) |
3430 | 2212 nil |
2213 (let ((match-data (match-data))) | |
2214 (goto-char (match-end 0)) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2215 (if ignore-decorations |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2216 t |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2217 (while (looking-at "[0-9]") (forward-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2218 (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1))) |
29490 | 2219 (store-match-data match-data)) |
3430 | 2220 ;; 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
|
2221 (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
|
2222 ;;;_ > 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
|
2223 (defun allout-current-bullet-pos () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2224 "Return position of current \(visible) topic's bullet." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2225 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2226 (if (not (allout-current-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2227 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2228 (1- (match-end 0)))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2229 ;;;_ > 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
|
2230 (defun allout-back-to-current-heading () |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2231 "Move to heading line of current topic, or beginning if already on the line. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2232 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2233 Return value of point, unless we started outside of (before any) topics, |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2234 in which case we return nil." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2235 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2236 (allout-beginning-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2237 (if (or (allout-on-current-heading-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2238 (and (re-search-backward (concat "^\\(" allout-regexp "\\)") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2239 nil 'move) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2240 (progn (while (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2241 (allout-beginning-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2242 (if (not (looking-at allout-regexp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2243 (re-search-backward (concat |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2244 "^\\(" allout-regexp "\\)") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2245 nil 'move))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2246 (allout-prefix-data (match-beginning 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2247 (match-end 1))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2248 (if (interactive-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2249 (allout-end-of-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2250 (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
|
2251 ;;;_ > 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
|
2252 (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
|
2253 ;;;_ > allout-pre-next-prefix () |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2254 (defun allout-pre-next-prefix () |
3430 | 2255 "Skip forward to just before the next heading line. |
2256 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2257 Returns that character position." |
3430 | 2258 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2259 (if (re-search-forward allout-line-boundary-regexp nil 'move) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2260 (prog1 (goto-char (match-beginning 0)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2261 (allout-prefix-data (match-beginning 2)(match-end 2))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2262 ;;;_ > 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
|
2263 (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
|
2264 "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
|
2265 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2266 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
|
2267 visible topic. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2268 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2269 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
|
2270 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
|
2271 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
|
2272 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2273 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
|
2274 (interactive "P") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2275 (if current |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2276 (allout-back-to-current-heading) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2277 (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
|
2278 (let ((level (allout-recent-depth))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2279 (allout-next-heading) |
3430 | 2280 (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
|
2281 (> (allout-recent-depth) level)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2282 (allout-next-heading)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2283 (and (not (eobp)) (forward-char -1)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2284 (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
|
2285 (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
|
2286 (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
|
2287 ;;;_ > 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
|
2288 (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
|
2289 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2290 "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
|
2291 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2292 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
|
2293 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
|
2294 excluded as delimiting whitespace between topics. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2295 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2296 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
|
2297 (interactive) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2298 (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
|
2299 ;;;_ > 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
|
2300 (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
|
2301 "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
|
2302 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2303 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
|
2304 \(See `allout-mode' doc string for details of hot-spot operation.)" |
3430 | 2305 (interactive) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2306 (let ((start-point (point))) |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2307 (move-beginning-of-line 1) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2308 (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2309 (if (and (interactive-p) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2310 (= (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
|
2311 (goto-char (allout-current-bullet-pos))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2312 ;;;_ > allout-end-of-entry (&optional inclusive) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2313 (defun allout-end-of-entry (&optional inclusive) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2314 "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
|
2315 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2316 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
|
2317 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
|
2318 collapsed." |
3430 | 2319 (interactive) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2320 (allout-pre-next-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2321 (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
|
2322 (forward-char -1)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2323 (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
|
2324 ;;;_ > 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
|
2325 (defun allout-end-of-current-heading () |
29490 | 2326 (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
|
2327 (allout-beginning-of-current-entry) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2328 (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
|
2329 (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
|
2330 (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
|
2331 ;;;_ > allout-get-body-text () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2332 (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
|
2333 "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
|
2334 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2335 (allout-end-of-prefix) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2336 (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
|
2337 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2338 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2339 (let ((pre-body (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2340 (if (not pre-body) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2341 nil |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2342 (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
|
2343 (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
|
2344 (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
|
2345 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2346 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2347 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2348 ) |
3430 | 2349 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2350 ;;;_ - 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
|
2351 ;;;_ > 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
|
2352 (defun allout-ascend-to-depth (depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2353 "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
|
2354 (if (and (> depth 0)(<= depth (allout-depth))) |
3430 | 2355 (let ((last-good (point))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2356 (while (and (< depth (allout-depth)) |
3430 | 2357 (setq last-good (point)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2358 (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
|
2359 (allout-previous-heading))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2360 (if (= (allout-recent-depth) depth) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2361 (progn (goto-char allout-recent-prefix-beginning) |
3430 | 2362 depth) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2363 (goto-char last-good) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2364 nil)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2365 (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
|
2366 ;;;_ > allout-ascend () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2367 (defun allout-ascend () |
29490 | 2368 "Ascend one level, returning t if successful, nil if not." |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2369 (prog1 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2370 (if (allout-beginning-of-level) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2371 (allout-previous-heading)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2372 (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
|
2373 ;;;_ > 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
|
2374 (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
|
2375 "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
|
2376 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2377 Returning depth if successful, nil if not." |
3430 | 2378 (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
|
2379 (start-depth (allout-depth))) |
3430 | 2380 (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
|
2381 (and (> (allout-depth) 0) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2382 (not (= depth (allout-recent-depth))) ; ... not there yet |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2383 (allout-next-heading) ; ... go further |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2384 (< start-depth (allout-recent-depth)))) ; ... still in topic |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2385 (if (and (> (allout-depth) 0) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2386 (= (allout-recent-depth) depth)) |
3430 | 2387 depth |
2388 (goto-char start-point) | |
2389 nil)) | |
2390 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2391 ;;;_ > allout-up-current-level (arg &optional dont-complain) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2392 (defun allout-up-current-level (arg &optional dont-complain) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2393 "Move out ARG levels from current visible topic. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2394 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2395 Positions on heading line of containing topic. Error if unable to |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2396 ascend that far, or nil if unable to ascend but optional arg |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2397 DONT-COMPLAIN is non-nil." |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2398 (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
|
2399 (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
|
2400 (let ((present-level (allout-recent-depth)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2401 (last-good (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2402 failed) |
3430 | 2403 ;; Loop for iterating arg: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2404 (while (and (> (allout-recent-depth) 1) |
3430 | 2405 (> arg 0) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2406 (not (bobp)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2407 (not failed)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2408 (setq last-good (point)) |
3430 | 2409 ;; Loop for going back over current or greater depth: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2410 (while (and (not (< (allout-recent-depth) present-level)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2411 (or (allout-previous-visible-heading 1) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2412 (not (setq failed present-level))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2413 (setq present-level (allout-current-depth)) |
3430 | 2414 (setq arg (- arg 1))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2415 (if (or failed |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2416 (> arg 0)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2417 (progn (goto-char last-good) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2418 (if (interactive-p) (allout-end-of-prefix)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2419 (if (not dont-complain) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
2420 (error "Can't ascend past outermost level") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2421 (if (interactive-p) (allout-end-of-prefix)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2422 nil)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2423 (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
|
2424 allout-recent-prefix-beginning))) |
3430 | 2425 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2426 ;;;_ - 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
|
2427 ;;;_ > 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
|
2428 (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
|
2429 "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
|
2430 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2431 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
|
2432 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2433 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
|
2434 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2435 Return depth if successful, nil otherwise." |
3430 | 2436 |
2437 (if (and backward (bobp)) | |
2438 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
|
2439 (let ((start-depth (or depth (allout-depth))) |
3430 | 2440 (start-point (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2441 last-depth) |
3430 | 2442 (while (and (not (if backward (bobp) (eobp))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2443 (if backward (allout-previous-heading) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2444 (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
|
2445 (> (setq last-depth (allout-recent-depth)) start-depth))) |
3430 | 2446 (if (and (not (eobp)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2447 (and (> (or last-depth (allout-depth)) 0) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2448 (= (allout-recent-depth) start-depth))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2449 allout-recent-prefix-beginning |
3430 | 2450 (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
|
2451 (if depth (allout-depth) start-depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2452 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
|
2453 ;;;_ > 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
|
2454 (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
|
2455 "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
|
2456 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2457 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
|
2458 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2459 Optional BACKWARD reverses direction. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2460 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2461 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
|
2462 (allout-next-sibling depth (not backward)) |
3430 | 2463 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2464 ;;;_ > 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
|
2465 (defun allout-snug-back () |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
2466 "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
|
2467 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2468 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
|
2469 (if (or (bobp) (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2470 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2471 (forward-char -1)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2472 (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
|
2473 nil |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2474 (forward-char -1)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2475 (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
|
2476 ;;;_ > 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
|
2477 (defun allout-beginning-of-level () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2478 "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
|
2479 (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
|
2480 ;;;_ > 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
|
2481 (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
|
2482 "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
|
2483 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2484 (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
|
2485 (while (allout-previous-sibling depth nil)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2486 (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
|
2487 (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
|
2488 ;;;_ > 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
|
2489 (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
|
2490 "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
|
2491 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2492 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
|
2493 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2494 (interactive "p") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2495 (let* ((backward (if (< arg 0) (setq arg (* -1 arg)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2496 (step (if backward -1 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2497 prev got) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2498 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2499 (while (> arg 0) ; limit condition |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2500 (while (and (not (if backward (bobp)(eobp))) ; boundary condition |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2501 ;; Move, skipping over all those concealed lines: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2502 (prog1 (condition-case nil (or (line-move step) t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2503 (error nil)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2504 (allout-beginning-of-current-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
|
2505 (not (setq got (looking-at allout-regexp))))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2506 ;; 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
|
2507 (if got (setq prev got)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2508 (setq arg (1- arg))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2509 (cond (got ; Last move was to a prefix: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2510 (allout-prefix-data (match-beginning 0) (match-end 0)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2511 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2512 (prev ; Last move wasn't, but prev was: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2513 (allout-prefix-data (match-beginning 0) (match-end 0))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2514 ((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
|
2515 ;;;_ > 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
|
2516 (defun allout-previous-visible-heading (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2517 "Move to the previous heading line. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2518 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2519 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
|
2520 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
|
2521 matches)." |
3430 | 2522 (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
|
2523 (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
|
2524 ;;;_ > 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
|
2525 (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
|
2526 "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
|
2527 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2528 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
|
2529 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2530 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
|
2531 (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
|
2532 (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
|
2533 (start-arg arg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2534 (backward (> 0 arg)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2535 last-depth |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2536 (last-good (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2537 at-boundary) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2538 (if (= 0 start-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2539 (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
|
2540 (if backward (setq arg (* -1 arg))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2541 (while (not (or (zerop arg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2542 at-boundary)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2543 (while (and (not (if backward (bobp) (eobp))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2544 (if backward (allout-previous-visible-heading 1) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2545 (allout-next-visible-heading 1)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2546 (> (setq last-depth (allout-recent-depth)) start-depth))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2547 (if (and last-depth (= last-depth start-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2548 (not (if backward (bobp) (eobp)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2549 (setq last-good (point) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2550 arg (1- arg)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2551 (setq at-boundary t))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2552 (if (and (not (eobp)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2553 (= 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
|
2554 (and (> (or last-depth (allout-depth)) 0) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2555 (= (allout-recent-depth) start-depth))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2556 allout-recent-prefix-beginning |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2557 (goto-char last-good) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2558 (if (not (interactive-p)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2559 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
|
2560 (allout-end-of-prefix) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
2561 (error "Hit %s level %d topic, traversed %d of %d requested" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2562 (if backward "first" "last") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2563 (allout-recent-depth) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2564 (- (abs start-arg) arg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2565 (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
|
2566 ;;;_ > 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
|
2567 (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
|
2568 "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
|
2569 (interactive "p") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2570 (if (interactive-p) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2571 (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
|
2572 (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
|
2573 (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
|
2574 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2575 ;;;_ #5 Alteration |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2576 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2577 ;;;_ - 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
|
2578 ;;;_ = 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
|
2579 (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
|
2580 "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
|
2581 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2582 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
|
2583 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
|
2584 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
|
2585 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
|
2586 `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
|
2587 (make-variable-buffer-local 'allout-post-goto-bullet) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2588 ;;;_ > 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
|
2589 (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
|
2590 "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
|
2591 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
2592 - 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
|
2593 outline commands. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2594 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2595 - 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
|
2596 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2597 ; 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
|
2598 (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
|
2599 nil |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2600 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2601 (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
|
2602 allout-after-save-decrypt) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2603 (allout-after-saves-handler)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2604 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2605 ;; Implement -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
|
2606 (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
|
2607 (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
|
2608 (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
|
2609 (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
|
2610 )) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2611 ;;;_ > 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
|
2612 (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
|
2613 "Outline `pre-command-hook' function for outline buffers. |
49962
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
2614 Implements special behavior when cursor is on bullet character. |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
2615 |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
2616 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
|
2617 reinterpreted as the corresponding control-character in the |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
2618 `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
|
2619 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
|
2620 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
|
2621 |
29490 | 2622 The upshot is that you can get easy, single (ie, unmodified) key |
2623 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
|
2624 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
|
2625 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
|
2626 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
|
2627 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2628 (if (not (allout-mode-p)) |
29490 | 2629 nil |
2630 ;; Hot-spot navigation provisions: | |
2631 (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
|
2632 (eq (point)(allout-current-bullet-pos))) |
29490 | 2633 (let* ((this-key-num (cond |
2634 ((numberp last-command-char) | |
2635 last-command-char) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2636 ;; Only xemacs has characterp. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2637 ((and (fboundp 'characterp) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
2638 (apply 'characterp |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
2639 (list last-command-char))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
2640 (apply 'char-to-int (list last-command-char))) |
29490 | 2641 (t 0))) |
2642 mapped-binding) | |
2643 (if (zerop this-key-num) | |
2644 nil | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2645 ; Map upper-register literals |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2646 ; to lower register: |
29490 | 2647 (if (<= 96 this-key-num) |
2648 (setq this-key-num (- this-key-num 32))) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2649 ; Check if we have a literal: |
29490 | 2650 (if (and (<= 64 this-key-num) |
2651 (>= 96 this-key-num)) | |
2652 (setq mapped-binding | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2653 (lookup-key 'allout-mode-map |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2654 (concat allout-command-prefix |
29490 | 2655 (char-to-string (- this-key-num |
2656 64)))))) | |
2657 (if mapped-binding | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2658 (setq allout-post-goto-bullet t |
29490 | 2659 this-command mapped-binding))))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2660 ;;;_ > 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
|
2661 (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
|
2662 "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
|
2663 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2664 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
|
2665 (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
|
2666 (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
|
2667 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
|
2668 (allout-mode t))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2669 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2670 ;;;_ - 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
|
2671 ;;;_ > 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
|
2672 (defun allout-solicit-alternate-bullet (depth &optional current-bullet) |
3430 | 2673 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2674 "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
|
2675 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2676 Offer one suitable for current depth DEPTH as default." |
3430 | 2677 |
29490 | 2678 (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
|
2679 (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
|
2680 (sans-escapes (regexp-sans-escapes allout-bullets-string)) |
29490 | 2681 choice) |
2682 (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
|
2683 (goto-char (allout-current-bullet-pos)) |
29490 | 2684 (setq choice (solicit-char-in-string |
2685 (format "Select bullet: %s ('%s' default): " | |
2686 sans-escapes | |
2687 default-bullet) | |
2688 sans-escapes | |
2689 t))) | |
2690 (message "") | |
3430 | 2691 (if (string= choice "") default-bullet choice)) |
2692 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2693 ;;;_ > 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
|
2694 (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
|
2695 "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
|
2696 (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
|
2697 ;;;_ > 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
|
2698 (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
|
2699 "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
|
2700 (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
|
2701 (string= allout-numbered-bullet |
3430 | 2702 (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
|
2703 (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
|
2704 (allout-get-bullet))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2705 ;;;_ > 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
|
2706 (defun 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
|
2707 "True if current header prefix bullet is for an encrypted entry \(body)." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2708 (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
|
2709 (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
|
2710 (if prefix |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2711 (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
|
2712 (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
|
2713 ;;;_ > 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
|
2714 (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
|
2715 "Return outline topic bullet suited to optional DEPTH, or current depth." |
3430 | 2716 ;; 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
|
2717 (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
|
2718 (char-to-string (aref allout-plain-bullets-string |
3430 | 2719 (% (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
|
2720 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
|
2721 allout-primary-bullet) |
3430 | 2722 ) |
2723 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2724 ;;;_ - 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
|
2725 ;;;_ > 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
|
2726 (defun allout-make-topic-prefix (&optional prior-bullet |
3430 | 2727 new |
2728 depth | |
2729 solicit | |
2730 number-control | |
2731 index) | |
2732 ;; Depth null means use current depth, non-null means we're either | |
2733 ;; opening a new topic after current topic, lower or higher, or we're | |
2734 ;; changing level of current topic. | |
2735 ;; Solicit dominates specified bullet-char. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2736 ;;;_ . Doc string: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2737 "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
|
2738 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2739 All the arguments are optional. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2740 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2741 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
|
2742 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
|
2743 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
|
2744 for instance. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2745 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2746 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
|
2747 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
|
2748 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
|
2749 sibling is one. The implication otherwise is that the current topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2750 is being adjusted - shifted or rebulleted - and we don't consider |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2751 bullet or previous sibling. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2752 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2753 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
|
2754 the current topics' depth. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2755 |
29490 | 2756 If SOLICIT is non-nil, then the choice of bullet is solicited from |
2757 user. If it's a character, then that character is offered as the | |
2758 default, otherwise the one suited to the context \(according to | |
2759 distinction or depth) is offered. \(This overrides other options, | |
2760 including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the | |
2761 context-specific bullet is used. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2762 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2763 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
|
2764 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
|
2765 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
|
2766 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
|
2767 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2768 \(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
|
2769 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2770 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
|
2771 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
|
2772 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
|
2773 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
|
2774 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
|
2775 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
|
2776 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
|
2777 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
|
2778 index for each successive sibling)." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2779 ;;;_ . Code: |
3430 | 2780 ;; The options are ordered in likely frequence of use, most common |
2781 ;; highest, least lowest. Ie, more likely to be doing prefix | |
2782 ;; adjustments than soliciting, and yet more than numbering. | |
2783 ;; Current prefix is least dominant, but most likely to be commonly | |
2784 ;; specified... | |
2785 | |
2786 (let* (body | |
2787 numbering | |
2788 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
|
2789 (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
|
2790 (header-lead allout-header-prefix) |
3430 | 2791 (bullet-char |
2792 | |
2793 ;; Getting value for bullet char is practically the whole job: | |
2794 | |
2795 (cond | |
2796 ; 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
|
2797 ((<= depth 1) (setq header-lead "") allout-primary-bullet) |
3430 | 2798 ; 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
|
2799 (allout-old-style-prefixes |
3430 | 2800 ;; Cheat - make body the whole thing, null out header-lead and |
2801 ;; bullet-char: | |
2802 (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
|
2803 (string-to-char allout-primary-bullet))) |
3430 | 2804 (setq header-lead "") |
2805 "") | |
2806 | |
2807 ;; (Neither level 1 nor old-style, so we're space padding. | |
2808 ;; Sneak it in the condition of the next case, whatever it is.) | |
2809 | |
2810 ;; Solicitation overrides numbering and other cases: | |
2811 ((progn (setq body (make-string (- depth 2) ?\ )) | |
2812 ;; The actual condition: | |
2813 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
|
2814 (let* ((got (allout-solicit-alternate-bullet depth solicit))) |
3430 | 2815 ;; 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
|
2816 (setq numbering (and allout-numbered-bullet |
3430 | 2817 (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
|
2818 (string= got allout-numbered-bullet))) |
3430 | 2819 ;; Now return what we got, regardless: |
2820 got)) | |
2821 | |
2822 ;; 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
|
2823 ((and allout-numbered-bullet number-control) |
3430 | 2824 (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
|
2825 allout-numbered-bullet |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2826 (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
|
2827 (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
|
2828 prior-bullet))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2829 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
|
2830 (allout-bullet-for-depth depth)))) |
3430 | 2831 |
2832 ;;; Neither soliciting nor controlled numbering ;;; | |
2833 ;;; (may be controlled denumbering, tho) ;;; | |
2834 | |
2835 ;; Check wrt previous sibling: | |
2836 ((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
|
2837 (<= 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
|
2838 allout-numbered-bullet ; ... & numbering enabled |
3430 | 2839 (not denumbering) |
2840 (let ((sibling-bullet | |
2841 (save-excursion | |
2842 ;; 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
|
2843 (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
|
2844 (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
|
2845 (allout-get-bullet)))) |
3430 | 2846 (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
|
2847 (string= allout-numbered-bullet sibling-bullet)) |
3430 | 2848 (setq numbering sibling-bullet))))) |
2849 | |
2850 ;; Distinctive prior bullet? | |
2851 ((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
|
2852 (allout-distinctive-bullet prior-bullet) |
3430 | 2853 ;; 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
|
2854 (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
|
2855 (string= prior-bullet allout-numbered-bullet))) |
3430 | 2856 ;; or numbered, and not denumbering: |
2857 (setq numbering (not denumbering))) | |
2858 ;; Here 'tis: | |
2859 prior-bullet)) | |
2860 | |
2861 ;; 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
|
2862 ((allout-bullet-for-depth depth))))) |
3430 | 2863 |
2864 (concat header-lead | |
2865 body | |
2866 bullet-char | |
2867 (if numbering | |
2868 (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
|
2869 (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
|
2870 ((allout-sibling-index)))))) |
3430 | 2871 ) |
2872 ) | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2873 ;;;_ > 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
|
2874 (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
|
2875 "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
|
2876 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2877 New topic is situated after current one, unless optional flag BEFORE |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2878 is non-nil, or unless current line is completely empty - lacking even |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2879 whitespace - in which case open is done on the current line. |
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 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
|
2882 the other offspring are exposed, or after the last child if the offspring |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2883 are hidden. \(The intervening offspring will be exposed in the latter |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2884 case.) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2885 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2886 If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. |
29490 | 2887 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2888 Nuances: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2889 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2890 - 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
|
2891 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
|
2892 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2893 - 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
|
2894 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
|
2895 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
|
2896 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
|
2897 deliberately dividing topic bodies. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2898 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2899 - 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
|
2900 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
|
2901 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
|
2902 single-spacing is used. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2903 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2904 - 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
|
2905 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
|
2906 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
|
2907 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
|
2908 from there." |
3430 | 2909 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2910 (allout-beginning-of-current-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
|
2911 (let* ((depth (+ (allout-current-depth) relative-depth)) |
3430 | 2912 (opening-on-blank (if (looking-at "^\$") |
2913 (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
|
2914 ;; 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
|
2915 opening-numbered |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2916 ref-depth |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2917 ref-bullet |
3430 | 2918 (ref-topic (save-excursion |
2919 (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
|
2920 (allout-ascend-to-depth depth)) |
3430 | 2921 ((>= 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
|
2922 (t (allout-back-to-current-heading))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2923 (setq ref-depth (allout-recent-depth)) |
29490 | 2924 (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
|
2925 (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
|
2926 (allout-recent-bullet) |
29490 | 2927 "")) |
3430 | 2928 (setq opening-numbered |
2929 (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
|
2930 (and allout-numbered-bullet |
3430 | 2931 (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
|
2932 (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
|
2933 (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
|
2934 allout-numbered-bullet)))) |
3430 | 2935 (point))) |
2936 dbl-space | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2937 doing-beginning) |
3430 | 2938 |
2939 (if (not opening-on-blank) | |
2940 ; Positioning and vertical | |
2941 ; padding - only if not | |
2942 ; opening-on-blank: | |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2943 (progn |
3430 | 2944 (goto-char ref-topic) |
2945 (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
|
2946 (or (and (<= relative-depth 0) ; not descending; |
3430 | 2947 (save-excursion |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
2948 ;; 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
|
2949 (or (> 0 (forward-line -1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2950 (looking-at "^\\s-*$") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2951 (bobp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2952 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2953 ;; 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
|
2954 (allout-end-of-current-subtree) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2955 (looking-at "\n\n"))) |
3430 | 2956 (and (= ref-depth 1) |
2957 (or before | |
2958 (= depth 1) | |
2959 (save-excursion | |
2960 ;; Don't already have following | |
2961 ;; vertical padding: | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2962 (not (allout-pre-next-prefix))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2963 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2964 ;; 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
|
2965 ;; going outwards: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2966 (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
|
2967 (progn (allout-back-to-current-heading) |
3430 | 2968 (setq doing-beginning (bobp)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2969 (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
|
2970 (allout-previous-heading))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2971 (if (and before (bobp)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2972 (open-line 1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2973 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2974 (if (<= relative-depth 0) |
3430 | 2975 ;; Not going inwards, don't snug up: |
2976 (if doing-beginning | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2977 (if (not dbl-space) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2978 (open-line 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2979 (open-line 2)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2980 (if before |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2981 (progn (end-of-line) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2982 (allout-pre-next-prefix) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2983 (while (and (= ?\n (following-char)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2984 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2985 (forward-char 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2986 (allout-hidden-p))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2987 (forward-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2988 (if (not (looking-at "^$")) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2989 (open-line 1))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2990 (allout-end-of-current-subtree) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2991 (if (looking-at "\n\n") (forward-char 1)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2992 ;; Going inwards - double-space if first offspring is |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2993 ;; double-spaced, otherwise snug up. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2994 (allout-end-of-entry) |
69250
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2995 (if (eobp) |
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2996 (newline 1) |
85c3b33d6427
Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents:
69124
diff
changeset
|
2997 (line-move 1)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2998 (allout-beginning-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
2999 (backward-char 1) |
3430 | 3000 (if (bolp) |
3001 ;; Blank lines between current header body and next | |
3002 ;; header - get to last substantive (non-white-space) | |
3003 ;; line in body: | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3004 (progn (setq dbl-space t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3005 (re-search-backward "[^ \t\n]" nil t))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3006 (if (looking-at "\n\n") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3007 (setq dbl-space t)) |
3430 | 3008 (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
|
3009 (allout-next-heading) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3010 (when (> (allout-recent-depth) ref-depth) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3011 ;; This is an offspring. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3012 (forward-line -1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3013 (looking-at "^\\s-*$"))) |
3430 | 3014 (progn (forward-line 1) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3015 (open-line 1) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3016 (forward-line 1))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3017 (allout-end-of-current-line)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3018 |
3430 | 3019 ;;(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
|
3020 (if (not (bobp)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3021 ;; 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
|
3022 ;; 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
|
3023 (progn (if (and (not (> depth ref-depth)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3024 (not before)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3025 (open-line 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3026 (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
|
3027 (newline 1) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3028 (if dbl-space |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3029 (open-line 1) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3030 (if (not before) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3031 (newline 1))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3032 (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
|
3033 (newline 1)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3034 (if (and (not (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3035 (not (bolp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3036 (forward-char 1)))) |
3430 | 3037 )) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3038 (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
|
3039 " ")) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3040 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3041 (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
|
3042 depth nil nil t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3043 (if (> relative-depth 0) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3044 (save-excursion (goto-char ref-topic) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3045 (allout-show-children))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3046 (end-of-line) |
3430 | 3047 ) |
3048 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3049 ;;;_ > 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
|
3050 (defun allout-open-subtopic (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3051 "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
|
3052 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3053 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
|
3054 prior to the current one." |
3430 | 3055 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3056 (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
|
3057 ;;;_ > 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
|
3058 (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
|
3059 "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
|
3060 |
29490 | 3061 Positive universal arg means to use the bullet of the prior sibling. |
3062 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3063 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
|
3064 one." |
3430 | 3065 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3066 (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
|
3067 ;;;_ > 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
|
3068 (defun allout-open-supertopic (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3069 "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
|
3070 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3071 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
|
3072 topic prior to the current one." |
3430 | 3073 |
3074 (interactive "p") | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3075 (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
|
3076 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3077 ;;;_ - Outline Alteration |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3078 ;;;_ : 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
|
3079 ;;;_ = 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
|
3080 (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
|
3081 "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
|
3082 ;;;_ > 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
|
3083 (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
|
3084 "`allout-mode' autofill function. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3085 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3086 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
|
3087 `allout-use-hanging-indents' is set." |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3088 (let ((fill-prefix (if allout-use-hanging-indents |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3089 ;; Check for topic header indentation: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3090 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3091 (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
|
3092 (if (looking-at allout-regexp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3093 ;; ... construct indentation to account for |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3094 ;; length of topic prefix: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3095 (make-string (progn (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3096 (current-column)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3097 ?\ ))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3098 (use-auto-fill-function (or allout-outside-normal-auto-fill-function |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3099 auto-fill-function |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3100 'do-auto-fill))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3101 (if (or allout-former-auto-filler allout-use-hanging-indents) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3102 (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
|
3103 ;;;_ > 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
|
3104 (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
|
3105 "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
|
3106 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3107 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
|
3108 be accommodated. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3109 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3110 Note that refill of indented paragraphs is not done." |
3430 | 3111 |
3112 (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
|
3113 (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3114 (let* ((new-margin (current-column)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3115 excess old-indent-begin old-indent-end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3116 ;; 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
|
3117 ;; *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
|
3118 ;; 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
|
3119 (old-margin (+ old-depth (- new-margin new-depth)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3120 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3121 ;; 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
|
3122 (allout-unprotected |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3123 (save-match-data |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3124 (while |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3125 (and (re-search-forward "\n\\(\\s-*\\)" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3126 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3127 t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3128 ;; Register the indent data, before we reset the |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3129 ;; 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
|
3130 (setq old-indent-begin (match-beginning 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3131 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
|
3132 (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
|
3133 (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
|
3134 old-margin))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3135 ;; Text starts left of old margin - don't adjust: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3136 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3137 ;; Text was hanging at or right of old left margin - |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3138 ;; reindent it, preserving its existing indentation |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3139 ;; beyond the old margin: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3140 (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
|
3141 (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
|
3142 ;;;_ > 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
|
3143 (defun allout-rebullet-current-heading (arg) |
29490 | 3144 "Solicit new bullet for current visible heading." |
3145 (interactive "p") | |
3146 (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
|
3147 (on-bullet (eq (point)(allout-current-bullet-pos))) |
29490 | 3148 (backwards (if (< arg 0) |
3149 (setq arg (* arg -1))))) | |
3150 (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
|
3151 (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
|
3152 (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
|
3153 (allout-rebullet-heading t ;;; solicit |
29490 | 3154 nil ;;; depth |
3155 nil ;;; number-control | |
3156 nil ;;; index | |
3157 t)) ;;; do-successors | |
3158 (setq arg (1- arg)) | |
3159 (if (<= arg 0) | |
3160 nil | |
3161 (setq initial-col nil) ; Override positioning back to init col | |
3162 (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
|
3163 (allout-next-visible-heading 1) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3164 (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
|
3165 (allout-next-visible-heading -1)))) |
29490 | 3166 (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
|
3167 (cond (on-bullet (goto-char (allout-current-bullet-pos))) |
29490 | 3168 (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
|
3169 ;;;_ > 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
|
3170 (defun allout-rebullet-heading (&optional solicit |
3430 | 3171 new-depth |
3172 number-control | |
3173 index | |
3174 do-successors) | |
3175 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3176 "Adjust bullet of current topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3177 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3178 All args are optional. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3179 |
29490 | 3180 If SOLICIT is non-nil, then the choice of bullet is solicited from |
3181 user. If it's a character, then that character is offered as the | |
3182 default, otherwise the one suited to the context \(according to | |
3183 distinction or depth) is offered. If non-nil, then the | |
3184 context-specific bullet is just used. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3185 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3186 Second arg DEPTH forces the topic prefix to that depth, regardless |
29490 | 3187 of the topic's current depth. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3188 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3189 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
|
3190 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
|
3191 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
|
3192 Its effect, numbering or denumbering, then depends on the setting |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3193 of the forth arg, INDEX. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3194 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3195 If NUMBER-CONTROL is non-nil and forth arg INDEX is nil, then the |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3196 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
|
3197 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
|
3198 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
|
3199 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
|
3200 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
|
3201 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
|
3202 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3203 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
|
3204 siblings. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3205 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3206 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
|
3207 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
|
3208 this function." |
3430 | 3209 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3210 (let* ((current-depth (allout-depth)) |
3430 | 3211 (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
|
3212 (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
|
3213 (me allout-recent-prefix-end) |
3430 | 3214 (current-bullet (buffer-substring (- me 1) me)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3215 (new-prefix (allout-make-topic-prefix current-bullet |
3430 | 3216 nil |
3217 new-depth | |
3218 solicit | |
3219 number-control | |
3220 index))) | |
3221 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3222 ;; Is new one is identical to old? |
3430 | 3223 (if (and (= current-depth new-depth) |
3224 (string= current-bullet | |
3225 (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
|
3226 ;; Nothing to do: |
3430 | 3227 t |
3228 | |
3229 ;; New prefix probably different from old: | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3230 ; 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
|
3231 (allout-unprotected (delete-region mb me)) |
3430 | 3232 (goto-char mb) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3233 ; Dispense with number if |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3234 ; 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
|
3235 (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
|
3236 (string= allout-numbered-bullet current-bullet) |
3430 | 3237 (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
|
3238 (allout-unprotected |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3239 (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
|
3240 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3241 ; 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
|
3242 (allout-unprotected (insert new-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3243 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3244 ;; 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
|
3245 (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
|
3246 (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
|
3247 (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
|
3248 (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
|
3249 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3250 ;; 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
|
3251 ;; caller elected for it: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3252 (if do-successors |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3253 (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
|
3254 (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
|
3255 (setq index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3256 (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
|
3257 ((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
|
3258 (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
|
3259 (allout-rebullet-heading nil ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3260 new-depth ;;; new-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3261 number-control;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3262 index ;;; index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3263 nil))))) ;;;(dont!)do-successors |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3264 ) ; (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
|
3265 ) ; let* ((current-depth (allout-depth))...) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3266 ) ; 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
|
3267 ;;;_ > allout-rebullet-topic (arg) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3268 (defun allout-rebullet-topic (arg) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3269 "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
|
3270 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3271 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
|
3272 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3273 With repeat count, shift topic depth by that amount." |
3430 | 3274 (interactive "P") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3275 (let ((start-col (current-column))) |
3430 | 3276 (save-excursion |
3277 ;; Normalize arg: | |
3278 (cond ((null arg) (setq arg 0)) | |
3279 ((listp arg) (setq arg (car arg)))) | |
3280 ;; Fill the user in, in case we're shifting a big topic: | |
3281 (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
|
3282 (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
|
3283 (if (<= (+ (allout-recent-depth) arg) 0) |
3430 | 3284 (error "Attempt to shift topic below level 1")) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3285 (allout-rebullet-topic-grunt arg) |
3430 | 3286 (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
|
3287 (move-to-column (max 0 (+ start-col arg))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3288 ;;;_ > allout-rebullet-topic-grunt (&optional relative-depth ...) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3289 (defun allout-rebullet-topic-grunt (&optional relative-depth |
3430 | 3290 starting-depth |
3291 starting-point | |
3292 index | |
3293 do-successors) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3294 "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
|
3295 \(visible or not). |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3296 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3297 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
|
3298 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3299 All arguments are optional. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3300 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3301 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
|
3302 topic that amount. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3303 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3304 The rest of the args are for internal recursive use by the function |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3305 itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." |
3430 | 3306 |
3307 (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
|
3308 (new-depth (allout-depth)) |
3430 | 3309 (starting-depth (or starting-depth new-depth)) |
3310 (on-starting-call (null starting-point)) | |
3311 (index (or index | |
3312 ;; Leave index null on starting call, so rebullet-heading | |
3313 ;; calculates it at what might be new depth: | |
3314 (and (or (zerop relative-depth) | |
3315 (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
|
3316 (allout-sibling-index)))) |
3430 | 3317 (moving-outwards (< 0 relative-depth)) |
3318 (starting-point (or starting-point (point)))) | |
3319 | |
3320 ;; Sanity check for excessive promotion done only on starting call: | |
3321 (and on-starting-call | |
3322 moving-outwards | |
3323 (> 0 (+ starting-depth relative-depth)) | |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
3324 (error "Attempt to shift topic out beyond level 1")) ;;; ====> |
3430 | 3325 |
3326 (cond ((= starting-depth new-depth) | |
3327 ;; We're at depth to work on this one: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3328 (allout-rebullet-heading nil ;;; solicit |
3430 | 3329 (+ starting-depth ;;; starting-depth |
3330 relative-depth) | |
3331 nil ;;; number | |
3332 index ;;; index | |
3333 ;; Every contained topic will get hit, | |
3334 ;; and we have to get to outside ones | |
3335 ;; deliberately: | |
3336 nil) ;;; do-successors | |
3337 ;; ... and work on subsequent ones which are at greater depth: | |
3338 (setq index 0) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3339 (allout-next-heading) |
3430 | 3340 (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
|
3341 (< starting-depth (allout-recent-depth))) |
3430 | 3342 (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
|
3343 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth |
3430 | 3344 (1+ starting-depth);;;starting-depth |
3345 starting-point ;;; starting-point | |
3346 index))) ;;; index | |
3347 | |
3348 ((< starting-depth new-depth) | |
3349 ;; Rare case - subtopic more than one level deeper than parent. | |
3350 ;; Treat this one at an even deeper level: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3351 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth |
3430 | 3352 new-depth ;;; starting-depth |
3353 starting-point ;;; starting-point | |
3354 index))) ;;; index | |
3355 | |
3356 (if on-starting-call | |
3357 (progn | |
3358 ;; Rectify numbering of former siblings of the adjusted topic, | |
3359 ;; if topic has changed depth | |
3360 (if (or do-successors | |
3361 (and (not (zerop relative-depth)) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3362 (or (= (allout-recent-depth) starting-depth) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3363 (= (allout-recent-depth) (+ starting-depth |
3430 | 3364 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
|
3365 (allout-rebullet-heading nil nil nil nil t)) |
3430 | 3366 ;; Now rectify numbering of new siblings of the adjusted topic, |
3367 ;; if depth has been changed: | |
3368 (progn (goto-char starting-point) | |
3369 (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
|
3370 (allout-rebullet-heading nil nil nil nil t))))) |
3430 | 3371 ) |
3372 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3373 ;;;_ > 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
|
3374 (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
|
3375 "Renumber siblings at current depth. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3376 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3377 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
|
3378 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3379 Returns final depth." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3380 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3381 ;; 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
|
3382 ;; 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
|
3383 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3384 (let ((ascender (allout-depth)) |
29490 | 3385 was-eobp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3386 (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
|
3387 (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
|
3388 (>= (allout-recent-depth) depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3389 (>= ascender depth)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3390 ; Skip over all topics at |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3391 ; lesser depths, which can not |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3392 ; have been disturbed: |
29490 | 3393 (while (and (not (setq was-eobp (eobp))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3394 (> (allout-recent-depth) ascender)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3395 (allout-next-heading)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3396 ; Prime ascender for ascension: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3397 (setq ascender (1- (allout-recent-depth))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3398 (if (>= (allout-recent-depth) depth) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3399 (allout-rebullet-heading nil ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3400 nil ;;; depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3401 nil ;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3402 nil ;;; index |
29490 | 3403 t)) ;;; do-successors |
3404 (if was-eobp (goto-char (point-max))))) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3405 (allout-recent-depth)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3406 ;;;_ > 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
|
3407 (defun allout-number-siblings (&optional denumber) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3408 "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
|
3409 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3410 With universal argument, denumber - assign default bullet to this |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3411 topic and its siblings. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3412 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3413 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
|
3414 rebulleting each topic at this level." |
3430 | 3415 |
3416 (interactive "P") | |
3417 | |
3418 (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
|
3419 (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
|
3420 (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
|
3421 (let ((depth (allout-recent-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3422 (index (if (not denumber) 1)) |
3430 | 3423 (use-bullet (equal '(16) denumber)) |
3424 (more t)) | |
3425 (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
|
3426 (allout-rebullet-heading use-bullet ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3427 depth ;;; depth |
3430 | 3428 t ;;; number-control |
3429 index ;;; index | |
3430 nil) ;;; do-successors | |
3431 (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
|
3432 (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
|
3433 ;;;_ > 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
|
3434 (defun allout-shift-in (arg) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3435 "Increase depth of current heading and any topics collapsed within it. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3436 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3437 We disallow shifts that would result in the topic having a depth more than |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3438 one level greater than the immediately previous topic, to avoid containment |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3439 discontinuity. The first topic in the file can be adjusted to any positive |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3440 depth, however." |
3430 | 3441 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3442 (if (> arg 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3443 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3444 (allout-back-to-current-heading) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3445 (if (not (bobp)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3446 (let* ((current-depth (allout-recent-depth)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3447 (start-point (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3448 (predecessor-depth (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3449 (forward-char -1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3450 (allout-goto-prefix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3451 (if (< (point) start-point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3452 (allout-recent-depth) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3453 0)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3454 (if (and (> predecessor-depth 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3455 (> (+ current-depth arg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3456 (1+ predecessor-depth))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3457 (error (concat "Disallowed shift deeper than" |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3458 " containing topic's children."))))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3459 (allout-rebullet-topic arg)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3460 ;;;_ > 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
|
3461 (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
|
3462 "Decrease depth of current heading and any topics collapsed within it. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3463 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3464 We disallow shifts that would result in the topic having a depth more than |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3465 one level greater than the immediately previous topic, to avoid containment |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3466 discontinuity. The first topic in the file can be adjusted to any positive |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3467 depth, however." |
3430 | 3468 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3469 (if (< arg 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3470 (allout-shift-in (* arg -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
|
3471 (allout-rebullet-topic (* arg -1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3472 ;;;_ : 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
|
3473 ;;;_ > 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
|
3474 (defun allout-kill-line (&optional arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3475 "Kill line, adjusting subsequent lines suitably for outline mode." |
3430 | 3476 |
3477 (interactive "*P") | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3478 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3479 (if (or (not (allout-mode-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3480 (not (bolp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3481 (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
|
3482 ;; Just do a regular kill: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3483 (kill-line arg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3484 ;; Ah, have to watch out for adjustments: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3485 (let* ((beg (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3486 (beg-hidden (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3487 (end-hidden (save-excursion (allout-end-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3488 (allout-hidden-p))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3489 (depth (allout-depth)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3490 (collapsed (allout-current-topic-collapsed-p))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3491 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3492 (if collapsed |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3493 (put-text-property beg (1+ beg) 'allout-was-collapsed t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3494 (remove-text-properties beg (1+ beg) '(allout-was-collapsed t))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3495 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3496 (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
|
3497 (allout-unprotected (kill-line arg)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3498 (kill-line arg)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3499 ; Provide some feedback: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3500 (sit-for 0) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3501 (if allout-numbered-bullet |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3502 (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
|
3503 (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
|
3504 (allout-next-heading)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3505 (allout-renumber-to-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
|
3506 ;;;_ > 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
|
3507 (defun allout-kill-topic () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3508 "Kill topic together with subtopics. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3509 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3510 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
|
3511 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3512 - 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
|
3513 - 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
|
3514 - 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
|
3515 previous one. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3516 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3517 Completely collapsed topics are marked as such, for re-collapse |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3518 when yank with allout-yank into an outline as a heading." |
3430 | 3519 |
3520 ;; Some finagling is done to make complex topic kills appear faster | |
3521 ;; than they actually are. A redisplay is performed immediately | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3522 ;; after the region is deleted, though the renumbering process |
3430 | 3523 ;; has yet to be performed. This means that there may appear to be |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3524 ;; a lag *after* a kill has been performed. |
3430 | 3525 |
3526 (interactive) | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3527 (let* ((collapsed (allout-current-topic-collapsed-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3528 (beg (prog1 (allout-back-to-current-heading) (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
|
3529 (depth (allout-recent-depth))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3530 (allout-end-of-current-subtree) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3531 (if (and (/= (current-column) 0) (not (eobp))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3532 (forward-char 1)) |
3430 | 3533 (if (not (eobp)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3534 (if (and (looking-at "\n") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3535 (or (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3536 (or (not (allout-next-heading)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3537 (= depth (allout-recent-depth)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3538 (and (> (- beg (point-min)) 3) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3539 (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
|
3540 (forward-char 1))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3541 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3542 (if collapsed |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3543 (put-text-property beg (1+ beg) 'allout-was-collapsed t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3544 (remove-text-properties beg (1+ beg) '(allout-was-collapsed t))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3545 (allout-unprotected (kill-region beg (point))) |
3430 | 3546 (sit-for 0) |
3547 (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
|
3548 (allout-renumber-to-depth depth)))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3549 ;;;_ > 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
|
3550 (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
|
3551 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3552 "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
|
3553 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3554 Does depth adjustment of yanked topics, when: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3555 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3556 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
|
3557 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
|
3558 topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3559 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3560 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
|
3561 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3562 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
|
3563 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
|
3564 header into which it's being yanked. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3565 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3566 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
|
3567 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
|
3568 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
|
3569 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3570 (interactive "*P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3571 ; Get to beginning, leaving |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3572 ; region around subject: |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3573 (if (< (allout-mark-marker t) (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3574 (exchange-point-and-mark)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3575 (let* ((subj-beg (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3576 (into-bol (bolp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3577 (subj-end (allout-mark-marker t)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3578 (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) |
29490 | 3579 ;; 'resituate' if yanking an entire topic into topic header: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3580 (resituate (and (allout-e-o-prefix-p) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3581 (looking-at (concat "\\(" allout-regexp "\\)")) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3582 (allout-prefix-data (match-beginning 1) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3583 (match-end 1)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3584 ;; `rectify-numbering' if resituating (where several topics may |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3585 ;; be resituating) or yanking a topic into a topic slot (bol): |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3586 (rectify-numbering (or resituate |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3587 (and into-bol (looking-at allout-regexp))))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3588 (if resituate |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3589 ; The yanked stuff is a topic: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3590 (let* ((prefix-len (- (match-end 1) subj-beg)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3591 (subj-depth (allout-recent-depth)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3592 (prefix-bullet (allout-recent-bullet)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3593 (adjust-to-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3594 ;; Nil if adjustment unnecessary, otherwise depth to which |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3595 ;; adjustment should be made: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3596 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3597 (and (goto-char subj-end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3598 (eolp) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3599 (goto-char subj-beg) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3600 (and (looking-at allout-regexp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3601 (progn |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3602 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3603 (not (= (point) subj-beg))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3604 (looking-at allout-regexp) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3605 (allout-prefix-data (match-beginning 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3606 (match-end 0))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3607 (allout-recent-depth)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3608 (more t)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3609 (setq rectify-numbering allout-numbered-bullet) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3610 (if adjust-to-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3611 ; Do the adjustment: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3612 (progn |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3613 (message "... yanking") (sit-for 0) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3614 (save-restriction |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3615 (narrow-to-region subj-beg subj-end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3616 ; Trim off excessive blank |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3617 ; line at end, if any: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3618 (goto-char (point-max)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3619 (if (looking-at "^$") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3620 (allout-unprotected (delete-char -1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3621 ; Work backwards, with each |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3622 ; shallowest level, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3623 ; successively excluding the |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3624 ; last processed topic from |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3625 ; the narrow region: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3626 (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
|
3627 (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3628 ; go as high as we can in each bunch: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3629 (while (allout-ascend-to-depth (1- (allout-depth)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3630 (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
|
3631 (allout-rebullet-topic-grunt (- adjust-to-depth |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3632 subj-depth)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3633 (allout-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3634 (if (setq more (not (bobp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3635 (progn (widen) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3636 (forward-char -1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3637 (narrow-to-region subj-beg (point)))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3638 (message "") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3639 ;; Preserve new bullet if it's a distinctive one, otherwise |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3640 ;; use old one: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3641 (if (string-match (regexp-quote prefix-bullet) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3642 allout-distinctive-bullets-string) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3643 ; Delete from bullet of old to |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3644 ; before bullet of new: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3645 (progn |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3646 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3647 (delete-region (point) subj-beg) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3648 (set-marker (allout-mark-marker t) subj-end) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3649 (goto-char subj-beg) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3650 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3651 ; Delete base subj prefix, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3652 ; leaving old one: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3653 (delete-region (point) (+ (point) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3654 prefix-len |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3655 (- adjust-to-depth subj-depth))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3656 ; and delete residual subj |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3657 ; prefix digits and space: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3658 (while (looking-at "[0-9]") (delete-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3659 (if (looking-at " ") (delete-char 1)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3660 (exchange-point-and-mark)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3661 (if rectify-numbering |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3662 (progn |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3663 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3664 ; Give some preliminary feedback: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3665 (message "... reconciling numbers") (sit-for 0) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3666 ; ... and renumber, in case necessary: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3667 (goto-char subj-beg) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3668 (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
|
3669 (allout-rebullet-heading nil ;;; solicit |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3670 (allout-depth) ;;; depth |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3671 nil ;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3672 nil ;;; index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3673 t)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3674 (message "")))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3675 (when (and (or into-bol resituate) was-collapsed) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3676 (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3677 (allout-hide-current-subtree)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3678 (if (not resituate) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3679 (exchange-point-and-mark)))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3680 ;;;_ > 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
|
3681 (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
|
3682 "`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
|
3683 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3684 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
|
3685 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3686 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
|
3687 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
|
3688 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3689 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
|
3690 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
|
3691 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
|
3692 topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3693 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3694 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
|
3695 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
|
3696 header into which it's being yanked. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3697 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3698 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
|
3699 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
|
3700 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
|
3701 exactly like normal yanks. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3702 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3703 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
|
3704 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
|
3705 |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
3706 `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
|
3707 works with normal `yank' in non-outline buffers." |
3430 | 3708 |
3709 (interactive "*P") | |
3710 (setq this-command 'yank) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3711 (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
|
3712 (if (allout-mode-p) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3713 (allout-yank-processing)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3714 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3715 ;;;_ > allout-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
|
3716 (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
|
3717 "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
|
3718 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3719 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
|
3720 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3721 Note - prefix changes to distinctive bullets will stick, if followed |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3722 by pops to non-distinctive yanks. Bug..." |
3430 | 3723 |
3724 (interactive "*p") | |
3725 (setq this-command 'yank) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3726 (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
|
3727 (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
|
3728 (allout-yank-processing))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3729 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3730 ;;;_ - Specialty bullet functions |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3731 ;;;_ : 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
|
3732 ;;;_ > 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
|
3733 (defun allout-resolve-xref () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3734 "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
|
3735 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3736 \(Works according to setting of `allout-file-xref-bullet')." |
3430 | 3737 (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
|
3738 (if (not allout-file-xref-bullet) |
3430 | 3739 (error |
64428
e55dd693f95b
(allout-resolve-xref): Fix typos in error strings.
Juanma Barranquero <lekktu@gmail.com>
parents:
64400
diff
changeset
|
3740 "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
|
3741 (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
|
3742 (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
|
3743 allout-file-xref-bullet) |
3430 | 3744 (let (file-name) |
3745 (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
|
3746 (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
|
3747 (heading-end (progn (end-of-line) (point)))) |
3430 | 3748 (goto-char text-start) |
3749 (setq file-name | |
3750 (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t) | |
3751 (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
|
3752 (setq file-name (expand-file-name file-name)) |
3430 | 3753 (if (or (file-exists-p file-name) |
3754 (if (file-writable-p file-name) | |
3755 (y-or-n-p (format "%s not there, create one? " | |
3756 file-name)) | |
3757 (error "%s not found and can't be created" file-name))) | |
3758 (condition-case failure | |
3759 (find-file-other-window file-name) | |
29490 | 3760 ('error failure)) |
3430 | 3761 (error "%s not found" file-name)) |
3762 ) | |
3763 ) | |
3764 ) | |
3765 ) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3766 |
29490 | 3767 ;;;_ #6 Exposure Control |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3768 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3769 ;;;_ - Fundamental |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3770 ;;;_ > 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
|
3771 (defun allout-flag-region (from to flag) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3772 "Conceal text from FROM to TO if FLAG is non-nil, else reveal it. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3773 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3774 Text is shown if flag is nil and hidden otherwise." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3775 ;; We use outline invisibility spec. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3776 (remove-overlays from to 'category 'allout-overlay-category) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3777 (when flag |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3778 (let ((o (make-overlay from to))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3779 (overlay-put o 'category 'allout-overlay-category) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3780 (when (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3781 (let ((props (symbol-plist 'allout-overlay-category))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3782 (while props |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3783 (overlay-put o (pop props) (pop props))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3784 (run-hooks 'allout-view-change-hook)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3785 ;;;_ > 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
|
3786 (defun allout-flag-current-subtree (flag) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3787 "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
|
3788 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3789 (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
|
3790 (allout-back-to-current-heading) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3791 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3792 (allout-flag-region (point) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3793 ;; Exposing must not leave trailing blanks hidden, |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3794 ;; 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
|
3795 ;; can use flag's inverse as the |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3796 ;; include-trailing-blank cue: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3797 (allout-end-of-current-subtree (not flag)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3798 flag))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3799 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3800 ;;;_ - Topic-specific |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3801 ;;;_ > allout-show-entry (&optional inclusive) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3802 (defun allout-show-entry (&optional inclusive) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3803 "Like `allout-show-current-entry', reveals entries nested in hidden topics. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3804 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3805 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
|
3806 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
|
3807 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
|
3808 the exposure." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3809 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3810 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3811 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3812 (let (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
|
3813 (allout-goto-prefix) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3814 (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
|
3815 (setq end (allout-pre-next-prefix)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3816 (allout-flag-region beg end nil) |
29490 | 3817 (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
|
3818 ;;;_ > 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
|
3819 (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
|
3820 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3821 "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
|
3822 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3823 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
|
3824 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3825 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
|
3826 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
|
3827 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3828 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
|
3829 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
|
3830 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
|
3831 it. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3832 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3833 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
|
3834 point of non-opened subtree?)" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3835 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3836 (interactive "p") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3837 (let ((start-point (point))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3838 (if (and (not strict) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3839 (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3840 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3841 (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
|
3842 ; expose it. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3843 ;; 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
|
3844 ;; infinite regress: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3845 (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
|
3846 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3847 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3848 (allout-beginning-of-current-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3849 (save-restriction |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3850 (let* ((chart (allout-chart-subtree (or level 1))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3851 (to-reveal (allout-chart-to-reveal chart (or level 1)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3852 (goto-char start-point) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3853 (when (and strict (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3854 ;; 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
|
3855 ;; unless strict was set. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3856 (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
|
3857 (when allout-show-bodies |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3858 (goto-char (car to-reveal)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3859 (allout-show-current-entry))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3860 (while to-reveal |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3861 (goto-char (car to-reveal)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3862 (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
|
3863 (progn (search-forward "\n" nil t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3864 (1- (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3865 nil) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3866 (when allout-show-bodies |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3867 (goto-char (car to-reveal)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3868 (allout-show-current-entry)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3869 (setq to-reveal (cdr to-reveal))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3870 ;; 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
|
3871 ;; within invisible text: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3872 (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
|
3873 ;;;_ > 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
|
3874 (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
|
3875 "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
|
3876 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3877 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
|
3878 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3879 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3880 (let ((orig-pt (point)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3881 (orig-pref (allout-goto-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3882 (last-at (point)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3883 bag-it) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3884 (while (or bag-it (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3885 (while (allout-hidden-p) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3886 ;; XXX We would use `(move-beginning-of-line 1)', but it gets |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3887 ;; stuck on hidden newlines at column 80, as of GNU Emacs 22.0.50. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3888 (beginning-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3889 (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
|
3890 (if (= last-at (setq last-at (point))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3891 ;; Oops, we're not making any progress! Show the current |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3892 ;; topic completely, and bag this try. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3893 (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
|
3894 (allout-show-current-subtree) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3895 (goto-char orig-pt) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3896 (setq bag-it t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3897 (beep) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3898 (message "%s: %s" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3899 "allout-show-to-offshoot: " |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3900 "Aberrant nesting encountered."))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3901 (allout-show-children) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3902 (goto-char orig-pref)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3903 (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
|
3904 (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
|
3905 (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
|
3906 ;;;_ > 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
|
3907 (defun allout-hide-current-entry () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3908 "Hide the body directly following this heading." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3909 (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
|
3910 (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3911 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3912 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3913 (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
|
3914 (progn (allout-end-of-entry) (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3915 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
|
3916 ;;;_ > 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
|
3917 (defun allout-show-current-entry (&optional arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3918 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3919 "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
|
3920 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3921 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3922 (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
|
3923 (allout-hide-current-entry) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3924 (save-excursion (allout-show-to-offshoot)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3925 (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
|
3926 (allout-flag-region (point) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3927 (progn (allout-end-of-entry t) (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3928 nil) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3929 ))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3930 ;;;_ > 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
|
3931 (defun allout-show-current-subtree (&optional arg) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3932 "Show everything within the current topic. With a repeat-count, |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3933 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
|
3934 (interactive "P") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3935 (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
|
3936 (if (<= (allout-current-depth) 0) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3937 ;; 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
|
3938 (if (not (allout-next-heading)) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
3939 (error "No topics") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3940 ;; got to first, outermost topic - set to expose it and siblings: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3941 (message "Above outermost topic - exposing all.") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3942 (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
|
3943 (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
|
3944 (if (not arg) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3945 (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
|
3946 (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
|
3947 (allout-expose-topic '(* :)))))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3948 ;;;_ > 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
|
3949 (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
|
3950 "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
|
3951 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3952 If optional INCLUDE-SINGLE-LINERS is true, then include single-line |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3953 topics \(which intrinsically can be considered both collapsed and |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3954 not\), as collapsed. Otherwise they are considered uncollapsed." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3955 (save-excursion |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
3956 (and |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3957 (= (progn (allout-back-to-current-heading) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3958 (move-end-of-line 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3959 (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3960 (allout-end-of-current-subtree)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3961 (or include-single-liners |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3962 (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
|
3963 ;;;_ > 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
|
3964 (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
|
3965 "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
|
3966 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3967 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
|
3968 and its siblings. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3969 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3970 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
|
3971 siblings, even if the target topic is already closed." |
3430 | 3972 |
3973 (interactive) | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3974 (let* ((from (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3975 (sibs-msg "Top-level topic already closed - closing siblings...") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3976 (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
|
3977 (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
|
3978 (just-close nil) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3979 ((allout-up-current-level 1 t) (allout-hide-current-subtree)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3980 (t (goto-char 0) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3981 (message sibs-msg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3982 (allout-expose-topic '(0 :)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3983 (message (concat sibs-msg " Done.")))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
3984 (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
|
3985 ;;;_ > 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
|
3986 (defun allout-show-current-branches () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3987 "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
|
3988 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3989 (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
|
3990 (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
|
3991 ;;;_ > 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
|
3992 (defun allout-hide-current-leaves () |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3993 "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
|
3994 (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
|
3995 (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
|
3996 (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
|
3997 (point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3998 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3999 ;;;_ - 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
|
4000 ;;;_ > 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
|
4001 (defun allout-show-all () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4002 "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
|
4003 (interactive) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4004 (message "Exposing entire buffer...") |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4005 (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
|
4006 (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
|
4007 ;;;_ > 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
|
4008 (defun allout-hide-bodies () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4009 "Hide all of buffer except headings." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4010 (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
|
4011 (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
|
4012 ;;;_ > 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
|
4013 (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
|
4014 "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
|
4015 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4016 (save-restriction |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4017 (narrow-to-region start end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4018 (goto-char (point-min)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4019 (while (not (eobp)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4020 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4021 (allout-flag-region (point) (allout-end-of-entry) t) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4022 (if (not (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4023 (forward-char |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4024 (if (looking-at "\n\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4025 2 1))))))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4026 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4027 ;;;_ > 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
|
4028 (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
|
4029 "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
|
4030 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4031 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
|
4032 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
|
4033 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
|
4034 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
|
4035 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4036 Cursor is left at start position. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4037 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4038 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
|
4039 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4040 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
|
4041 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4042 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
|
4043 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
|
4044 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4045 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
|
4046 subtopics of the current topic. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4047 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4048 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
|
4049 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
|
4050 explicit specs following the `:'. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4051 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4052 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
|
4053 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4054 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
|
4055 - 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
|
4056 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
|
4057 that level. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4058 - 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
|
4059 number, but do not force already opened subtopics to be closed. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4060 - 0 means to close topic - hide all offspring. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4061 : - `repeat' |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4062 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
|
4063 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
|
4064 on the list. Ie, apply to all topics at level but the last |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4065 ones. \(Only first of multiple colons at same level is |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4066 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
|
4067 * - 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
|
4068 + - 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
|
4069 - - 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
|
4070 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4071 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
|
4072 \(allout-expose-topic '(-1 : 0)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4073 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
|
4074 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
|
4075 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
|
4076 \(allout-expose-topic '(-1 () : 1 0)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4077 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
|
4078 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
|
4079 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
|
4080 \(allout-expose-topic '(-2 : -1 *)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4081 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
|
4082 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
|
4083 last and completely open the last one." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4084 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4085 (interactive "xExposure spec: ") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4086 (if (not (listp spec)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4087 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
|
4088 (let ((depth (allout-depth)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4089 (max-pos 0) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4090 prev-elem curr-elem |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4091 stay) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4092 (while spec |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4093 (setq prev-elem curr-elem |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4094 curr-elem (car spec) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4095 spec (cdr spec)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4096 (cond ; Do current element: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4097 ((null curr-elem) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4098 ((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
|
4099 (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
|
4100 (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
|
4101 (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
|
4102 ((eq curr-elem '+) (allout-show-current-branches) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4103 (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
|
4104 (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
|
4105 ((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
|
4106 ((eq curr-elem ':) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4107 (setq stay t) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4108 ;; 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
|
4109 ;; w.r.t. remaining siblings: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4110 (let ((residue ; = # of sibs not covered by remaining spec |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4111 ;; 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
|
4112 (- (length (allout-chart-siblings)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4113 (length spec)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4114 (if (< 0 residue) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4115 ;; Some residue - cover it with prev-elem: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4116 (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
|
4117 spec))))))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4118 ((numberp curr-elem) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4119 (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
|
4120 (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
|
4121 (if (> 0 curr-elem) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4122 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
|
4123 (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
|
4124 (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
|
4125 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
|
4126 (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
|
4127 (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
|
4128 (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
|
4129 (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
|
4130 ((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
|
4131 (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
|
4132 (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
|
4133 (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
|
4134 (cond (stay (setq stay nil)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4135 ((listp (car spec)) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4136 ((> max-pos (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4137 ;; 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
|
4138 (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
|
4139 (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
|
4140 ((allout-next-sibling depth)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4141 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
|
4142 ;;;_ > 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
|
4143 (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
|
4144 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4145 "Deprecated. Use `allout-expose-topic' \(with different schema |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4146 format) instead. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4147 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4148 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
|
4149 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4150 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
|
4151 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
|
4152 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4153 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
|
4154 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
|
4155 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
|
4156 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
|
4157 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
|
4158 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4159 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
|
4160 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4161 - 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
|
4162 - 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
|
4163 absolute value of the number. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4164 - 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
|
4165 - 0 just closes |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4166 - `*' completely opens the topic, including bodies. |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4167 - `+' shows all the sub headers, but not the bodies |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4168 - `-' 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
|
4169 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4170 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
|
4171 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
|
4172 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
|
4173 for the corresponding offspring of the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4174 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4175 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
|
4176 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4177 (interactive "xExposure spec: ") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4178 (let ((depth (allout-current-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4179 max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4180 (cond ((null spec) nil) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4181 ((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
|
4182 (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
|
4183 (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
|
4184 (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
|
4185 ((numberp spec) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4186 (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
|
4187 (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
|
4188 (end-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4189 (if (or (not max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4190 (> (point) max-pos)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4191 (setq max-pos (point))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4192 (if (> 0 spec) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4193 (setq spec (* -1 spec))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4194 (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
|
4195 (allout-show-children spec))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4196 ((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
|
4197 ;(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
|
4198 ; (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
|
4199 ; (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
|
4200 (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
|
4201 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
|
4202 (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
|
4203 (setq spec (cdr spec)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4204 (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
|
4205 (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
|
4206 (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
|
4207 (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
|
4208 (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
|
4209 (setq max-pos got))))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4210 (while (and followers |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4211 (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
|
4212 (progn (goto-char max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4213 (setq max-pos nil))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4214 (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
|
4215 (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
|
4216 (allout-old-expose-topic (car followers)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4217 (setq followers (cdr followers))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4218 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
|
4219 ;;;_ > 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
|
4220 (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
|
4221 "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
|
4222 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
|
4223 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
|
4224 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4225 Cursor is left at start position. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4226 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4227 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
|
4228 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4229 Examples: |
61969
38ca28ee68d6
(allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents:
59996
diff
changeset
|
4230 \(allout-new-exposure (-1 () () () 1) 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4231 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
|
4232 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
|
4233 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
|
4234 \(allout-new-exposure : -1 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4235 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
|
4236 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
|
4237 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
|
4238 \(allout-new-exposure -2 : -1 *) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4239 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
|
4240 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
|
4241 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
|
4242 (list 'save-excursion |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4243 '(if (not (or (allout-goto-prefix) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4244 (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
|
4245 (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
|
4246 (list 'allout-expose-topic (list 'quote spec)))) |
29490 | 4247 |
4248 ;;;_ #7 Systematic outline presentation - copying, printing, flattening | |
4249 | |
4250 ;;;_ - Mapping and processing of topics | |
4251 ;;;_ ( 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
|
4252 ;;;_ > 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
|
4253 (defun allout-stringify-flat-index (flat-index &optional context) |
29490 | 4254 "Convert list representing section/subsection/... to document string. |
4255 | |
4256 Optional arg CONTEXT indicates interior levels to include." | |
4257 (let ((delim ".") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
4258 result |
29490 | 4259 numstr |
4260 (context-depth (or (and context 2) 1))) | |
4261 ;; Take care of the explicit context: | |
4262 (while (> context-depth 0) | |
4263 (setq numstr (int-to-string (car flat-index)) | |
4264 flat-index (cdr flat-index) | |
4265 result (if flat-index | |
4266 (cons delim (cons numstr result)) | |
4267 (cons numstr result)) | |
4268 context-depth (if flat-index (1- context-depth) 0))) | |
4269 (setq delim " ") | |
4270 ;; Take care of the indentation: | |
4271 (if flat-index | |
4272 (progn | |
4273 (while flat-index | |
4274 (setq result | |
4275 (cons delim | |
4276 (cons (make-string | |
4277 (1+ (truncate (if (zerop (car flat-index)) | |
4278 1 | |
4279 (log10 (car flat-index))))) | |
4280 ? ) | |
4281 result))) | |
4282 (setq flat-index (cdr flat-index))) | |
4283 ;; Dispose of single extra delim: | |
4284 (setq result (cdr result)))) | |
4285 (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
|
4286 ;;;_ > 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
|
4287 (defun allout-stringify-flat-index-plain (flat-index) |
29490 | 4288 "Convert list representing section/subsection/... to document string." |
4289 (let ((delim ".") | |
4290 result) | |
4291 (while flat-index | |
4292 (setq result (cons (int-to-string (car flat-index)) | |
4293 (if result | |
4294 (cons delim result)))) | |
4295 (setq flat-index (cdr flat-index))) | |
4296 (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
|
4297 ;;;_ > 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
|
4298 (defun allout-stringify-flat-index-indented (flat-index) |
29490 | 4299 "Convert list representing section/subsection/... to document string." |
4300 (let ((delim ".") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
4301 result |
29490 | 4302 numstr) |
4303 ;; Take care of the explicit context: | |
4304 (setq numstr (int-to-string (car flat-index)) | |
4305 flat-index (cdr flat-index) | |
4306 result (if flat-index | |
4307 (cons delim (cons numstr result)) | |
4308 (cons numstr result))) | |
4309 (setq delim " ") | |
4310 ;; Take care of the indentation: | |
4311 (if flat-index | |
4312 (progn | |
4313 (while flat-index | |
4314 (setq result | |
4315 (cons delim | |
4316 (cons (make-string | |
4317 (1+ (truncate (if (zerop (car flat-index)) | |
4318 1 | |
4319 (log10 (car flat-index))))) | |
4320 ? ) | |
4321 result))) | |
4322 (setq flat-index (cdr flat-index))) | |
4323 ;; Dispose of single extra delim: | |
4324 (setq result (cdr result)))) | |
4325 (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
|
4326 ;;;_ > 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
|
4327 (defun allout-listify-exposed (&optional start end format) |
29490 | 4328 |
4329 "Produce a list representing exposed topics in current region. | |
4330 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4331 This list can then be used by `allout-process-exposed' to manipulate |
29490 | 4332 the subject region. |
4333 | |
4334 Optional START and END indicate bounds of region. | |
4335 | |
4336 optional arg, FORMAT, designates an alternate presentation form for | |
4337 the prefix: | |
4338 | |
4339 list - Present prefix as numeric section.subsection..., starting with | |
4340 section indicated by the list, innermost nesting first. | |
4341 `indent' \(symbol) - Convert header prefixes to all white space, | |
4342 except for distinctive bullets. | |
4343 | |
4344 The elements of the list produced are lists that represents a topic | |
4345 header and body. The elements of that list are: | |
4346 | |
4347 - a number representing the depth of the topic, | |
4348 - a string representing the header-prefix, including trailing whitespace and | |
4349 bullet. | |
4350 - a string representing the bullet character, | |
4351 - and a series of strings, each containing one line of the exposed | |
4352 portion of the topic entry." | |
4353 | |
4354 (interactive "r") | |
4355 (save-excursion | |
4356 (let* | |
4357 ;; state vars: | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4358 (strings prefix result depth new-depth out gone-out bullet beg |
29490 | 4359 next done) |
4360 | |
4361 (goto-char start) | |
4362 (beginning-of-line) | |
4363 ;; Goto initial topic, and register preceeding stuff, if any: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4364 (if (> (allout-goto-prefix) start) |
29490 | 4365 ;; First topic follows beginning point - register preliminary stuff: |
4366 (setq result (list (list 0 "" nil | |
4367 (buffer-substring start (1- (point))))))) | |
4368 (while (and (not done) | |
4369 (not (eobp)) ; Loop until we've covered the region. | |
4370 (not (> (point) end))) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4371 (setq depth (allout-recent-depth) ; Current topics depth, |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4372 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
|
4373 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
|
4374 beg (progn (allout-end-of-prefix t) (point))) ; and beginning. |
29490 | 4375 (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
|
4376 (not (allout-next-visible-heading 1))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4377 (setq new-depth (allout-recent-depth)) |
29490 | 4378 (setq gone-out out |
4379 out (< new-depth depth)) | |
4380 (beginning-of-line) | |
4381 (setq next (point)) | |
4382 (goto-char beg) | |
4383 (setq strings nil) | |
4384 (while (> next (point)) ; Get all the exposed text in | |
4385 (setq strings | |
4386 (cons (buffer-substring | |
4387 beg | |
4388 ;To hidden text or end of line: | |
4389 (progn | |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4390 (end-of-line) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4391 (allout-back-to-visible-text))) |
29490 | 4392 strings)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4393 (when (< (point) next) ; Resume from after hid text, if any. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4394 (line-move 1)) |
29490 | 4395 (setq beg (point))) |
4396 ;; Accumulate list for this topic: | |
4397 (setq strings (nreverse strings)) | |
4398 (setq result | |
4399 (cons | |
4400 (if format | |
4401 (let ((special (if (string-match | |
4402 (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
|
4403 allout-distinctive-bullets-string) |
29490 | 4404 bullet))) |
4405 (cond ((listp format) | |
4406 (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
|
4407 (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
|
4408 (allout-stringify-flat-index format |
29490 | 4409 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
|
4410 (allout-stringify-flat-index-plain |
29490 | 4411 format)) |
4412 strings | |
4413 special)) | |
4414 ((eq format 'indent) | |
4415 (if special | |
4416 (list depth | |
4417 (concat (make-string (1+ depth) ? ) | |
4418 (substring prefix -1)) | |
4419 strings) | |
4420 (list depth | |
4421 (make-string depth ? ) | |
4422 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
|
4423 (t (error "allout-listify-exposed: %s %s" |
29490 | 4424 "invalid format" format)))) |
4425 (list depth prefix strings)) | |
4426 result)) | |
4427 ;; Reasses format, if any: | |
4428 (if (and format (listp format)) | |
4429 (cond ((= new-depth depth) | |
4430 (setq format (cons (1+ (car format)) | |
4431 (cdr format)))) | |
4432 ((> new-depth depth) ; descending - assume by 1: | |
4433 (setq format (cons 1 format))) | |
4434 (t | |
4435 ; Pop the residue: | |
4436 (while (< new-depth depth) | |
4437 (setq format (cdr format)) | |
4438 (setq depth (1- depth))) | |
4439 ; And increment the current one: | |
4440 (setq format | |
4441 (cons (1+ (or (car format) | |
4442 -1)) | |
4443 (cdr format))))))) | |
4444 ;; Put the list with first at front, to last at back: | |
4445 (nreverse result)))) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4446 ;;;_ > my-region-active-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4447 (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
|
4448 (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
|
4449 '(region-active-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4450 '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
|
4451 ;;;_ > allout-process-exposed (&optional func from to frombuf |
29490 | 4452 ;;; 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
|
4453 (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
|
4454 format start-num) |
29490 | 4455 "Map function on exposed parts of current topic; results to another buffer. |
4456 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4457 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
|
4458 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4459 Apply FUNCTION to exposed portions FROM position TO position in buffer |
29490 | 4460 FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an |
4461 alternate presentation form: | |
4462 | |
4463 `flat' - Present prefix as numeric section.subsection..., starting with | |
4464 section indicated by the start-num, innermost nesting first. | |
4465 X`flat-indented' - Prefix is like `flat' for first topic at each | |
4466 X level, but subsequent topics have only leaf topic | |
4467 X number, padded with blanks to line up with first. | |
4468 `indent' \(symbol) - Convert header prefixes to all white space, | |
4469 except for distinctive bullets. | |
4470 | |
4471 Defaults: | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4472 FUNCTION: `allout-insert-listified' |
29490 | 4473 FROM: region start, if region active, else start of buffer |
4474 TO: region end, if region active, else end of buffer | |
4475 FROMBUF: current buffer | |
4476 TOBUF: buffer name derived: \"*current-buffer-name exposed*\" | |
4477 FORMAT: nil" | |
4478 | |
4479 ; Resolve arguments, | |
4480 ; 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
|
4481 (if (not func) (setq func 'allout-insert-listified)) |
29490 | 4482 (if (not (and from to)) |
4483 (if (my-region-active-p) | |
4484 (setq from (region-beginning) to (region-end)) | |
4485 (setq from (point-min) to (point-max)))) | |
4486 (if frombuf | |
4487 (if (not (bufferp frombuf)) | |
4488 ;; Specified but not a buffer - get it: | |
4489 (let ((got (get-buffer frombuf))) | |
4490 (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
|
4491 (error (concat "allout-process-exposed: source buffer " |
29490 | 4492 frombuf |
4493 " not found.")) | |
4494 (setq frombuf got)))) | |
4495 ;; not specified - default it: | |
4496 (setq frombuf (current-buffer))) | |
4497 (if tobuf | |
4498 (if (not (bufferp tobuf)) | |
4499 (setq tobuf (get-buffer-create tobuf))) | |
4500 ;; not specified - default it: | |
4501 (setq tobuf (concat "*" (buffer-name frombuf) " exposed*"))) | |
4502 (if (listp format) | |
4503 (nreverse format)) | |
4504 | |
4505 (let* ((listified | |
4506 (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
|
4507 (allout-listify-exposed from to format)))) |
29490 | 4508 (set-buffer tobuf) |
4509 (mapcar func listified) | |
4510 (pop-to-buffer tobuf))) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4511 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4512 ;;;_ - 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
|
4513 ;;;_ > 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
|
4514 (defun allout-insert-listified (listified) |
29490 | 4515 "Insert contents of listified outline portion in current buffer. |
4516 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4517 LISTIFIED is a list representing each topic header and body: |
29490 | 4518 |
4519 \`(depth prefix text)' | |
4520 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4521 or \`(depth prefix text bullet-plus)' |
29490 | 4522 |
4523 If `bullet-plus' is specified, it is inserted just after the entire prefix." | |
4524 (setq listified (cdr listified)) | |
4525 (let ((prefix (prog1 | |
4526 (car listified) | |
4527 (setq listified (cdr listified)))) | |
4528 (text (prog1 | |
4529 (car listified) | |
4530 (setq listified (cdr listified)))) | |
4531 (bullet-plus (car listified))) | |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4532 (insert prefix) |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4533 (if bullet-plus (insert (concat " " bullet-plus))) |
29490 | 4534 (while text |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4535 (insert (car text)) |
29490 | 4536 (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
|
4537 (insert "\n"))) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4538 (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
|
4539 ;;;_ > 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
|
4540 (defun allout-copy-exposed-to-buffer (&optional arg tobuf format) |
29490 | 4541 "Duplicate exposed portions of current outline to another buffer. |
4542 | |
4543 Other buffer has current buffers name with \" exposed\" appended to it. | |
4544 | |
4545 With repeat count, copy the exposed parts of only the current topic. | |
4546 | |
4547 Optional second arg TOBUF is target buffer name. | |
4548 | |
4549 Optional third arg FORMAT, if non-nil, symbolically designates an | |
4550 alternate presentation format for the outline: | |
4551 | |
4552 `flat' - Convert topic header prefixes to numeric | |
4553 section.subsection... identifiers. | |
4554 `indent' - Convert header prefixes to all white space, except for | |
4555 distinctive bullets. | |
4556 `indent-flat' - The best of both - only the first of each level has | |
4557 the full path, the rest have only the section number | |
4558 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
|
4559 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4560 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4561 (if (not tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4562 (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
|
4563 (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
|
4564 (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
|
4565 (end (if arg (allout-end-of-current-subtree) (point-max))) |
29490 | 4566 (buf (current-buffer)) |
4567 (start-list ())) | |
4568 (if (eq format 'flat) | |
4569 (setq format (if arg (save-excursion | |
4570 (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
|
4571 (allout-topic-flat-index)) |
29490 | 4572 '(1)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4573 (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
|
4574 (allout-process-exposed 'allout-insert-listified |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4575 beg |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4576 end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4577 (current-buffer) |
29490 | 4578 tobuf |
4579 format start-list) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4580 (goto-char (point-min)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4581 (pop-to-buffer buf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4582 (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
|
4583 ;;;_ > 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
|
4584 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf) |
29490 | 4585 "Present numeric outline of outline's exposed portions in another buffer. |
4586 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4587 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
|
4588 `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
|
4589 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4590 Use `allout-indented-exposed-to-buffer' for indented presentation. |
29490 | 4591 |
4592 With repeat count, copy the exposed portions of only current topic. | |
4593 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4594 Other buffer has current buffer's name with \" exposed\" appended to |
29490 | 4595 it, unless optional second arg TOBUF is specified, in which case it is |
4596 used verbatim." | |
4597 (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
|
4598 (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
|
4599 ;;;_ > 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
|
4600 (defun allout-indented-exposed-to-buffer (&optional arg tobuf) |
29490 | 4601 "Present indented outline of outline's exposed portions in another buffer. |
4602 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4603 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
|
4604 `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
|
4605 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4606 Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. |
29490 | 4607 |
4608 With repeat count, copy the exposed portions of only current topic. | |
4609 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4610 Other buffer has current buffer's name with \" exposed\" appended to |
29490 | 4611 it, unless optional second arg TOBUF is specified, in which case it is |
4612 used verbatim." | |
4613 (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
|
4614 (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
|
4615 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4616 ;;;_ - 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
|
4617 ;;;_ > 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
|
4618 (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
|
4619 "Return copy of STRING for literal reproduction across LaTeX processing. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4620 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
|
4621 string across LaTeX processing." |
29490 | 4622 (mapconcat (function |
4623 (lambda (char) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4624 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4625 (concat "\\char" (number-to-string char) "{}")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4626 ((= char ?\n) "\\\\") |
29490 | 4627 (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
|
4628 string |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4629 "")) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4630 ;;;_ > 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
|
4631 (defun allout-latex-verbatim-quote-curr-line () |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
4632 "Express line for exact \(literal) representation across LaTeX processing. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4633 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4634 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
|
4635 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
|
4636 environment. Leaves point at the end of the line." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4637 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4638 (let ((beg (point)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4639 (end (progn (end-of-line)(point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4640 (goto-char beg) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4641 (while (re-search-forward "\\\\" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4642 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4643 end ; bounded by end-of-line |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4644 1) ; no matches, move to end & return nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4645 (goto-char (match-beginning 0)) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4646 (insert "\\") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4647 (setq end (1+ end)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4648 (goto-char (1+ (match-end 0)))))) |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4649 ;;;_ > 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
|
4650 (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
|
4651 "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
|
4652 ;; 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
|
4653 ;; 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
|
4654 (set-buffer buffer) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4655 (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
|
4656 "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
|
4657 (page-numbering (if allout-number-pages |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4658 "\\pagestyle{empty}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4659 "")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4660 (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
|
4661 allout-title-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4662 (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
|
4663 allout-label-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4664 (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
|
4665 allout-head-line-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4666 (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
|
4667 allout-body-line-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4668 (setlength (format "%s%s%s%s" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4669 "\\newlength{\\stepsize}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4670 "\\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
|
4671 allout-indent |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4672 "}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4673 (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
|
4674 "\\newcommand{\\OneHeadLine}[3]{%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4675 "\\noindent%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4676 "\\hspace*{#2\\stepsize}%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4677 "\\labelcmd{#1}\\hspace*{.2cm}" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4678 "\\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
|
4679 allout-line-skip |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4680 "]\n}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4681 (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
|
4682 "\\newcommand{\\OneBodyLine}[2]{%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4683 "\\noindent%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4684 "\\hspace*{#1\\stepsize}%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4685 "\\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
|
4686 allout-line-skip |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4687 "]\n}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4688 (begindoc "\\begin{document}\n\\begin{center}\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4689 (title (format "%s%s%s%s" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4690 "\\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
|
4691 (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
|
4692 (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
|
4693 (eval allout-title) |
29490 | 4694 ('error "<unnamed buffer>")) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4695 "Unnamed Outline")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4696 "}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4697 "\\end{center}\n\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4698 (hsize "\\hsize = 7.5 true in\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4699 (hoffset "\\hoffset = -1.5 true in\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4700 (vspace "\\vspace{.1cm}\n\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4701 (insert (concat doc-style |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4702 page-numbering |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4703 titlecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4704 labelcmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4705 headlinecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4706 bodylinecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4707 setlength |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4708 oneheadline |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4709 onebodyline |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4710 begindoc |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4711 title |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4712 hsize |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4713 hoffset |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4714 vspace) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4715 ))) |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4716 ;;;_ > 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
|
4717 (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
|
4718 "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
|
4719 (set-buffer buffer) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4720 (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
|
4721 ;;;_ > 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
|
4722 (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
|
4723 "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
|
4724 |
29490 | 4725 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
|
4726 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
|
4727 (let* ((head-line (if text (car text))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4728 (body-lines (cdr text)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4729 (curr-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4730 body-content bop) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4731 ; Do the head line: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
4732 (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
|
4733 (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
|
4734 "\1}{" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4735 depth |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4736 "}{\\verb\1 " |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4737 (if head-line |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4738 (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
|
4739 "") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4740 "\1}\n")) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4741 (if (not body-lines) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4742 nil |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4743 ;;(insert "\\beginlines\n") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4744 (insert "\\begin{verbatim}\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4745 (while body-lines |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4746 (setq curr-line (car body-lines)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4747 (if (and (not body-content) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4748 (not (string-match "^\\s-*$" curr-line))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4749 (setq body-content t)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4750 ; Mangle any occurrences of |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4751 ; "\end{verbatim}" in text, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4752 ; it's special: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4753 (if (and body-content |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4754 (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
|
4755 (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
|
4756 ">" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4757 (substring curr-line bop)))) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4758 ;;(insert "|" (car body-lines) "|") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4759 (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
|
4760 (allout-latex-verbatim-quote-curr-line) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4761 (insert "\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4762 (setq body-lines (cdr body-lines))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4763 (if body-content |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4764 (setq body-content nil) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4765 (forward-char -1) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4766 (insert "\\ ") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4767 (forward-char 1)) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4768 ;;(insert "\\endlines\n") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4769 (insert "\\end{verbatim}\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4770 ))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4771 ;;;_ > 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
|
4772 (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
|
4773 "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
|
4774 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
|
4775 with \"*\" prepended and \" latex-formed*\" appended. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4776 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4777 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
|
4778 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4779 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4780 (if (not tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4781 (setq tobuf |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4782 (get-buffer-create (concat "*" (buffer-name) " latexified*")))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4783 (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
|
4784 (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
|
4785 (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
|
4786 (buf (current-buffer))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4787 (set-buffer tobuf) |
3430 | 4788 (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
|
4789 (allout-insert-latex-header tobuf) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4790 (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
|
4791 (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
|
4792 beg |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4793 end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4794 buf |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4795 tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4796 (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
|
4797 (allout-insert-latex-trailer tobuf) |
3430 | 4798 (goto-char (point-min)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4799 (pop-to-buffer buf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4800 (goto-char start-pt))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4801 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4802 ;;;_ #8 Encryption |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4803 ;;;_ > 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
|
4804 (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
|
4805 "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
|
4806 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4807 Optional FETCH-PASS universal argument provokes key-pair encryption with |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4808 single universal argument. With doubled universal argument \(value = 16), |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4809 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
|
4810 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
|
4811 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
|
4812 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4813 Currently only GnuPG encryption is supported. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4814 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4815 \**NOTE WELL** that the encrypted text must be ascii-armored. For gnupg |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4816 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
|
4817 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4818 Both symmetric-key and key-pair encryption is implemented. Symmetric is |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4819 the default, use a single \(x4) universal argument for keypair mode. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4820 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4821 Encrypted topic's bullet is set to a `~' to signal that the contents of the |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4822 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
|
4823 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
|
4824 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
|
4825 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
|
4826 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
|
4827 auto-encryption specifics. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4828 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4829 \**NOTE WELL** that automatic encryption that happens during saves will |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4830 default to symmetric encryption - you must manually \(re)encrypt key-pair |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4831 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
|
4832 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4833 Level-1 topics, with prefix consisting solely of an `*' asterisk, cannot be |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4834 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
|
4835 \\[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
|
4836 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4837 Passphrase Caching |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4838 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4839 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
|
4840 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
|
4841 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4842 The solicited passphrase is retained for reuse in a buffer-specific cache |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4843 for some set period of time \(default, 60 seconds), after which the string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4844 is nulled. The passphrase cache timeout is customized by setting |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4845 `pgg-passphrase-cache-expiry'. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4846 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4847 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
|
4848 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4849 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
|
4850 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
|
4851 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
|
4852 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
|
4853 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
|
4854 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
|
4855 keys. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4856 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4857 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
|
4858 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
|
4859 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
|
4860 is created if necessary. That setting is for retention of the passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4861 verifier across emacs sessions. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4862 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4863 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
|
4864 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
|
4865 when the hint is presented, or if passphrase hints are disabled. If |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4866 enabled \(see the `allout-passphrase-hint-handling' docstring for details), |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4867 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
|
4868 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
|
4869 (interactive "P") |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4870 (save-excursion |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4871 (allout-back-to-current-heading) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4872 (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
|
4873 ) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4874 ) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4875 ;;;_ > 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
|
4876 (defun 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
|
4877 "Encrypt clear text or decrypt encoded topic contents \(body and subtopics.) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4878 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4879 Optional FETCH-PASS universal argument provokes key-pair encryption with |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4880 single universal argument. With doubled universal argument \(value = 16), |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4881 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
|
4882 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
|
4883 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
|
4884 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4885 Currently only GnuPG encryption is supported. |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4886 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4887 \**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
|
4888 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
|
4889 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4890 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
|
4891 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4892 (interactive "P") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4893 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4894 (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
|
4895 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4896 (if (= (allout-recent-depth) 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4897 (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
|
4898 " 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
|
4899 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4900 (let* ((allout-buffer (current-buffer)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4901 ;; Asses location: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4902 (after-bullet-pos (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4903 (was-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4904 (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
|
4905 (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
|
4906 (allout-encrypted-topic-p))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4907 (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
|
4908 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4909 (backward-char 1) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4910 (allout-hidden-p))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4911 (subtree-beg (1+ (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4912 (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
|
4913 (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
|
4914 subtree-end)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4915 (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
|
4916 (subtree-trailing-char (char-after subtree-end)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4917 ;; kluge - result-text needs to be nil, but we also want to |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4918 ;; check for the error condition |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4919 (result-text (if (or (string= "" subject-text) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4920 (string= "\n" subject-text)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4921 (error "No topic contents to %scrypt" |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4922 (if was-encrypted "de" "en")) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4923 nil)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4924 ;; Assess key parameters: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4925 (key-info (or |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4926 ;; 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
|
4927 (and was-encrypted |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4928 (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
|
4929 (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
|
4930 '(keypair nil)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4931 '(symmetric nil))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4932 (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
|
4933 (for-key-identity (cadr key-info)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4934 (fetch-pass (and fetch-pass (member fetch-pass '(16 (16)))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4935 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4936 (setq result-text |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4937 (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
|
4938 (current-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4939 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
|
4940 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4941 ;; 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
|
4942 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4943 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4944 (set-buffer allout-buffer) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4945 (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
|
4946 (insert result-text) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4947 (if was-collapsed |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4948 (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
|
4949 ;; 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
|
4950 (if (not was-encrypted) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4951 (if (and (= subtree-end-char ?\n) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4952 (= subtree-trailing-char ?\n)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
4953 (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
|
4954 ;; 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
|
4955 (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
|
4956 (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
|
4957 allout-topic-encryption-bullet)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4958 (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
|
4959 (delete-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4960 (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
|
4961 (if was-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4962 ;; 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
|
4963 (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
|
4964 (delete-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4965 ;; 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
|
4966 (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
|
4967 (insert "*")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4968 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4969 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4970 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4971 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4972 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4973 ;;;_ > 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
|
4974 ;;; 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
|
4975 ;;; passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4976 (defun 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
|
4977 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
|
4978 passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4979 "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
|
4980 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4981 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
|
4982 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4983 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
|
4984 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4985 KEY-TYPE indicates whether to use a 'symmetric or 'keypair cipher. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4986 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4987 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
|
4988 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
|
4989 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4990 Optional RETRIED is for internal use - conveys the number of failed keys |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4991 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
|
4992 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4993 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
|
4994 for verification purposes. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4995 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4996 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
|
4997 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4998 (require 'pgg) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4999 |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5000 (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
|
5001 (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
|
5002 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5003 (let* ((scheme (upcase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5004 (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
|
5005 (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
|
5006 (or for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5007 (split-string (read-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5008 (format "%s message recipients: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5009 scheme)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5010 "[ \t,]+")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5011 (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
|
5012 (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
|
5013 (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
|
5014 (buffer-name allout-buffer))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5015 (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
|
5016 key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5017 (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
|
5018 target-prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5019 (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
|
5020 target-prompt-id)))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5021 result-text status) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5022 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5023 (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
|
5024 ;; 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
|
5025 (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
|
5026 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5027 (catch 'encryption-failed |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5028 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5029 ;; Obtain the passphrase if we don't already have one and we're not |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5030 ;; doing a keypair encryption: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5031 (if (not (or passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5032 (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
|
5033 (not decrypt)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5034 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5035 (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
|
5036 target-cache-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5037 target-prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5038 key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5039 allout-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5040 retried fetch-pass))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5041 (with-temp-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5042 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5043 (insert text) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5044 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5045 (cond |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5046 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5047 ;; symmetric: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5048 ((equal key-type 'symmetric) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5049 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5050 (if decrypt |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5051 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5052 (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
|
5053 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5054 (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
|
5055 passphrase))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5056 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5057 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5058 (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
|
5059 ;; failed - handle passphrase caching |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5060 (if verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5061 (throw 'encryption-failed nil) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5062 (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
|
5063 (error "Symmetric-cipher encryption failed - %s" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5064 "try again with different passphrase.")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5065 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5066 ;; encrypt 'keypair: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5067 ((not decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5068 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5069 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5070 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5071 (pgg-encrypt for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5072 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
|
5073 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5074 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5075 (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
|
5076 (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
|
5077 (error "encryption failed")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5078 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5079 ;; decrypt 'keypair: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5080 (t |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5081 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5082 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5083 (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
|
5084 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5085 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5086 (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
|
5087 (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
|
5088 (error "decryption failed")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5089 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5090 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5091 (setq result-text |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5092 (buffer-substring 1 (- (point-max) (if decrypt 0 1)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5093 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5094 ;; validate result - non-empty |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5095 (cond ((not result-text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5096 (if verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5097 nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5098 ;; transform was fruitless, retry w/new passphrase. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5099 (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
|
5100 (allout-encrypt-string text allout-buffer decrypt nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5101 (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
|
5102 passphrase))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5103 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5104 ;; Barf if encryption yields extraordinary control chars: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5105 ((and (not decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5106 (string-match "[\C-a\C-k\C-o-\C-z\C-@]" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5107 result-text)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5108 (error (concat "encryption produced unusable" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5109 " non-armored text - reconfigure!"))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5110 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5111 ;; valid result and just verifying or non-symmetric: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5112 ((or verifying (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
|
5113 (if (or verifying decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5114 (pgg-add-passphrase-to-cache target-cache-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5115 passphrase t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5116 result-text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5117 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5118 ;; valid result and regular symmetric - "register" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5119 ;; passphrase with mnemonic aids/cache. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5120 (t |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5121 (set-buffer allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5122 (if passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5123 (pgg-add-passphrase-to-cache target-cache-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5124 passphrase t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5125 (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
|
5126 allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5127 result-text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5128 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5129 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5130 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5131 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5132 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5133 ;;;_ > 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
|
5134 ;;; 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
|
5135 (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
|
5136 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
|
5137 "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
|
5138 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5139 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
|
5140 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
|
5141 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
|
5142 user for corroboration. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5143 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5144 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
|
5145 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5146 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
|
5147 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5148 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
|
5149 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5150 KEY-TYPE is either 'symmetric or 'keypair. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5151 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5152 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
|
5153 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5154 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
|
5155 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5156 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
|
5157 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
|
5158 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5159 (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
|
5160 ;; 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
|
5161 (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
|
5162 (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
|
5163 pgg-default-scheme |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5164 "GPG"))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5165 (if prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5166 (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
|
5167 "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5168 cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5169 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5170 ;; Symmetric hereon: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5171 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5172 (save-excursion |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5173 (set-buffer allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5174 (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
|
5175 (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
|
5176 (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
|
5177 'needed) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5178 retried))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5179 (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
|
5180 "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5181 (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
|
5182 (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
|
5183 prompt-id retry-message)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5184 (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
|
5185 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
|
5186 (prompt full-prompt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5187 (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
|
5188 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5189 (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
|
5190 (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
|
5191 (got-pass (or cached |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5192 (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
|
5193 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5194 confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5195 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5196 (if (not got-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5197 nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5198 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5199 ;; 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
|
5200 ;; deactivate-passwd memory clearing: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5201 (setq got-pass (format "%s" got-pass)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5202 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5203 (cond (verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5204 (save-window-excursion |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5205 (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
|
5206 allout-buffer 'symmetric |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5207 for-key nil 0 'verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5208 got-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5209 (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
|
5210 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5211 (if (and (not confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5212 (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
|
5213 (concat "Passphrase differs from established" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5214 " - use new one instead? ")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5215 ;; deactivate password for subsequent |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5216 ;; confirmation: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5217 (progn |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5218 (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
|
5219 (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
|
5220 nil) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5221 t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5222 (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
|
5223 (error "Wrong passphrase.")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5224 ;; No verifier string - force confirmation by repetition of |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5225 ;; (new) passphrase: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5226 ((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
|
5227 (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
|
5228 ;; confirmation vs new input - doing pgg-read-passphrase will do the |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5229 ;; 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
|
5230 (if (not confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5231 (setq confirmation |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5232 (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
|
5233 " ... confirm spelling: ") |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5234 cache-id t))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5235 (prog1 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5236 (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
|
5237 confirmation |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5238 (if (yes-or-no-p (concat "spelling of original and" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5239 " confirmation differ - retry? ")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5240 (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
|
5241 (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
|
5242 ;; recurse to this routine: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5243 (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
|
5244 (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
|
5245 (error "Confirmation failed."))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5246 ;; reduce opportunity for memory cherry-picking by zeroing duplicate: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5247 (dotimes (i (length got-pass)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5248 (aset got-pass i 0)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5249 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5250 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5251 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5252 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5253 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5254 ;;;_ > allout-encrypted-topic-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5255 (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
|
5256 "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
|
5257 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5258 (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
|
5259 (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
|
5260 allout-topic-encryption-bullet) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5261 (looking-at "\\*")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5262 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5263 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5264 ;;;_ > 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
|
5265 ;; XXX gpg-specific, alas |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5266 (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
|
5267 "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
|
5268 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5269 The key type is one of 'symmetric or 'keypair. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5270 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5271 if 'keypair, and some of the user's secret keys are among those for which |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5272 the message was encoded, return the identity of the first. otherwise, |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5273 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
|
5274 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5275 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
|
5276 (require 'pgg-parse) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5277 (save-excursion |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5278 (with-temp-buffer |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5279 (insert text) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5280 (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
|
5281 (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
|
5282 'symmetric |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5283 'keypair)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5284 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
|
5285 (if (equal type 'keypair) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5286 (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
|
5287 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
|
5288 secret-keys) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5289 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
|
5290 (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
|
5291 first-secret-key)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5292 (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
|
5293 ) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5294 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5295 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5296 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5297 ;;;_ > 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
|
5298 (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
|
5299 "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
|
5300 ;; 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
|
5301 (random t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5302 (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
|
5303 (dotimes (i (length spew)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5304 (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
|
5305 (allout-encrypt-string spew nil (current-buffer) 'symmetric |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5306 nil nil 0 passphrase)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5307 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5308 ;;;_ > 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
|
5309 ;;; outline-buffer) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5310 (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
|
5311 outline-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5312 "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
|
5313 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5314 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
|
5315 settings. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5316 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5317 PASSPHRASE is the passphrase being mnemonicized |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5318 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5319 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
|
5320 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5321 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
|
5322 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
|
5323 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5324 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
|
5325 `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
|
5326 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
|
5327 `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
|
5328 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5329 ;; 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
|
5330 ;; - adjust the verifier |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5331 ;; - 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
|
5332 ;; - 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
|
5333 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5334 (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
|
5335 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
|
5336 (new-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5337 (if new-verifier-needed |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5338 ;; 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
|
5339 (subst-char-in-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5340 ?\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
|
5341 passphrase)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5342 new-hint) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5343 (when new-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5344 ;; 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
|
5345 (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
|
5346 (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
|
5347 (setq new-hint |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5348 (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
|
5349 allout-passphrase-hint-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5350 (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
|
5351 (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
|
5352 (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
|
5353 allout-passphrase-hint-string))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5354 (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
|
5355 (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
|
5356 (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
|
5357 allout-passphrase-verifier-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5358 ) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5359 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5360 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5361 ;;;_ > 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
|
5362 (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
|
5363 "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
|
5364 |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
5365 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
|
5366 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5367 (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
|
5368 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
|
5369 (if verifier-string |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5370 ;; Return it uncollapsed |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5371 (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
|
5372 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5373 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5374 ;;;_ > 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
|
5375 (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
|
5376 "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
|
5377 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5378 \"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
|
5379 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5380 (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
|
5381 (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
|
5382 allout-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5383 (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
|
5384 'decrypt allout-buffer 'symmetric |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5385 key nil 0 'verifying passphrase) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5386 t))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5387 ;;;_ > 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
|
5388 (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
|
5389 "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
|
5390 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5391 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
|
5392 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
|
5393 `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
|
5394 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5395 Such a topic has the allout-topic-encryption-bullet without an |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5396 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
|
5397 must also have content." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5398 (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
|
5399 (while (not done) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5400 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5401 (if (not (re-search-forward |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5402 (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
|
5403 (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
|
5404 (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
|
5405 nil t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5406 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5407 done t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5408 (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
|
5409 (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
|
5410 (forward-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5411 (setq got (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5412 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5413 (cond ((not got) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5414 (setq done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5415 |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5416 ((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
|
5417 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5418 done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5419 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5420 ((eobp) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5421 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5422 done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5423 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5424 (t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5425 (setq content-beg (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5426 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5427 (allout-end-of-subtree) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5428 (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
|
5429 (and except-mark |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5430 (<= content-beg except-mark) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5431 (>= (point) except-mark))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5432 ;; Continue looking |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5433 (setq got nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5434 ;; Got it! |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5435 (setq done t))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5436 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5437 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5438 (if got |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5439 (goto-char got)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5440 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5441 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5442 ;;;_ > 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
|
5443 (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
|
5444 "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
|
5445 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5446 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
|
5447 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
|
5448 `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
|
5449 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5450 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
|
5451 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
|
5452 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
|
5453 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
|
5454 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
|
5455 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5456 (interactive "p") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5457 (save-excursion |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5458 (let* ((current-mark (point-marker)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5459 (current-mark-position (marker-position current-mark)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5460 was-modified |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5461 bo-subtree |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5462 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
|
5463 (goto-char (point-min)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5464 (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
|
5465 (setq was-modified (buffer-modified-p)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5466 (when (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5467 (and (boundp 'allout-encrypt-unencrypted-on-saves) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5468 allout-encrypt-unencrypted-on-saves |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5469 (setq bo-subtree (re-search-forward "$")) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5470 (not (allout-hidden-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5471 (>= current-mark (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5472 (allout-end-of-current-subtree) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5473 (<= current-mark (point)))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5474 (setq editing-topic (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5475 ;; 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
|
5476 ;; 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
|
5477 editing-point (- current-mark-position |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5478 (count-trailing-whitespace-region |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5479 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
|
5480 (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
|
5481 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5482 (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
|
5483 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5484 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5485 (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
|
5486 (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
|
5487 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5488 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5489 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5490 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5491 ;;;_ #9 miscellaneous |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5492 ;;;_ > 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
|
5493 (defun allout-mark-topic () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5494 "Put the region around topic currently containing point." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5495 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5496 (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
|
5497 (allout-goto-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5498 (push-mark (point)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5499 (allout-end-of-current-subtree) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5500 (exchange-point-and-mark)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5501 ;;;_ > outlineify-sticky () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5502 ;; 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
|
5503 ;;;###autoload |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5504 (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
|
5505 ;;;###autoload |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5506 (defun outlineify-sticky (&optional arg) |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
5507 "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
|
5508 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5509 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
|
5510 setup for auto-startup." |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5511 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5512 (interactive "P") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5513 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5514 (allout-mode t) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5515 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5516 (save-excursion |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5517 (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
|
5518 (if (looking-at allout-regexp) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5519 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
|
5520 (allout-open-topic 2) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5521 (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
|
5522 "`allout-mode' docstring: `^Hm'.")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5523 (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
|
5524 "allout-layout" (or allout-layout '(-1 : 0)))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5525 ;;;_ > 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
|
5526 (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
|
5527 "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
|
5528 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5529 Returns list `(beginning-point prefix-string suffix-string)'." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5530 ;; 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
|
5531 (let (beg prefix suffix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5532 (save-excursion |
3430 | 5533 (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
|
5534 (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
|
5535 (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
|
5536 (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
|
5537 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5538 (setq beg (- (point) 16)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5539 (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
|
5540 (point) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5541 (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
|
5542 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5543 (point)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5544 (setq prefix (buffer-substring-no-properties |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5545 (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
|
5546 (forward-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5547 (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5548 beg)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5549 (list beg prefix suffix)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5550 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5551 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5552 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5553 ;;;_ > allout-adjust-file-variable (varname value) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5554 (defun allout-adjust-file-variable (varname value) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5555 "Adjust the setting of an emacs file variable named VARNAME to VALUE. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5556 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5557 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
|
5558 `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
|
5559 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5560 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
|
5561 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
|
5562 variables, itself, is created if not already present. When created, the |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5563 section lines \(including the section line) exist as second-level topics in |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5564 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
|
5565 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5566 enable-local-variables must be true for any of this to happen." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5567 (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
|
5568 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
|
5569 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5570 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5571 (let ((section-data (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
|
5572 beg prefix suffix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5573 (if section-data |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5574 (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
|
5575 prefix (cadr section-data) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5576 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
|
5577 ;; create the section |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5578 (goto-char (point-max)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5579 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5580 (allout-open-topic 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5581 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5582 (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
|
5583 (allout-open-topic 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5584 (setq beg (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5585 suffix "" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5586 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
|
5587 (beginning-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5588 (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5589 beg)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5590 (goto-char beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5591 (insert "Local variables:\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5592 (allout-open-topic 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5593 (insert "End:\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5594 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5595 ;; 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
|
5596 ;; of new value: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5597 (goto-char beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5598 (allout-show-to-offshoot) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5599 (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
|
5600 (let* ((value-beg (point)) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5601 (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
|
5602 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5603 (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5604 (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
|
5605 (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
|
5606 (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
|
5607 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5608 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5609 (forward-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5610 (insert (concat prefix varname ":"))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5611 (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
|
5612 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5613 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5614 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5615 ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5616 ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting) |
3430 | 5617 (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
|
5618 "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
|
5619 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5620 Optional arg DO-DEFAULTING indicates to accept empty input (CR)." |
3430 | 5621 |
5622 (let ((new-prompt prompt) | |
5623 got) | |
5624 | |
5625 (while (not got) | |
5626 (message "%s" new-prompt) | |
5627 | |
5628 ;; We do our own reading here, so we can circumvent, eg, special | |
29490 | 5629 ;; treatment for `?' character. (Oughta use minibuffer keymap instead.) |
3430 | 5630 (setq got |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5631 (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
|
5632 |
29490 | 5633 (setq got |
5634 (cond ((string-match (regexp-quote got) string) got) | |
5635 ((and do-defaulting (string= got "\r")) | |
5636 ;; Return empty string to default: | |
5637 "") | |
5638 ((string= got "\C-g") (signal 'quit nil)) | |
5639 (t | |
5640 (setq new-prompt (concat prompt | |
5641 got | |
5642 " ...pick from: " | |
5643 string | |
5644 "")) | |
5645 nil)))) | |
5646 ;; got something out of loop - return it: | |
5647 got) | |
3430 | 5648 ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5649 ;;;_ > regexp-sans-escapes (string) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5650 (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
|
5651 "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
|
5652 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5653 Representations of actual backslashes - '\\\\\\\\' - are left as a |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5654 single backslash. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5655 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5656 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
|
5657 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5658 (if (string= regexp "") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5659 "" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5660 ;; 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
|
5661 ;; backslash, or else to nil: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5662 (setq successive-backslashes |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5663 (if (= (aref regexp 0) ?\\) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5664 (if successive-backslashes (1+ successive-backslashes) 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5665 nil)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5666 (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
|
5667 ;; Include first char: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5668 (concat (substring regexp 0 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5669 (regexp-sans-escapes (substring regexp 1))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5670 ;; Exclude first char, but maintain count: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5671 (regexp-sans-escapes (substring regexp 1) successive-backslashes)))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5672 ;;;_ > count-trailing-whitespace-region (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5673 (defun count-trailing-whitespace-region (beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5674 "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
|
5675 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5676 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
|
5677 (if (> beg end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5678 0 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5679 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5680 (goto-char beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5681 (let ((count 0)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5682 (while (re-search-forward "[ ][ ]*$" end t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5683 (goto-char (1+ (match-beginning 0))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5684 (setq count (1+ count))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5685 count)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5686 ;;;_ > allout-mark-marker to accommodate divergent emacsen: |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5687 (defun allout-mark-marker (&optional force buffer) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5688 "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
|
5689 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5690 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
|
5691 so pass them along when appropriate." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5692 (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5693 (apply 'mark-marker force buffer) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5694 (mark-marker))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5695 ;;;_ > subst-char-in-string if necessary |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5696 (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
|
5697 (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
|
5698 "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
|
5699 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
|
5700 (let ((i (length string)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5701 (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
|
5702 (while (> i 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5703 (setq i (1- i)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5704 (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
|
5705 (aset newstr i tochar))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5706 newstr))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5707 ;;;_ > wholenump if necessary |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5708 (if (not (fboundp 'wholenump)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5709 (defalias 'wholenump 'natnump)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5710 ;;;_ > remove-overlays if necessary |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5711 (if (not (fboundp 'remove-overlays)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5712 (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
|
5713 "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
|
5714 Overlays might be moved and/or split. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5715 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
|
5716 (unless beg (setq beg (point-min))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5717 (unless end (setq end (point-max))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5718 (if (< end beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5719 (setq beg (prog1 end (setq end beg)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5720 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5721 (dolist (o (overlays-in beg end)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5722 (when (eq (overlay-get o name) val) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5723 ;; Either push this overlay outside beg...end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5724 ;; or split it to exclude beg...end |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5725 ;; 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
|
5726 (if (< (overlay-start o) beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5727 (if (> (overlay-end o) end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5728 (progn |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5729 (move-overlay (copy-overlay o) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5730 (overlay-start o) beg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5731 (move-overlay o end (overlay-end o))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5732 (move-overlay o (overlay-start o) beg)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5733 (if (> (overlay-end o) end) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5734 (move-overlay o end (overlay-end o)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5735 (delete-overlay o))))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5736 ) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5737 ;;;_ > copy-overlay if necessary - xemacs ~ 21.4 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5738 (if (not (fboundp 'copy-overlay)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5739 (defun copy-overlay (o) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5740 "Return a copy of overlay O." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5741 (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
|
5742 ;; 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
|
5743 ;; insertion-type of the two markers. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5744 (overlay-buffer o))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5745 (props (overlay-properties o))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5746 (while props |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5747 (overlay-put o1 (pop props) (pop props))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5748 o1))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5749 ;;;_ > add-to-invisibility-spec if necessary - xemacs ~ 21.4 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5750 (if (not (fboundp 'add-to-invisibility-spec)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5751 (defun add-to-invisibility-spec (element) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5752 "Add ELEMENT to `buffer-invisibility-spec'. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5753 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
|
5754 that can be added." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5755 (if (eq buffer-invisibility-spec t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5756 (setq buffer-invisibility-spec (list t))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5757 (setq buffer-invisibility-spec |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5758 (cons element buffer-invisibility-spec)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5759 ;;;_ > remove-from-invisibility-spec if necessary - xemacs ~ 21.4 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5760 (if (not (fboundp 'remove-from-invisibility-spec)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5761 (defun remove-from-invisibility-spec (element) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5762 "Remove ELEMENT from `buffer-invisibility-spec'." |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5763 (if (consp buffer-invisibility-spec) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5764 (setq buffer-invisibility-spec (delete element |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5765 buffer-invisibility-spec))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5766 ;;;_ > move-beginning-of-line if necessary - older emacs, xemacs |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5767 (if (not (fboundp 'move-beginning-of-line)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5768 (defun move-beginning-of-line (arg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5769 "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
|
5770 \(This disregards invisible newlines such as those |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5771 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
|
5772 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5773 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
|
5774 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
|
5775 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
|
5776 (interactive "p") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5777 (or arg (setq arg 1)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5778 (if (/= arg 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5779 (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
|
5780 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5781 (let ((orig (point))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5782 ;; Move to beginning-of-line, ignoring fields and invisibles. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5783 (skip-chars-backward "^\n") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5784 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5785 (goto-char (if (featurep 'xemacs) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5786 (previous-property-change (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5787 (previous-char-property-change (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5788 (skip-chars-backward "^\n")) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5789 (vertical-motion 0) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5790 (if (/= orig (point)) |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
5791 (goto-char orig)))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5792 ) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5793 ;;;_ > move-end-of-line if necessary - older emacs, xemacs |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5794 (if (not (fboundp 'move-end-of-line)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5795 (defun move-end-of-line (arg) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5796 "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
|
5797 \(This disregards invisible newlines such as those |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5798 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
|
5799 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5800 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
|
5801 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
|
5802 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
|
5803 (interactive "p") |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5804 (or arg (setq arg 1)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5805 (let ((orig (point)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5806 done) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5807 (while (not done) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5808 (let ((newpos |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5809 (save-excursion |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5810 (let ((goal-column 0)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5811 (and (condition-case nil |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5812 (or (line-move arg) t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5813 (error nil)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5814 (not (bobp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5815 (progn |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5816 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5817 (goto-char (previous-char-property-change (point)))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5818 (backward-char 1))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5819 (point))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5820 (goto-char newpos) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5821 (if (and (> (point) newpos) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5822 (eq (preceding-char) ?\n)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5823 (backward-char 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5824 (if (and (> (point) newpos) (not (eobp)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5825 (not (eq (following-char) ?\n))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5826 ;; If we skipped something intangible |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5827 ;; 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
|
5828 ;; keep going. |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5829 (setq arg 1) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5830 (setq done t))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5831 (if (/= orig (point)) |
69481
be6a0491d438
* allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69250
diff
changeset
|
5832 (goto-char orig)))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5833 ) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5834 ;;;_ > line-move-invisible-p if necessary |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5835 (if (not (fboundp 'line-move-invisible-p)) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5836 (defun line-move-invisible-p (pos) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5837 "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
|
5838 (let ((prop |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5839 (get-char-property pos 'invisible))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5840 (if (eq buffer-invisibility-spec t) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5841 prop |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5842 (or (memq prop buffer-invisibility-spec) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5843 (assq prop buffer-invisibility-spec)))))) |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5844 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5845 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5846 ;;;_ #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
|
5847 ;;;_ > 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
|
5848 (defun allout-bullet-isearch (&optional bullet) |
29490 | 5849 "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
|
5850 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5851 (if (not bullet) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5852 (setq bullet (solicit-char-in-string |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5853 "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
|
5854 (regexp-sans-escapes allout-bullets-string)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5855 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5856 (let ((isearch-regexp t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5857 (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
|
5858 allout-header-prefix |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5859 "[ \t]*" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5860 bullet))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5861 (isearch-repeat 'forward) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5862 (isearch-mode t))) |
68953
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5863 |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5864 ;;;_ #11 Provide |
0ddd5b380ffb
Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents:
68651
diff
changeset
|
5865 (provide 'allout) |
3430 | 5866 |
5867 ;;;_* Local emacs vars. | |
69124
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5868 ;; The following `allout-layout' local variable setting: |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5869 ;; - 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
|
5870 ;; - shows the children of the third to last (config vars) |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5871 ;; - and the second to last (code section), |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5872 ;; - and closes the last topic (this local-variables section). |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5873 ;;Local variables: |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5874 ;;allout-layout: (0 : -1 -1 0) |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5875 ;;End: |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5876 |
f6b5ed4f7f58
Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68956
diff
changeset
|
5877 ;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
5878 ;;; allout.el ends here |