Mercurial > emacs
annotate lisp/allout.el @ 68384:1d4de26bcb1f
(vc-default-dired-state-info): Pass FILE to vc-user-login-name.
(vc-default-update-changelog): Don't use vc-user-login-name, we don't
need it here.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Wed, 25 Jan 2006 18:55:41 +0000 |
parents | c3cfae9a5571 |
children | 3bd95f4f2941 37d0562504bf 7beb78bc1f8e |
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, |
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64474
diff
changeset
|
4 ;; 2005 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 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
9 ;; Version: 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 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
31 ;; Allout outline mode provides extensive outline formatting and |
29490 | 32 ;; and manipulation beyond standard emacs outline mode. It provides |
33 ;; for structured editing of outlines, as well as navigation and | |
34 ;; exposure. It also provides for syntax-sensitive text like | |
35 ;; programming languages. (For an example, see the allout code | |
36 ;; itself, which is organized in ;; an outline framework.) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
37 ;; |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
38 ;; Some features: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
39 ;; |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
40 ;; - classic outline-mode topic-oriented navigation and exposure adjustment |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
41 ;; - topic-oriented editing including coherent topic and subtopic |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
42 ;; creation, promotion, demotion, cut/paste across depths, etc |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
43 ;; - incremental search with dynamic exposure and reconcealment of text |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
44 ;; - customizable bullet format enbles programming-language specific |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
45 ;; outlining, for ultimate code-folding editing. (allout code itself is |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
46 ;; formatted as an outline - do ESC-x eval-current-buffer in allout.el |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
47 ;; to try it out.) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
48 ;; - configurable per-file initial exposure settings |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
49 ;; - symmetric-key and key-pair topic encryption, plus symmetric passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
50 ;; 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
|
51 ;; (using a stashed encrypted dummy string) and user-supplied hint |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
52 ;; maintenance. (see allout-toggle-current-subtree-encryption docstring.) |
29490 | 53 ;; - 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
|
54 ;; - "hot-spot" operation, for single-keystroke maneuvering and |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
55 ;; exposure control (see the allout-mode docstring) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
56 ;; - easy rendering of exposed portions into numbered, latex, indented, etc |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
57 ;; outline styles |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
58 ;; |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
59 ;; and more. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
60 ;; |
29490 | 61 ;; 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
|
62 ;; 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
|
63 ;; 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
|
64 ;; activation of allout-mode. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
65 ;; |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
66 ;; 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
|
67 ;; `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
|
68 ;; `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
|
69 ;; 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
|
70 ;; |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
71 ;; Note - the lines beginning with `;;;_' are outline topic headers. |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
72 ;; 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
|
73 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
74 ;; 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
|
75 |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
76 ;;; Code: |
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
77 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
78 ;;;_* Provide |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
79 ;(provide 'outline) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
80 (provide 'allout) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
81 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
82 ;;;_* Dependency autoloads |
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) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
85 (fset 'allout-real-isearch-abort |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
86 (symbol-function 'isearch-abort)) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
87 )) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
88 (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
|
89 "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
|
90 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
91 ;;;_* USER CUSTOMIZATION VARIABLES: |
21088 | 92 (defgroup allout nil |
93 "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
|
94 :prefix "allout-" |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
95 :group 'outlines) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
96 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
97 ;;;_ + 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
|
98 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
99 ;;;_ = 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
|
100 (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
|
101 "*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
|
102 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
103 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
|
104 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
|
105 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
|
106 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
|
107 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
108 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
|
109 \(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
|
110 `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
|
111 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
112 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
|
113 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
|
114 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
115 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
|
116 auto-layout is not. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
117 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
118 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
|
119 enabled. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
120 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
121 See the docstring for `allout-init' for the proper interface to |
29490 | 122 this variable." |
123 :type '(choice (const :tag "On" t) | |
124 (const :tag "Ask about layout" "ask") | |
125 (const :tag "Mode only" "activate") | |
126 (const :tag "Off" nil)) | |
127 :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
|
128 ;;;_ = 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
|
129 (defvar allout-layout nil |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
130 "*Layout specification and provisional mode trigger for allout outlines. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
131 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
132 Buffer-specific. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
133 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
134 A list value specifies a default layout for the current buffer, to be |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
135 applied upon activation of `allout-mode'. Any non-nil value will |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
136 automatically trigger `allout-mode' \(provided `allout-init' has been called |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
137 to enable this behavior). |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
138 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
139 See the docstring for `allout-init' for details on setting up for |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
140 auto-mode-activation, and for `allout-expose-topic' for the format of |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
141 the layout specification. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
142 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
143 You can associate a particular outline layout with a file by setting |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
144 this var via the file's local variables. For example, the following |
11034
27df51bcb4b0
(outline-layout): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
10867
diff
changeset
|
145 lines at the bottom of an Emacs Lisp file: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
146 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
147 ;;;Local variables: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
148 ;;;allout-layout: \(0 : -1 -1 0) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
149 ;;;End: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
150 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
151 will, modulo the above-mentioned conditions, cause the mode to be |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
152 activated when the file is visited, followed by the equivalent of |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
153 `\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
154 the allout.el, itself.) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
155 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
156 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
|
157 to the comment-start string, if any, of the language of the file. This |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
158 is modulo the setting of `allout-use-mode-specific-leader', which see.") |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
159 (make-variable-buffer-local 'allout-layout) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
160 ;;;_ = 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
|
161 (defcustom allout-show-bodies nil |
29490 | 162 "*If non-nil, show entire body when exposing a topic, rather than |
163 just the header." | |
164 :type 'boolean | |
165 :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
|
166 (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
|
167 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
168 ;;;_ = 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
|
169 (defcustom allout-header-prefix "." |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
170 "*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
|
171 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
172 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
|
173 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
|
174 \(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
|
175 character, which is typically set to the `allout-primary-bullet'. Many |
21088 | 176 outlines start at level 2 to avoid this discrepancy." |
177 :type 'string | |
178 :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
|
179 (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
|
180 ;;;_ = 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
|
181 (defcustom allout-primary-bullet "*" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
182 "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
|
183 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
184 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
|
185 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
|
186 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
|
187 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
188 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
|
189 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
|
190 and `allout-distinctive-bullets-string' for the range of available |
21088 | 191 bullets." |
192 :type 'string | |
193 :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
|
194 (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
|
195 ;;;_ = 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
|
196 (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
|
197 "*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
|
198 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
199 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
|
200 bullets. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
201 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
202 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
|
203 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
204 Outline mode has to be reactivated in order for changes to the value |
21088 | 205 of this var to take effect." |
206 :type 'string | |
207 :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
|
208 (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
|
209 ;;;_ = 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
|
210 (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
|
211 "*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
|
212 |
29490 | 213 These bullets are used to distinguish topics from the run-of-the-mill |
214 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
|
215 the topic-opening, shifting, and rebulleting \(eg, on topic shift, |
29490 | 216 topic paste, blanket rebulleting) routines, but are offered among the |
217 choices for rebulleting. They are not altered by the above automatic | |
218 rebulleting, so they can be used to characterize topics, eg: | |
219 | |
220 `?' question topics | |
221 `\(' parenthetic comment \(with a matching close paren inside) | |
222 `[' 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
|
223 `\"' a quotation |
29490 | 224 `=' value settings |
225 `~' \"more or less\" | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
226 `^' see above |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
227 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
228 ... 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
|
229 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
|
230 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
231 See `allout-plain-bullets-string' for the selection of |
29490 | 232 alternating bullets. |
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 You must run `set-allout-regexp' in order for outline mode to |
29490 | 235 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
|
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, `]', on either of the bullet |
21088 | 238 strings." |
239 :type 'string | |
240 :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
|
241 (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
|
242 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
243 ;;;_ = 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
|
244 (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
|
245 "*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
|
246 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
247 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
|
248 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
|
249 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
|
250 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
251 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
|
252 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
253 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
|
254 alist, then use comment-start string, if any, then use default \(`.'). |
29490 | 255 \(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
|
256 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
257 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
|
258 `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
|
259 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
260 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
|
261 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
262 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
|
263 `_' 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
|
264 comment strings. comment-start strings that do end in spaces are not |
29490 | 265 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
|
266 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
|
267 can use `allout-mode-leaders' to override this behavior, when |
21088 | 268 incorrect.]" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
269 :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
|
270 (const allout-mode-leaders) |
21088 | 271 (const comment-start)) |
272 :group 'allout) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
273 ;;;_ = 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
|
274 (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
|
275 "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
|
276 |
29490 | 277 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
|
278 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
|
279 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
280 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
|
281 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
|
282 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
|
283 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
|
284 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
285 ;;;_ = 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
|
286 (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
|
287 "*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
|
288 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
289 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
|
290 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
|
291 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
|
292 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
293 Whatever the setting of this variable, both old and new style prefixes |
21088 | 294 are always respected by the topic maneuvering functions." |
295 :type 'boolean | |
296 :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
|
297 (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
|
298 ;;;_ = 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
|
299 (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
|
300 "*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
|
301 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
302 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
|
303 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
|
304 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
|
305 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
|
306 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
307 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
|
308 prefixes: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
309 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
310 * Top level |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
311 .* A topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
312 . + One level 3 subtopic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
313 . . One level 4 subtopic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
314 . . A second 4 subtopic |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
315 . + Another level 3 subtopic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
316 . #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
|
317 . #2 Another |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
318 . ! 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
|
319 . #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
|
320 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
321 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
|
322 numbered and other distinctive bullets retained): |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
323 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
324 * Top level |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
325 .* A topic |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
326 . * One level 3 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
327 . * One level 4 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
328 . * A second 4 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
329 . * Another level 3 subtopic |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
330 . #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
|
331 . #2 Another |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
332 . ! 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
|
333 . #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
|
334 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
335 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
|
336 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
|
337 this variable setting. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
338 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
339 The setting of this var is not relevant when `allout-old-style-prefixes' |
21088 | 340 is non-nil." |
341 :type 'boolean | |
342 :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
|
343 (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
|
344 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
345 ;;;_ = 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
|
346 (defcustom allout-numbered-bullet "#" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
347 "*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
|
348 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
349 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
|
350 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
|
351 to \"#\", you can set it to a bullet of your choice. A nil value |
21088 | 352 disables numbering maintenance." |
353 :type '(choice (const nil) string) | |
354 :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
|
355 (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
|
356 ;;;_ = 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
|
357 (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
|
358 "*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
|
359 |
29490 | 360 Set this var to the bullet you want to use for file cross-references." |
21088 | 361 :type '(choice (const nil) string) |
362 :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
|
363 ;;;_ = 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
|
364 (defcustom allout-presentation-padding 2 |
29490 | 365 "*Presentation-format white-space padding factor, for greater indent." |
366 :type 'integer | |
367 :group 'allout) | |
368 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
369 (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
|
370 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
371 ;;;_ = 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
|
372 (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
|
373 "*If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic |
29490 | 374 numbers to minimal amount with some context. Otherwise, entire |
375 numbers are always used." | |
376 :type 'boolean | |
377 :group 'allout) | |
378 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
379 ;;;_ + 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
|
380 ;;;_ - 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
|
381 (defcustom allout-number-pages nil |
21088 | 382 "*Non-nil turns on page numbering for LaTeX formatting of an outline." |
383 :type 'boolean | |
384 :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
|
385 ;;;_ - 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
|
386 (defcustom allout-label-style "\\large\\bf" |
21088 | 387 "*Font and size of labels for LaTeX formatting of an outline." |
388 :type '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 ;;;_ - 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
|
391 (defcustom allout-head-line-style "\\large\\sl " |
21088 | 392 "*Font and size of entries for LaTeX formatting of an outline." |
393 :type 'string | |
394 :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
|
395 ;;;_ - 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
|
396 (defcustom allout-body-line-style " " |
21088 | 397 "*Font and size of entries for LaTeX formatting of an outline." |
398 :type 'string | |
399 :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
|
400 ;;;_ - 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
|
401 (defcustom allout-title-style "\\Large\\bf" |
21088 | 402 "*Font and size of titles for LaTeX formatting of an outline." |
403 :type 'string | |
404 :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
|
405 ;;;_ - allout-title |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
406 (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
|
407 "*Expression to be evaluated to determine the title for LaTeX |
21088 | 408 formatted copy." |
409 :type 'sexp | |
410 :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
|
411 ;;;_ - 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
|
412 (defcustom allout-line-skip ".05cm" |
21088 | 413 "*Space between lines for LaTeX formatting of an outline." |
414 :type 'string | |
415 :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
|
416 ;;;_ - 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
|
417 (defcustom allout-indent ".3cm" |
21088 | 418 "*LaTeX formatted depth-indent spacing." |
419 :type 'string | |
420 :group 'allout) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
421 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
422 ;;;_ + Topic encryption |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
423 ;;;_ = allout-topic-encryption-bullet |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
424 (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
|
425 "*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
|
426 :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
|
427 :group 'allout) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
428 ;;;_ = allout-passphrase-verifier-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
429 (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
|
430 "*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
|
431 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
432 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
|
433 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
|
434 :type 'boolean |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
435 :group 'allout) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
436 (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
|
437 ;;;_ = allout-passphrase-hint-handling |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
438 (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
|
439 "*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
|
440 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
441 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
|
442 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
|
443 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
|
444 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
445 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
|
446 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
|
447 :type '(choice (const always) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
448 (const needed) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
449 (const disabled)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
450 :group 'allout) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
451 (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
|
452 ;;;_ = 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
|
453 (defcustom 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
|
454 "*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
|
455 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
456 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
|
457 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
|
458 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
459 - 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
|
460 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
|
461 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
|
462 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
|
463 encrypted.) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
464 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
|
465 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
|
466 - 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
|
467 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
|
468 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
|
469 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
|
470 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
|
471 - 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
|
472 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
473 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
|
474 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
|
475 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
|
476 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
|
477 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
|
478 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
479 :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
|
480 (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
|
481 (const :tag "No" nil)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
482 :group 'allout) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
483 (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
|
484 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
485 ;;;_ + Miscellaneous customization |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
486 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
487 ;;;_ = allout-command-prefix |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
488 (defcustom allout-command-prefix "\C-c" |
29490 | 489 "*Key sequence to be used as prefix for outline mode command key bindings." |
490 :type 'string | |
491 :group 'allout) | |
492 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
493 ;;;_ = 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
|
494 ;;; 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
|
495 ;;; 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
|
496 (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
|
497 "*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
|
498 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
499 String or vector key will be prefaced with `allout-command-prefix', |
29490 | 500 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
|
501 (setq allout-keybindings-list |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
502 '( |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
503 ; 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
|
504 ("\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
|
505 ("\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
|
506 ("\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
|
507 ("\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
|
508 ("\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
|
509 ("\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
|
510 ("\C-e" allout-end-of-entry) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
511 ; 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
|
512 ("\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
|
513 ("\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
|
514 ("\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
|
515 ("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
|
516 ("\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
|
517 ("!" allout-show-all) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
518 ("x" allout-toggle-current-subtree-encryption) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
519 ; 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
|
520 (" " 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
|
521 ("." 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
|
522 ("," 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
|
523 ("'" 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
|
524 (">" 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
|
525 ("<" 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
|
526 ("\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
|
527 ("*" 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
|
528 ("#" 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
|
529 ("\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
|
530 ("\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
|
531 ("\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
|
532 ("\C-k" allout-kill-topic) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
533 ; 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
|
534 ;([?\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
|
535 ("@" 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
|
536 ("=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
|
537 ("=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
|
538 ("=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
|
539 ("=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
|
540 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
541 ;;;_ = allout-isearch-dynamic-expose |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
542 (defcustom allout-isearch-dynamic-expose t |
29490 | 543 "*Non-nil enable dynamic exposure of hidden incremental-search |
544 targets as they're encountered." | |
21088 | 545 :type 'boolean |
546 :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
|
547 (make-variable-buffer-local 'allout-isearch-dynamic-expose) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
548 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
549 ;;;_ = 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
|
550 (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
|
551 "*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
|
552 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
|
553 relevant mostly for use with indented-text-mode, or other situations |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
554 where auto-fill occurs. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
555 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
556 \[This feature no longer depends in any way on the `filladapt.el' |
21088 | 557 lisp-archive package.\]" |
558 :type 'boolean | |
559 :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
|
560 (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
|
561 |
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-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
|
563 (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
|
564 'text) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
565 "*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
|
566 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
567 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
|
568 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
|
569 the header. |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
570 |
50855
31ce4fcda3d8
(allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents:
49966
diff
changeset
|
571 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
|
572 those that do not have the variable `comment-start' set. A value of |
21088 | 573 `force' enables reindent whether or not `comment-start' is set." |
574 :type '(choice (const nil) (const t) (const text) (const force)) | |
575 :group 'allout) | |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
576 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
577 (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
|
578 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
579 ;;;_ = 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
|
580 (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
|
581 "*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
|
582 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
583 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
|
584 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
|
585 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
586 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
|
587 is nil. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
588 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
589 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
|
590 For details, see `allout-toggle-current-subtree-encryption's docstring." |
21088 | 591 :type 'boolean |
592 :group 'allout) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
593 (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
|
594 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
595 ;;;_* CODE - no user customizations below. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
596 |
29490 | 597 ;;;_ #1 Internal Outline Formatting and Configuration |
598 ;;;_ : 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
|
599 ;;;_ = allout-version |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
600 (defvar allout-version "2.1" |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
601 "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
|
602 ;;;_ > 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
|
603 (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
|
604 "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
|
605 (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
|
606 (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
|
607 (if here (insert msg)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
608 (message "%s" msg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
609 msg)) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
610 ;;;_ : 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
|
611 ;;;_ = allout-mode |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
612 (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
|
613 (make-variable-buffer-local 'allout-mode) |
29490 | 614 ;;;_ : 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
|
615 ;;;_ = 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
|
616 (defvar allout-regexp "" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
617 "*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
|
618 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
619 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
|
620 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
|
621 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
|
622 (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
|
623 ;;;_ = 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
|
624 (defvar allout-bullets-string "" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
625 "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
|
626 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
627 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
|
628 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
|
629 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
|
630 (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
|
631 ;;;_ = 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
|
632 (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
|
633 "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
|
634 (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
|
635 ;;;_ = 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
|
636 (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
|
637 "`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
|
638 |
7639 | 639 \(Ie, C-j, *or* C-m, for prefixes of hidden topics). This is properly |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
640 set when `allout-regexp' is produced by `set-allout-regexp', so |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
641 that (match-beginning 2) and (match-end 2) delimit the prefix.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
642 (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
|
643 ;;;_ = 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
|
644 (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
|
645 "Like `allout-line-boundary-regexp', for headers at beginning of buffer. |
29490 | 646 \(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
|
647 (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
|
648 ;;;_ = 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
|
649 (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
|
650 "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
|
651 (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
|
652 ;;;_ = 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
|
653 (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
|
654 "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
|
655 (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
|
656 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
657 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
658 ;;;_ 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
|
659 (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
|
660 "*Reset the leading string used to identify topic headers." |
3430 | 661 (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
|
662 (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
|
663 (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
|
664 (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
|
665 ;;;_ 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
|
666 (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
|
667 "*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
|
668 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
669 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
|
670 language comments. Returns the leading string." |
3430 | 671 |
672 (interactive "P") | |
673 (if (not (stringp header-lead)) | |
674 (setq header-lead (read-string | |
675 "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
|
676 (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
|
677 (allout-reset-header-lead header-lead) |
3430 | 678 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
|
679 ;;;_ > 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
|
680 (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
|
681 "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
|
682 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
683 Works according to settings of: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
684 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
685 `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
|
686 `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
|
687 `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
|
688 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
|
689 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
690 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
|
691 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
|
692 (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
|
693 (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
|
694 (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
|
695 '(allout-mode-leaders |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
696 comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
697 t))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
698 allout-use-mode-specific-leader |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
699 ;; 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
|
700 t))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
701 (leader |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
702 (cond |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
703 ((not use-leader) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
704 ;; Use the explicitly designated leader: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
705 ((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
|
706 (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
|
707 ;; 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
|
708 (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
|
709 ;; ... 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
|
710 (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
|
711 comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
712 ;; Use comment-start, maybe tripled, and with |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
713 ;; underscore: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
714 (concat |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
715 (if (string= " " |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
716 (substring comment-start |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
717 (1- (length comment-start)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
718 ;; 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
|
719 (substring comment-start 0 -1) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
720 (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
|
721 ;; ... and append underscore, whichever: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
722 "_"))))))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
723 (if (not leader) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
724 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
|
725 (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
|
726 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
|
727 (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
|
728 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
|
729 ;;;_ > 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
|
730 (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
|
731 "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
|
732 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
733 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
|
734 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
|
735 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
|
736 (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
|
737 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
|
738 (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
|
739 (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
|
740 ;;;_ > 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
|
741 (defun set-allout-regexp () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
742 "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
|
743 |
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 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
|
745 `allout-distinctive-bullets-string'." |
3430 | 746 |
747 (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
|
748 ;; 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
|
749 (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
|
750 (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
|
751 '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
|
752 'allout-primary-bullet)) |
3430 | 753 cur-string |
754 cur-len | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
755 cur-char |
3430 | 756 cur-char-string |
757 index | |
758 new-string) | |
759 (while strings | |
760 (setq new-string "") (setq index 0) | |
761 (setq cur-len (length (setq cur-string (symbol-value (car strings))))) | |
762 (while (< index cur-len) | |
763 (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
|
764 (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
|
765 (concat allout-bullets-string |
3430 | 766 (cond |
767 ; Single dash would denote a | |
768 ; sequence, repeated denotes | |
769 ; a dash: | |
770 ((eq cur-char ?-) "--") | |
771 ; literal close-square-bracket | |
772 ; doesn't work right in the | |
773 ; expr, exclude it: | |
774 ((eq cur-char ?\]) "") | |
775 (t (regexp-quote (char-to-string cur-char)))))) | |
776 (setq index (1+ index))) | |
777 (setq strings (cdr strings))) | |
778 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
779 ;; 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
|
780 (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
|
781 (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
|
782 ;; 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
|
783 (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
|
784 allout-header-prefix |
3430 | 785 "[ \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
|
786 allout-bullets-string |
3430 | 787 "]\\)\\|\\" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
788 allout-primary-bullet |
3430 | 789 "+\\|\^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
|
790 (setq allout-line-boundary-regexp |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
791 (concat "\\([\n\r]\\)\\(" allout-regexp "\\)")) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
792 (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
|
793 (concat "\\(\\`\\)\\(" allout-regexp "\\)")) |
3430 | 794 ) |
29490 | 795 ;;;_ : 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
|
796 ;;;_ = 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
|
797 (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
|
798 ;;;_ > 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
|
799 (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
|
800 "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
|
801 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
802 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
|
803 See doc string for allout-keybindings-list for format of binding list." |
29490 | 804 (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
|
805 (pref (list allout-command-prefix))) |
29490 | 806 (mapcar (function |
807 (lambda (cell) | |
808 (let ((add-pref (null (cdr (cdr cell)))) | |
809 (key-suff (list (car cell)))) | |
810 (apply 'define-key | |
811 (list map | |
812 (apply 'concat (if add-pref | |
813 (append pref key-suff) | |
814 key-suff)) | |
815 (car (cdr cell))))))) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
816 keymap-list) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
817 map)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
818 ;;;_ = 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
|
819 (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
|
820 "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
|
821 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
|
822 activation. Being deprecated.") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
823 ;;;_ = 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
|
824 (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
|
825 "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
|
826 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
|
827 activation. Being deprecated.") |
29490 | 828 ;;;_ : Menu bar |
54952
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
829 (defvar allout-mode-exposure-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
830 (defvar allout-mode-editing-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
831 (defvar allout-mode-navigation-menu) |
5e2b4f7225cb
(allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents:
54770
diff
changeset
|
832 (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
|
833 (defun produce-allout-mode-menubar-entries () |
29490 | 834 (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
|
835 (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
|
836 allout-mode-map |
29490 | 837 "Allout outline exposure menu." |
838 '("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
|
839 ["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
|
840 ["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
|
841 ["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
|
842 ["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
|
843 ["Hide Leaves" allout-hide-current-leaves t] |
29490 | 844 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
845 ["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
|
846 (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
|
847 allout-mode-map |
29490 | 848 "Allout outline editing menu." |
849 '("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
|
850 ["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
|
851 ["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
|
852 ["Open Supertopic" allout-open-supertopic t] |
29490 | 853 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
854 ["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
|
855 ["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
|
856 ["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
|
857 ["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
|
858 ["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
|
859 "----" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
860 ["Toggle Topic Encryption" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
861 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
|
862 (> (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
|
863 (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
|
864 allout-mode-map |
29490 | 865 "Allout outline navigation menu." |
866 '("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
|
867 ["Next Visible Heading" allout-next-visible-heading t] |
29490 | 868 ["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
|
869 allout-previous-visible-heading t] |
29490 | 870 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
871 ["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
|
872 ["Forward Current Level" allout-forward-current-level t] |
29490 | 873 ["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
|
874 allout-backward-current-level t] |
29490 | 875 "----" |
876 ["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
|
877 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
|
878 ["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
|
879 ["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
|
880 (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
|
881 allout-mode-map |
29490 | 882 "Allout outlines miscellaneous bindings." |
883 '("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
|
884 ["Version" allout-version t] |
29490 | 885 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
886 ["Duplicate Exposed" allout-copy-exposed-to-buffer t] |
29490 | 887 ["Duplicate Exposed, numbered" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
888 allout-flatten-exposed-to-buffer t] |
29490 | 889 ["Duplicate Exposed, indented" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
890 allout-indented-exposed-to-buffer t] |
29490 | 891 "----" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
892 ["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
|
893 ["Set New Exposure" allout-expose-topic t]))) |
29490 | 894 ;;;_ : 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
|
895 ;;;_ = 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
|
896 (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
|
897 "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
|
898 (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
|
899 ;;;_ > 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
|
900 (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
|
901 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
902 "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
|
903 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
904 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
|
905 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
|
906 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
|
907 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
|
908 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
|
909 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
|
910 from the list." |
3430 | 911 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
912 (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
|
913 prior-capsule ; By `capsule' i mean a list |
3430 | 914 ; containing a value, so we can |
915 ; distinguish nil from no value. | |
916 ) | |
917 | |
918 (if value | |
919 | |
920 ;; Registering: | |
921 (progn | |
922 (if on-list | |
923 nil ; Already preserved prior value - don't mess with it. | |
924 ;; 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
|
925 (setq allout-mode-prior-settings |
3430 | 926 (cons (list name |
927 (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
|
928 allout-mode-prior-settings))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
929 ; And impose the new value, locally: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
930 (progn (make-local-variable name) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
931 (set name (car value)))) |
3430 | 932 |
933 ;; Relinquishing: | |
934 (if (not on-list) | |
935 | |
936 ;; Oops, not registered - leave it be: | |
937 nil | |
938 | |
939 ;; Some registration: | |
940 ; reestablish it: | |
941 (setq prior-capsule (car (cdr on-list))) | |
942 (if prior-capsule | |
943 (set name (car prior-capsule)) ; Some prior value - reestablish it. | |
944 (makunbound name)) ; Previously unbound - demolish var. | |
945 ; Remove registration: | |
946 (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
|
947 (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
|
948 (if (not (eq (car allout-mode-prior-settings) |
3430 | 949 on-list)) |
950 (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
|
951 (cons (car allout-mode-prior-settings) |
3430 | 952 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
|
953 (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
|
954 (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
|
955 (setq allout-mode-prior-settings rebuild))))) |
3430 | 956 ) |
29490 | 957 ;;;_ : 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
|
958 ;;;_ = allout-pre-was-isearching nil |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
959 (defvar allout-pre-was-isearching nil |
29490 | 960 "Cue for isearch-dynamic-exposure mechanism, implemented in |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
961 allout-pre- and -post-command-hooks.") |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
962 (make-variable-buffer-local 'allout-pre-was-isearching) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
963 ;;;_ = allout-isearch-prior-pos nil |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
964 (defvar allout-isearch-prior-pos nil |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
965 "Cue for isearch-dynamic-exposure tracking, used by |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
966 `allout-isearch-expose'.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
967 (make-variable-buffer-local 'allout-isearch-prior-pos) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
968 ;;;_ = allout-isearch-did-quit |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
969 (defvar allout-isearch-did-quit nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
970 "Distinguishes isearch conclusion and cancellation. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
971 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
972 Maintained by allout-isearch-abort \(which is wrapped around the real |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
973 isearch-abort), and monitored by allout-isearch-expose for action.") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
974 (make-variable-buffer-local 'allout-isearch-did-quit) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
975 ;;;_ > allout-unprotected (expr) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
976 (defmacro allout-unprotected (expr) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
977 "Enable internal outline operations to alter read-only text." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
978 `(let ((was-inhibit-r-o inhibit-read-only)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
979 (unwind-protect |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
980 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
981 (setq inhibit-read-only t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
982 ,expr) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
983 (setq inhibit-read-only was-inhibit-r-o) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
984 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
985 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
986 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
987 ;;;_ = allout-undo-aggregation |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
988 (defvar allout-undo-aggregation 30 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
989 "Amount of successive self-insert actions to bunch together per undo. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
990 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
991 This is purely a kludge variable, regulating the compensation for a bug in |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
992 the way that `before-change-functions' and undo interact.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
993 (make-variable-buffer-local 'allout-undo-aggregation) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
994 ;;;_ = 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
|
995 (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
|
996 "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
|
997 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
|
998 to track repeats.") |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
999 ;;;_ = allout-file-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1000 (defvar allout-file-passphrase-verifier-string nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1001 "Name for use as a file variable for verifying encryption passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1002 across sessions.") |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1003 (make-variable-buffer-local 'allout-file-passphrase-verifier-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1004 ;;;_ = allout-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1005 (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
|
1006 "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
|
1007 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
|
1008 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1009 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
|
1010 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
|
1011 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
|
1012 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
|
1013 search attacks. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1014 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1015 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
|
1016 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
|
1017 `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
|
1018 (make-variable-buffer-local 'allout-passphrase-verifier-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1019 ;;;_ = allout-passphrase-hint-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1020 (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
|
1021 "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
|
1022 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1023 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
|
1024 the reminder is deployed. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1025 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1026 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
|
1027 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
|
1028 `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
|
1029 (make-variable-buffer-local 'allout-passphrase-hint-string) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1030 (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
|
1031 ;;;_ = allout-after-save-decrypt |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1032 (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
|
1033 "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
|
1034 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1035 - 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
|
1036 - 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
|
1037 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1038 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
|
1039 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
|
1040 (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
|
1041 ;;;_ > allout-mode-p () |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1042 ;; 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
|
1043 ;; 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
|
1044 (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
|
1045 "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
|
1046 'allout-mode) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1047 ;;;_ > 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
|
1048 (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
|
1049 "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
|
1050 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1051 (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
|
1052 (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
|
1053 (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
|
1054 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1055 (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
|
1056 'except-current) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1057 (point-marker)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1058 (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
|
1059 (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
|
1060 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1061 (message "auto-encrypting pending topics") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1062 (sit-for 2) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1063 (condition-case failure |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1064 (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
|
1065 (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
|
1066 (error (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1067 (message |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1068 "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
|
1069 failure) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1070 (sit-for 2)))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1071 )) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1072 nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1073 ;;;_ > 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
|
1074 (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
|
1075 "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
|
1076 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1077 (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
|
1078 ;; 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
|
1079 (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
|
1080 (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
|
1081 ;;;_ > allout-after-saves-handler () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1082 (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
|
1083 "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
|
1084 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1085 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
|
1086 the save. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1087 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1088 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
|
1089 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
|
1090 (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
|
1091 (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
|
1092 allout-after-save-decrypt)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1093 t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1094 (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
|
1095 (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
|
1096 (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
|
1097 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1098 (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
|
1099 (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
|
1100 (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
|
1101 ) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1102 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1103 ;;;_ #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
|
1104 ;;;_ = 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
|
1105 (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
|
1106 "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
|
1107 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
|
1108 (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
|
1109 ;;;_ > 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
|
1110 (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
|
1111 "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
|
1112 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1113 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
|
1114 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1115 - nil \(or no argument) deactivate auto-activation/layout; |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1116 - `activate', enable auto-activation only; |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1117 - `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
|
1118 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
|
1119 - `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
|
1120 - 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
|
1121 any confirmation check. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1122 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1123 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
|
1124 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
|
1125 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
|
1126 `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
|
1127 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1128 `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
|
1129 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
|
1130 setting. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1131 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1132 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
|
1133 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
|
1134 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1135 \(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
|
1136 \(allout-init t)" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1137 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1138 (interactive) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1139 (if (interactive-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1140 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1141 (setq mode |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1142 (completing-read |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1143 (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
|
1144 "(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
|
1145 '(("nil")("full")("activate")("deactivate") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1146 ("ask") ("report") ("")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1147 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1148 t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1149 (if (string= mode "") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1150 (setq mode 'report) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1151 (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
|
1152 (let |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1153 ;; 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
|
1154 ((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
|
1155 (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
|
1156 'find-file-hook |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1157 '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
|
1158 (curr-mode 'allout-auto-activation)) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1159 |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1160 (cond ((not mode) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1161 (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
|
1162 (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
|
1163 (if (interactive-p) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1164 (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
|
1165 ((eq mode 'report) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1166 (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
|
1167 (allout-init nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1168 ;; 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
|
1169 (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
|
1170 (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
|
1171 (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
|
1172 (cond ((eq mode 'activate) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1173 (message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1174 "Outline mode auto-activation enabled.") |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1175 'activate) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1176 ((eq mode 'report) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1177 ;; 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
|
1178 (allout-init mode)) |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1179 ((eq mode 'ask) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1180 (message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1181 (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
|
1182 "-layout \(upon confirmation) enabled.")) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1183 'ask) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1184 ((message |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1185 "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
|
1186 'full))))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
1187 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1188 ;;;_ > 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
|
1189 (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
|
1190 "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
|
1191 (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
|
1192 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
|
1193 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
|
1194 allout-mode-misc-menu)) |
29490 | 1195 cur) |
1196 (while menus | |
1197 (setq cur (car menus) | |
1198 menus (cdr menus)) | |
1199 (easy-menu-add cur)))) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1200 ;;;_ > allout-mode (&optional toggle) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1201 ;;;_ : Defun: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1202 ;;;###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
|
1203 (defun allout-mode (&optional toggle) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1204 ;;;_ . Doc string: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1205 "Toggle minor mode for controlling exposure and editing of text outlines. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1206 |
29490 | 1207 Optional arg forces mode to re-initialize iff arg is positive num or |
1208 symbol. Allout outline mode always runs as a minor mode. | |
1209 | |
48858
f4d079377a9a
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48857
diff
changeset
|
1210 Allout outline mode provides extensive outline oriented formatting and |
29490 | 1211 manipulation. It enables structural editing of outlines, as well as |
1212 navigation and exposure. It also is specifically aimed at | |
1213 accommodating syntax-sensitive text like programming languages. \(For | |
1214 an example, see the allout code itself, which is organized as an allout | |
1215 outline.) | |
1216 | |
1217 In addition to outline navigation and exposure, allout includes: | |
1218 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1219 - topic-oriented repositioning, promotion/demotion, cut, and paste |
29490 | 1220 - integral outline exposure-layout |
1221 - incremental search with dynamic exposure and reconcealment of hidden text | |
1222 - 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
|
1223 - easy topic encryption and decryption |
29490 | 1224 - \"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
|
1225 exposure control. \(See the allout-mode docstring.) |
29490 | 1226 |
1227 and many other features. | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1228 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1229 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
|
1230 special `allout-mode' features and terminology. See also the outline |
29490 | 1231 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
|
1232 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
|
1233 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
|
1234 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1235 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1236 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
|
1237 `allout-command-prefix' variables. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1238 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1239 Navigation: Exposure Control: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1240 ---------- ---------------- |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1241 \\[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
|
1242 \\[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
|
1243 \\[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
|
1244 \\[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
|
1245 \\[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
|
1246 \\[allout-end-of-entry] allout-end-of-entry |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1247 \\[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
|
1248 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1249 Topic Header Production: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1250 ----------------------- |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1251 \\[allout-open-sibtopic] allout-open-sibtopic Create a new sibling after current topic. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1252 \\[allout-open-subtopic] allout-open-subtopic ... an offspring of current topic. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1253 \\[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
|
1254 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1255 Topic Level and Prefix Adjustment: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1256 --------------------------------- |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1257 \\[allout-shift-in] allout-shift-in Shift current topic and all offspring deeper. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1258 \\[allout-shift-out] allout-shift-out ... less deep. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1259 \\[allout-rebullet-current-heading] allout-rebullet-current-heading Prompt for alternate bullet for |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1260 current topic. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1261 \\[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
|
1262 - 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
|
1263 alternated according to nesting depth. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1264 \\[allout-number-siblings] allout-number-siblings Number bullets of topic and siblings - the |
3430 | 1265 offspring are not affected. With repeat |
1266 count, revoke numbering. | |
1267 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1268 Topic-oriented Killing and Yanking: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1269 ---------------------------------- |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1270 \\[allout-kill-topic] allout-kill-topic Kill current topic, including offspring. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1271 \\[allout-kill-line] allout-kill-line Like kill-line, but reconciles numbering, etc. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1272 \\[allout-yank] allout-yank Yank, adjusting depth of yanked topic to |
3430 | 1273 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
|
1274 heading (ie, prefix sans text). |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1275 \\[allout-yank-pop] allout-yank-pop Is to allout-yank as yank-pop is to yank |
3430 | 1276 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1277 Misc commands: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1278 ------------- |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1279 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
|
1280 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
|
1281 for `allout-layout'. |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1282 \\[allout-mark-topic] allout-mark-topic |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1283 \\[allout-copy-exposed-to-buffer] allout-copy-exposed-to-buffer |
29490 | 1284 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
|
1285 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
|
1286 of current buffer - \"*BUFFERNAME exposed*\". |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1287 \\[allout-flatten-exposed-to-buffer] allout-flatten-exposed-to-buffer |
29490 | 1288 Like above 'copy-exposed', but convert topic |
1289 prefixes to section.subsection... numeric | |
1290 format. | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1291 ESC ESC (allout-init t) Setup Emacs session for outline mode |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1292 auto-activation. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1293 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1294 Encrypted Entries |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1295 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1296 Outline mode supports easily togglable gpg encryption of topics, with |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1297 niceties like support for symmetric and key-pair modes, passphrase timeout, |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1298 passphrase consistency checking, user-provided hinting for symmetric key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1299 mode, and auto-encryption of topics pending encryption on save. The aim is |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1300 to enable reliable topic privacy while preventing accidents like neglected |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1301 encryption, encryption with a mistaken passphrase, forgetting which |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1302 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
|
1303 |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1304 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
|
1305 `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
|
1306 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1307 HOT-SPOT Operation |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1308 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1309 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
|
1310 navigation and exposure control. |
3430 | 1311 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1312 \\<allout-mode-map> |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1313 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
|
1314 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
|
1315 corresponding allout-mode keymap control chars. For example, \"f\" |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1316 would invoke the command typically bound to \"C-c C-f\" |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1317 \(\\[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
|
1318 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1319 Thus, by positioning the cursor on a topic bullet, you can execute |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1320 the outline navigation and manipulation commands with a single |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1321 keystroke. Non-literal chars never get this special translation, so |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1322 you can use them to get away from the hot-spot, and back to normal |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1323 operation. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1324 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1325 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
|
1326 will move to the hot-spot when the cursor is already located at the |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1327 beginning of the current entry, so you can simply hit \\[allout-beginning-of-current-entry] |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1328 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
|
1329 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1330 Terminology |
3430 | 1331 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1332 Topic hierarchy constituents - TOPICS and SUBTOPICS: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1333 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1334 TOPIC: A basic, coherent component of an Emacs outline. It can |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1335 contain other topics, and it can be subsumed by other topics, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1336 CURRENT topic: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1337 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
|
1338 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
|
1339 containment. Also called the: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1340 LEVEL: The same as DEPTH. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1341 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1342 ANCESTORS: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1343 The topics that contain a topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1344 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
|
1345 the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1346 OFFSPRING: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1347 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
|
1348 SUBTOPIC: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1349 An immediate offspring of a topic; |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1350 CHILDREN: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1351 The immediate offspring of a topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1352 SIBLINGS: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1353 Topics having the same parent and depth. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1354 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1355 Topic text constituents: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1356 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1357 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
|
1358 text. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1359 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
|
1360 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
|
1361 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
|
1362 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
|
1363 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
|
1364 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1365 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
|
1366 of the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1367 PREFIX-LEAD: |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1368 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
|
1369 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
|
1370 `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
|
1371 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1372 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
|
1373 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
|
1374 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
|
1375 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
|
1376 docstring for more detail. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1377 PREFIX-PADDING: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1378 Spaces or asterisks which separate the prefix-lead and the |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1379 bullet, according to the depth of the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1380 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
|
1381 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
|
1382 `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
|
1383 for these variables for more details.) The default choice of |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1384 bullet when generating varies in a cycle with the depth of the |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1385 topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1386 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
|
1387 BODY: Same as ENTRY. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1388 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1389 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1390 EXPOSURE: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1391 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
|
1392 of its offspring and contained text. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1393 CONCEALED: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1394 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
|
1395 units of concealed text is represented by `...' ellipses. |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1396 (Ref the `selective-display' var.) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1397 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1398 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
|
1399 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
|
1400 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
|
1401 ;;;_ . Code |
3430 | 1402 (interactive "P") |
1403 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1404 (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
|
1405 (allout-mode-p))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1406 ; Massage universal-arg `toggle' val: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1407 (toggle (and toggle |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1408 (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
|
1409 toggle))) |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
1410 ; 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
|
1411 (explicit-activation (and toggle |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1412 (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
|
1413 (and (wholenump toggle) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
1414 (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
|
1415 ;; 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
|
1416 (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
|
1417 (car command-history))) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1418 (write-file-hook-var-name (if (boundp 'write-file-functions) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1419 'write-file-functions |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1420 'local-write-file-hooks)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1421 do-layout |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1422 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1423 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1424 ; 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
|
1425 (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
|
1426 |
3430 | 1427 (cond |
1428 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1429 ;; 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
|
1430 ;; 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
|
1431 ;; 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
|
1432 ;; 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
|
1433 ;; skip everything. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1434 ((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
|
1435 ; 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
|
1436 active ; Already activated. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1437 (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
|
1438 (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
|
1439 emacs-version)); 19.19. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1440 t) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1441 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1442 ;; Deactivation: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1443 ((and (not explicit-activation) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1444 (or active toggle)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1445 ; Activation not explicitly |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1446 ; requested, and either in |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1447 ; active state or *de*activation |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1448 ; 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
|
1449 (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
|
1450 (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
|
1451 ; 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
|
1452 ; as we set them: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1453 (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
|
1454 (mapcar (function |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1455 (lambda (cell) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1456 (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
|
1457 (car (cdr cell))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1458 (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
|
1459 (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
|
1460 allout-added-bindings) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1461 (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
|
1462 (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
|
1463 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1464 (if allout-old-style-prefixes |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1465 (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
|
1466 (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
|
1467 (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
|
1468 (allout-resumptions 'selective-display) |
29490 | 1469 (if (and (boundp 'before-change-functions) before-change-functions) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1470 (allout-resumptions 'before-change-functions)) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1471 (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
|
1472 (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
|
1473 (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
|
1474 (setq auto-save-hook |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1475 (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
|
1476 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
|
1477 (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
|
1478 (allout-resumptions 'paragraph-separate) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1479 (allout-resumptions (if (string-match "^18" emacs-version) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1480 'auto-fill-hook |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1481 '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
|
1482 (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
|
1483 (setq allout-mode nil)) |
3430 | 1484 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1485 ;; Activation: |
3430 | 1486 ((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
|
1487 (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
|
1488 (if allout-old-style-prefixes |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1489 (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
|
1490 (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
|
1491 (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
|
1492 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1493 (allout-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
|
1494 (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
|
1495 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1496 (set-allout-regexp) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1497 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1498 ; 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
|
1499 ; of allout-keybindings-list: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1500 (if (boundp 'minor-mode-map-alist) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1501 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1502 (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
|
1503 ; 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
|
1504 (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
|
1505 (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
|
1506 (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
|
1507 (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
|
1508 ; 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
|
1509 ; 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
|
1510 (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
|
1511 minor-mode-map-alist)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1512 (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
|
1513 (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
|
1514 minor-mode-map-alist)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1515 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1516 ; 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
|
1517 ; 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
|
1518 ; for later revocation: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1519 (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
|
1520 (list allout-keybindings-list)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1521 (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
|
1522 (list (current-local-map))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1523 ; 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
|
1524 (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
|
1525 (current-local-map))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1526 ) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1527 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1528 ; selective-display is the |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1529 ; emacs conditional exposure |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1530 ; mechanism: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1531 (allout-resumptions 'selective-display '(t)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1532 (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
|
1533 (add-hook 'post-command-hook 'allout-post-command-business) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
1534 (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
|
1535 (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
|
1536 ; 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
|
1537 ; respect for topic headline, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1538 ; hanging-indents, etc: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1539 (let* ((fill-func-var (if (string-match "^18" emacs-version) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1540 'auto-fill-hook |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1541 'auto-fill-function)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1542 (fill-func (symbol-value fill-func-var))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1543 ;; Register prevailing fill func for use by allout-auto-fill: |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1544 (allout-resumptions 'allout-former-auto-filler (list fill-func)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1545 ;; Register allout-auto-fill to be used if filling is active: |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1546 (allout-resumptions fill-func-var '(allout-auto-fill))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1547 ;; Paragraphs are broken by topic headlines. |
3430 | 1548 (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
|
1549 (allout-resumptions 'paragraph-start |
29490 | 1550 (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
|
1551 allout-regexp "\\)"))) |
3430 | 1552 (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
|
1553 (allout-resumptions 'paragraph-separate |
29490 | 1554 (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
|
1555 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
|
1556 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1557 (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
|
1558 (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
|
1559 (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
|
1560 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1561 (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
|
1562 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1563 (if allout-layout |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1564 (setq do-layout t)) |
3430 | 1565 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1566 (if (and allout-isearch-dynamic-expose |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1567 (not (fboundp 'allout-real-isearch-abort))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1568 (allout-enwrap-isearch)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1569 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1570 (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
|
1571 (setq allout-mode t)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1572 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1573 ;; Reactivation: |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1574 ((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
|
1575 (allout-infer-body-reindent)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1576 ) ; cond |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1577 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1578 (if (and do-layout |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1579 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
|
1580 (listp allout-layout) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1581 (and (not (eq allout-auto-activation 'activate)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1582 (if (eq allout-auto-activation 'ask) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1583 (if (y-or-n-p (format "Expose %s with layout '%s'? " |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1584 (buffer-name) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1585 allout-layout)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1586 t |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1587 (message "Skipped %s layout." (buffer-name)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1588 nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1589 t))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1590 (save-excursion |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1591 (message "Adjusting '%s' exposure..." (buffer-name)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1592 (goto-char 0) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1593 (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
|
1594 (condition-case err |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1595 (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
|
1596 (apply 'allout-expose-topic (list allout-layout)) |
7527
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1597 (message "Adjusting '%s' exposure... done." (buffer-name))) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1598 ;; Problem applying exposure - notify user, but don't |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1599 ;; interrupt, eg, file visit: |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1600 (error (message "%s" (car (cdr err))) |
1f09079e18c4
(outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents:
7476
diff
changeset
|
1601 (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
|
1602 allout-mode |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1603 ) ; let* |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1604 ) ; 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
|
1605 ;;;_ > allout-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
|
1606 (defalias 'allout-minor-mode 'allout-mode) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1607 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1608 ;;;_ #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
|
1609 ;;; All the basic outline functions that directly do string matches to |
3430 | 1610 ;;; 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
|
1611 ;;; `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
|
1612 ;;; 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
|
1613 ;;; 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
|
1614 ;;; 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
|
1615 ;;; 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
|
1616 ;;;_ = 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
|
1617 (defvar allout-recent-prefix-beginning 0 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1618 "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
|
1619 (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
|
1620 ;;;_ = 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
|
1621 (defvar allout-recent-prefix-end 0 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1622 "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
|
1623 (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
|
1624 ;;;_ = 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
|
1625 (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
|
1626 "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
|
1627 (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
|
1628 ;;;_ > 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
|
1629 (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
|
1630 "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
|
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 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
|
1633 `(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
|
1634 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
|
1635 ;;;_ > 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
|
1636 (defmacro allout-recent-depth () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1637 "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
|
1638 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1639 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
|
1640 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
|
1641 `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
|
1642 to return the current depth." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1643 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1644 '(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
|
1645 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
|
1646 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
|
1647 ;;;_ > 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
|
1648 (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
|
1649 "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
|
1650 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1651 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
|
1652 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
|
1653 `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
|
1654 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
|
1655 '(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
|
1656 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
|
1657 ;;;_ > 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
|
1658 (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
|
1659 "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
|
1660 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1661 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
|
1662 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
|
1663 `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
|
1664 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
|
1665 '(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
|
1666 allout-recent-prefix-end)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1667 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1668 ;;;_ #4 Navigation |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1669 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1670 ;;;_ - Position Assessment |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1671 ;;;_ : 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
|
1672 ;;;_ > 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
|
1673 (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
|
1674 "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
|
1675 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1676 Actually, returns prefix beginning point." |
3430 | 1677 (save-excursion |
1678 (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
|
1679 (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
|
1680 (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
|
1681 ;;;_ > 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
|
1682 (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
|
1683 ;;;_ > 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
|
1684 (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
|
1685 "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
|
1686 (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
|
1687 (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
|
1688 (= (point)(save-excursion (allout-end-of-prefix)(point))))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1689 ;;;_ > 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
|
1690 (defmacro allout-hidden-p () |
3430 | 1691 "True if point is in hidden text." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1692 '(save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1693 (and (re-search-backward "[\n\r]" () t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1694 (= ?\r (following-char))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1695 ;;;_ > allout-visible-p () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1696 (defmacro allout-visible-p () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1697 "True if point is not in hidden text." |
3430 | 1698 (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
|
1699 '(not (allout-hidden-p))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1700 ;;;_ : 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
|
1701 ;;;_ > 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
|
1702 (defsubst allout-depth () |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
1703 "Like `allout-current-depth', but respects hidden as well as visible topics." |
29490 | 1704 (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
|
1705 (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
|
1706 (allout-recent-depth) |
29490 | 1707 (progn |
1708 ;; Oops, no prefix, zero prefix data: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1709 (allout-prefix-data (point)(point)) |
29490 | 1710 ;; ... and return 0: |
1711 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
|
1712 ;;;_ > 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
|
1713 (defmacro allout-current-depth () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1714 "Return nesting depth of visible topic most immediately containing point." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1715 '(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
|
1716 (if (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1717 (max 1 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1718 (- 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
|
1719 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
|
1720 allout-header-subtraction)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1721 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
|
1722 ;;;_ > 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
|
1723 (defun allout-get-current-prefix () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1724 "Topic prefix of the current topic." |
3430 | 1725 (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
|
1726 (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
|
1727 (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
|
1728 ;;;_ > 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
|
1729 (defun allout-get-bullet () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1730 "Return bullet of containing topic (visible or not)." |
3430 | 1731 (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
|
1732 (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
|
1733 (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
|
1734 ;;;_ > 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
|
1735 (defun allout-current-bullet () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1736 "Return bullet of current (visible) topic heading, or none if none found." |
3430 | 1737 (condition-case err |
1738 (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
|
1739 (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
|
1740 (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
|
1741 allout-recent-prefix-end)) |
3430 | 1742 ;; Quick and dirty provision, ostensibly for missing bullet: |
29490 | 1743 ('args-out-of-range nil)) |
3430 | 1744 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1745 ;;;_ > 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
|
1746 (defun allout-get-prefix-bullet (prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1747 "Return the bullet of the header prefix string PREFIX." |
3430 | 1748 ;; Doesn't make sense if we're old-style prefixes, but this just |
1749 ;; 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
|
1750 (if (string-match allout-regexp prefix) |
3430 | 1751 (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
|
1752 ;;;_ > 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
|
1753 (defun allout-sibling-index (&optional depth) |
29490 | 1754 "Item number of this prospective topic among its siblings. |
1755 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1756 If optional arg DEPTH is greater than current depth, then we're |
29490 | 1757 opening a new level, and return 0. |
1758 | |
1759 If less than this depth, ascend to that depth and count..." | |
1760 | |
1761 (save-excursion | |
1762 (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
|
1763 ((or (not depth) (= depth (allout-depth))) |
29490 | 1764 (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
|
1765 (while (allout-previous-sibling (allout-recent-depth) nil) |
29490 | 1766 (setq index (1+ index))) |
1767 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
|
1768 ((< 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
|
1769 (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
|
1770 (allout-sibling-index)) |
29490 | 1771 (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
|
1772 ;;;_ > 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
|
1773 (defun allout-topic-flat-index () |
29490 | 1774 "Return a list indicating point's numeric section.subsect.subsubsect... |
1775 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
|
1776 (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
|
1777 (next-index (allout-sibling-index depth)) |
29490 | 1778 (rev-sibls nil)) |
1779 (while (> next-index 0) | |
1780 (setq rev-sibls (cons next-index rev-sibls)) | |
1781 (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
|
1782 (setq next-index (allout-sibling-index depth))) |
29490 | 1783 rev-sibls) |
1784 ) | |
3430 | 1785 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1786 ;;;_ - Navigation macros |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1787 ;;;_ > 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
|
1788 (defsubst allout-next-heading () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1789 "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
|
1790 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1791 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
|
1792 |
29490 | 1793 (if (and (bobp) (not (eobp))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1794 (forward-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1795 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1796 (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
|
1797 (allout-prefix-data ; Got valid location state - set vars: |
29490 | 1798 (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
|
1799 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
|
1800 (or (match-end 2) allout-recent-prefix-end)))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1801 ;;;_ : allout-this-or-next-heading |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1802 (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
|
1803 "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
|
1804 ;; 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
|
1805 ;; 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
|
1806 (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
|
1807 ;;;_ > 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
|
1808 (defmacro allout-previous-heading () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1809 "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
|
1810 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1811 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
|
1812 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1813 '(if (bobp) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1814 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
|
1815 (allout-goto-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1816 (if |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1817 ;; 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
|
1818 (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
|
1819 (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
|
1820 (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
|
1821 (allout-prefix-data |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1822 (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
|
1823 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
|
1824 (or (match-end 2) allout-recent-prefix-end)))))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1825 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1826 ;;;_ - Subtree Charting |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1827 ;;;_ " 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
|
1828 ;;; 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
|
1829 ;;; |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1830 ;;; 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
|
1831 ;;; 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
|
1832 ;;; out the subtopic locations. The chart then serves as the basis |
29490 | 1833 ;;; for assessment or adjustment of the subtree, without redundant |
1834 ;;; traversal of the structure. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1835 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1836 ;;;_ > allout-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
|
1837 (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
|
1838 "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
|
1839 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
1840 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
|
1841 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
|
1842 use. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1843 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1844 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
|
1845 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1846 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
|
1847 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
|
1848 for their elaborate manipulations. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1849 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1850 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
|
1851 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
|
1852 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
|
1853 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
|
1854 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
|
1855 itself. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1856 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
1857 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
|
1858 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
|
1859 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
|
1860 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1861 (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
|
1862 chart curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1863 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1864 (if original ; Just starting? |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1865 ; Register initial settings and |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1866 ; 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
|
1867 (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
|
1868 (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
|
1869 (allout-next-heading))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1870 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1871 ;; 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
|
1872 ;; 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
|
1873 ;; the typically quite constrained Emacs max-lisp-eval-depth. |
29490 | 1874 ;; |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1875 ;; 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
|
1876 ;; operation rather than recursing for lower levels. Bah. |
29490 | 1877 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1878 (while (and (not (eobp)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1879 ; 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
|
1880 (< 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
|
1881 (cond ((= prev-depth curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1882 ;; 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
|
1883 (setq chart (cons (point) chart)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1884 (if (and levels (<= levels 1)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1885 ;; 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
|
1886 (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
|
1887 ;; 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
|
1888 ;; 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
|
1889 (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
|
1890 (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
|
1891 (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
|
1892 (allout-next-heading))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1893 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1894 ((and (< prev-depth curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1895 (or (not levels) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1896 (> levels 0))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1897 ;; 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
|
1898 (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
|
1899 (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
|
1900 (1- levels)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1901 orig-depth |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1902 curr-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1903 chart)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1904 ;; ... then continue with this one. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1905 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1906 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1907 ;; ... 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
|
1908 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1909 ))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1910 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1911 (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
|
1912 ; the original level. Position |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1913 ; to the end of it: |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1914 (progn (and (not (eobp)) (forward-char -1)) |
29490 | 1915 (and (memq (preceding-char) '(?\n ?\r)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1916 (memq (aref (buffer-substring (max 1 (- (point) 3)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1917 (point)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1918 1) |
29490 | 1919 '(?\n ?\r)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1920 (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
|
1921 (setq allout-recent-end-of-subtree (point)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
1922 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1923 chart ; (nreverse chart) not necessary, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1924 ; and maybe not preferable. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1925 )) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
1926 ;;;_ > allout-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
|
1927 (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
|
1928 "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
|
1929 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
|
1930 for an explanation of charts." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1931 (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
|
1932 (if (allout-goto-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1933 (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
|
1934 (while (allout-next-sibling) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1935 (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
|
1936 (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
|
1937 ;;;_ > 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
|
1938 (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
|
1939 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1940 "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
|
1941 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
1942 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
|
1943 start point." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1944 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1945 (let (result here) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1946 (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
|
1947 chart) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1948 (setq here (car chart)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1949 (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
|
1950 (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
|
1951 (1- depth))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1952 ;; 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
|
1953 ;; more depth to go: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1954 (if further (setq result (append further result))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1955 (setq chart (cdr chart))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1956 (goto-char here) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1957 (if (= (preceding-char) ?\r) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1958 (setq result (cons here result))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1959 (setq chart (cdr chart)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1960 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
|
1961 ;;;_ 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
|
1962 ;; (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
|
1963 ;; "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
|
1964 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1965 ;; 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
|
1966 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1967 ;; 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
|
1968 ;; 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
|
1969 ;; 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
|
1970 ;; 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
|
1971 ;; 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
|
1972 ;; 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
|
1973 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1974 ;; 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
|
1975 ;; 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
|
1976 ;; exposed reside. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1977 |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1978 ;; - 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
|
1979 ;; 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
|
1980 ;; 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
|
1981 ;; - 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
|
1982 ;; opened. |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1983 ;; - 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
|
1984 ;; 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
|
1985 ;; exposure:" |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1986 ;; (while spec |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1987 ;; (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
|
1988 ;; ) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1989 ;; ) |
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
1990 ;; (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
|
1991 ;; ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1992 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
1993 ;;;_ - 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
|
1994 ;;;_ > 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
|
1995 (defun allout-goto-prefix () |
29490 | 1996 "Put point at beginning of immediately containing outline topic. |
1997 | |
1998 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
|
1999 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2000 Not sensitive to topic visibility. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2001 |
46161
29f1f32aee5b
(outline-goto-prefix): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
44182
diff
changeset
|
2002 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
|
2003 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2004 (let (done) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2005 (while (and (not done) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2006 (re-search-backward "[\n\r]" nil 1)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2007 (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
|
2008 (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
|
2009 (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
|
2010 (match-end 0))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2011 (forward-char -1))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2012 (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
|
2013 (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
|
2014 (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
|
2015 ((allout-next-heading)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2016 (done)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2017 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
|
2018 ;;;_ > 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
|
2019 (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
|
2020 "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
|
2021 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2022 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
|
2023 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
|
2024 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2025 (if (not (allout-goto-prefix)) |
3430 | 2026 nil |
2027 (let ((match-data (match-data))) | |
2028 (goto-char (match-end 0)) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2029 (if ignore-decorations |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2030 t |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2031 (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
|
2032 (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1))) |
29490 | 2033 (store-match-data match-data)) |
3430 | 2034 ;; 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
|
2035 (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
|
2036 ;;;_ > 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
|
2037 (defun allout-current-bullet-pos () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2038 "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
|
2039 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2040 (if (not (allout-current-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2041 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2042 (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
|
2043 ;;;_ > 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
|
2044 (defun allout-back-to-current-heading () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2045 "Move to heading line of current topic, or beginning if already on the line." |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2046 |
3430 | 2047 (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
|
2048 (prog1 (or (allout-on-current-heading-p) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2049 (and (re-search-backward (concat "^\\(" allout-regexp "\\)") |
3430 | 2050 nil |
2051 'move) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2052 (allout-prefix-data (match-beginning 1)(match-end 1)))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2053 (if (interactive-p) (allout-end-of-prefix)))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2054 ;;;_ > 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
|
2055 (defalias 'allout-back-to-heading 'allout-back-to-current-heading) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2056 ;;;_ > allout-pre-next-preface () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2057 (defun allout-pre-next-preface () |
3430 | 2058 "Skip forward to just before the next heading line. |
2059 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2060 Returns that character position." |
3430 | 2061 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2062 (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
|
2063 (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
|
2064 (allout-prefix-data (match-beginning 2)(match-end 2))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2065 ;;;_ > allout-end-of-subtree (&optional current) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2066 (defun allout-end-of-subtree (&optional current) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2067 "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
|
2068 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2069 If optional CURRENT is true (default false), then put point at the end of |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2070 the containing visible topic. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2071 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2072 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
|
2073 (interactive "P") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2074 (if current |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2075 (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
|
2076 (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
|
2077 (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
|
2078 (allout-next-heading) |
3430 | 2079 (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
|
2080 (> (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
|
2081 (allout-next-heading)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2082 (and (not (eobp)) (forward-char -1)) |
29490 | 2083 (and (memq (preceding-char) '(?\n ?\r)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2084 (memq (aref (buffer-substring (max 1 (- (point) 3)) (point)) 1) |
29490 | 2085 '(?\n ?\r)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2086 (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
|
2087 (setq allout-recent-end-of-subtree (point)))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2088 ;;;_ > allout-end-of-current-subtree () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2089 (defun allout-end-of-current-subtree () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2090 "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
|
2091 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2092 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
|
2093 (interactive) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2094 (allout-end-of-subtree 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
|
2095 ;;;_ > 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
|
2096 (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
|
2097 "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
|
2098 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2099 If already there, move cursor to bullet for hot-spot operation. |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
2100 \(See `allout-mode' doc string for details on hot-spot operation.)" |
3430 | 2101 (interactive) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2102 (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
|
2103 (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2104 (if (and (interactive-p) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2105 (= (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
|
2106 (goto-char (allout-current-bullet-pos))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2107 ;;;_ > allout-end-of-entry () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2108 (defun allout-end-of-entry () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2109 "Position the point at the end of the current topics' entry." |
3430 | 2110 (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
|
2111 (prog1 (allout-pre-next-preface) |
3430 | 2112 (if (and (not (bobp))(looking-at "^$")) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2113 (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
|
2114 ;;;_ > 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
|
2115 (defun allout-end-of-current-heading () |
29490 | 2116 (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
|
2117 (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
|
2118 (re-search-forward "[\n\r]" nil t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2119 (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
|
2120 (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
|
2121 ;;;_ > allout-get-body-text () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2122 (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
|
2123 "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
|
2124 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2125 (allout-end-of-prefix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2126 (if (not (re-search-forward "[\n\r]" nil t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2127 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2128 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2129 (let ((pre-body (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2130 (if (not pre-body) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2131 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2132 (allout-end-of-entry) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2133 (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
|
2134 (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
|
2135 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2136 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2137 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2138 ) |
3430 | 2139 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2140 ;;;_ - 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
|
2141 ;;;_ > 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
|
2142 (defun allout-ascend-to-depth (depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2143 "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
|
2144 (if (and (> depth 0)(<= depth (allout-depth))) |
3430 | 2145 (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
|
2146 (while (and (< depth (allout-depth)) |
3430 | 2147 (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
|
2148 (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
|
2149 (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
|
2150 (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
|
2151 (progn (goto-char allout-recent-prefix-beginning) |
3430 | 2152 depth) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2153 (goto-char last-good) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2154 nil)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2155 (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
|
2156 ;;;_ > 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
|
2157 (defun allout-ascend () |
29490 | 2158 "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
|
2159 (prog1 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2160 (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
|
2161 (allout-previous-heading)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2162 (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
|
2163 ;;;_ > 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
|
2164 (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
|
2165 "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
|
2166 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2167 Returning depth if successful, nil if not." |
3430 | 2168 (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
|
2169 (start-depth (allout-depth))) |
3430 | 2170 (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
|
2171 (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
|
2172 (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
|
2173 (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
|
2174 (< 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
|
2175 (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
|
2176 (= (allout-recent-depth) depth)) |
3430 | 2177 depth |
2178 (goto-char start-point) | |
2179 nil)) | |
2180 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2181 ;;;_ > 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
|
2182 (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
|
2183 "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
|
2184 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2185 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
|
2186 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
|
2187 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
|
2188 (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
|
2189 (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
|
2190 (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
|
2191 (last-good (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2192 failed |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2193 return) |
3430 | 2194 ;; 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
|
2195 (while (and (> (allout-recent-depth) 1) |
3430 | 2196 (> arg 0) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2197 (not (bobp)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2198 (not failed)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2199 (setq last-good (point)) |
3430 | 2200 ;; 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
|
2201 (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
|
2202 (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
|
2203 (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
|
2204 (setq present-level (allout-current-depth)) |
3430 | 2205 (setq arg (- arg 1))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2206 (if (or failed |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2207 (> arg 0)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2208 (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
|
2209 (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
|
2210 (if (not dont-complain) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
2211 (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
|
2212 (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
|
2213 nil)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2214 (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
|
2215 allout-recent-prefix-beginning))) |
3430 | 2216 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2217 ;;;_ - 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
|
2218 ;;;_ > 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
|
2219 (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
|
2220 "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
|
2221 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2222 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
|
2223 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2224 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
|
2225 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2226 Return depth if successful, nil otherwise." |
3430 | 2227 |
2228 (if (and backward (bobp)) | |
2229 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
|
2230 (let ((start-depth (or depth (allout-depth))) |
3430 | 2231 (start-point (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2232 last-depth) |
3430 | 2233 (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
|
2234 (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
|
2235 (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
|
2236 (> (setq last-depth (allout-recent-depth)) start-depth))) |
3430 | 2237 (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
|
2238 (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
|
2239 (= (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
|
2240 allout-recent-prefix-beginning |
3430 | 2241 (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
|
2242 (if depth (allout-depth) start-depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2243 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
|
2244 ;;;_ > 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
|
2245 (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
|
2246 "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
|
2247 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2248 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
|
2249 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2250 Optional BACKWARD reverses direction. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2251 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2252 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
|
2253 (allout-next-sibling depth (not backward)) |
3430 | 2254 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2255 ;;;_ > 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
|
2256 (defun allout-snug-back () |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
2257 "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
|
2258 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2259 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
|
2260 (if (or (bobp) (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2261 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2262 (forward-char -1)) |
29490 | 2263 (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2264 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2265 (forward-char -1) |
29490 | 2266 (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2267 (forward-char -1))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2268 (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
|
2269 ;;;_ > 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
|
2270 (defun allout-beginning-of-level () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2271 "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
|
2272 (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
|
2273 ;;;_ > 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
|
2274 (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
|
2275 "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
|
2276 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2277 (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
|
2278 (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
|
2279 (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
|
2280 (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
|
2281 ;;;_ > 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
|
2282 (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
|
2283 "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
|
2284 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2285 Move as far as possible in indicated direction \(beginning or end of |
29490 | 2286 buffer) if headings are exhausted." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2287 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2288 (interactive "p") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2289 (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
|
2290 (step (if backward -1 1)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2291 (start-point (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2292 prev got) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2293 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2294 (while (> arg 0) ; limit condition |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2295 (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
|
2296 ;; Move, skipping over all those concealed lines: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2297 (< -1 (forward-line step)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2298 (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
|
2299 ;; 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
|
2300 (if got (setq prev got)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2301 (setq arg (1- arg))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2302 (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
|
2303 (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
|
2304 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2305 (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
|
2306 (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
|
2307 ((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
|
2308 ;;;_ > 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
|
2309 (defun allout-previous-visible-heading (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2310 "Move to the previous heading line. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2311 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2312 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
|
2313 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
|
2314 matches)." |
3430 | 2315 (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
|
2316 (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
|
2317 ;;;_ > 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
|
2318 (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
|
2319 "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
|
2320 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2321 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
|
2322 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2323 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
|
2324 (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
|
2325 (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
|
2326 (start-point (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2327 (start-arg arg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2328 (backward (> 0 arg)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2329 last-depth |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2330 (last-good (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2331 at-boundary) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2332 (if (= 0 start-depth) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2333 (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
|
2334 (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
|
2335 (while (not (or (zerop arg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2336 at-boundary)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2337 (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
|
2338 (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
|
2339 (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
|
2340 (> (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
|
2341 (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
|
2342 (not (if backward (bobp) (eobp)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2343 (setq last-good (point) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2344 arg (1- arg)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2345 (setq at-boundary t))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2346 (if (and (not (eobp)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2347 (= 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
|
2348 (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
|
2349 (= (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
|
2350 allout-recent-prefix-beginning |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2351 (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
|
2352 (if (not (interactive-p)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2353 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
|
2354 (allout-end-of-prefix) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
2355 (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
|
2356 (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
|
2357 (allout-recent-depth) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2358 (- (abs start-arg) arg) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2359 (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
|
2360 ;;;_ > 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
|
2361 (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
|
2362 "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
|
2363 (interactive "p") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2364 (if (interactive-p) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2365 (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
|
2366 (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
|
2367 (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
|
2368 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2369 ;;;_ #5 Alteration |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2370 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2371 ;;;_ - 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
|
2372 ;;;_ = 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
|
2373 (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
|
2374 "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
|
2375 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2376 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
|
2377 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
|
2378 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
|
2379 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
|
2380 `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
|
2381 (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
|
2382 ;;;_ > 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
|
2383 (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
|
2384 "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
|
2385 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
2386 - 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
|
2387 outline commands. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2388 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2389 - Decrypt topic currently being edited if it was encrypted for a save. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2390 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2391 - Massage buffer-undo-list so successive, standard character self-inserts are |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2392 aggregated. This kludge compensates for lack of undo bunching when |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2393 before-change-functions is used." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2394 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2395 ; 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
|
2396 (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
|
2397 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
|
2398 (if allout-isearch-dynamic-expose |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2399 (allout-isearch-rectification)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2400 ;; Undo bunching business: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2401 (if (and (listp buffer-undo-list) ; Undo history being kept. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2402 (equal this-command 'self-insert-command) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2403 (equal last-command 'self-insert-command)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2404 (let* ((prev-stuff (cdr buffer-undo-list)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2405 (before-prev-stuff (cdr (cdr prev-stuff))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2406 cur-cell cur-from cur-to |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2407 prev-cell prev-from prev-to) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2408 (if (and before-prev-stuff ; Goes back far enough to bother, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2409 (not (car prev-stuff)) ; and break before current, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2410 (not (car before-prev-stuff)) ; !and break before prev! |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2411 (setq prev-cell (car (cdr prev-stuff))) ; contents now, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2412 (setq cur-cell (car buffer-undo-list)) ; contents prev. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2413 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2414 ;; cur contents denote a single char insertion: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2415 (numberp (setq cur-from (car cur-cell))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2416 (numberp (setq cur-to (cdr cur-cell))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2417 (= 1 (- cur-to cur-from)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2418 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2419 ;; prev contents denote fewer than aggregate-limit |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2420 ;; insertions: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2421 (numberp (setq prev-from (car prev-cell))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2422 (numberp (setq prev-to (cdr prev-cell))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2423 ; Below threshold: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2424 (> allout-undo-aggregation (- prev-to prev-from))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2425 (setq buffer-undo-list |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2426 (cons (cons prev-from cur-to) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2427 (cdr (cdr (cdr buffer-undo-list)))))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2428 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2429 (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
|
2430 allout-after-save-decrypt) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2431 (allout-after-saves-handler)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2432 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2433 ;; Implement -post-goto-bullet, if set: (must be after undo business) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2434 (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
|
2435 (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
|
2436 (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
|
2437 (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
|
2438 )) |
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 ;;;_ > 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
|
2440 (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
|
2441 "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
|
2442 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
|
2443 |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
2444 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
|
2445 reinterpreted as the corresponding control-character in the |
13d146080936
(allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
49588
diff
changeset
|
2446 `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
|
2447 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
|
2448 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
|
2449 |
29490 | 2450 The upshot is that you can get easy, single (ie, unmodified) key |
2451 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
|
2452 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
|
2453 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
|
2454 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
|
2455 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2456 (if (not (allout-mode-p)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2457 ;; Shouldn't be invoked if not in allout-mode, but just in case: |
29490 | 2458 nil |
2459 ;; Register isearch status: | |
2460 (if (and (boundp 'isearch-mode) isearch-mode) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2461 (setq allout-pre-was-isearching t) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2462 (setq allout-pre-was-isearching nil)) |
29490 | 2463 ;; Hot-spot navigation provisions: |
2464 (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
|
2465 (eq (point)(allout-current-bullet-pos))) |
29490 | 2466 (let* ((this-key-num (cond |
2467 ((numberp last-command-char) | |
2468 last-command-char) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2469 ;; Only xemacs has characterp. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2470 ((and (fboundp 'characterp) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
2471 (apply 'characterp |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
2472 (list last-command-char))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
2473 (apply 'char-to-int (list last-command-char))) |
29490 | 2474 (t 0))) |
2475 mapped-binding) | |
2476 (if (zerop this-key-num) | |
2477 nil | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2478 ; Map upper-register literals |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2479 ; to lower register: |
29490 | 2480 (if (<= 96 this-key-num) |
2481 (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
|
2482 ; Check if we have a literal: |
29490 | 2483 (if (and (<= 64 this-key-num) |
2484 (>= 96 this-key-num)) | |
2485 (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
|
2486 (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
|
2487 (concat allout-command-prefix |
29490 | 2488 (char-to-string (- this-key-num |
2489 64)))))) | |
2490 (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
|
2491 (setq allout-post-goto-bullet t |
29490 | 2492 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
|
2493 ;;;_ > 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
|
2494 (defun allout-find-file-hook () |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2495 "Activate `allout-mode' when `allout-auto-activation', `allout-layout' non-nil. |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2496 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2497 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
|
2498 (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
|
2499 (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
|
2500 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
|
2501 (allout-mode t))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2502 ;;;_ > allout-isearch-rectification |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2503 (defun allout-isearch-rectification () |
29490 | 2504 "Rectify outline exposure before, during, or after isearch. |
2505 | |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
2506 Called as part of `allout-post-command-business'." |
29490 | 2507 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2508 (let ((isearching (and (boundp 'isearch-mode) isearch-mode))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2509 (cond ((and isearching (not allout-pre-was-isearching)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2510 (allout-isearch-expose 'start)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2511 ((and isearching allout-pre-was-isearching) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2512 (allout-isearch-expose 'continue)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2513 ((and (not isearching) allout-pre-was-isearching) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2514 (allout-isearch-expose 'final)) |
29490 | 2515 ;; Not and wasn't isearching: |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2516 (t (setq allout-isearch-prior-pos nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2517 (setq allout-isearch-did-quit 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
|
2518 ;;;_ = allout-isearch-was-font-lock |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2519 (defvar allout-isearch-was-font-lock |
29490 | 2520 (and (boundp 'font-lock-mode) font-lock-mode)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2521 ;;;_ > allout-isearch-expose (mode) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2522 (defun allout-isearch-expose (mode) |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
2523 "MODE is either 'clear, 'start, 'continue, or 'final." |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2524 ;; allout-isearch-prior-pos encodes exposure status of prior pos: |
29490 | 2525 ;; (pos was-vis header-pos end-pos) |
2526 ;; pos - point of concern | |
2527 ;; was-vis - t, else 'topic if entire topic was exposed, 'entry otherwise | |
2528 ;; Do reclosure or prior pos, as necessary: | |
2529 (if (eq mode 'start) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2530 (setq allout-isearch-was-font-lock (and (boundp 'font-lock-mode) |
29490 | 2531 font-lock-mode) |
2532 font-lock-mode nil) | |
2533 (if (eq mode 'final) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2534 (setq font-lock-mode allout-isearch-was-font-lock)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2535 (if (and allout-isearch-prior-pos |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2536 (listp allout-isearch-prior-pos)) |
29490 | 2537 ;; Conceal prior peek: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2538 (allout-flag-region (car (cdr allout-isearch-prior-pos)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2539 (car (cdr (cdr allout-isearch-prior-pos))) |
29490 | 2540 ?\r))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2541 (if (allout-visible-p) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2542 (setq allout-isearch-prior-pos nil) |
29490 | 2543 (if (not (eq mode 'final)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2544 (setq allout-isearch-prior-pos (cons (point) (allout-show-entry))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2545 (if allout-isearch-did-quit |
29490 | 2546 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
|
2547 (setq allout-isearch-prior-pos nil) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2548 (allout-show-children)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2549 (setq allout-isearch-did-quit 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
|
2550 ;;;_ > allout-enwrap-isearch () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2551 (defun allout-enwrap-isearch () |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2552 "Impose `allout-mode' isearch-abort wrapper for dynamic exposure in isearch. |
29490 | 2553 |
2554 The function checks to ensure that the rebinding is done only once." | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2555 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2556 (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2557 (if (fboundp 'allout-real-isearch-abort) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2558 ;; |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2559 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2560 ; Ensure load of isearch-mode: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2561 (if (or (and (fboundp 'isearch-mode) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2562 (fboundp 'isearch-abort)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2563 (condition-case error |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2564 (load-library "isearch-mode") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2565 ('file-error (message |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2566 "Skipping isearch-mode provisions - %s '%s'" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2567 (car (cdr error)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2568 (car (cdr (cdr error)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2569 (sit-for 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2570 ;; Inhibit subsequent tries and return nil: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2571 (setq allout-isearch-dynamic-expose nil)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2572 ;; Isearch-mode loaded, encapsulate specific entry points for |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2573 ;; outline dynamic-exposure business: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2574 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2575 ;; stash crucial isearch-mode funcs under known, private |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2576 ;; names, then register wrapper functions under the old |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2577 ;; names, in their stead: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2578 (fset 'allout-real-isearch-abort (symbol-function 'isearch-abort)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2579 (fset 'isearch-abort 'allout-isearch-abort))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2580 ;;;_ > allout-isearch-abort () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2581 (defun allout-isearch-abort () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2582 "Wrapper for allout-real-isearch-abort \(which see), to register |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2583 actual quits." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2584 (interactive) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2585 (setq allout-isearch-did-quit nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2586 (condition-case what |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2587 (allout-real-isearch-abort) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2588 ('quit (setq allout-isearch-did-quit t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2589 (signal 'quit nil)))) |
29490 | 2590 |
2591 ;;; Prevent unnecessary font-lock while isearching! | |
2592 (defvar isearch-was-font-locking nil) | |
2593 (defun isearch-inhibit-font-lock () | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2594 "Inhibit `font-lock' while isearching - for use on `isearch-mode-hook'." |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2595 (if (and (allout-mode-p) (boundp 'font-lock-mode) font-lock-mode) |
29490 | 2596 (setq isearch-was-font-locking t |
2597 font-lock-mode nil))) | |
2598 (add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock) | |
2599 (defun isearch-reenable-font-lock () | |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
2600 "Reenable font-lock after isearching - for use on `isearch-mode-end-hook'." |
29490 | 2601 (if (and (boundp 'font-lock-mode) font-lock-mode) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2602 (if (and (allout-mode-p) isearch-was-font-locking) |
29490 | 2603 (setq isearch-was-font-locking nil |
2604 font-lock-mode t)))) | |
2605 (add-hook 'isearch-mode-end-hook 'isearch-reenable-font-lock) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2606 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2607 ;;;_ - 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
|
2608 ;;;_ > 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
|
2609 (defun allout-solicit-alternate-bullet (depth &optional current-bullet) |
3430 | 2610 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2611 "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
|
2612 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2613 Offer one suitable for current depth DEPTH as default." |
3430 | 2614 |
29490 | 2615 (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
|
2616 (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
|
2617 (sans-escapes (regexp-sans-escapes allout-bullets-string)) |
29490 | 2618 choice) |
2619 (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
|
2620 (goto-char (allout-current-bullet-pos)) |
29490 | 2621 (setq choice (solicit-char-in-string |
2622 (format "Select bullet: %s ('%s' default): " | |
2623 sans-escapes | |
2624 default-bullet) | |
2625 sans-escapes | |
2626 t))) | |
2627 (message "") | |
3430 | 2628 (if (string= choice "") default-bullet choice)) |
2629 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2630 ;;;_ > 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
|
2631 (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
|
2632 "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
|
2633 (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
|
2634 ;;;_ > 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
|
2635 (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
|
2636 "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
|
2637 (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
|
2638 (string= allout-numbered-bullet |
3430 | 2639 (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
|
2640 (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
|
2641 (allout-get-bullet))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2642 ;;;_ > 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
|
2643 (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
|
2644 "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
|
2645 (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
|
2646 (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
|
2647 (if prefix |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2648 (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
|
2649 (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
|
2650 ;;;_ > 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
|
2651 (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
|
2652 "Return outline topic bullet suited to optional DEPTH, or current depth." |
3430 | 2653 ;; 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
|
2654 (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
|
2655 (char-to-string (aref allout-plain-bullets-string |
3430 | 2656 (% (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
|
2657 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
|
2658 allout-primary-bullet) |
3430 | 2659 ) |
2660 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2661 ;;;_ - 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
|
2662 ;;;_ > 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
|
2663 (defun allout-make-topic-prefix (&optional prior-bullet |
3430 | 2664 new |
2665 depth | |
2666 solicit | |
2667 number-control | |
2668 index) | |
2669 ;; Depth null means use current depth, non-null means we're either | |
2670 ;; opening a new topic after current topic, lower or higher, or we're | |
2671 ;; changing level of current topic. | |
2672 ;; Solicit dominates specified bullet-char. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2673 ;;;_ . Doc string: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2674 "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
|
2675 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2676 All the arguments are optional. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2677 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2678 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
|
2679 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
|
2680 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
|
2681 for instance. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2682 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2683 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
|
2684 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
|
2685 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
|
2686 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
|
2687 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
|
2688 bullet or previous sibling. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2689 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2690 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
|
2691 the current topics' depth. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2692 |
29490 | 2693 If SOLICIT is non-nil, then the choice of bullet is solicited from |
2694 user. If it's a character, then that character is offered as the | |
2695 default, otherwise the one suited to the context \(according to | |
2696 distinction or depth) is offered. \(This overrides other options, | |
2697 including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the | |
2698 context-specific bullet is used. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2699 |
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 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
|
2701 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
|
2702 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
|
2703 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
|
2704 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2705 \(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
|
2706 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2707 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
|
2708 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
|
2709 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
|
2710 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
|
2711 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
|
2712 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
|
2713 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
|
2714 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
|
2715 index for each successive sibling)." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2716 ;;;_ . Code: |
3430 | 2717 ;; The options are ordered in likely frequence of use, most common |
2718 ;; highest, least lowest. Ie, more likely to be doing prefix | |
2719 ;; adjustments than soliciting, and yet more than numbering. | |
2720 ;; Current prefix is least dominant, but most likely to be commonly | |
2721 ;; specified... | |
2722 | |
2723 (let* (body | |
2724 numbering | |
2725 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
|
2726 (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
|
2727 (header-lead allout-header-prefix) |
3430 | 2728 (bullet-char |
2729 | |
2730 ;; Getting value for bullet char is practically the whole job: | |
2731 | |
2732 (cond | |
2733 ; 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
|
2734 ((<= depth 1) (setq header-lead "") allout-primary-bullet) |
3430 | 2735 ; 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
|
2736 (allout-old-style-prefixes |
3430 | 2737 ;; Cheat - make body the whole thing, null out header-lead and |
2738 ;; bullet-char: | |
2739 (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
|
2740 (string-to-char allout-primary-bullet))) |
3430 | 2741 (setq header-lead "") |
2742 "") | |
2743 | |
2744 ;; (Neither level 1 nor old-style, so we're space padding. | |
2745 ;; Sneak it in the condition of the next case, whatever it is.) | |
2746 | |
2747 ;; Solicitation overrides numbering and other cases: | |
2748 ((progn (setq body (make-string (- depth 2) ?\ )) | |
2749 ;; The actual condition: | |
2750 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
|
2751 (let* ((got (allout-solicit-alternate-bullet depth solicit))) |
3430 | 2752 ;; 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
|
2753 (setq numbering (and allout-numbered-bullet |
3430 | 2754 (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
|
2755 (string= got allout-numbered-bullet))) |
3430 | 2756 ;; Now return what we got, regardless: |
2757 got)) | |
2758 | |
2759 ;; 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
|
2760 ((and allout-numbered-bullet number-control) |
3430 | 2761 (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
|
2762 allout-numbered-bullet |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2763 (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
|
2764 (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
|
2765 prior-bullet))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2766 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
|
2767 (allout-bullet-for-depth depth)))) |
3430 | 2768 |
2769 ;;; Neither soliciting nor controlled numbering ;;; | |
2770 ;;; (may be controlled denumbering, tho) ;;; | |
2771 | |
2772 ;; Check wrt previous sibling: | |
2773 ((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
|
2774 (<= 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
|
2775 allout-numbered-bullet ; ... & numbering enabled |
3430 | 2776 (not denumbering) |
2777 (let ((sibling-bullet | |
2778 (save-excursion | |
2779 ;; 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
|
2780 (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
|
2781 (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
|
2782 (allout-get-bullet)))) |
3430 | 2783 (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
|
2784 (string= allout-numbered-bullet sibling-bullet)) |
3430 | 2785 (setq numbering sibling-bullet))))) |
2786 | |
2787 ;; Distinctive prior bullet? | |
2788 ((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
|
2789 (allout-distinctive-bullet prior-bullet) |
3430 | 2790 ;; 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
|
2791 (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
|
2792 (string= prior-bullet allout-numbered-bullet))) |
3430 | 2793 ;; or numbered, and not denumbering: |
2794 (setq numbering (not denumbering))) | |
2795 ;; Here 'tis: | |
2796 prior-bullet)) | |
2797 | |
2798 ;; 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
|
2799 ((allout-bullet-for-depth depth))))) |
3430 | 2800 |
2801 (concat header-lead | |
2802 body | |
2803 bullet-char | |
2804 (if numbering | |
2805 (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
|
2806 (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
|
2807 ((allout-sibling-index)))))) |
3430 | 2808 ) |
2809 ) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2810 ;;;_ > allout-open-topic (relative-depth &optional before use_recent_bullet) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2811 (defun allout-open-topic (relative-depth &optional before use_recent_bullet) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2812 "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
|
2813 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2814 New topic is situated after current one, unless optional flag BEFORE |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2815 is non-nil, or unless current line is complete empty (not even |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
2816 whitespace), in which case open is done on current line. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2817 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2818 If USE_RECENT_BULLET is true, offer to use the bullet of the prior sibling. |
29490 | 2819 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2820 Nuances: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2821 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2822 - 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
|
2823 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
|
2824 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2825 - 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
|
2826 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
|
2827 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
|
2828 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
|
2829 deliberately dividing topic bodies. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2830 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2831 - 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
|
2832 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
|
2833 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
|
2834 single-spacing is used. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2835 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2836 - 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
|
2837 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
|
2838 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
|
2839 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
|
2840 from there." |
3430 | 2841 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2842 (let* ((depth (+ (allout-current-depth) relative-depth)) |
3430 | 2843 (opening-on-blank (if (looking-at "^\$") |
2844 (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
|
2845 ;; 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
|
2846 opening-numbered |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2847 opening-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2848 ref-depth |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2849 ref-bullet |
3430 | 2850 (ref-topic (save-excursion |
2851 (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
|
2852 (allout-ascend-to-depth depth)) |
3430 | 2853 ((>= 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
|
2854 (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
|
2855 (setq ref-depth (allout-recent-depth)) |
29490 | 2856 (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
|
2857 (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
|
2858 (allout-recent-bullet) |
29490 | 2859 "")) |
3430 | 2860 (setq opening-numbered |
2861 (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
|
2862 (and allout-numbered-bullet |
3430 | 2863 (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
|
2864 (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
|
2865 (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
|
2866 allout-numbered-bullet)))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2867 (setq opening-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2868 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2869 (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
|
2870 (or (<= relative-depth 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2871 (allout-descend-to-depth depth)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2872 (if (allout-numbered-type-prefix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2873 allout-numbered-bullet)))) |
3430 | 2874 (point))) |
2875 dbl-space | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2876 doing-beginning) |
3430 | 2877 |
2878 (if (not opening-on-blank) | |
2879 ; Positioning and vertical | |
2880 ; padding - only if not | |
2881 ; opening-on-blank: | |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
2882 (progn |
3430 | 2883 (goto-char ref-topic) |
2884 (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
|
2885 (or (and (<= relative-depth 0) ; not descending; |
3430 | 2886 (save-excursion |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
2887 ;; 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
|
2888 (or (> 0 (forward-line -1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2889 (looking-at "^\\s-*$") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2890 (bobp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2891 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2892 ;; 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
|
2893 (allout-end-of-current-subtree) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2894 (bolp))) |
3430 | 2895 (and (= ref-depth 1) |
2896 (or before | |
2897 (= depth 1) | |
2898 (save-excursion | |
2899 ;; Don't already have following | |
2900 ;; vertical padding: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2901 (not (allout-pre-next-preface))))))) |
3430 | 2902 |
2903 ; Position to prior heading, | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2904 ; if inserting backwards, and |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2905 ; not going outwards: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2906 (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
|
2907 (progn (allout-back-to-current-heading) |
3430 | 2908 (setq doing-beginning (bobp)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2909 (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
|
2910 (allout-previous-heading))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2911 (if (and before (bobp)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2912 (allout-unprotected (allout-open-line-not-read-only)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2913 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2914 (if (<= relative-depth 0) |
3430 | 2915 ;; Not going inwards, don't snug up: |
2916 (if doing-beginning | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2917 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2918 (if (not dbl-space) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2919 (allout-open-line-not-read-only) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2920 (allout-open-line-not-read-only) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2921 (allout-open-line-not-read-only))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2922 (if before |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2923 (progn (end-of-line) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2924 (allout-pre-next-preface) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2925 (while (= ?\r (following-char)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2926 (forward-char 1)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2927 (if (not (looking-at "^$")) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2928 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2929 (allout-open-line-not-read-only)))) |
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 (allout-end-of-current-subtree))) |
3430 | 2931 ;; Going inwards - double-space if first offspring is, |
2932 ;; otherwise snug up. | |
2933 (end-of-line) ; So we skip any concealed progeny. | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2934 (allout-pre-next-preface) |
3430 | 2935 (if (bolp) |
2936 ;; Blank lines between current header body and next | |
2937 ;; header - get to last substantive (non-white-space) | |
2938 ;; line in body: | |
2939 (re-search-backward "[^ \t\n]" nil t)) | |
2940 (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
|
2941 (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
|
2942 (if (> (allout-recent-depth) ref-depth) |
3430 | 2943 ;; This is an offspring. |
2944 (progn (forward-line -1) | |
2945 (looking-at "^\\s-*$")))) | |
2946 (progn (forward-line 1) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2947 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2948 (allout-open-line-not-read-only)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2949 (forward-line 1))) |
3430 | 2950 (end-of-line)) |
2951 ;;(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
|
2952 (if (not (bobp)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2953 ;; 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
|
2954 ;; 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
|
2955 (progn (if (and (not (> depth ref-depth)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2956 (not before)) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2957 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2958 (allout-open-line-not-read-only)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2959 (if (> depth ref-depth) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2960 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2961 (allout-open-line-not-read-only)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2962 (if dbl-space |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2963 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2964 (allout-open-line-not-read-only)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2965 (if (not before) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2966 (allout-unprotected (newline 1)))))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2967 (if dbl-space |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2968 (allout-unprotected (newline 1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2969 (if (and (not (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2970 (not (bolp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2971 (forward-char 1)))) |
3430 | 2972 )) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
2973 (insert (concat (allout-make-topic-prefix opening-numbered |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2974 t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2975 depth) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2976 " ")) |
3430 | 2977 |
2978 ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1)))) | |
2979 | |
2980 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2981 (allout-rebullet-heading (and use_recent_bullet ;;; solicit |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2982 ref-bullet) |
29490 | 2983 depth ;;; depth |
2984 nil ;;; number-control | |
2985 nil ;;; index | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2986 t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
2987 (end-of-line) |
3430 | 2988 ) |
2989 ) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2990 ;;;_ . open-topic contingencies |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2991 ;;;_ ; base topic - one from which open was issued |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2992 ;;;_ , beginning char |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
2993 ;;;_ , amount of space before will be used, unless opening in place |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2994 ;;;_ , end char will be used, unless opening before (and it still may) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2995 ;;;_ ; absolute depth of new topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2996 ;;;_ ! insert in place - overrides most stuff |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2997 ;;;_ ; relative depth of new re base |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2998 ;;;_ ; before or after base topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
2999 ;;;_ ; spacing around topic, if any, prior to new topic and at same depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3000 ;;;_ ; buffer boundaries - special provisions for beginning and end ob |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3001 ;;;_ ; level 1 topics have special provisions also - double space. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3002 ;;;_ ; location of new topic |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3003 ;;;_ > allout-open-line-not-read-only () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3004 (defun allout-open-line-not-read-only () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3005 "Open line and remove inherited read-only text prop from new char, if any." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3006 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3007 (if (plist-get (text-properties-at (point)) 'read-only) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3008 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3009 (remove-text-properties (point) (+ 1 (point)) '(read-only nil))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3010 ;;;_ > 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
|
3011 (defun allout-open-subtopic (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3012 "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
|
3013 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3014 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
|
3015 prior to the current one." |
3430 | 3016 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3017 (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
|
3018 ;;;_ > 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
|
3019 (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
|
3020 "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
|
3021 |
29490 | 3022 Positive universal arg means to use the bullet of the prior sibling. |
3023 | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3024 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
|
3025 one." |
3430 | 3026 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3027 (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
|
3028 ;;;_ > 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
|
3029 (defun allout-open-supertopic (arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3030 "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
|
3031 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3032 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
|
3033 topic prior to the current one." |
3430 | 3034 |
3035 (interactive "p") | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3036 (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
|
3037 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3038 ;;;_ - Outline Alteration |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3039 ;;;_ : 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
|
3040 ;;;_ = 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
|
3041 (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
|
3042 "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
|
3043 ;;;_ > 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
|
3044 (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
|
3045 "`allout-mode' autofill function. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3046 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3047 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
|
3048 `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
|
3049 (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
|
3050 ;; Check for topic header indentation: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3051 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3052 (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
|
3053 (if (looking-at allout-regexp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3054 ;; ... construct indentation to account for |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3055 ;; 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
|
3056 (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
|
3057 (current-column)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3058 ?\ )))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3059 (if (or allout-former-auto-filler allout-use-hanging-indents) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3060 (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
|
3061 ;;;_ > 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
|
3062 (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
|
3063 "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
|
3064 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3065 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
|
3066 be accommodated. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3067 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3068 Note that refill of indented paragraphs is not done." |
3430 | 3069 |
3070 (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
|
3071 (allout-end-of-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3072 (let* ((new-margin (current-column)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3073 excess old-indent-begin old-indent-end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3074 curr-ind |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3075 ;; 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
|
3076 ;; *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
|
3077 ;; 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
|
3078 (old-margin (+ old-depth (- new-margin new-depth)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3079 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3080 ;; 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
|
3081 (allout-unprotected |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3082 (save-match-data |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3083 (while |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3084 (and (re-search-forward "[\n\r]\\(\\s-*\\)" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3085 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3086 t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3087 ;; Register the indent data, before we reset the |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3088 ;; 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
|
3089 (setq old-indent-begin (match-beginning 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3090 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
|
3091 (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
|
3092 (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
|
3093 old-margin))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3094 ;; 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
|
3095 nil |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3096 ;; 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
|
3097 ;; reindent it, preserving its existing indentation |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3098 ;; beyond the old margin: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3099 (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
|
3100 (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
|
3101 ;;;_ > 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
|
3102 (defun allout-rebullet-current-heading (arg) |
29490 | 3103 "Solicit new bullet for current visible heading." |
3104 (interactive "p") | |
3105 (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
|
3106 (on-bullet (eq (point)(allout-current-bullet-pos))) |
29490 | 3107 (backwards (if (< arg 0) |
3108 (setq arg (* arg -1))))) | |
3109 (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
|
3110 (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
|
3111 (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
|
3112 (allout-rebullet-heading t ;;; solicit |
29490 | 3113 nil ;;; depth |
3114 nil ;;; number-control | |
3115 nil ;;; index | |
3116 t)) ;;; do-successors | |
3117 (setq arg (1- arg)) | |
3118 (if (<= arg 0) | |
3119 nil | |
3120 (setq initial-col nil) ; Override positioning back to init col | |
3121 (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
|
3122 (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
|
3123 (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
|
3124 (allout-next-visible-heading -1)))) |
29490 | 3125 (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
|
3126 (cond (on-bullet (goto-char (allout-current-bullet-pos))) |
29490 | 3127 (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
|
3128 ;;;_ > 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
|
3129 (defun allout-rebullet-heading (&optional solicit |
3430 | 3130 new-depth |
3131 number-control | |
3132 index | |
3133 do-successors) | |
3134 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3135 "Adjust bullet of current topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3136 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3137 All args are optional. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3138 |
29490 | 3139 If SOLICIT is non-nil, then the choice of bullet is solicited from |
3140 user. If it's a character, then that character is offered as the | |
3141 default, otherwise the one suited to the context \(according to | |
3142 distinction or depth) is offered. If non-nil, then the | |
3143 context-specific bullet is just used. | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3144 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3145 Second arg DEPTH forces the topic prefix to that depth, regardless |
29490 | 3146 of the topic's current depth. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3147 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3148 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
|
3149 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
|
3150 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
|
3151 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
|
3152 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
|
3153 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3154 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
|
3155 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
|
3156 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
|
3157 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
|
3158 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
|
3159 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
|
3160 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
|
3161 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3162 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
|
3163 siblings. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3164 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3165 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
|
3166 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
|
3167 this function." |
3430 | 3168 |
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 (let* ((current-depth (allout-depth)) |
3430 | 3170 (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
|
3171 (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
|
3172 (me allout-recent-prefix-end) |
3430 | 3173 (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
|
3174 (new-prefix (allout-make-topic-prefix current-bullet |
3430 | 3175 nil |
3176 new-depth | |
3177 solicit | |
3178 number-control | |
3179 index))) | |
3180 | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3181 ;; Is new one is identical to old? |
3430 | 3182 (if (and (= current-depth new-depth) |
3183 (string= current-bullet | |
3184 (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
|
3185 ;; Nothing to do: |
3430 | 3186 t |
3187 | |
3188 ;; New prefix probably different from old: | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3189 ; 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
|
3190 (allout-unprotected (delete-region mb me)) |
3430 | 3191 (goto-char mb) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3192 ; Dispense with number if |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3193 ; 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
|
3194 (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
|
3195 (string= allout-numbered-bullet current-bullet) |
3430 | 3196 (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
|
3197 (allout-unprotected |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3198 (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
|
3199 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3200 ; 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
|
3201 (allout-unprotected (insert new-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3202 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3203 ;; 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
|
3204 (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
|
3205 (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
|
3206 (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
|
3207 (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
|
3208 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3209 ;; 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
|
3210 ;; caller elected for it: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3211 (if do-successors |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3212 (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
|
3213 (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
|
3214 (setq index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3215 (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
|
3216 ((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
|
3217 (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
|
3218 (allout-rebullet-heading nil ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3219 new-depth ;;; new-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3220 number-control;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3221 index ;;; index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3222 nil))))) ;;;(dont!)do-successors |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3223 ) ; (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
|
3224 ) ; let* ((current-depth (allout-depth))...) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3225 ) ; 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
|
3226 ;;;_ > 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
|
3227 (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
|
3228 "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
|
3229 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3230 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
|
3231 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3232 With repeat count, shift topic depth by that amount." |
3430 | 3233 (interactive "P") |
3234 (let ((start-col (current-column)) | |
3235 (was-eol (eolp))) | |
3236 (save-excursion | |
3237 ;; Normalize arg: | |
3238 (cond ((null arg) (setq arg 0)) | |
3239 ((listp arg) (setq arg (car arg)))) | |
3240 ;; Fill the user in, in case we're shifting a big topic: | |
3241 (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
|
3242 (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
|
3243 (if (<= (+ (allout-recent-depth) arg) 0) |
3430 | 3244 (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
|
3245 (allout-rebullet-topic-grunt arg) |
3430 | 3246 (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
|
3247 (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
|
3248 ;;;_ > 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
|
3249 (defun allout-rebullet-topic-grunt (&optional relative-depth |
3430 | 3250 starting-depth |
3251 starting-point | |
3252 index | |
3253 do-successors) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3254 "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
|
3255 \(visible or not). |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3256 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3257 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
|
3258 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3259 All arguments are optional. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3260 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3261 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
|
3262 topic that amount. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3263 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3264 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
|
3265 itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." |
3430 | 3266 |
3267 (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
|
3268 (new-depth (allout-depth)) |
3430 | 3269 (starting-depth (or starting-depth new-depth)) |
3270 (on-starting-call (null starting-point)) | |
3271 (index (or index | |
3272 ;; Leave index null on starting call, so rebullet-heading | |
3273 ;; calculates it at what might be new depth: | |
3274 (and (or (zerop relative-depth) | |
3275 (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
|
3276 (allout-sibling-index)))) |
3430 | 3277 (moving-outwards (< 0 relative-depth)) |
3278 (starting-point (or starting-point (point)))) | |
3279 | |
3280 ;; Sanity check for excessive promotion done only on starting call: | |
3281 (and on-starting-call | |
3282 moving-outwards | |
3283 (> 0 (+ starting-depth relative-depth)) | |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
3284 (error "Attempt to shift topic out beyond level 1")) ;;; ====> |
3430 | 3285 |
3286 (cond ((= starting-depth new-depth) | |
3287 ;; 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
|
3288 (allout-rebullet-heading nil ;;; solicit |
3430 | 3289 (+ starting-depth ;;; starting-depth |
3290 relative-depth) | |
3291 nil ;;; number | |
3292 index ;;; index | |
3293 ;; Every contained topic will get hit, | |
3294 ;; and we have to get to outside ones | |
3295 ;; deliberately: | |
3296 nil) ;;; do-successors | |
3297 ;; ... and work on subsequent ones which are at greater depth: | |
3298 (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
|
3299 (allout-next-heading) |
3430 | 3300 (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
|
3301 (< starting-depth (allout-recent-depth))) |
3430 | 3302 (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
|
3303 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth |
3430 | 3304 (1+ starting-depth);;;starting-depth |
3305 starting-point ;;; starting-point | |
3306 index))) ;;; index | |
3307 | |
3308 ((< starting-depth new-depth) | |
3309 ;; Rare case - subtopic more than one level deeper than parent. | |
3310 ;; 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
|
3311 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth |
3430 | 3312 new-depth ;;; starting-depth |
3313 starting-point ;;; starting-point | |
3314 index))) ;;; index | |
3315 | |
3316 (if on-starting-call | |
3317 (progn | |
3318 ;; Rectify numbering of former siblings of the adjusted topic, | |
3319 ;; if topic has changed depth | |
3320 (if (or do-successors | |
3321 (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
|
3322 (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
|
3323 (= (allout-recent-depth) (+ starting-depth |
3430 | 3324 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
|
3325 (allout-rebullet-heading nil nil nil nil t)) |
3430 | 3326 ;; Now rectify numbering of new siblings of the adjusted topic, |
3327 ;; if depth has been changed: | |
3328 (progn (goto-char starting-point) | |
3329 (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
|
3330 (allout-rebullet-heading nil nil nil nil t))))) |
3430 | 3331 ) |
3332 ) | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3333 ;;;_ > 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
|
3334 (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
|
3335 "Renumber siblings at current depth. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3336 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3337 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
|
3338 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3339 Returns final depth." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3340 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3341 ;; 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
|
3342 ;; 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
|
3343 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3344 (let ((ascender (allout-depth)) |
29490 | 3345 was-eobp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3346 (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
|
3347 (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
|
3348 (>= (allout-recent-depth) depth) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3349 (>= ascender depth)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3350 ; Skip over all topics at |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3351 ; lesser depths, which can not |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3352 ; have been disturbed: |
29490 | 3353 (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
|
3354 (> (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
|
3355 (allout-next-heading)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3356 ; 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
|
3357 (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
|
3358 (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
|
3359 (allout-rebullet-heading nil ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3360 nil ;;; depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3361 nil ;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3362 nil ;;; index |
29490 | 3363 t)) ;;; do-successors |
3364 (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
|
3365 (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
|
3366 ;;;_ > 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
|
3367 (defun allout-number-siblings (&optional denumber) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3368 "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
|
3369 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3370 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
|
3371 topic and its siblings. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3372 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3373 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
|
3374 rebulleting each topic at this level." |
3430 | 3375 |
3376 (interactive "P") | |
3377 | |
3378 (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
|
3379 (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
|
3380 (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
|
3381 (let ((depth (allout-recent-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3382 (index (if (not denumber) 1)) |
3430 | 3383 (use-bullet (equal '(16) denumber)) |
3384 (more t)) | |
3385 (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
|
3386 (allout-rebullet-heading use-bullet ;;; solicit |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3387 depth ;;; depth |
3430 | 3388 t ;;; number-control |
3389 index ;;; index | |
3390 nil) ;;; do-successors | |
3391 (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
|
3392 (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
|
3393 ;;;_ > 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
|
3394 (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
|
3395 "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
|
3396 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3397 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
|
3398 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
|
3399 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
|
3400 depth, however." |
3430 | 3401 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3402 (if (> arg 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3403 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3404 (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
|
3405 (if (not (bobp)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3406 (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
|
3407 (start-point (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3408 (predecessor-depth (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3409 (forward-char -1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3410 (allout-goto-prefix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3411 (if (< (point) start-point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3412 (allout-recent-depth) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3413 0)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3414 (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
|
3415 (> (+ current-depth arg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3416 (1+ predecessor-depth))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3417 (error (concat "May not shift deeper than offspring depth" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3418 " of previous 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
|
3419 (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
|
3420 ;;;_ > 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
|
3421 (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
|
3422 "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
|
3423 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3424 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
|
3425 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
|
3426 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
|
3427 depth, however." |
3430 | 3428 (interactive "p") |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3429 (if (< arg 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3430 (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
|
3431 (allout-rebullet-topic (* arg -1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3432 ;;;_ : 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
|
3433 ;;;_ > 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
|
3434 (defun allout-kill-line (&optional arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3435 "Kill line, adjusting subsequent lines suitably for outline mode." |
3430 | 3436 |
3437 (interactive "*P") | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3438 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3439 (let ((start-point (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3440 (leading-kill-ring-entry (car kill-ring)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3441 binding) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3442 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3443 (condition-case err |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3444 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3445 (if (not (and (allout-mode-p) ; active outline mode, |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3446 allout-numbered-bullet ; numbers may need adjustment, |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3447 (bolp) ; may be clipping topic head, |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3448 (looking-at allout-regexp))) ; are clipping topic head. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3449 ;; Above conditions do not obtain - just do a regular kill: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3450 (kill-line arg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3451 ;; Ah, have to watch out for adjustments: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3452 (let* ((depth (allout-depth)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3453 (start-point (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3454 binding) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3455 ; Do the kill, presenting option |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3456 ; for read-only text: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3457 (kill-line arg) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3458 ; Provide some feedback: |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3459 (sit-for 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3460 (save-excursion |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3461 ; Start with the topic |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3462 ; following killed line: |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3463 (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
|
3464 (allout-next-heading)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3465 (allout-renumber-to-depth depth)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3466 ;; condition case handler: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3467 (text-read-only |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3468 (goto-char start-point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3469 (setq binding (where-is-internal 'allout-kill-topic nil t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3470 (cond ((not binding) (setq binding "")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3471 ((arrayp binding) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3472 (setq binding (mapconcat 'key-description (list binding) ", "))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3473 (t (setq binding (format "%s" binding)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3474 ;; ensure prior kill-ring leader is properly restored: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3475 (if (eq leading-kill-ring-entry (cadr kill-ring)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3476 ;; Aborted kill got pushed on front - ditch it: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
3477 (let ((got (car kill-ring))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
3478 (setq kill-ring (cdr kill-ring)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
3479 got) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3480 ;; Aborted kill got appended to prior - resurrect prior: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3481 (setcar kill-ring leading-kill-ring-entry)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3482 ;; make last-command skip this failed command, so kill-appending |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3483 ;; conditions track: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3484 (setq this-command last-command) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3485 (error (concat "read-only text hit - use %s allout-kill-topic to" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3486 " discard collapsed stuff") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3487 binding))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3488 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3489 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3490 ;;;_ > 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
|
3491 (defun allout-kill-topic () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3492 "Kill topic together with subtopics. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3493 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3494 Leaves primary topic's trailing vertical whitespace, if any." |
3430 | 3495 |
3496 ;; Some finagling is done to make complex topic kills appear faster | |
3497 ;; than they actually are. A redisplay is performed immediately | |
3498 ;; after the region is disposed of, though the renumbering process | |
3499 ;; has yet to be performed. This means that there may appear to be | |
3500 ;; a lag *after* the kill has been performed. | |
3501 | |
3502 (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
|
3503 (let* ((beg (prog1 (allout-back-to-current-heading)(beginning-of-line))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3504 (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
|
3505 (allout-end-of-current-subtree) |
3430 | 3506 (if (not (eobp)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3507 (if (or (not (looking-at "^$")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3508 ;; A blank line - cut it with this topic *unless* this |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3509 ;; is the last topic at this level, in which case |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3510 ;; we'll leave the blank line as part of the |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3511 ;; containing topic: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3512 (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
|
3513 (and (allout-next-heading) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3514 (>= (allout-recent-depth) depth)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3515 (forward-char 1))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3516 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3517 (allout-unprotected (kill-region beg (point))) |
3430 | 3518 (sit-for 0) |
3519 (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
|
3520 (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
|
3521 ;;;_ > 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
|
3522 (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
|
3523 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3524 "Incidental outline-specific business to be done just after text yanks. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3525 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3526 Does depth adjustment of yanked topics, when: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3527 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3528 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
|
3529 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
|
3530 topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3531 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3532 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
|
3533 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3534 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
|
3535 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
|
3536 header into which it's being yanked. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3537 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3538 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
|
3539 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
|
3540 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
|
3541 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3542 (interactive "*P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3543 ; Get to beginning, leaving |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3544 ; region around subject: |
29490 | 3545 (if (< (my-mark-marker t) (point)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3546 (exchange-point-and-mark)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3547 (let* ((subj-beg (point)) |
29490 | 3548 (subj-end (my-mark-marker t)) |
3549 ;; '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
|
3550 (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
|
3551 (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
|
3552 (allout-prefix-data (match-beginning 1) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3553 (match-end 1)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3554 ;; `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
|
3555 ;; 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
|
3556 (rectify-numbering (or resituate |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3557 (and (bolp) (looking-at allout-regexp))))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3558 (if resituate |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3559 ; The yanked stuff is a topic: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3560 (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
|
3561 (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
|
3562 (prefix-bullet (allout-recent-bullet)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3563 (adjust-to-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3564 ;; 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
|
3565 ;; adjustment should be made: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3566 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3567 (and (goto-char subj-end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3568 (eolp) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3569 (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
|
3570 (and (looking-at allout-regexp) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3571 (progn |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3572 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3573 (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
|
3574 (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
|
3575 (allout-prefix-data (match-beginning 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3576 (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
|
3577 (allout-recent-depth)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3578 done |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3579 (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
|
3580 (setq rectify-numbering allout-numbered-bullet) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3581 (if adjust-to-depth |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3582 ; Do the adjustment: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3583 (progn |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3584 (message "... yanking") (sit-for 0) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3585 (save-restriction |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3586 (narrow-to-region subj-beg subj-end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3587 ; Trim off excessive blank |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3588 ; line at end, if any: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3589 (goto-char (point-max)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3590 (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
|
3591 (allout-unprotected (delete-char -1))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3592 ; Work backwards, with each |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3593 ; shallowest level, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3594 ; successively excluding the |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3595 ; last processed topic from |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3596 ; the narrow region: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3597 (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
|
3598 (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3599 ; 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
|
3600 (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
|
3601 (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
|
3602 (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
|
3603 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
|
3604 (allout-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3605 (if (setq more (not (bobp))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3606 (progn (widen) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3607 (forward-char -1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3608 (narrow-to-region subj-beg (point)))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3609 (message "") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3610 ;; 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
|
3611 ;; use old one: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3612 (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
|
3613 allout-distinctive-bullets-string) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3614 ; Delete from bullet of old to |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3615 ; before bullet of new: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3616 (progn |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3617 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3618 (delete-region (point) subj-beg) |
29490 | 3619 (set-marker (my-mark-marker t) subj-end) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3620 (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
|
3621 (allout-end-of-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3622 ; Delete base subj prefix, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3623 ; leaving old one: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3624 (delete-region (point) (+ (point) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3625 prefix-len |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3626 (- adjust-to-depth subj-depth))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3627 ; and delete residual subj |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3628 ; prefix digits and space: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3629 (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
|
3630 (if (looking-at " ") (delete-char 1)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3631 (exchange-point-and-mark)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3632 (if rectify-numbering |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
3633 (progn |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3634 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3635 ; Give some preliminary feedback: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3636 (message "... reconciling numbers") (sit-for 0) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3637 ; ... and renumber, in case necessary: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3638 (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
|
3639 (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
|
3640 (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
|
3641 (allout-depth) ;;; depth |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3642 nil ;;; number-control |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3643 nil ;;; index |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3644 t)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3645 (message "")))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3646 (if (not resituate) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3647 (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
|
3648 ;;;_ > 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
|
3649 (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
|
3650 "`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
|
3651 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3652 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
|
3653 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3654 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
|
3655 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
|
3656 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3657 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
|
3658 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
|
3659 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
|
3660 topic prefix. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3661 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3662 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
|
3663 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
|
3664 header into which it's being yanked. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3665 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3666 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
|
3667 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
|
3668 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
|
3669 exactly like normal yanks. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3670 |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
3671 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
|
3672 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
|
3673 |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
3674 `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
|
3675 works with normal `yank' in non-outline buffers." |
3430 | 3676 |
3677 (interactive "*P") | |
3678 (setq this-command 'yank) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3679 (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
|
3680 (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
|
3681 (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
|
3682 ;;;_ > 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
|
3683 (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
|
3684 "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
|
3685 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3686 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
|
3687 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3688 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
|
3689 by pops to non-distinctive yanks. Bug..." |
3430 | 3690 |
3691 (interactive "*p") | |
3692 (setq this-command 'yank) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3693 (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
|
3694 (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
|
3695 (allout-yank-processing))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3696 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3697 ;;;_ - Specialty bullet functions |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3698 ;;;_ : 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
|
3699 ;;;_ > 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
|
3700 (defun allout-resolve-xref () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3701 "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
|
3702 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3703 \(Works according to setting of `allout-file-xref-bullet')." |
3430 | 3704 (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
|
3705 (if (not allout-file-xref-bullet) |
3430 | 3706 (error |
64428
e55dd693f95b
(allout-resolve-xref): Fix typos in error strings.
Juanma Barranquero <lekktu@gmail.com>
parents:
64400
diff
changeset
|
3707 "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
|
3708 (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
|
3709 (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
|
3710 allout-file-xref-bullet) |
3430 | 3711 (let (file-name) |
3712 (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
|
3713 (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
|
3714 (heading-end (progn (end-of-line) (point)))) |
3430 | 3715 (goto-char text-start) |
3716 (setq file-name | |
3717 (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t) | |
3718 (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
|
3719 (setq file-name (expand-file-name file-name)) |
3430 | 3720 (if (or (file-exists-p file-name) |
3721 (if (file-writable-p file-name) | |
3722 (y-or-n-p (format "%s not there, create one? " | |
3723 file-name)) | |
3724 (error "%s not found and can't be created" file-name))) | |
3725 (condition-case failure | |
3726 (find-file-other-window file-name) | |
29490 | 3727 ('error failure)) |
3430 | 3728 (error "%s not found" file-name)) |
3729 ) | |
3730 ) | |
3731 ) | |
3732 ) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3733 |
29490 | 3734 ;;;_ #6 Exposure Control |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3735 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3736 ;;;_ - Fundamental |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3737 ;;;_ > 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
|
3738 (defun 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
|
3739 "Hide or show lines from FROM to TO, via Emacs selective-display FLAG char. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3740 Ie, text following flag C-m \(carriage-return) is hidden until the |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3741 next C-j (newline) char. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3742 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3743 Returns the endpoint of the region." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3744 ;; "OFR-" prefixes to avoid collisions with vars in code calling the macro. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3745 ;; ie, elisp macro vars are not 'hygenic', so distinct names are necessary. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3746 (let ((was-inhibit-r-o inhibit-read-only) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3747 (was-undo-list buffer-undo-list) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3748 (was-modified (buffer-modified-p)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3749 trans) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3750 (unwind-protect |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3751 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3752 (setq inhibit-read-only t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3753 (setq buffer-undo-list t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3754 (if (> from to) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3755 (setq trans from from to to trans)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3756 (subst-char-in-region from to |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3757 (if (= flag ?\n) ?\r ?\n) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3758 flag t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3759 ;; adjust character read-protection on all the affected lines. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3760 ;; we handle the region line-by-line. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3761 (goto-char to) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3762 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3763 (setq to (min (+ 2 (point)) (point-max))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3764 (goto-char from) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3765 (beginning-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3766 (while (< (point) to) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3767 ;; handle from start of exposed to beginning of hidden, or eol: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3768 (remove-text-properties (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3769 (progn (if (re-search-forward "[\r\n]" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3770 nil t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3771 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3772 (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3773 '(read-only nil)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3774 ;; handle from start of hidden, if any, to eol: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3775 (if (and (not (eobp)) (= (char-after (point)) ?\r)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3776 (put-text-property (point) (progn (end-of-line) (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3777 'read-only t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3778 ;; Handle the end-of-line to beginning of next line: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3779 (if (not (eobp)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3780 (progn (forward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3781 (remove-text-properties (1- (point)) (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3782 '(read-only nil))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3783 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3784 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3785 (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
|
3786 (setq inhibit-read-only was-inhibit-r-o) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3787 (setq buffer-undo-list was-undo-list) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3788 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3789 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3790 ) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3791 ;;;_ > 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
|
3792 (defun allout-flag-current-subtree (flag) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3793 "Hide or show subtree of currently-visible topic. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3794 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3795 See `allout-flag-region' for more details." |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3796 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3797 (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
|
3798 (allout-back-to-current-heading) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3799 (let ((from (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3800 (to (progn (allout-end-of-current-subtree) (1- (point))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3801 (allout-flag-region from to flag)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3802 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3803 ;;;_ - Topic-specific |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3804 ;;;_ > 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
|
3805 (defun allout-show-entry () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3806 "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
|
3807 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3808 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
|
3809 expense of exposing its context, but can leave the outline with aberrant |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3810 exposure. `allout-hide-current-entry-completely' or `allout-show-offshoot' |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3811 should be used after the peek to rectify the exposure." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3812 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3813 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3814 (save-excursion |
29490 | 3815 (let ((at (point)) |
3816 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
|
3817 (allout-goto-prefix) |
29490 | 3818 (setq beg (if (= (preceding-char) ?\r) (1- (point)) (point))) |
3819 (re-search-forward "[\n\r]" nil t) | |
3820 (setq end (1- (if (< at (point)) | |
3821 ;; We're on topic head line - show only it: | |
3822 (point) | |
3823 ;; or we're in body - include it: | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3824 (max beg (or (allout-pre-next-preface) (point)))))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3825 (allout-flag-region beg end ?\n) |
29490 | 3826 (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
|
3827 ;;;_ > 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
|
3828 (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
|
3829 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3830 "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
|
3831 |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3832 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
|
3833 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3834 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
|
3835 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
|
3836 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3837 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
|
3838 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
|
3839 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
|
3840 it. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3841 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3842 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
|
3843 point of non-opened subtree?)" |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3844 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3845 (interactive "p") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3846 (let (max-pos) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3847 (if (and (not strict) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3848 (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
|
3849 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3850 (progn (allout-show-to-offshoot) ; Point's concealed, open to |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3851 ; expose it. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3852 ;; Then recurse, but with "strict" set so we don't |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3853 ;; infinite regress: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3854 (setq max-pos (allout-show-children level t))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3855 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3856 (save-excursion |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3857 (save-restriction |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3858 (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
|
3859 (chart (allout-chart-subtree (or level 1))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3860 (to-reveal (allout-chart-to-reveal chart (or level 1)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3861 (goto-char start-pt) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3862 (if (and strict (= (preceding-char) ?\r)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3863 ;; Concealed root would already have been taken care of, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3864 ;; unless strict was set. |
29490 | 3865 (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
|
3866 (allout-flag-region (point) (allout-snug-back) ?\n) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3867 (if allout-show-bodies |
29490 | 3868 (progn (goto-char (car to-reveal)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3869 (allout-show-current-entry))))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3870 (while to-reveal |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3871 (goto-char (car to-reveal)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3872 (allout-flag-region (point) (allout-snug-back) ?\n) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3873 (if allout-show-bodies |
29490 | 3874 (progn (goto-char (car to-reveal)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3875 (allout-show-current-entry))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3876 (setq to-reveal (cdr to-reveal))))))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3877 ;;;_ > allout-hide-point-reconcile () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3878 (defun allout-hide-reconcile () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3879 "Like `allout-hide-current-entry'; hides completely if within hidden region. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3880 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3881 Specifically intended for aberrant exposure states, like entries that were |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3882 exposed by `allout-show-entry' but are within otherwise concealed regions." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3883 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3884 (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
|
3885 (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
|
3886 (allout-flag-region (if (not (bobp)) (1- (point)) (point)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3887 (progn (allout-pre-next-preface) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3888 (if (= ?\r (following-char)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3889 (point) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3890 (1- (point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3891 ?\r))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3892 ;;;_ > 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
|
3893 (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
|
3894 "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
|
3895 |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3896 As with `allout-hide-current-entry-completely', useful for rectifying |
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3897 aberrant exposure states produced by `allout-show-entry'." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3898 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3899 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3900 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3901 (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
|
3902 (orig-pref (allout-goto-prefix)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3903 (last-at (point)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3904 bag-it) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3905 (while (or bag-it (= (preceding-char) ?\r)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3906 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3907 (if (= last-at (setq last-at (point))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3908 ;; 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
|
3909 ;; topic completely, and bag this try. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3910 (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
|
3911 (allout-show-current-subtree) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3912 (goto-char orig-pt) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3913 (setq bag-it t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3914 (beep) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3915 (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
|
3916 "allout-show-to-offshoot: " |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3917 "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
|
3918 (allout-show-children) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3919 (goto-char orig-pref)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3920 (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
|
3921 (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
|
3922 (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
|
3923 ;;;_ > 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
|
3924 (defun allout-hide-current-entry () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3925 "Hide the body directly following this heading." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3926 (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
|
3927 (allout-back-to-current-heading) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3928 (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
|
3929 (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
|
3930 (progn (allout-end-of-entry) (point)) |
29490 | 3931 ?\r))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3932 ;;;_ > 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
|
3933 (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
|
3934 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3935 "Show body following current heading, or hide the entry if repeat count." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3936 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3937 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3938 (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
|
3939 (allout-hide-current-entry) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3940 (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
|
3941 (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
|
3942 (progn (allout-end-of-entry) (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3943 ?\n) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
3944 ))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3945 ;;;_ > allout-hide-current-entry-completely () |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3946 ; ... allout-hide-current-entry-completely also for isearch dynamic exposure: |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3947 (defun allout-hide-current-entry-completely () |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3948 "Like `allout-hide-current-entry', but conceal topic completely. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3949 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3950 Specifically intended for aberrant exposure states, like entries that were |
48857
8641226163f1
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48856
diff
changeset
|
3951 exposed by `allout-show-entry' but are within otherwise concealed regions." |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3952 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3953 (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
|
3954 (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
|
3955 (allout-flag-region (if (not (bobp)) (1- (point)) (point)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3956 (progn (allout-pre-next-preface) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3957 (if (= ?\r (following-char)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3958 (point) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3959 (1- (point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
3960 ?\r))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3961 ;;;_ > 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
|
3962 (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
|
3963 "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
|
3964 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
|
3965 (interactive "P") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3966 (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
|
3967 (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
|
3968 ;; 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
|
3969 (if (not (allout-next-heading)) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
3970 (error "No topics") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3971 ;; 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
|
3972 (message "Above outermost topic - exposing all.") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3973 (allout-flag-region (point-min)(point-max) ?\n)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3974 (if (not arg) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3975 (allout-flag-current-subtree ?\n) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3976 (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
|
3977 (allout-expose-topic '(* :)))))) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3978 ;;;_ > 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
|
3979 (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
|
3980 "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
|
3981 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3982 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
|
3983 and its siblings. |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3984 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3985 If optional arg JUST-CLOSE is non-nil, do not treat the parent or |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3986 siblings, even if the target topic is already closed." |
3430 | 3987 |
3988 (interactive) | |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3989 (let ((from (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3990 (orig-eol (progn (end-of-line) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3991 (if (not (allout-goto-prefix)) |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
3992 (error "No topics found") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3993 (end-of-line)(point))))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
3994 (allout-flag-current-subtree ?\r) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3995 (goto-char from) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3996 (if (and (= orig-eol (progn (goto-char orig-eol) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3997 (end-of-line) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3998 (point))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
3999 (not just-close) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4000 ;; Structure didn't change - try hiding current level: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4001 (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
|
4002 (if (allout-up-current-level 1 t) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4003 t |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4004 (goto-char 0) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4005 (let ((msg |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4006 "Top-level topic already closed - closing siblings...")) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4007 (message msg) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4008 (allout-expose-topic '(0 :)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4009 (message (concat msg " Done."))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4010 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
|
4011 (/= (allout-recent-depth) 0)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4012 (allout-hide-current-subtree)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4013 (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
|
4014 ;;;_ > 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
|
4015 (defun allout-show-current-branches () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4016 "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
|
4017 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4018 (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
|
4019 (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
|
4020 ;;;_ > 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
|
4021 (defun allout-hide-current-leaves () |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4022 "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
|
4023 (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
|
4024 (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
|
4025 (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
|
4026 (point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4027 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4028 ;;;_ - 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
|
4029 ;;;_ > 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
|
4030 (defun allout-show-all () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4031 "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
|
4032 (interactive) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4033 (message "Exposing entire buffer...") |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4034 (allout-flag-region (point-min) (point-max) ?\n) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4035 (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
|
4036 ;;;_ > 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
|
4037 (defun allout-hide-bodies () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4038 "Hide all of buffer except headings." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4039 (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
|
4040 (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
|
4041 ;;;_ > 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
|
4042 (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
|
4043 "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
|
4044 (save-excursion |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4045 (save-restriction |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4046 (narrow-to-region start end) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4047 (goto-char (point-min)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4048 (while (not (eobp)) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4049 (allout-flag-region (point) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4050 (progn (allout-pre-next-preface) (point)) ?\r) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4051 (if (not (eobp)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4052 (forward-char |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4053 (if (looking-at "[\n\r][\n\r]") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4054 2 1))))))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4055 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4056 ;;;_ > 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
|
4057 (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
|
4058 "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
|
4059 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4060 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
|
4061 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
|
4062 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
|
4063 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
|
4064 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4065 Cursor is left at start position. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4066 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4067 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
|
4068 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4069 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
|
4070 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4071 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
|
4072 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
|
4073 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4074 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
|
4075 subtopics of the current topic. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4076 |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4077 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
|
4078 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
|
4079 explicit specs following the `:'. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4080 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4081 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
|
4082 |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4083 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
|
4084 - 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
|
4085 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
|
4086 that level. |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4087 - 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
|
4088 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
|
4089 - 0 means to close topic - hide all offspring. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4090 : - `repeat' |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4091 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
|
4092 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
|
4093 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
|
4094 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
|
4095 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
|
4096 * - 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
|
4097 + - 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
|
4098 - - 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
|
4099 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4100 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
|
4101 \(allout-expose-topic '(-1 : 0)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4102 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
|
4103 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
|
4104 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
|
4105 \(allout-expose-topic '(-1 () : 1 0)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4106 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
|
4107 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
|
4108 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
|
4109 \(allout-expose-topic '(-2 : -1 *)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4110 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
|
4111 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
|
4112 last and completely open the last one." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4113 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4114 (interactive "xExposure spec: ") |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4115 (if (not (listp spec)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4116 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
|
4117 (let ((depth (allout-depth)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4118 (max-pos 0) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4119 prev-elem curr-elem |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4120 stay done |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4121 snug-back |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4122 ) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4123 (while spec |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4124 (setq prev-elem curr-elem |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4125 curr-elem (car spec) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4126 spec (cdr spec)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4127 (cond ; Do current element: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4128 ((null curr-elem) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4129 ((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
|
4130 (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
|
4131 (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
|
4132 (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
|
4133 ((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
|
4134 (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
|
4135 (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
|
4136 ((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
|
4137 ((eq curr-elem ':) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4138 (setq stay t) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4139 ;; 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
|
4140 ;; w.r.t. remaining siblings: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4141 (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
|
4142 ;; 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
|
4143 (- (length (allout-chart-siblings)) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4144 (length spec)))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4145 (if (< 0 residue) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4146 ;; 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
|
4147 (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
|
4148 spec))))))) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4149 ((numberp curr-elem) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4150 (if (and (>= 0 curr-elem) (allout-visible-p)) |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4151 (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
|
4152 (if (> 0 curr-elem) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4153 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
|
4154 (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
|
4155 (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
|
4156 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
|
4157 (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
|
4158 (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
|
4159 (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
|
4160 (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
|
4161 ((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
|
4162 (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
|
4163 (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
|
4164 (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
|
4165 (cond (stay (setq stay nil)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4166 ((listp (car spec)) nil) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4167 ((> max-pos (point)) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4168 ;; 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
|
4169 (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
|
4170 (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
|
4171 ((allout-next-sibling depth)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4172 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
|
4173 ;;;_ > 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
|
4174 (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
|
4175 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4176 "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
|
4177 format) instead. |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4178 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4179 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
|
4180 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4181 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
|
4182 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
|
4183 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4184 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
|
4185 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
|
4186 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
|
4187 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
|
4188 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
|
4189 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4190 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
|
4191 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4192 - 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
|
4193 - 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
|
4194 absolute value of the number. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4195 - 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
|
4196 - 0 just closes |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4197 - `*' completely opens the topic, including bodies. |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4198 - `+' shows all the sub headers, but not the bodies |
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
4199 - `-' 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
|
4200 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4201 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
|
4202 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
|
4203 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
|
4204 for the corresponding offspring of the topic. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4205 |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4206 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
|
4207 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4208 (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
|
4209 (let ((depth (allout-current-depth)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4210 done |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4211 max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4212 (cond ((null spec) nil) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4213 ((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
|
4214 (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
|
4215 (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
|
4216 (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
|
4217 ((numberp spec) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4218 (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
|
4219 (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
|
4220 (end-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4221 (if (or (not max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4222 (> (point) max-pos)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4223 (setq max-pos (point))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4224 (if (> 0 spec) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4225 (setq spec (* -1 spec))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4226 (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
|
4227 (allout-show-children spec))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4228 ((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
|
4229 ;(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
|
4230 ; (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
|
4231 ; (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
|
4232 (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
|
4233 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
|
4234 (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
|
4235 (setq spec (cdr spec)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4236 (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
|
4237 (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
|
4238 (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
|
4239 (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
|
4240 (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
|
4241 (setq max-pos got))))))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4242 (while (and followers |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4243 (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
|
4244 (progn (goto-char max-pos) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4245 (setq max-pos nil))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4246 (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
|
4247 (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
|
4248 (allout-old-expose-topic (car followers)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4249 (setq followers (cdr followers))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4250 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
|
4251 ;;;_ > 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
|
4252 (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
|
4253 "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
|
4254 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
|
4255 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
|
4256 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4257 Cursor is left at start position. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4258 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4259 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
|
4260 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4261 Examples: |
61969
38ca28ee68d6
(allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents:
59996
diff
changeset
|
4262 \(allout-new-exposure (-1 () () () 1) 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4263 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
|
4264 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
|
4265 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
|
4266 \(allout-new-exposure : -1 0) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4267 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
|
4268 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
|
4269 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
|
4270 \(allout-new-exposure -2 : -1 *) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4271 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
|
4272 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
|
4273 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
|
4274 (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
|
4275 '(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
|
4276 (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
|
4277 (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
|
4278 (list 'allout-expose-topic (list 'quote spec)))) |
29490 | 4279 |
4280 ;;;_ #7 Systematic outline presentation - copying, printing, flattening | |
4281 | |
4282 ;;;_ - Mapping and processing of topics | |
4283 ;;;_ ( 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
|
4284 ;;;_ > 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
|
4285 (defun allout-stringify-flat-index (flat-index &optional context) |
29490 | 4286 "Convert list representing section/subsection/... to document string. |
4287 | |
4288 Optional arg CONTEXT indicates interior levels to include." | |
4289 (let ((delim ".") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
4290 result |
29490 | 4291 numstr |
4292 (context-depth (or (and context 2) 1))) | |
4293 ;; Take care of the explicit context: | |
4294 (while (> context-depth 0) | |
4295 (setq numstr (int-to-string (car flat-index)) | |
4296 flat-index (cdr flat-index) | |
4297 result (if flat-index | |
4298 (cons delim (cons numstr result)) | |
4299 (cons numstr result)) | |
4300 context-depth (if flat-index (1- context-depth) 0))) | |
4301 (setq delim " ") | |
4302 ;; Take care of the indentation: | |
4303 (if flat-index | |
4304 (progn | |
4305 (while flat-index | |
4306 (setq result | |
4307 (cons delim | |
4308 (cons (make-string | |
4309 (1+ (truncate (if (zerop (car flat-index)) | |
4310 1 | |
4311 (log10 (car flat-index))))) | |
4312 ? ) | |
4313 result))) | |
4314 (setq flat-index (cdr flat-index))) | |
4315 ;; Dispose of single extra delim: | |
4316 (setq result (cdr result)))) | |
4317 (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
|
4318 ;;;_ > 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
|
4319 (defun allout-stringify-flat-index-plain (flat-index) |
29490 | 4320 "Convert list representing section/subsection/... to document string." |
4321 (let ((delim ".") | |
4322 result) | |
4323 (while flat-index | |
4324 (setq result (cons (int-to-string (car flat-index)) | |
4325 (if result | |
4326 (cons delim result)))) | |
4327 (setq flat-index (cdr flat-index))) | |
4328 (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
|
4329 ;;;_ > 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
|
4330 (defun allout-stringify-flat-index-indented (flat-index) |
29490 | 4331 "Convert list representing section/subsection/... to document string." |
4332 (let ((delim ".") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
4333 result |
29490 | 4334 numstr) |
4335 ;; Take care of the explicit context: | |
4336 (setq numstr (int-to-string (car flat-index)) | |
4337 flat-index (cdr flat-index) | |
4338 result (if flat-index | |
4339 (cons delim (cons numstr result)) | |
4340 (cons numstr result))) | |
4341 (setq delim " ") | |
4342 ;; Take care of the indentation: | |
4343 (if flat-index | |
4344 (progn | |
4345 (while flat-index | |
4346 (setq result | |
4347 (cons delim | |
4348 (cons (make-string | |
4349 (1+ (truncate (if (zerop (car flat-index)) | |
4350 1 | |
4351 (log10 (car flat-index))))) | |
4352 ? ) | |
4353 result))) | |
4354 (setq flat-index (cdr flat-index))) | |
4355 ;; Dispose of single extra delim: | |
4356 (setq result (cdr result)))) | |
4357 (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
|
4358 ;;;_ > 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
|
4359 (defun allout-listify-exposed (&optional start end format) |
29490 | 4360 |
4361 "Produce a list representing exposed topics in current region. | |
4362 | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4363 This list can then be used by `allout-process-exposed' to manipulate |
29490 | 4364 the subject region. |
4365 | |
4366 Optional START and END indicate bounds of region. | |
4367 | |
4368 optional arg, FORMAT, designates an alternate presentation form for | |
4369 the prefix: | |
4370 | |
4371 list - Present prefix as numeric section.subsection..., starting with | |
4372 section indicated by the list, innermost nesting first. | |
4373 `indent' \(symbol) - Convert header prefixes to all white space, | |
4374 except for distinctive bullets. | |
4375 | |
4376 The elements of the list produced are lists that represents a topic | |
4377 header and body. The elements of that list are: | |
4378 | |
4379 - a number representing the depth of the topic, | |
4380 - a string representing the header-prefix, including trailing whitespace and | |
4381 bullet. | |
4382 - a string representing the bullet character, | |
4383 - and a series of strings, each containing one line of the exposed | |
4384 portion of the topic entry." | |
4385 | |
4386 (interactive "r") | |
4387 (save-excursion | |
4388 (let* | |
4389 ;; state vars: | |
4390 (strings prefix pad result depth new-depth out gone-out bullet beg | |
4391 next done) | |
4392 | |
4393 (goto-char start) | |
4394 (beginning-of-line) | |
4395 ;; 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
|
4396 (if (> (allout-goto-prefix) start) |
29490 | 4397 ;; First topic follows beginning point - register preliminary stuff: |
4398 (setq result (list (list 0 "" nil | |
4399 (buffer-substring start (1- (point))))))) | |
4400 (while (and (not done) | |
4401 (not (eobp)) ; Loop until we've covered the region. | |
4402 (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
|
4403 (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
|
4404 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
|
4405 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
|
4406 beg (progn (allout-end-of-prefix t) (point))) ; and beginning. |
29490 | 4407 (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
|
4408 (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
|
4409 (setq new-depth (allout-recent-depth)) |
29490 | 4410 (setq gone-out out |
4411 out (< new-depth depth)) | |
4412 (beginning-of-line) | |
4413 (setq next (point)) | |
4414 (goto-char beg) | |
4415 (setq strings nil) | |
4416 (while (> next (point)) ; Get all the exposed text in | |
4417 (setq strings | |
4418 (cons (buffer-substring | |
4419 beg | |
4420 ;To hidden text or end of line: | |
4421 (progn | |
4422 (search-forward "\r" | |
4423 (save-excursion (end-of-line) | |
4424 (point)) | |
4425 1) | |
4426 (if (= (preceding-char) ?\r) | |
4427 (1- (point)) | |
4428 (point)))) | |
4429 strings)) | |
4430 (if (< (point) next) ; Resume from after hid text, if any. | |
4431 (forward-line 1)) | |
4432 (setq beg (point))) | |
4433 ;; Accumulate list for this topic: | |
4434 (setq strings (nreverse strings)) | |
4435 (setq result | |
4436 (cons | |
4437 (if format | |
4438 (let ((special (if (string-match | |
4439 (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
|
4440 allout-distinctive-bullets-string) |
29490 | 4441 bullet))) |
4442 (cond ((listp format) | |
4443 (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
|
4444 (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
|
4445 (allout-stringify-flat-index format |
29490 | 4446 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
|
4447 (allout-stringify-flat-index-plain |
29490 | 4448 format)) |
4449 strings | |
4450 special)) | |
4451 ((eq format 'indent) | |
4452 (if special | |
4453 (list depth | |
4454 (concat (make-string (1+ depth) ? ) | |
4455 (substring prefix -1)) | |
4456 strings) | |
4457 (list depth | |
4458 (make-string depth ? ) | |
4459 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
|
4460 (t (error "allout-listify-exposed: %s %s" |
29490 | 4461 "invalid format" format)))) |
4462 (list depth prefix strings)) | |
4463 result)) | |
4464 ;; Reasses format, if any: | |
4465 (if (and format (listp format)) | |
4466 (cond ((= new-depth depth) | |
4467 (setq format (cons (1+ (car format)) | |
4468 (cdr format)))) | |
4469 ((> new-depth depth) ; descending - assume by 1: | |
4470 (setq format (cons 1 format))) | |
4471 (t | |
4472 ; Pop the residue: | |
4473 (while (< new-depth depth) | |
4474 (setq format (cdr format)) | |
4475 (setq depth (1- depth))) | |
4476 ; And increment the current one: | |
4477 (setq format | |
4478 (cons (1+ (or (car format) | |
4479 -1)) | |
4480 (cdr format))))))) | |
4481 ;; Put the list with first at front, to last at back: | |
4482 (nreverse result)))) | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4483 ;;;_ > my-region-active-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4484 (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
|
4485 (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
|
4486 '(region-active-p) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4487 '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
|
4488 ;;;_ > allout-process-exposed (&optional func from to frombuf |
29490 | 4489 ;;; 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
|
4490 (defun allout-process-exposed (&optional func from to frombuf tobuf |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4491 format &optional start-num) |
29490 | 4492 "Map function on exposed parts of current topic; results to another buffer. |
4493 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4494 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
|
4495 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4496 Apply FUNCTION to exposed portions FROM position TO position in buffer |
29490 | 4497 FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an |
4498 alternate presentation form: | |
4499 | |
4500 `flat' - Present prefix as numeric section.subsection..., starting with | |
4501 section indicated by the start-num, innermost nesting first. | |
4502 X`flat-indented' - Prefix is like `flat' for first topic at each | |
4503 X level, but subsequent topics have only leaf topic | |
4504 X number, padded with blanks to line up with first. | |
4505 `indent' \(symbol) - Convert header prefixes to all white space, | |
4506 except for distinctive bullets. | |
4507 | |
4508 Defaults: | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4509 FUNCTION: `allout-insert-listified' |
29490 | 4510 FROM: region start, if region active, else start of buffer |
4511 TO: region end, if region active, else end of buffer | |
4512 FROMBUF: current buffer | |
4513 TOBUF: buffer name derived: \"*current-buffer-name exposed*\" | |
4514 FORMAT: nil" | |
4515 | |
4516 ; Resolve arguments, | |
4517 ; 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
|
4518 (if (not func) (setq func 'allout-insert-listified)) |
29490 | 4519 (if (not (and from to)) |
4520 (if (my-region-active-p) | |
4521 (setq from (region-beginning) to (region-end)) | |
4522 (setq from (point-min) to (point-max)))) | |
4523 (if frombuf | |
4524 (if (not (bufferp frombuf)) | |
4525 ;; Specified but not a buffer - get it: | |
4526 (let ((got (get-buffer frombuf))) | |
4527 (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
|
4528 (error (concat "allout-process-exposed: source buffer " |
29490 | 4529 frombuf |
4530 " not found.")) | |
4531 (setq frombuf got)))) | |
4532 ;; not specified - default it: | |
4533 (setq frombuf (current-buffer))) | |
4534 (if tobuf | |
4535 (if (not (bufferp tobuf)) | |
4536 (setq tobuf (get-buffer-create tobuf))) | |
4537 ;; not specified - default it: | |
4538 (setq tobuf (concat "*" (buffer-name frombuf) " exposed*"))) | |
4539 (if (listp format) | |
4540 (nreverse format)) | |
4541 | |
4542 (let* ((listified | |
4543 (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
|
4544 (allout-listify-exposed from to format)))) |
29490 | 4545 (set-buffer tobuf) |
4546 (mapcar func listified) | |
4547 (pop-to-buffer tobuf))) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4548 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4549 ;;;_ - 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
|
4550 ;;;_ > 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
|
4551 (defun allout-insert-listified (listified) |
29490 | 4552 "Insert contents of listified outline portion in current buffer. |
4553 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4554 LISTIFIED is a list representing each topic header and body: |
29490 | 4555 |
4556 \`(depth prefix text)' | |
4557 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4558 or \`(depth prefix text bullet-plus)' |
29490 | 4559 |
4560 If `bullet-plus' is specified, it is inserted just after the entire prefix." | |
4561 (setq listified (cdr listified)) | |
4562 (let ((prefix (prog1 | |
4563 (car listified) | |
4564 (setq listified (cdr listified)))) | |
4565 (text (prog1 | |
4566 (car listified) | |
4567 (setq listified (cdr listified)))) | |
4568 (bullet-plus (car listified))) | |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4569 (insert prefix) |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4570 (if bullet-plus (insert (concat " " bullet-plus))) |
29490 | 4571 (while text |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4572 (insert (car text)) |
29490 | 4573 (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
|
4574 (insert "\n"))) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4575 (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
|
4576 ;;;_ > 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
|
4577 (defun allout-copy-exposed-to-buffer (&optional arg tobuf format) |
29490 | 4578 "Duplicate exposed portions of current outline to another buffer. |
4579 | |
4580 Other buffer has current buffers name with \" exposed\" appended to it. | |
4581 | |
4582 With repeat count, copy the exposed parts of only the current topic. | |
4583 | |
4584 Optional second arg TOBUF is target buffer name. | |
4585 | |
4586 Optional third arg FORMAT, if non-nil, symbolically designates an | |
4587 alternate presentation format for the outline: | |
4588 | |
4589 `flat' - Convert topic header prefixes to numeric | |
4590 section.subsection... identifiers. | |
4591 `indent' - Convert header prefixes to all white space, except for | |
4592 distinctive bullets. | |
4593 `indent-flat' - The best of both - only the first of each level has | |
4594 the full path, the rest have only the section number | |
4595 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
|
4596 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4597 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4598 (if (not tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4599 (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
|
4600 (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
|
4601 (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
|
4602 (end (if arg (allout-end-of-current-subtree) (point-max))) |
29490 | 4603 (buf (current-buffer)) |
4604 (start-list ())) | |
4605 (if (eq format 'flat) | |
4606 (setq format (if arg (save-excursion | |
4607 (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
|
4608 (allout-topic-flat-index)) |
29490 | 4609 '(1)))) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4610 (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
|
4611 (allout-process-exposed 'allout-insert-listified |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4612 beg |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4613 end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4614 (current-buffer) |
29490 | 4615 tobuf |
4616 format start-list) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4617 (goto-char (point-min)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4618 (pop-to-buffer buf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4619 (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
|
4620 ;;;_ > 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
|
4621 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf) |
29490 | 4622 "Present numeric outline of outline's exposed portions in another buffer. |
4623 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4624 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
|
4625 `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
|
4626 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4627 Use `allout-indented-exposed-to-buffer' for indented presentation. |
29490 | 4628 |
4629 With repeat count, copy the exposed portions of only current topic. | |
4630 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4631 Other buffer has current buffer's name with \" exposed\" appended to |
29490 | 4632 it, unless optional second arg TOBUF is specified, in which case it is |
4633 used verbatim." | |
4634 (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
|
4635 (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
|
4636 ;;;_ > 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
|
4637 (defun allout-indented-exposed-to-buffer (&optional arg tobuf) |
29490 | 4638 "Present indented outline of outline's exposed portions in another buffer. |
4639 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4640 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
|
4641 `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
|
4642 |
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4643 Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. |
29490 | 4644 |
4645 With repeat count, copy the exposed portions of only current topic. | |
4646 | |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4647 Other buffer has current buffer's name with \" exposed\" appended to |
29490 | 4648 it, unless optional second arg TOBUF is specified, in which case it is |
4649 used verbatim." | |
4650 (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
|
4651 (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
|
4652 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4653 ;;;_ - 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
|
4654 ;;;_ > 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
|
4655 (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
|
4656 "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
|
4657 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
|
4658 string across LaTeX processing." |
29490 | 4659 (mapconcat (function |
4660 (lambda (char) | |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4661 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4662 (concat "\\char" (number-to-string char) "{}")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4663 ((= char ?\n) "\\\\") |
29490 | 4664 (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
|
4665 string |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4666 "")) |
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-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
|
4668 (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
|
4669 "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
|
4670 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
4671 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
|
4672 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
|
4673 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
|
4674 (beginning-of-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4675 (let ((beg (point)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4676 (end (progn (end-of-line)(point)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4677 (goto-char beg) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4678 (while (re-search-forward "\\\\" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4679 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4680 end ; bounded by end-of-line |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4681 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
|
4682 (goto-char (match-beginning 0)) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4683 (insert "\\") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4684 (setq end (1+ end)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4685 (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
|
4686 ;;;_ > 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
|
4687 (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
|
4688 "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
|
4689 ;; 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
|
4690 ;; 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
|
4691 (set-buffer buffer) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4692 (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
|
4693 "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
|
4694 (page-numbering (if allout-number-pages |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4695 "\\pagestyle{empty}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4696 "")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4697 (linesdef (concat "\\def\\beginlines{" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4698 "\\par\\begingroup\\nobreak\\medskip" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4699 "\\parindent=0pt\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4700 " \\kern1pt\\nobreak \\obeylines \\obeyspaces " |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4701 "\\everypar{\\strut}}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4702 "\\def\\endlines{" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4703 "\\kern1pt\\endgroup\\medbreak\\noindent}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4704 (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
|
4705 allout-title-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4706 (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
|
4707 allout-label-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4708 (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
|
4709 allout-head-line-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4710 (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
|
4711 allout-body-line-style)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4712 (setlength (format "%s%s%s%s" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4713 "\\newlength{\\stepsize}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4714 "\\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
|
4715 allout-indent |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4716 "}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4717 (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
|
4718 "\\newcommand{\\OneHeadLine}[3]{%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4719 "\\noindent%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4720 "\\hspace*{#2\\stepsize}%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4721 "\\labelcmd{#1}\\hspace*{.2cm}" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4722 "\\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
|
4723 allout-line-skip |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4724 "]\n}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4725 (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
|
4726 "\\newcommand{\\OneBodyLine}[2]{%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4727 "\\noindent%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4728 "\\hspace*{#1\\stepsize}%\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4729 "\\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
|
4730 allout-line-skip |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4731 "]\n}\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4732 (begindoc "\\begin{document}\n\\begin{center}\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4733 (title (format "%s%s%s%s" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4734 "\\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
|
4735 (allout-latex-verb-quote (if allout-title |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4736 (condition-case err |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4737 (eval allout-title) |
29490 | 4738 ('error "<unnamed buffer>")) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4739 "Unnamed Outline")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4740 "}\n" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4741 "\\end{center}\n\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4742 (hsize "\\hsize = 7.5 true in\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4743 (hoffset "\\hoffset = -1.5 true in\n") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4744 (vspace "\\vspace{.1cm}\n\n")) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4745 (insert (concat doc-style |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4746 page-numbering |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4747 titlecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4748 labelcmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4749 headlinecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4750 bodylinecmd |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4751 setlength |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4752 oneheadline |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4753 onebodyline |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4754 begindoc |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4755 title |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4756 hsize |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4757 hoffset |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4758 vspace) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4759 ))) |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
4760 ;;;_ > 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
|
4761 (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
|
4762 "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
|
4763 (set-buffer buffer) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4764 (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
|
4765 ;;;_ > 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
|
4766 (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
|
4767 "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
|
4768 |
29490 | 4769 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
|
4770 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
|
4771 (let* ((head-line (if text (car text))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4772 (body-lines (cdr text)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4773 (curr-line) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4774 body-content bop) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4775 ; Do the head line: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48859
diff
changeset
|
4776 (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
|
4777 (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
|
4778 "\1}{" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4779 depth |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4780 "}{\\verb\1 " |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4781 (if head-line |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4782 (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
|
4783 "") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4784 "\1}\n")) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4785 (if (not body-lines) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4786 nil |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4787 ;;(insert "\\beginlines\n") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4788 (insert "\\begin{verbatim}\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4789 (while body-lines |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4790 (setq curr-line (car body-lines)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4791 (if (and (not body-content) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4792 (not (string-match "^\\s-*$" curr-line))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4793 (setq body-content t)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4794 ; Mangle any occurrences of |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4795 ; "\end{verbatim}" in text, |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4796 ; it's special: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4797 (if (and body-content |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4798 (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
|
4799 (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
|
4800 ">" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4801 (substring curr-line bop)))) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4802 ;;(insert "|" (car body-lines) "|") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4803 (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
|
4804 (allout-latex-verbatim-quote-curr-line) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4805 (insert "\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4806 (setq body-lines (cdr body-lines))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4807 (if body-content |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4808 (setq body-content nil) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4809 (forward-char -1) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4810 (insert "\\ ") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4811 (forward-char 1)) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4812 ;;(insert "\\endlines\n") |
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
4813 (insert "\\end{verbatim}\n") |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4814 ))) |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
4815 ;;;_ > allout-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
|
4816 (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
|
4817 "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
|
4818 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
|
4819 with \"*\" prepended and \" latex-formed*\" appended. |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4820 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4821 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
|
4822 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4823 (interactive "P") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4824 (if (not tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4825 (setq tobuf |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4826 (get-buffer-create (concat "*" (buffer-name) " latexified*")))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4827 (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
|
4828 (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
|
4829 (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
|
4830 (buf (current-buffer))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4831 (set-buffer tobuf) |
3430 | 4832 (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
|
4833 (allout-insert-latex-header tobuf) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4834 (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
|
4835 (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
|
4836 beg |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4837 end |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4838 buf |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4839 tobuf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4840 (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
|
4841 (allout-insert-latex-trailer tobuf) |
3430 | 4842 (goto-char (point-min)) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4843 (pop-to-buffer buf) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4844 (goto-char start-pt))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
4845 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4846 ;;;_ #8 Encryption |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4847 ;;;_ > 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
|
4848 (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
|
4849 "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
|
4850 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4851 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
|
4852 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
|
4853 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
|
4854 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
|
4855 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
|
4856 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4857 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
|
4858 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4859 \**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
|
4860 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
|
4861 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4862 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
|
4863 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
|
4864 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4865 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
|
4866 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
|
4867 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
|
4868 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
|
4869 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
|
4870 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
|
4871 auto-encryption specifics. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4872 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4873 \**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
|
4874 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
|
4875 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
|
4876 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4877 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
|
4878 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
|
4879 \\[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
|
4880 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4881 Passphrase Caching |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4882 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4883 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
|
4884 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
|
4885 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4886 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
|
4887 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
|
4888 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
|
4889 `pgg-passphrase-cache-expiry'. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4890 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4891 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
|
4892 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4893 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
|
4894 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
|
4895 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
|
4896 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
|
4897 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
|
4898 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
|
4899 keys. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4900 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4901 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
|
4902 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
|
4903 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
|
4904 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
|
4905 verifier across emacs sessions. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4906 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4907 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
|
4908 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
|
4909 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
|
4910 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
|
4911 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
|
4912 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
|
4913 (interactive "P") |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4914 (save-excursion |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4915 (allout-back-to-current-heading) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4916 (allout-toggle-subtree-encryption) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4917 ) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4918 ) |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4919 ;;;_ > 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
|
4920 (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
|
4921 "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
|
4922 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4923 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
|
4924 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
|
4925 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
|
4926 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
|
4927 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
|
4928 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4929 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
|
4930 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4931 \**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
|
4932 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
|
4933 |
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
4934 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
|
4935 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4936 (interactive "P") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4937 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4938 (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
|
4939 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4940 (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
|
4941 (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
|
4942 " 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
|
4943 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4944 (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
|
4945 ;; Asses location: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4946 (after-bullet-pos (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4947 (was-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4948 (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
|
4949 (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
|
4950 (allout-encrypted-topic-p))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4951 (was-collapsed (if (not (re-search-forward "[\n\r]" nil t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4952 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4953 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4954 (looking-at "\r"))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4955 (subtree-beg (1+ (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4956 (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
|
4957 (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
|
4958 subtree-end)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4959 (subtree-end-char (char-after (1- subtree-end))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4960 (subtree-trailling-char (char-after subtree-end)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4961 (place-holder (if (or (string= "" subject-text) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4962 (string= "\n" subject-text)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4963 (error "No topic contents to %scrypt" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4964 (if was-encrypted "de" "en")))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4965 ;; Assess key parameters: |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4966 (key-info (or |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4967 ;; 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
|
4968 (and was-encrypted |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4969 (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
|
4970 (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
|
4971 '(keypair nil)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4972 '(symmetric nil))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4973 (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
|
4974 (for-key-identity (cadr key-info)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4975 (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
|
4976 result-text) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4977 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4978 (setq result-text |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4979 (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
|
4980 (current-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
4981 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
|
4982 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4983 ;; 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
|
4984 (allout-unprotected |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4985 (progn |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4986 (set-buffer allout-buffer) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4987 (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
|
4988 (insert result-text) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4989 (if was-collapsed |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4990 (allout-flag-region subtree-beg (1- (point)) ?\r)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4991 ;; adjust trailling-blank-lines to preserve topic spacing: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4992 (if (not was-encrypted) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4993 (if (and (member subtree-end-char '(?\r ?\n)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4994 (member subtree-trailling-char '(?\r ?\n))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4995 (insert subtree-trailling-char))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
4996 ;; 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
|
4997 (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
|
4998 (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
|
4999 allout-topic-encryption-bullet)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5000 (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
|
5001 (delete-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5002 (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
|
5003 (if was-encrypted |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5004 ;; 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
|
5005 (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
|
5006 (delete-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5007 ;; 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
|
5008 (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
|
5009 (insert "*")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5010 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5011 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5012 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5013 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5014 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5015 ;;;_ > 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
|
5016 ;;; 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
|
5017 ;;; passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5018 (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
|
5019 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
|
5020 passphrase) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5021 "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
|
5022 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5023 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
|
5024 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5025 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
|
5026 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5027 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
|
5028 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5029 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
|
5030 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
|
5031 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5032 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
|
5033 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
|
5034 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5035 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
|
5036 for verification purposes. |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5037 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5038 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
|
5039 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5040 (require 'pgg) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5041 |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5042 (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
|
5043 (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
|
5044 |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5045 (let* ((scheme (upcase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5046 (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
|
5047 (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
|
5048 (or for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5049 (split-string (read-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5050 (format "%s message recipients: " |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5051 scheme)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5052 "[ \t,]+")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5053 (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
|
5054 (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
|
5055 (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
|
5056 (buffer-name allout-buffer))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5057 (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
|
5058 key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5059 (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
|
5060 target-prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5061 (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
|
5062 target-prompt-id)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5063 (comment "Processed by allout driving pgg") |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5064 work-buffer result result-text status) |
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 (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
|
5067 ;; 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
|
5068 (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
|
5069 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5070 (catch 'encryption-failed |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5071 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5072 ;; 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
|
5073 ;; doing a keypair encryption: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5074 (if (not (or passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5075 (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
|
5076 (not decrypt)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5077 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5078 (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
|
5079 target-cache-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5080 target-prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5081 key-type |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5082 allout-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5083 retried fetch-pass))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5084 (with-temp-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5085 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5086 (insert (subst-char-in-string ?\r ?\n text)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5087 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5088 (cond |
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 ;; symmetric: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5091 ((equal key-type 'symmetric) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5092 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5093 (if decrypt |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5094 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5095 (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
|
5096 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5097 (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
|
5098 passphrase))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5099 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5100 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5101 (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
|
5102 ;; failed - handle passphrase caching |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5103 (if verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5104 (throw 'encryption-failed nil) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5105 (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
|
5106 (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
|
5107 "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
|
5108 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5109 ;; encrypt 'keypair: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5110 ((not decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5111 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5112 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5113 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5114 (pgg-encrypt for-key |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5115 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
|
5116 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5117 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5118 (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
|
5119 (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
|
5120 (error "encryption failed")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5121 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5122 ;; decrypt 'keypair: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5123 (t |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5124 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5125 (setq status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5126 (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
|
5127 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5128 (if status |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5129 (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
|
5130 (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
|
5131 (error "decryption failed")))) |
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 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5134 (setq result-text |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5135 (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
|
5136 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5137 ;; validate result - non-empty |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5138 (cond ((not result-text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5139 (if verifying |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5140 nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5141 ;; 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
|
5142 (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
|
5143 (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
|
5144 (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
|
5145 passphrase))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5146 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5147 ;; 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
|
5148 ((and (not decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5149 (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
|
5150 result-text)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5151 (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
|
5152 " non-armored text - reconfigure!"))) |
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 ;; 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
|
5155 ((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
|
5156 (if (or verifying decrypt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5157 (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
|
5158 passphrase t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5159 result-text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5160 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5161 ;; 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
|
5162 ;; 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
|
5163 (t |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5164 (set-buffer allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5165 (if passphrase |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5166 (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
|
5167 passphrase t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5168 (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
|
5169 allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5170 result-text) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5171 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5172 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5173 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5174 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5175 ) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5176 ;;;_ > 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
|
5177 ;;; 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
|
5178 (defun 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
|
5179 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
|
5180 "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
|
5181 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5182 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
|
5183 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
|
5184 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
|
5185 user for corroboration. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5186 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5187 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
|
5188 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5189 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
|
5190 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5191 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
|
5192 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5193 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
|
5194 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5195 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
|
5196 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5197 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
|
5198 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5199 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
|
5200 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
|
5201 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5202 (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
|
5203 ;; 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
|
5204 (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
|
5205 (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
|
5206 pgg-default-scheme |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5207 "GPG"))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5208 (if prompt-id |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5209 (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
|
5210 "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5211 cache-id t) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5212 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5213 ;; Symmetric hereon: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5214 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5215 (save-excursion |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5216 (set-buffer allout-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5217 (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
|
5218 (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
|
5219 (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
|
5220 'needed) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5221 retried))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5222 (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
|
5223 "")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5224 (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
|
5225 (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
|
5226 prompt-id retry-message)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5227 (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
|
5228 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
|
5229 (prompt full-prompt) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5230 (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
|
5231 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5232 (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
|
5233 (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
|
5234 (got-pass (or cached |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5235 (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
|
5236 |
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 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5239 (if (not got-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5240 nil |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5241 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5242 ;; 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
|
5243 ;; deactivate-passwd memory clearing: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5244 (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
|
5245 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5246 (cond (verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5247 (save-window-excursion |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5248 (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
|
5249 allout-buffer 'symmetric |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5250 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
|
5251 got-pass) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5252 (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
|
5253 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5254 (if (and (not confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5255 (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
|
5256 (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
|
5257 " - use new one instead? ")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5258 ;; deactivate password for subsequent |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5259 ;; confirmation: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5260 (progn |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5261 (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
|
5262 (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
|
5263 nil) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5264 t)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5265 (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
|
5266 (error "Wrong passphrase.")))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5267 ;; 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
|
5268 ;; (new) passphrase: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5269 ((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
|
5270 (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
|
5271 ;; 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
|
5272 ;; 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
|
5273 (if (not confirmation) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5274 (setq confirmation |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5275 (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
|
5276 " ... confirm spelling: ") |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5277 cache-id t))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5278 (prog1 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5279 (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
|
5280 confirmation |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5281 (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
|
5282 " confirmation differ - retry? ")) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5283 (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
|
5284 (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
|
5285 ;; recurse to this routine: |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5286 (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
|
5287 (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
|
5288 (error "Confirmation failed."))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5289 ;; 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
|
5290 (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
|
5291 (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
|
5292 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5293 ) |
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 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5297 ;;;_ > allout-encrypted-topic-p () |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5298 (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
|
5299 "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
|
5300 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5301 (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
|
5302 (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
|
5303 allout-topic-encryption-bullet) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5304 (looking-at "\\*")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5305 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5306 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5307 ;;;_ > 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
|
5308 ;; XXX gpg-specific, alas |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5309 (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
|
5310 "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
|
5311 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5312 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
|
5313 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5314 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
|
5315 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
|
5316 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
|
5317 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5318 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
|
5319 (require 'pgg-parse) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5320 (save-excursion |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5321 (with-temp-buffer |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5322 (insert (subst-char-in-string ?\r ?\n text)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5323 (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
|
5324 (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
|
5325 'symmetric |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5326 'keypair)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5327 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
|
5328 (if (equal type 'keypair) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5329 (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
|
5330 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
|
5331 secret-keys) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5332 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
|
5333 (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
|
5334 first-secret-key)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5335 (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
|
5336 ) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5337 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5338 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5339 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5340 ;;;_ > 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
|
5341 (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
|
5342 "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
|
5343 ;; 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
|
5344 (random t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5345 (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
|
5346 (dotimes (i (length spew)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5347 (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
|
5348 (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
|
5349 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
|
5350 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5351 ;;;_ > 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
|
5352 ;;; outline-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5353 (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
|
5354 outline-buffer) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5355 "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
|
5356 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5357 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
|
5358 settings. |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5359 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5360 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
|
5361 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5362 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
|
5363 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5364 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
|
5365 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
|
5366 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5367 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
|
5368 `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
|
5369 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
|
5370 `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
|
5371 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5372 ;; 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
|
5373 ;; - adjust the verifier |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5374 ;; - 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
|
5375 ;; - 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
|
5376 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5377 (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
|
5378 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
|
5379 (new-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5380 (if new-verifier-needed |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5381 ;; 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
|
5382 (subst-char-in-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5383 ?\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
|
5384 passphrase)))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5385 new-hint) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5386 (when new-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5387 ;; 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
|
5388 (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
|
5389 (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
|
5390 (setq new-hint |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5391 (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
|
5392 allout-passphrase-hint-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5393 (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
|
5394 (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
|
5395 (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
|
5396 allout-passphrase-hint-string))) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5397 (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
|
5398 (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
|
5399 (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
|
5400 allout-passphrase-verifier-string)) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5401 ) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5402 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5403 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5404 ;;;_ > 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
|
5405 (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
|
5406 "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
|
5407 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5408 Derived from value of `allout-file-passphrase-verifier-string'." |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5409 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5410 (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
|
5411 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
|
5412 (if verifier-string |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5413 ;; Return it uncollapsed |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5414 (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
|
5415 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5416 ) |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5417 ;;;_ > 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
|
5418 (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
|
5419 "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
|
5420 |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5421 \"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
|
5422 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5423 (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
|
5424 (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
|
5425 allout-passphrase-verifier-string |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5426 (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
|
5427 '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
|
5428 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
|
5429 t))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5430 ;;;_ > 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
|
5431 (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
|
5432 "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
|
5433 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5434 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
|
5435 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
|
5436 `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
|
5437 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5438 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
|
5439 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
|
5440 must also have content." |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5441 (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
|
5442 (while (not done) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5443 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5444 (if (not (re-search-forward |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5445 (format "\\(\\`\\|[\n\r]\\)%s *%s[^*]" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5446 (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
|
5447 (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
|
5448 nil t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5449 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5450 done t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5451 (goto-char (setq got (match-beginning 0))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5452 (if (looking-at "[\n\r]") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5453 (forward-char 1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5454 (setq got (point))) |
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 (cond ((not got) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5457 (setq done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5458 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5459 ((not (re-search-forward "[\n\r]")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5460 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5461 done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5462 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5463 ((eobp) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5464 (setq got nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5465 done t)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5466 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5467 (t |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5468 (setq content-beg (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5469 (backward-char 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5470 (allout-end-of-subtree) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5471 (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
|
5472 (and except-mark |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5473 (<= content-beg except-mark) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5474 (>= (point) except-mark))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5475 ;; Continue looking |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5476 (setq got nil) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5477 ;; Got it! |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5478 (setq done t))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5479 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5480 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5481 (if got |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5482 (goto-char got)) |
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 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5485 ;;;_ > 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
|
5486 (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
|
5487 "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
|
5488 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5489 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
|
5490 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
|
5491 `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
|
5492 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5493 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
|
5494 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
|
5495 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
|
5496 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
|
5497 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
|
5498 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5499 (interactive "p") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5500 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5501 (let ((current-mark (point-marker)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5502 was-modified |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5503 bo-subtree |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5504 editing-topic editing-point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5505 (goto-char (point-min)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5506 (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
|
5507 (setq was-modified (buffer-modified-p)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5508 (if (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5509 (and (boundp '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
|
5510 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
|
5511 (setq bo-subtree (re-search-forward "[\n\r]")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5512 ;; Not collapsed: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5513 (string= (match-string 0) "\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5514 (>= current-mark (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5515 (allout-end-of-current-subtree) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5516 (<= current-mark (point)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5517 (setq editing-topic (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5518 ;; 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
|
5519 ;; encrypted, any relevant text shifts are in place: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5520 editing-point (marker-position current-mark))) |
67262
c3cfae9a5571
(eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents:
66319
diff
changeset
|
5521 (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
|
5522 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5523 (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
|
5524 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5525 (if (not was-modified) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5526 (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
|
5527 (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
|
5528 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5529 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5530 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5531 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5532 ;;;_ #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
|
5533 ;;;_ > 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
|
5534 (defun allout-mark-topic () |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5535 "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
|
5536 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5537 (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
|
5538 (allout-goto-prefix) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5539 (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
|
5540 (allout-end-of-current-subtree) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5541 (exchange-point-and-mark)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5542 ;;;_ > outlineify-sticky () |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5543 ;; 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
|
5544 ;;;###autoload |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5545 (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
|
5546 ;;;###autoload |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5547 (defun outlineify-sticky (&optional arg) |
13964
4de229297f1f
(outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
5548 "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
|
5549 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5550 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
|
5551 setup for auto-startup." |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5552 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5553 (interactive "P") |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5554 |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5555 (allout-mode t) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5556 |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5557 (save-excursion |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5558 (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
|
5559 (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
|
5560 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
|
5561 (allout-open-topic 2) |
41571
2902b21d2034
(outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents:
38431
diff
changeset
|
5562 (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
|
5563 "`allout-mode' docstring: `^Hm'.")) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5564 (allout-adjust-file-variable |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5565 "allout-layout" (format "%s" (or allout-layout '(-1 : 0))))))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5566 ;;;_ > 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
|
5567 (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
|
5568 "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
|
5569 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5570 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
|
5571 ;; 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
|
5572 (let (beg prefix suffix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5573 (save-excursion |
3430 | 5574 (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
|
5575 (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
|
5576 (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
|
5577 (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
|
5578 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5579 (setq beg (- (point) 16)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5580 (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
|
5581 (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5582 (progn (if (re-search-forward "[\n\r]" nil t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5583 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5584 (point)))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5585 (setq prefix (buffer-substring-no-properties |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5586 (progn (if (re-search-backward "[\n\r]" nil t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5587 (forward-char 1)) |
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 (list beg prefix suffix)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5591 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5592 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5593 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5594 ;;;_ > 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
|
5595 (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
|
5596 "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
|
5597 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5598 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
|
5599 `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
|
5600 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5601 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
|
5602 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
|
5603 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
|
5604 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
|
5605 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
|
5606 |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5607 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
|
5608 (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
|
5609 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
|
5610 nil |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5611 (save-excursion |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5612 (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
|
5613 beg prefix suffix) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5614 (if section-data |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5615 (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
|
5616 prefix (cadr section-data) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5617 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
|
5618 ;; create the section |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5619 (goto-char (point-max)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5620 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5621 (allout-open-topic 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5622 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5623 (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
|
5624 (allout-open-topic 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5625 (setq beg (point) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5626 suffix "" |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5627 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
|
5628 (beginning-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5629 (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5630 beg)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5631 (goto-char beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5632 (insert "Local variables:\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5633 (allout-open-topic 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5634 (insert "End:\n") |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5635 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5636 ;; 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
|
5637 ;; of new value: |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5638 (goto-char beg) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5639 (allout-show-to-offshoot) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5640 (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
|
5641 (let* ((value-beg (point)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5642 (line-end (progn (if (re-search-forward "[\n\r]" nil t) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5643 (forward-char -1)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5644 (point))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5645 (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
|
5646 (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
|
5647 (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
|
5648 (end-of-line) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5649 (open-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5650 (forward-line 1) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5651 (insert (concat prefix varname ":"))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5652 (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
|
5653 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5654 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5655 ) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5656 ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5657 ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting) |
3430 | 5658 (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
|
5659 "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
|
5660 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5661 Optional arg DO-DEFAULTING indicates to accept empty input (CR)." |
3430 | 5662 |
5663 (let ((new-prompt prompt) | |
5664 got) | |
5665 | |
5666 (while (not got) | |
5667 (message "%s" new-prompt) | |
5668 | |
5669 ;; We do our own reading here, so we can circumvent, eg, special | |
29490 | 5670 ;; treatment for `?' character. (Oughta use minibuffer keymap instead.) |
3430 | 5671 (setq got |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5672 (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
|
5673 |
29490 | 5674 (setq got |
5675 (cond ((string-match (regexp-quote got) string) got) | |
5676 ((and do-defaulting (string= got "\r")) | |
5677 ;; Return empty string to default: | |
5678 "") | |
5679 ((string= got "\C-g") (signal 'quit nil)) | |
5680 (t | |
5681 (setq new-prompt (concat prompt | |
5682 got | |
5683 " ...pick from: " | |
5684 string | |
5685 "")) | |
5686 nil)))) | |
5687 ;; got something out of loop - return it: | |
5688 got) | |
3430 | 5689 ) |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5690 ;;;_ > regexp-sans-escapes (string) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5691 (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
|
5692 "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
|
5693 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5694 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
|
5695 single backslash. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5696 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5697 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
|
5698 |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5699 (if (string= regexp "") |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5700 "" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5701 ;; 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
|
5702 ;; backslash, or else to nil: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5703 (setq successive-backslashes |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5704 (if (= (aref regexp 0) ?\\) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5705 (if successive-backslashes (1+ successive-backslashes) 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5706 nil)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5707 (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
|
5708 ;; Include first char: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5709 (concat (substring regexp 0 1) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5710 (regexp-sans-escapes (substring regexp 1))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5711 ;; Exclude first char, but maintain count: |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5712 (regexp-sans-escapes (substring regexp 1) successive-backslashes)))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5713 ;;;_ - add-hook definition for divergent emacsen |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5714 ;;;_ > add-hook (hook function &optional append) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5715 (if (not (fboundp 'add-hook)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5716 (defun add-hook (hook function &optional append) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5717 "Add to the value of HOOK the function FUNCTION unless already present. |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5718 \(It becomes the first hook on the list unless optional APPEND is non-nil, in |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5719 which case it becomes the last). HOOK should be a symbol, and FUNCTION may be |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5720 any valid function. HOOK's value should be a list of functions, not a single |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5721 function. If HOOK is void, it is first set to nil." |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5722 (or (boundp hook) (set hook nil)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5723 (or (if (consp function) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5724 ;; Clever way to tell whether a given lambda-expression |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5725 ;; is equal to anything in the hook. |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5726 (let ((tail (assoc (cdr function) (symbol-value hook)))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5727 (equal function tail)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5728 (memq function (symbol-value hook))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5729 (set hook |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5730 (if append |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5731 (nconc (symbol-value hook) (list function)) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5732 (cons function (symbol-value hook))))))) |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5733 ;;;_ > 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
|
5734 (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
|
5735 (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
|
5736 "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
|
5737 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
|
5738 (let ((i (length string)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5739 (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
|
5740 (while (> i 0) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5741 (setq i (1- i)) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5742 (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
|
5743 (aset newstr i tochar))) |
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5744 newstr))) |
47127
895cc47caf77
(my-mark-marker): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
46161
diff
changeset
|
5745 ;;;_ : my-mark-marker to accommodate divergent emacsen: |
29490 | 5746 (defun my-mark-marker (&optional force buffer) |
64283
d57ad48e7901
(my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents:
64091
diff
changeset
|
5747 "Accommodate the different signature for `mark-marker' across Emacsen. |
55717
50b099e608af
(allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents:
54952
diff
changeset
|
5748 |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5749 XEmacs takes two optional args, while mainline GNU Emacs does not, |
29490 | 5750 so pass them along when appropriate." |
66319
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5751 (if (featurep 'xemacs) |
4b40c48a16ad
Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents:
66230
diff
changeset
|
5752 (apply 'mark-marker force buffer) |
29490 | 5753 (mark-marker))) |
5754 | |
66230
4344fd52a670
Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
5755 ;;;_ #10 Under development |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5756 ;;;_ > 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
|
5757 (defun allout-bullet-isearch (&optional bullet) |
29490 | 5758 "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
|
5759 (interactive) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5760 (if (not bullet) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5761 (setq bullet (solicit-char-in-string |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5762 "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
|
5763 (regexp-sans-escapes allout-bullets-string)))) |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5764 |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5765 (let ((isearch-regexp t) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5766 (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
|
5767 allout-header-prefix |
7218
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5768 "[ \t]*" |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5769 bullet))) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5770 (isearch-repeat 'forward) |
49f9f9a08b4c
major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents:
6736
diff
changeset
|
5771 (isearch-mode t))) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5772 ;;;_ ? Re hooking up with isearch - use isearch-op-fun rather than |
15664
a50ebf4ac764
(outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents:
15663
diff
changeset
|
5773 ;;; wrapping the isearch functions. |
3430 | 5774 |
5775 ;;;_* Local emacs vars. | |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5776 ;;; The following `allout-layout' local variable setting: |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5777 ;;; - closes all topics from the first topic to just before the third-to-last, |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5778 ;;; - shows the children of the third to last (config vars) |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5779 ;;; - and the second to last (code section), |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5780 ;;; - and closes the last topic (this local-variables section). |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5781 ;;;Local variables: |
48856
e7aab76fa215
Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47127
diff
changeset
|
5782 ;;;allout-layout: (0 : -1 -1 0) |
7416
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5783 ;;;End: |
4996c50431de
(outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents:
7218
diff
changeset
|
5784 |
52401 | 5785 ;;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c |
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38250
diff
changeset
|
5786 ;;; allout.el ends here |