annotate lisp/allout.el @ 69481:be6a0491d438

* allout.el: Increment version to 2.2.1 in file commentary. (allout-version): Increment to 2.2.1. (allout-default-layout): New customization variable, used when the file lacks a specific allout-layout. Uses allout-layout-type for recursively nested definition. (allout-layout-type): Widget defining allout layouts, necessary for self-recursive definition. (allout-mode): Incorporate allout-default-layout as fallback for allout-layout. (allout-layout): Mark as 'safe-local-variable', and refer mention fallback to `allout-default-layout' in absence of a specified value. (allout-passphrase-verifier-string) (allout-passphrase-hint-string): Mark as 'safe-local-variable'. (allout-file-passphrase-verifier-string): Obsolete variable, removed. (allout-get-encryption-passphrase-verifier): Use correct name of passphrase verifier in docstring. From Ken Manheimer.
author Luc Teirlinck <teirllm@auburn.edu>
date Wed, 15 Mar 2006 03:14:15 +0000
parents 85c3b33d6427
children e753e12d2f33 203c9b24206b e3bacb89536a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
1 ;;; allout.el --- extensive outline mode for use alone and with other modes
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2
64762
41bb365f41c4 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64474
diff changeset
3 ;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004,
69124
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
4 ;; 2005, 2006 Free Software Foundation, Inc.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
6 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
7 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
8 ;; Created: Dec 1991 - first release to usenet
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
9 ;; Version: 2.2.1
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
10 ;; Keywords: outlines wp languages
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
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
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
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
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13964
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64091
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61969
diff changeset
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61969
diff changeset
27 ;; Boston, MA 02110-1301, USA.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
29 ;;; Commentary:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
30
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
31 ;; Allout outline minor mode provides extensive outline formatting and
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
32 ;; and manipulation beyond standard emacs outline mode. Some features:
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
33 ;;
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
34 ;; - Classic outline-mode topic-oriented navigation and exposure adjustment
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
35 ;; - Topic-oriented editing including coherent topic and subtopic
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
36 ;; creation, promotion, demotion, cut/paste across depths, etc.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
37 ;; - Incremental search with dynamic exposure and reconcealment of text
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
38 ;; - Customizable bullet format - enables programming-language specific
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
39 ;; outlining, for code-folding editing. (Allout code itself is to try it;
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
40 ;; formatted as an outline - do ESC-x eval-current-buffer in allout.el; but
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
41 ;; emacs local file variables need to be enabled when the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
42 ;; file was visited - see `enable-local-variables'.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
43 ;; - Configurable per-file initial exposure settings
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
44 ;; - Symmetric-key and key-pair topic encryption, plus symmetric passphrase
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
45 ;; mnemonic support, with verification against an established passphrase
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
46 ;; (using a stashed encrypted dummy string) and user-supplied hint
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
47 ;; maintenance. (See allout-toggle-current-subtree-encryption docstring.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
48 ;; - Automatic topic-number maintenance
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
49 ;; - "Hot-spot" operation, for single-keystroke maneuvering and
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
50 ;; exposure control (see the allout-mode docstring)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
51 ;; - Easy rendering of exposed portions into numbered, latex, indented, etc
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
52 ;; outline styles
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
53 ;; - Careful attention to whitespace - enabling blank lines between items
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
54 ;; and maintenance of hanging indentation (in paragraph auto-fill and
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
55 ;; across topic promotion and demotion) of topic bodies consistent with
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
56 ;; indentation of their topic header.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
57 ;;
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
58 ;; and more.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
59 ;;
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
60 ;; See the `allout-mode' function's docstring for an introduction to the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
61 ;; mode. The development version and helpful notes are available at
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
62 ;; http://myriadicity.net/Sundry/EmacsAllout .
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
63 ;;
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
64 ;; The outline menubar additions provide quick reference to many of
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
65 ;; the features, and see the docstring of the variable `allout-init'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
66 ;; for instructions on priming your emacs session for automatic
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
67 ;; activation of allout-mode.
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
68 ;;
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
69 ;; See the docstring of the variables `allout-layout' and
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
70 ;; `allout-auto-activation' for details on automatic activation of
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
71 ;; `allout-mode' as a minor mode. (It has changed since allout
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
72 ;; 3.x, for those of you that depend on the old method.)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
73 ;;
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
74 ;; Note - the lines beginning with `;;;_' are outline topic headers.
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
75 ;; Just `ESC-x eval-current-buffer' to give it a whirl.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
76
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
77 ;; ken manheimer (ken dot manheimer at gmail dot com)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
78
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
79 ;;; Code:
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
80
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
81 ;;;_* Dependency autoloads
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
82 (require 'overlay)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
83 (eval-when-compile (progn (require 'pgg)
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
84 (require 'pgg-gpg)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
85 (require 'overlay)
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
86 ))
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
87 (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg"
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
88 "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
89
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
90 ;;;_* USER CUSTOMIZATION VARIABLES:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
91
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
92 ;;;_ > defgroup allout
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
93 (defgroup allout nil
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
94 "Extensive outline mode for use alone and with other modes."
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
95 :prefix "allout-"
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
96 :group 'outlines)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
97
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
98 ;;;_ + Layout, Mode, and Topic Header Configuration
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
99
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
100 ;;;_ = allout-auto-activation
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
101 (defcustom allout-auto-activation nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
102 "*Regulates auto-activation modality of allout outlines - see `allout-init'.
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
103
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
104 Setq-default by `allout-init' to regulate whether or not allout
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
105 outline mode is automatically activated when the buffer-specific
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
106 variable `allout-layout' is non-nil, and whether or not the layout
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
107 dictated by `allout-layout' should be imposed on mode activation.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
108
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
109 With value t, auto-mode-activation and auto-layout are enabled.
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
110 \(This also depends on `allout-find-file-hook' being installed in
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
111 `find-file-hook', which is also done by `allout-init'.)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
112
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
113 With value `ask', auto-mode-activation is enabled, and endorsement for
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
114 performing auto-layout is asked of the user each time.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
115
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
116 With value `activate', only auto-mode-activation is enabled,
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
117 auto-layout is not.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
118
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
119 With value nil, neither auto-mode-activation nor auto-layout are
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
120 enabled.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
121
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
122 See the docstring for `allout-init' for the proper interface to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
123 this variable."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
124 :type '(choice (const :tag "On" t)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
125 (const :tag "Ask about layout" "ask")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
126 (const :tag "Mode only" "activate")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
127 (const :tag "Off" nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
128 :group 'allout)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
129 ;;;_ = allout-default-layout
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
130 (defcustom allout-default-layout '(-2 : 0)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
131 "*Default allout outline layout specification.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
132
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
133 This setting specifies the outline exposure to use when
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
134 `allout-layout' has the local value `t'. This docstring describes the
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
135 layout specifications.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
136
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
137 A list value specifies a default layout for the current buffer,
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
138 to be applied upon activation of `allout-mode'. Any non-nil
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
139 value will automatically trigger `allout-mode', provided
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
140 `allout-init' has been called to enable this behavior.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
141
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
142 The types of elements in the layout specification are:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
143
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
144 integer - dictate the relative depth to open the corresponding topic(s),
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
145 where:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
146 - negative numbers force the topic to be closed before opening
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
147 to the absolute value of the number, so all siblings are open
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
148 only to that level.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
149 - positive numbers open to the relative depth indicated by the
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
150 number, but do not force already opened subtopics to be closed.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
151 - 0 means to close topic - hide all subitems.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
152 : - repeat spec - apply the preceeding element to all siblings at
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
153 current level, *up to* those siblings that would be covered by specs
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
154 following the `:' on the list. Ie, apply to all topics at level but
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
155 trailing ones accounted for by trailing specs. \(Only the first of
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
156 multiple colons at the same level is honored - later ones are ignored.)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
157 * - completely exposes the topic, including bodies
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
158 + - exposes all subtopics, but not the bodies
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
159 - - exposes the body of the corresponding topic, but not subtopics
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
160 list - a nested layout spec, to be applied intricately to its
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
161 corresponding item(s)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
162
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
163 Examples:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
164 '(-2 : 0)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
165 Collapse the top-level topics to show their children and
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
166 grandchildren, but completely collapse the final top-level topic.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
167 '(-1 () : 1 0)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
168 Close the first topic so only the immediate subtopics are shown,
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
169 leave the subsequent topics exposed as they are until the second
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
170 second to last topic, which is exposed at least one level, and
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
171 completely close the last topic.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
172 '(-2 : -1 *)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
173 Expose children and grandchildren of all topics at current
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
174 level except the last two; expose children of the second to
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
175 last and completely expose the last one, including its subtopics.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
176
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
177 See `allout-expose-topic' for more about the exposure process.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
178
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
179 Also, allout's mode-specific provisions will make topic prefixes default
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
180 to the comment-start string, if any, of the language of the file. This
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
181 is modulo the setting of `allout-use-mode-specific-leader', which see."
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
182 :type 'allout-layout-type
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
183 :group 'allout)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
184 ;;;_ : allout-layout-type
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
185 (define-widget 'allout-layout-type 'lazy
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
186 "Allout layout format customization basic building blocks."
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
187 :type '(repeat
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
188 (choice (integer :tag "integer (<= zero is strict)")
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
189 (const :tag ": (repeat prior)" :)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
190 (const :tag "* (completely expose)" *)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
191 (const :tag "+ (expose all offspring, headlines only)" +)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
192 (const :tag "- (expose topic body but not offspring)" -)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
193 (allout-layout-type :tag "<Nested layout>"))))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
194
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
195 ;;;_ = allout-show-bodies
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
196 (defcustom allout-show-bodies nil
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
197 "*If non-nil, show entire body when exposing a topic, rather than
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
198 just the header."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
199 :type 'boolean
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
200 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
201 (make-variable-buffer-local 'allout-show-bodies)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
202
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
203 ;;;_ = allout-header-prefix
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
204 (defcustom allout-header-prefix "."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
205 "*Leading string which helps distinguish topic headers.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
206
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
207 Outline topic header lines are identified by a leading topic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
208 header prefix, which mostly have the value of this var at their front.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
209 \(Level 1 topics are exceptions. They consist of only a single
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
210 character, which is typically set to the `allout-primary-bullet'. Many
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
211 outlines start at level 2 to avoid this discrepancy."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
212 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
213 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
214 (make-variable-buffer-local 'allout-header-prefix)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
215 ;;;_ = allout-primary-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
216 (defcustom allout-primary-bullet "*"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
217 "Bullet used for top-level outline topics.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
218
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
219 Outline topic header lines are identified by a leading topic header
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
220 prefix, which is concluded by bullets that includes the value of this
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
221 var and the respective allout-*-bullets-string vars.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
222
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
223 The value of an asterisk (`*') provides for backwards compatibility
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
224 with the original Emacs outline mode. See `allout-plain-bullets-string'
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
225 and `allout-distinctive-bullets-string' for the range of available
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
226 bullets."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
227 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
228 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
229 (make-variable-buffer-local 'allout-primary-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
230 ;;;_ = allout-plain-bullets-string
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
231 (defcustom allout-plain-bullets-string ".,"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
232 "*The bullets normally used in outline topic prefixes.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
233
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
234 See `allout-distinctive-bullets-string' for the other kind of
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
235 bullets.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
236
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
237 DO NOT include the close-square-bracket, `]', as a bullet.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
238
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
239 Outline mode has to be reactivated in order for changes to the value
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
240 of this var to take effect."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
241 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
242 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
243 (make-variable-buffer-local 'allout-plain-bullets-string)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
244 ;;;_ = allout-distinctive-bullets-string
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
245 (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
246 "*Persistent outline header bullets used to distinguish special topics.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
247
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
248 These bullets are used to distinguish topics from the run-of-the-mill
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
249 ones. They are not used in the standard topic headers created by
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
250 the topic-opening, shifting, and rebulleting \(eg, on topic shift,
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
251 topic paste, blanket rebulleting) routines, but are offered among the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
252 choices for rebulleting. They are not altered by the above automatic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
253 rebulleting, so they can be used to characterize topics, eg:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
254
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
255 `?' question topics
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
256 `\(' parenthetic comment \(with a matching close paren inside)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
257 `[' meta-note \(with a matching close ] inside)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
258 `\"' a quotation
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
259 `=' value settings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
260 `~' \"more or less\"
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
261 `^' see above
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
262
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
263 ... for example. (`#' typically has a special meaning to the software,
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
264 according to the value of `allout-numbered-bullet'.)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
265
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
266 See `allout-plain-bullets-string' for the selection of
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
267 alternating bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
268
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
269 You must run `set-allout-regexp' in order for outline mode to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
270 reconcile to changes of this value.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
271
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
272 DO NOT include the close-square-bracket, `]', on either of the bullet
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
273 strings."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
274 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
275 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
276 (make-variable-buffer-local 'allout-distinctive-bullets-string)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
277
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
278 ;;;_ = allout-use-mode-specific-leader
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
279 (defcustom allout-use-mode-specific-leader t
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
280 "*When non-nil, use mode-specific topic-header prefixes.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
281
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
282 Allout outline mode will use the mode-specific `allout-mode-leaders'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
283 and/or comment-start string, if any, to lead the topic prefix string,
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
284 so topic headers look like comments in the programming language.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
285
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
286 String values are used as they stand.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
287
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
288 Value t means to first check for assoc value in `allout-mode-leaders'
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
289 alist, then use comment-start string, if any, then use default \(`.').
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
290 \(See note about use of comment-start strings, below.)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
291
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
292 Set to the symbol for either of `allout-mode-leaders' or
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
293 `comment-start' to use only one of them, respectively.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
294
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
295 Value nil means to always use the default \(`.').
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
296
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
297 comment-start strings that do not end in spaces are tripled, and an
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
298 `_' underscore is tacked on the end, to distinguish them from regular
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
299 comment strings. comment-start strings that do end in spaces are not
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
300 tripled, but an underscore is substituted for the space. [This
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
301 presumes that the space is for appearance, not comment syntax. You
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
302 can use `allout-mode-leaders' to override this behavior, when
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
303 incorrect.]"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
304 :type '(choice (const t) (const nil) string
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
305 (const allout-mode-leaders)
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
306 (const comment-start))
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
307 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
308 ;;;_ = allout-mode-leaders
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
309 (defvar allout-mode-leaders '()
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
310 "Specific allout-prefix leading strings per major modes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
311
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
312 Entries will be used instead or in lieu of mode-specific
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
313 comment-start strings. See also `allout-use-mode-specific-leader'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
314
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
315 If you're constructing a string that will comment-out outline
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
316 structuring so it can be included in program code, append an extra
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
317 character, like an \"_\" underscore, to distinguish the lead string
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
318 from regular comments that start at bol.")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
319
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
320 ;;;_ = allout-old-style-prefixes
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
321 (defcustom allout-old-style-prefixes nil
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
322 "*When non-nil, use only old-and-crusty `outline-mode' `*' topic prefixes.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
323
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
324 Non-nil restricts the topic creation and modification
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
325 functions to asterix-padded prefixes, so they look exactly
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
326 like the original Emacs-outline style prefixes.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
327
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
328 Whatever the setting of this variable, both old and new style prefixes
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
329 are always respected by the topic maneuvering functions."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
330 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
331 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
332 (make-variable-buffer-local 'allout-old-style-prefixes)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
333 ;;;_ = allout-stylish-prefixes - alternating bullets
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
334 (defcustom allout-stylish-prefixes t
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
335 "*Do fancy stuff with topic prefix bullets according to level, etc.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
336
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
337 Non-nil enables topic creation, modification, and repositioning
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
338 functions to vary the topic bullet char (the char that marks the topic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
339 depth) just preceding the start of the topic text) according to level.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
340 Otherwise, only asterisks (`*') and distinctive bullets are used.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
341
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
342 This is how an outline can look (but sans indentation) with stylish
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
343 prefixes:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
344
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
345 * Top level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
346 .* A topic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
347 . + One level 3 subtopic
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
348 . . One level 4 subtopic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
349 . . A second 4 subtopic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
350 . + Another level 3 subtopic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
351 . #1 A numbered level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
352 . #2 Another
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
353 . ! Another level 4 subtopic with a different distinctive bullet
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
354 . #4 And another numbered level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
355
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
356 This would be an outline with stylish prefixes inhibited (but the
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
357 numbered and other distinctive bullets retained):
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
358
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
359 * Top level
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
360 .* A topic
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
361 . * One level 3 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
362 . * One level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
363 . * A second 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
364 . * Another level 3 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
365 . #1 A numbered level 4 subtopic
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
366 . #2 Another
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
367 . ! Another level 4 subtopic with a different distinctive bullet
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
368 . #4 And another numbered level 4 subtopic
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
369
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
370 Stylish and constant prefixes (as well as old-style prefixes) are
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
371 always respected by the topic maneuvering functions, regardless of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
372 this variable setting.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
373
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
374 The setting of this var is not relevant when `allout-old-style-prefixes'
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
375 is non-nil."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
376 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
377 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
378 (make-variable-buffer-local 'allout-stylish-prefixes)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
379
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
380 ;;;_ = allout-numbered-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
381 (defcustom allout-numbered-bullet "#"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
382 "*String designating bullet of topics that have auto-numbering; nil for none.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
383
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
384 Topics having this bullet have automatic maintenance of a sibling
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
385 sequence-number tacked on, just after the bullet. Conventionally set
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
386 to \"#\", you can set it to a bullet of your choice. A nil value
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
387 disables numbering maintenance."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
388 :type '(choice (const nil) string)
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
389 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
390 (make-variable-buffer-local 'allout-numbered-bullet)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
391 ;;;_ = allout-file-xref-bullet
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
392 (defcustom allout-file-xref-bullet "@"
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
393 "*Bullet signifying file cross-references, for `allout-resolve-xref'.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
394
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
395 Set this var to the bullet you want to use for file cross-references."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
396 :type '(choice (const nil) string)
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
397 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
398 ;;;_ = allout-presentation-padding
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
399 (defcustom allout-presentation-padding 2
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
400 "*Presentation-format white-space padding factor, for greater indent."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
401 :type 'integer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
402 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
403
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
404 (make-variable-buffer-local 'allout-presentation-padding)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
405
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
406 ;;;_ = allout-abbreviate-flattened-numbering
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
407 (defcustom allout-abbreviate-flattened-numbering nil
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
408 "*If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
409 numbers to minimal amount with some context. Otherwise, entire
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
410 numbers are always used."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
411 :type 'boolean
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
412 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
413
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
414 ;;;_ + LaTeX formatting
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
415 ;;;_ - allout-number-pages
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
416 (defcustom allout-number-pages nil
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
417 "*Non-nil turns on page numbering for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
418 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
419 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
420 ;;;_ - allout-label-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
421 (defcustom allout-label-style "\\large\\bf"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
422 "*Font and size of labels for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
423 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
424 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
425 ;;;_ - allout-head-line-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
426 (defcustom allout-head-line-style "\\large\\sl "
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
427 "*Font and size of entries for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
428 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
429 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
430 ;;;_ - allout-body-line-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
431 (defcustom allout-body-line-style " "
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
432 "*Font and size of entries for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
433 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
434 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
435 ;;;_ - allout-title-style
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
436 (defcustom allout-title-style "\\Large\\bf"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
437 "*Font and size of titles for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
438 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
439 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
440 ;;;_ - allout-title
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
441 (defcustom allout-title '(or buffer-file-name (buffer-name))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
442 "*Expression to be evaluated to determine the title for LaTeX
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
443 formatted copy."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
444 :type 'sexp
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
445 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
446 ;;;_ - allout-line-skip
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
447 (defcustom allout-line-skip ".05cm"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
448 "*Space between lines for LaTeX formatting of an outline."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
449 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
450 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
451 ;;;_ - allout-indent
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
452 (defcustom allout-indent ".3cm"
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
453 "*LaTeX formatted depth-indent spacing."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
454 :type 'string
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
455 :group 'allout)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
456
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
457 ;;;_ + Topic encryption
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
458 ;;;_ = allout-topic-encryption-bullet
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
459 (defcustom allout-topic-encryption-bullet "~"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
460 "*Bullet signifying encryption of the entry's body."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
461 :type '(choice (const nil) string)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
462 :group 'allout)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
463 ;;;_ = allout-passphrase-verifier-handling
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
464 (defcustom allout-passphrase-verifier-handling t
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
465 "*Enable use of symmetric encryption passphrase verifier if non-nil.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
466
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
467 See the docstring for the `allout-enable-file-variable-adjustment'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
468 variable for details about allout ajustment of file variables."
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
469 :type 'boolean
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
470 :group 'allout)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
471 (make-variable-buffer-local 'allout-passphrase-verifier-handling)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
472 ;;;_ = allout-passphrase-hint-handling
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
473 (defcustom allout-passphrase-hint-handling 'always
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
474 "*Dictate outline encryption passphrase reminder handling:
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
475
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
476 always - always show reminder when prompting
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
477 needed - show reminder on passphrase entry failure
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
478 disabled - never present or adjust reminder
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
479
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
480 See the docstring for the `allout-enable-file-variable-adjustment'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
481 variable for details about allout ajustment of file variables."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
482 :type '(choice (const always)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
483 (const needed)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
484 (const disabled))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
485 :group 'allout)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
486 (make-variable-buffer-local 'allout-passphrase-hint-handling)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
487 ;;;_ = allout-encrypt-unencrypted-on-saves
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
488 (defcustom allout-encrypt-unencrypted-on-saves t
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
489 "*When saving, should topics pending encryption be encrypted?
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
490
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
491 The idea is to prevent file-system exposure of any un-encrypted stuff, and
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
492 mostly covers both deliberate file writes and auto-saves.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
493
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
494 - Yes: encrypt all topics pending encryption, even if it's the one
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
495 currently being edited. \(In that case, the currently edited topic
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
496 will be automatically decrypted before any user interaction, so they
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
497 can continue editing but the copy on the file system will be
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
498 encrypted.)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
499 Auto-saves will use the \"All except current topic\" mode if this
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
500 one is selected, to avoid practical difficulties - see below.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
501 - All except current topic: skip the topic currently being edited, even if
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
502 it's pending encryption. This may expose the current topic on the
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
503 file sytem, but avoids the nuisance of prompts for the encryption
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
504 passphrase in the middle of editing for, eg, autosaves.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
505 This mode is used for auto-saves for both this option and \"Yes\".
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
506 - No: leave it to the user to encrypt any unencrypted topics.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
507
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
508 For practical reasons, auto-saves always use the 'except-current policy
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
509 when auto-encryption is enabled. \(Otherwise, spurious passphrase prompts
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
510 and unavoidable timing collisions are too disruptive.) If security for a
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
511 file requires that even the current topic is never auto-saved in the clear,
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
512 disable auto-saves for that file."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
513
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
514 :type '(choice (const :tag "Yes" t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
515 (const :tag "All except current topic" except-current)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
516 (const :tag "No" nil))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
517 :group 'allout)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
518 (make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
519
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
520 ;;;_ + Miscellaneous customization
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
521
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
522 ;;;_ = allout-command-prefix
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
523 (defcustom allout-command-prefix "\C-c "
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
524 "*Key sequence to be used as prefix for outline mode command key bindings.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
525
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
526 Default is '\C-c<space>'; just '\C-c' is more short-and-sweet, if you're
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
527 willing to let allout use a bunch of \C-c keybindings."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
528 :type 'string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
529 :group 'allout)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
530
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
531 ;;;_ = allout-keybindings-list
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
532 ;;; You have to reactivate allout-mode - `(allout-mode t)' - to
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
533 ;;; institute changes to this var.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
534 (defvar allout-keybindings-list ()
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
535 "*List of `allout-mode' key / function bindings, for `allout-mode-map'.
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
536
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
537 String or vector key will be prefaced with `allout-command-prefix',
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
538 unless optional third, non-nil element is present.")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
539 (setq allout-keybindings-list
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
540 '(
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
541 ; Motion commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
542 ("\C-n" allout-next-visible-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
543 ("\C-p" allout-previous-visible-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
544 ("\C-u" allout-up-current-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
545 ("\C-f" allout-forward-current-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
546 ("\C-b" allout-backward-current-level)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
547 ("\C-a" allout-beginning-of-current-entry)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
548 ("\C-e" allout-end-of-entry)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
549 ; Exposure commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
550 ("\C-i" allout-show-children)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
551 ("\C-s" allout-show-current-subtree)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
552 ("\C-h" allout-hide-current-subtree)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
553 ("h" allout-hide-current-subtree)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
554 ("\C-o" allout-show-current-entry)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
555 ("!" allout-show-all)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
556 ("x" allout-toggle-current-subtree-encryption)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
557 ; Alteration commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
558 (" " allout-open-sibtopic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
559 ("." allout-open-subtopic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
560 ("," allout-open-supertopic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
561 ("'" allout-shift-in)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
562 (">" allout-shift-in)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
563 ("<" allout-shift-out)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
564 ("\C-m" allout-rebullet-topic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
565 ("*" allout-rebullet-current-heading)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
566 ("#" allout-number-siblings)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
567 ("\C-k" allout-kill-line t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
568 ("\C-y" allout-yank t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
569 ("\M-y" allout-yank-pop t)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
570 ("\C-k" allout-kill-topic)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
571 ; Miscellaneous commands:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
572 ;([?\C-\ ] allout-mark-topic)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
573 ("@" allout-resolve-xref)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
574 ("=c" allout-copy-exposed-to-buffer)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
575 ("=i" allout-indented-exposed-to-buffer)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
576 ("=t" allout-latexify-exposed)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
577 ("=p" allout-flatten-exposed-to-buffer)))
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
578
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
579 ;;;_ = allout-use-hanging-indents
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
580 (defcustom allout-use-hanging-indents t
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
581 "*If non-nil, topic body text auto-indent defaults to indent of the header.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
582 Ie, it is indented to be just past the header prefix. This is
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
583 relevant mostly for use with indented-text-mode, or other situations
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
584 where auto-fill occurs."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
585 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
586 :group 'allout)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
587 (make-variable-buffer-local 'allout-use-hanging-indents)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
588
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
589 ;;;_ = allout-reindent-bodies
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
590 (defcustom allout-reindent-bodies (if allout-use-hanging-indents
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
591 'text)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
592 "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
593
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
594 When active, topic body lines that are indented even with or beyond
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
595 their topic header are reindented to correspond with depth shifts of
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
596 the header.
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
597
50855
31ce4fcda3d8 (allout-auto-activation, allout-use-mode-specific-leader)
Juanma Barranquero <lekktu@gmail.com>
parents: 49966
diff changeset
598 A value of t enables reindent in non-programming-code buffers, ie
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
599 those that do not have the variable `comment-start' set. A value of
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
600 `force' enables reindent whether or not `comment-start' is set."
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
601 :type '(choice (const nil) (const t) (const text) (const force))
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
602 :group 'allout)
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
603
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
604 (make-variable-buffer-local 'allout-reindent-bodies)
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
605
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
606 ;;;_ = allout-enable-file-variable-adjustment
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
607 (defcustom allout-enable-file-variable-adjustment t
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
608 "*If non-nil, some allout outline actions edit Emacs local file var text.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
609
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
610 This can range from changes to existing entries, addition of new ones,
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
611 and creation of a new local variables section when necessary.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
612
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
613 Emacs file variables adjustments are also inhibited if `enable-local-variables'
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
614 is nil.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
615
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
616 Operations potentially causing edits include allout encryption routines.
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
617 For details, see `allout-toggle-current-subtree-encryption's docstring."
21088
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
618 :type 'boolean
ac1673121774 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 19923
diff changeset
619 :group 'allout)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
620 (make-variable-buffer-local 'allout-enable-file-variable-adjustment)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
621
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
622 ;;;_* CODE - no user customizations below.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
623
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
624 ;;;_ #1 Internal Outline Formatting and Configuration
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
625 ;;;_ : Version
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
626 ;;;_ = allout-version
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
627 (defvar allout-version "2.2.1"
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
628 "Version of currently loaded outline package. \(allout.el)")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
629 ;;;_ > allout-version
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
630 (defun allout-version (&optional here)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
631 "Return string describing the loaded outline version."
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
632 (interactive "P")
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
633 (let ((msg (concat "Allout Outline Mode v " allout-version)))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
634 (if here (insert msg))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
635 (message "%s" msg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
636 msg))
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
637 ;;;_ : Mode activation (defined here because it's referenced early)
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
638 ;;;_ = allout-mode
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
639 (defvar allout-mode nil "Allout outline mode minor-mode flag.")
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
640 (make-variable-buffer-local 'allout-mode)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
641 ;;;_ = allout-layout nil
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
642 (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL - see docstring.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
643 "Buffer-specific setting for allout layout.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
644
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
645 In buffers where this is non-nil \(and if `allout-init' has been run, to
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
646 enable this behavior), `allout-mode' will be automatically activated. The
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
647 layout dictated by the value will be used to set the initial exposure when
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
648 `allout-mode' is activated.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
649
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
650 \*You should not setq-default this variable non-nil unless you want every
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
651 visited file to be treated as an allout file.*
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
652
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
653 The value would typically be set by a file local variable. For
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
654 example, the following lines at the bottom of an Emacs Lisp file:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
655
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
656 ;;;Local variables:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
657 ;;;allout-layout: \(0 : -1 -1 0)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
658 ;;;End:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
659
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
660 dictate activation of `allout-mode' mode when the file is visited
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
661 \(presuming allout-init was already run), followed by the
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
662 equivalent of `\(allout-expose-topic 0 : -1 -1 0)'. \(This is
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
663 the layout used for the allout.el source file.)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
664
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
665 `allout-default-layout' describes the specification format.
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
666 `allout-layout' can additionally have the value `t', in which
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
667 case the value of `allout-default-layout' is used.")
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
668 (make-variable-buffer-local 'allout-layout)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
669 (put 'allout-layout 'safe-local-variable t)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
670
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
671 ;;;_ : 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
672 ;;;_ = 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
673 (defvar allout-regexp ""
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
674 "*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
675
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
676 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
677 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
678 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
679 (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
680 ;;;_ = 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
681 (defvar allout-bullets-string ""
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
682 "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
683
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
684 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
685 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
686 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
687 (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
688 ;;;_ = 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
689 (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
690 "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
691 (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
692 ;;;_ = 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
693 (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
694 "`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
695
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
696 This is properly set when `allout-regexp' is produced by
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
697 `set-allout-regexp', so that (match-beginning 2) and (match-end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
698 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
699 (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
700 ;;;_ = 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
701 (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
702 "Like `allout-line-boundary-regexp', for headers at beginning of buffer.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
703 \(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
704 (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
705 ;;;_ = 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
706 (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
707 "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
708 (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
709 ;;;_ = 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
710 (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
711 "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
712 (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
713
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
714
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
715 ;;;_ 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
716 (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
717 "*Reset the leading string used to identify topic headers."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718 (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
719 (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
720 (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
721 (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
722 ;;;_ 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
723 (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
724 "*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
725
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
726 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
727 language comments. Returns the leading string."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 (if (not (stringp header-lead))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 (setq header-lead (read-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732 "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
733 (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
734 (allout-reset-header-lead header-lead)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735 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
736 ;;;_ > 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
737 (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
738 "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
739
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
740 Works according to settings of:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
741
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
742 `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
743 `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
744 `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
745 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
746
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
747 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
748 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
749 (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
750 (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
751 (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
752 '(allout-mode-leaders
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
753 comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
754 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
755 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
756 ;; 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
757 t)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
758 (leader
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
759 (cond
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
760 ((not use-leader) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
761 ;; Use the explicitly designated leader:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
762 ((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
763 (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
764 ;; 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
765 (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
766 ;; ... 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
767 (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
768 comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
769 ;; Use comment-start, maybe tripled, and with
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
770 ;; underscore:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
771 (concat
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
772 (if (string= " "
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
773 (substring comment-start
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
774 (1- (length comment-start))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
775 ;; 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
776 (substring comment-start 0 -1)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
777 (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
778 ;; ... and append underscore, whichever:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
779 "_")))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
780 (if (not leader)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
781 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
782 (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
783 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
784 (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
785 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
786 ;;;_ > 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
787 (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
788 "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
789
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
790 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
791 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
792 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
793 (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
794 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
795 (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
796 (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
797 ;;;_ > 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
798 (defun set-allout-regexp ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
799 "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
800
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
801 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
802 `allout-distinctive-bullets-string'."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
803
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
804 (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
805 ;; 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
806 (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
807 (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
808 '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
809 'allout-primary-bullet))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
810 cur-string
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
811 cur-len
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
812 cur-char
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
813 index)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
814 (while strings
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
815 (setq index 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
816 (setq cur-len (length (setq cur-string (symbol-value (car strings)))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817 (while (< index cur-len)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 (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
819 (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
820 (concat allout-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 ; Single dash would denote a
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823 ; sequence, repeated denotes
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
824 ; a dash:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
825 ((eq cur-char ?-) "--")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826 ; literal close-square-bracket
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
827 ; doesn't work right in the
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
828 ; expr, exclude it:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
829 ((eq cur-char ?\]) "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
830 (t (regexp-quote (char-to-string cur-char))))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831 (setq index (1+ index)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 (setq strings (cdr strings)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
834 ;; 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
835 (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
836 (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
837 ;; 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
838 (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
839 allout-header-prefix
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 "[ \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
841 allout-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 "]\\)\\|\\"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
843 allout-primary-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 "+\\|\^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
845 (setq allout-line-boundary-regexp
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
846 (concat "\\(\n\\)\\(" allout-regexp "\\)"))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
847 (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
848 (concat "\\(\\`\\)\\(" allout-regexp "\\)"))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 )
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
850 ;;;_ : 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
851 ;;;_ = 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
852 (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
853 ;;;_ > 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
854 (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
855 "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
856
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
857 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
858 See doc string for allout-keybindings-list for format of binding list."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
859 (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
860 (pref (list allout-command-prefix)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
861 (mapcar (function
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
862 (lambda (cell)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
863 (let ((add-pref (null (cdr (cdr cell))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
864 (key-suff (list (car cell))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
865 (apply 'define-key
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
866 (list map
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
867 (apply 'concat (if add-pref
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
868 (append pref key-suff)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
869 key-suff))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
870 (car (cdr cell)))))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
871 keymap-list)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
872 map))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
873 ;;;_ = 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
874 (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
875 "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
876 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
877 activation. Being deprecated.")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
878 ;;;_ = 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
879 (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
880 "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
881 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
882 activation. Being deprecated.")
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
883 ;;;_ : Menu bar
54952
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
884 (defvar allout-mode-exposure-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
885 (defvar allout-mode-editing-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
886 (defvar allout-mode-navigation-menu)
5e2b4f7225cb (allout-mode-exposure-menu, allout-mode-editing-menu):
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
887 (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
888 (defun produce-allout-mode-menubar-entries ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
889 (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
890 (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
891 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
892 "Allout outline exposure menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
893 '("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
894 ["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
895 ["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
896 ["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
897 ["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
898 ["Hide Leaves" allout-hide-current-leaves t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
899 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
900 ["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
901 (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
902 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
903 "Allout outline editing menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
904 '("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
905 ["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
906 ["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
907 ["Open Supertopic" allout-open-supertopic t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
908 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
909 ["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
910 ["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
911 ["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
912 ["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
913 ["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
914 "----"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
915 ["Toggle Topic Encryption"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
916 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
917 (> (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
918 (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
919 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
920 "Allout outline navigation menu."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
921 '("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
922 ["Next Visible Heading" allout-next-visible-heading t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
923 ["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
924 allout-previous-visible-heading t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
925 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
926 ["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
927 ["Forward Current Level" allout-forward-current-level t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
928 ["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
929 allout-backward-current-level t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
930 "----"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
931 ["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
932 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
933 ["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
934 ["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
935 (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
936 allout-mode-map
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
937 "Allout outlines miscellaneous bindings."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
938 '("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
939 ["Version" allout-version t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
940 "----"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
941 ["Duplicate Exposed" allout-copy-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
942 ["Duplicate Exposed, numbered"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
943 allout-flatten-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
944 ["Duplicate Exposed, indented"
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
945 allout-indented-exposed-to-buffer t]
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
946 "----"
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 ["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
948 ["Set New Exposure" allout-expose-topic t])))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
949 ;;;_ : 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
950 ;;;_ = 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
951 (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
952 "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
953 (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
954 ;;;_ > 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
955 (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
956
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
957 "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
958
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
959 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
960 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
961 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
962 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
963 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
964 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
965 from the list."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966
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 (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
968 prior-capsule ; By `capsule' i mean a list
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
969 ; containing a value, so we can
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 ; distinguish nil from no value.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 (if value
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
974
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
975 ;; Registering:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 (progn
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
977 (if on-list
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978 nil ; Already preserved prior value - don't mess with it.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979 ;; 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
980 (setq allout-mode-prior-settings
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
981 (cons (list name
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 (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
983 allout-mode-prior-settings)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
984 ; And impose the new value, locally:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
985 (progn (make-local-variable name)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
986 (set name (car value))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
987
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
988 ;; Relinquishing:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
989 (if (not on-list)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991 ;; Oops, not registered - leave it be:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 ;; Some registration:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
995 ; reestablish it:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
996 (setq prior-capsule (car (cdr on-list)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
997 (if prior-capsule
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
998 (set name (car prior-capsule)) ; Some prior value - reestablish it.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
999 (makunbound name)) ; Previously unbound - demolish var.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1000 ; Remove registration:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1001 (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
1002 (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
1003 (if (not (eq (car allout-mode-prior-settings)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1004 on-list))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1005 (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
1006 (cons (car allout-mode-prior-settings)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1007 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
1008 (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
1009 (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
1010 (setq allout-mode-prior-settings rebuild)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1011 )
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1012 ;;;_ : 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
1013 ;;;_ > allout-unprotected (expr)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1014 (defmacro allout-unprotected (expr)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1015 "Enable internal outline operations to alter invisible text."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1016 `(let ((inhibit-read-only t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1017 ,expr))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1018 ;;;_ = allout-mode-hook
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1019 (defvar allout-mode-hook nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1020 "*Hook that's run when allout mode starts.")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1021 ;;;_ = allout-overlay-category
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1022 (defvar allout-overlay-category nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1023 "Symbol for use in allout invisible-text overlays as the category.")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1024 ;;;_ = allout-view-change-hook
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1025 (defvar allout-view-change-hook nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1026 "*Hook that's run after allout outline visibility changes.")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1027
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1028 ;;;_ = allout-outside-normal-auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1029 (defvar allout-outside-normal-auto-fill-function nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1030 "Value of normal-auto-fill-function outside of allout mode.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1031
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1032 Used by allout-auto-fill to do the mandated normal-auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1033 wrapped within allout's automatic fill-prefix setting.")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1034 (make-variable-buffer-local 'allout-outside-normal-auto-fill-function)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1035 ;;;_ = 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
1036 (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
1037 "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
1038 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
1039 to track repeats.")
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1040 ;;;_ = allout-passphrase-verifier-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1041 (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
1042 "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
1043 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
1044
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1045 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
1046 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
1047 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
1048 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
1049 search attacks.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1050
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1051 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
1052 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
1053 `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
1054 (make-variable-buffer-local 'allout-passphrase-verifier-string)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1055 (put 'allout-passphrase-verifier-string 'safe-local-variable t)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1056 ;;;_ = allout-passphrase-hint-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1057 (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
1058 "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
1059
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1060 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
1061 the reminder is deployed.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1062
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1063 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
1064 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
1065 `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
1066 (make-variable-buffer-local 'allout-passphrase-hint-string)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1067 (put 'allout-passphrase-hint-string 'safe-local-variable t)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1068 (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
1069 ;;;_ = allout-after-save-decrypt
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1070 (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
1071 "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
1072
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1073 - 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
1074 - 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
1075
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1076 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
1077 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
1078 (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
1079 ;;;_ > allout-mode-p ()
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1080 ;; 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
1081 ;; 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
1082 (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
1083 "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
1084 'allout-mode)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1085 ;;;_ > 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
1086 (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
1087 "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
1088
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1089 (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
1090 (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
1091 (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
1092 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1093 (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
1094 'except-current)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1095 (point-marker))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1096 (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
1097 (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
1098 (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1099 (message "auto-encrypting pending topics")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1100 (sit-for 0)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1101 (condition-case failure
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1102 (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
1103 (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
1104 (error (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1105 (message
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1106 "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
1107 failure)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1108 (sit-for 2))))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1109 ))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1110 nil)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1111 ;;;_ > 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
1112 (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
1113 "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
1114
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1115 (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
1116 ;; 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
1117 (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
1118 (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
1119 ;;;_ > allout-after-saves-handler ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1120 (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
1121 "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
1122
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1123 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
1124 the save.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1125
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1126 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
1127 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
1128 (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
1129 (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
1130 allout-after-save-decrypt))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1131 t
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1132 (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
1133 (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
1134 (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
1135 (if (not was-modified)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1136 (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
1137 (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
1138 (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
1139 )
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1140
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1141 ;;;_ #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
1142 ;;;_ = 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
1143 (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
1144 "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
1145 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
1146 (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
1147 ;;;_ > 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
1148 (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
1149 "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
1150
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1151 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
1152
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1153 - nil \(or no argument) deactivate auto-activation/layout;
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1154 - `activate', enable auto-activation only;
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1155 - `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
1156 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
1157 - `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
1158 - 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
1159 any confirmation check.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1160
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1161 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
1162 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
1163 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
1164 `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
1165
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1166 `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
1167 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
1168 setting.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1169
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1170 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
1171 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
1172
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1173 \(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
1174 \(allout-init t)"
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1175
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1176 (interactive)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1177 (if (interactive-p)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1178 (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1179 (setq mode
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1180 (completing-read
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1181 (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
1182 "(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
1183 '(("nil")("full")("activate")("deactivate")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1184 ("ask") ("report") (""))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1185 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1186 t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1187 (if (string= mode "")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1188 (setq mode 'report)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1189 (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
1190 (let
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1191 ;; 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
1192 ((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
1193 (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
1194 'find-file-hook
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1195 'find-file-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
1196 (curr-mode 'allout-auto-activation))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1197
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1198 (cond ((not mode)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1199 (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
1200 (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
1201 (if (interactive-p)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1202 (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
1203 ((eq mode 'report)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1204 (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
1205 (allout-init nil)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1206 ;; 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
1207 (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
1208 (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
1209 (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
1210 (cond ((eq mode 'activate)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1211 (message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1212 "Outline mode auto-activation enabled.")
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1213 'activate)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1214 ((eq mode 'report)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1215 ;; 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
1216 (allout-init mode))
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1217 ((eq mode 'ask)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1218 (message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1219 (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
1220 "-layout \(upon confirmation) enabled."))
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1221 'ask)
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1222 ((message
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1223 "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
1224 'full)))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1225 ;;;_ > 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
1226 (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
1227 "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
1228 (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
1229 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
1230 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
1231 allout-mode-misc-menu))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1232 cur)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1233 (while menus
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1234 (setq cur (car menus)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1235 menus (cdr menus))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1236 (easy-menu-add cur))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1237 ;;;_ > allout-set-overlay-category
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1238 (defun allout-set-overlay-category ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1239 "Set the properties of the allout invisible-text overlay."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1240 (setplist 'allout-overlay-category nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1241 (put 'allout-overlay-category 'invisible 'allout)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1242 (put 'allout-overlay-category 'evaporate t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1243 ;; XXX We use isearch-open-invisible *and* isearch-mode-end-hook. The
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1244 ;; latter would be sufficient, but it seems that a separate behavior -
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1245 ;; the _transient_ opening of invisible text during isearch - is keyed to
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1246 ;; presence of the isearch-open-invisible property - even though this
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1247 ;; property controls the isearch _arrival_ behavior. This is the case at
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1248 ;; least in emacs 21, 22.0, and xemacs 21.4.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1249 (put 'allout-overlay-category 'isearch-open-invisible
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1250 'allout-isearch-end-handler)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1251 (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1252 (put 'allout-overlay-category 'start-open t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1253 (put 'allout-overlay-category 'insert-in-front-hooks
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1254 '(allout-overlay-insert-in-front-handler)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1255 (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1256 (progn (make-variable-buffer-local 'before-change-functions)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1257 (add-hook 'before-change-functions
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1258 'allout-before-change-handler))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1259 (put 'allout-overlay-category 'modification-hooks
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1260 '(allout-overlay-interior-modification-handler))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1261 ;;;_ > allout-mode (&optional toggle)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1262 ;;;_ : Defun:
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1263 ;;;###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
1264 (defun allout-mode (&optional toggle)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1265 ;;;_ . Doc string:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1266 "Toggle minor mode for controlling exposure and editing of text outlines.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1267 \\<allout-mode-map>
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1268
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1269 Optional arg forces mode to re-initialize iff arg is positive num or
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1270 symbol. Allout outline mode always runs as a minor mode.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1271
48858
f4d079377a9a Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48857
diff changeset
1272 Allout outline mode provides extensive outline oriented formatting and
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1273 manipulation. It enables structural editing of outlines, as well as
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1274 navigation and exposure. It also is specifically aimed at
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1275 accommodating syntax-sensitive text like programming languages. \(For
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1276 an example, see the allout code itself, which is organized as an allout
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1277 outline.)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1278
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1279 In addition to outline navigation and exposure, allout includes:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1280
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1281 - topic-oriented repositioning, promotion/demotion, cut, and paste
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1282 - integral outline exposure-layout
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1283 - incremental search with dynamic exposure and reconcealment of hidden text
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1284 - 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
1285 - easy topic encryption and decryption
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1286 - \"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
1287 exposure control. \(See the allout-mode docstring.)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1288
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1289 and many other features.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1290
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1291 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
1292 special `allout-mode' features and terminology. See also the outline
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1293 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
1294 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
1295 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
1296
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1297
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1298 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
1299 `allout-command-prefix' variables.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1300
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1301 Navigation: Exposure Control:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1302 ---------- ----------------
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1303 \\[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
1304 \\[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
1305 \\[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
1306 \\[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
1307 \\[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
1308 \\[allout-end-of-entry] allout-end-of-entry
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1309 \\[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
1310
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1311 Topic Header Production:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1312 -----------------------
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1313 \\[allout-open-sibtopic] allout-open-sibtopic Create a new sibling after current topic.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1314 \\[allout-open-subtopic] allout-open-subtopic ... an offspring of current topic.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1315 \\[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
1316
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1317 Topic Level and Prefix Adjustment:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1318 ---------------------------------
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1319 \\[allout-shift-in] allout-shift-in Shift current topic and all offspring deeper.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1320 \\[allout-shift-out] allout-shift-out ... less deep.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1321 \\[allout-rebullet-current-heading] allout-rebullet-current-heading Prompt for alternate bullet for
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1322 current topic.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1323 \\[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
1324 - 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
1325 alternated according to nesting depth.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1326 \\[allout-number-siblings] allout-number-siblings Number bullets of topic and siblings - the
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1327 offspring are not affected. With repeat
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1328 count, revoke numbering.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1329
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1330 Topic-oriented Killing and Yanking:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1331 ----------------------------------
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1332 \\[allout-kill-topic] allout-kill-topic Kill current topic, including offspring.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1333 \\[allout-kill-line] allout-kill-line Like kill-line, but reconciles numbering, etc.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1334 \\[allout-yank] allout-yank Yank, adjusting depth of yanked topic to
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1335 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
1336 heading (ie, prefix sans text).
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1337 \\[allout-yank-pop] allout-yank-pop Is to allout-yank as yank-pop is to yank
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1338
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1339 Topic-oriented Encryption:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1340 -------------------------
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1341 \\[allout-toggle-current-subtree-encryption] allout-toggle-current-subtree-encryption Encrypt/Decrypt topic content
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1342
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1343 Misc commands:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1344 -------------
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1345 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
1346 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
1347 for `allout-layout'.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1348 \\[allout-mark-topic] allout-mark-topic
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1349 \\[allout-copy-exposed-to-buffer] allout-copy-exposed-to-buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1350 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
1351 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
1352 of current buffer - \"*BUFFERNAME exposed*\".
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1353 \\[allout-flatten-exposed-to-buffer] allout-flatten-exposed-to-buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1354 Like above 'copy-exposed', but convert topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1355 prefixes to section.subsection... numeric
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1356 format.
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1357 \\[eval-expression] (allout-init t) Setup Emacs session for outline mode
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1358 auto-activation.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1359
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1360 Topic Encryption
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1361
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1362 Outline mode supports gpg encryption of topics, with support for
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1363 symmetric and key-pair modes, passphrase timeout, passphrase
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1364 consistency checking, user-provided hinting for symmetric key
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1365 mode, and auto-encryption of topics pending encryption on save.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1366 \(Topics pending encryption are, by default, automatically
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1367 encrypted during file saves; if you're editing the contents of
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1368 such a topic, it is automatically decrypted for continued
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1369 editing.) The aim is reliable topic privacy while preventing
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1370 accidents like neglected encryption before saves, forgetting
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1371 which passphrase was used, and other practical pitfalls.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1372
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1373 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
1374 `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
1375
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1376 HOT-SPOT Operation
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1377
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1378 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
1379 navigation and exposure control.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1380
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1381 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
1382 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
1383 corresponding allout-mode keymap control chars. For example, \"f\"
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1384 would invoke the command typically bound to \"C-c<space>C-f\"
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1385 \(\\[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
1386
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1387 Thus, by positioning the cursor on a topic bullet, you can
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1388 execute the outline navigation and manipulation commands with a
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1389 single keystroke. Regular navigation keys (eg, \\[forward-char], \\[next-line]) never get
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1390 this special translation, so you can use them to get out of the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1391 hot-spot and back to normal operation.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1392
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1393 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
1394 will move to the hot-spot when the cursor is already located at the
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1395 beginning of the current entry, so you usually can hit \\[allout-beginning-of-current-entry]
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1396 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
1397
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1398 Terminology
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1399
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1400 Topic hierarchy constituents - TOPICS and SUBTOPICS:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1401
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1402 TOPIC: A basic, coherent component of an Emacs outline. It can
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1403 contain and be contained by other topics.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1404 CURRENT topic:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1405 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
1406 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
1407 containment. Also called the:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1408 LEVEL: The same as DEPTH.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1409
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1410 ANCESTORS:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1411 The topics that contain a topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1412 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
1413 the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1414 OFFSPRING:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1415 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
1416 SUBTOPIC:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1417 An immediate offspring of a topic;
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1418 CHILDREN:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1419 The immediate offspring of a topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1420 SIBLINGS:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1421 Topics having the same parent and depth.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1422
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1423 Topic text constituents:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1424
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1425 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
1426 text.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1427 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
1428 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
1429 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
1430 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
1431 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
1432
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1433 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
1434 of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1435 PREFIX-LEAD:
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1436 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
1437 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
1438 `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
1439
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1440 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
1441 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
1442 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
1443 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
1444 docstring for more detail.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1445 PREFIX-PADDING:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1446 Spaces or asterisks which separate the prefix-lead and the
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1447 bullet, determining the depth of the topic.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1448 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
1449 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
1450 `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
1451 for these variables for more details.) The default choice of
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1452 bullet when generating topics varies in a cycle with the depth of
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1453 the topic.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1454 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
1455 BODY: Same as ENTRY.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1456
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1457
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1458 EXPOSURE:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1459 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
1460 of its offspring and contained text.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1461 CONCEALED:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1462 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
1463 units of concealed text is represented by `...' ellipses.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1464
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1465 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
1466 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
1467 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
1468 ;;;_ . Code
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1469 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1470
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1471 (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
1472 (allout-mode-p)))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1473 ; Massage universal-arg `toggle' val:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1474 (toggle (and toggle
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1475 (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
1476 toggle)))
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
1477 ; 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
1478 (explicit-activation (and toggle
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1479 (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
1480 (and (wholenump toggle)
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
1481 (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
1482 ;; 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
1483 (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
1484 (car command-history)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1485 (write-file-hook-var-name (cond ((boundp 'write-file-functions)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1486 'write-file-functions)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1487 ((boundp 'write-file-hooks)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1488 'write-file-hooks)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1489 (t 'local-write-file-hooks)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1490 do-layout
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1491 )
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1492
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1493 ; 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
1494 (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
1495
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1496 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1497
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1498 ;; 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
1499 ;; 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
1500 ;; 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
1501 ;; 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
1502 ;; skip everything.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1503 ((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
1504 ; 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
1505 active ; Already activated.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1506 (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
1507 (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
1508 emacs-version)); 19.19.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1509 t)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1510
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1511 ;; Deactivation:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1512 ((and (not explicit-activation)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1513 (or active toggle))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1514 ; Activation not explicitly
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1515 ; requested, and either in
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1516 ; active state or *de*activation
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1517 ; 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
1518 (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
1519 (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
1520 ; 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
1521 ; as we set them:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1522 (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
1523 (mapcar (function
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1524 (lambda (cell)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1525 (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
1526 (car (cdr cell)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1527 (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
1528 (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
1529 allout-added-bindings)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1530 (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
1531 (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
1532
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1533 (if allout-old-style-prefixes
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1534 (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
1535 (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
1536 (allout-resumptions 'allout-old-style-prefixes)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1537 ;;(allout-resumptions 'selective-display)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1538 (remove-from-invisibility-spec '(allout . t))
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1539 (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
1540 (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
1541 (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
1542 (setq auto-save-hook
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1543 (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
1544 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
1545 (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
1546 (allout-resumptions 'paragraph-separate)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1547 (allout-resumptions 'auto-fill-function)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1548 (allout-resumptions 'normal-auto-fill-function)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1549 (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
1550 (setq allout-mode nil))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1551
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1552 ;; Activation:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1553 ((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
1554 (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
1555 (if allout-old-style-prefixes
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1556 (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
1557 (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
1558 (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
1559
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1560 (allout-set-overlay-category) ; Doesn't hurt to redo this.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1561
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1562 (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
1563 (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
1564
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1565 (set-allout-regexp)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1566
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1567 ; 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
1568 ; of allout-keybindings-list:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1569 (if (boundp 'minor-mode-map-alist)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1570
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1571 (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
1572 ; 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
1573 (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
1574 (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
1575 (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
1576 (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
1577 ; 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
1578 ; 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
1579 (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
1580 minor-mode-map-alist))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1581 (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
1582 (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
1583 minor-mode-map-alist))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1584
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1585 ; 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
1586 ; 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
1587 ; for later revocation:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1588 (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
1589 (list allout-keybindings-list))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
1590 (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
1591 (list (current-local-map)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1592 ; 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
1593 (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
1594 (current-local-map)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1595 )
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
1596
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1597 (add-to-invisibility-spec '(allout . t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1598 (make-local-variable 'line-move-ignore-invisible)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1599 (setq line-move-ignore-invisible t)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1600 (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
1601 (add-hook 'post-command-hook 'allout-post-command-business)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1602 (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
1603 (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
1604 (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
1605 ; 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
1606 ; respect for topic headline,
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1607 ; hanging-indents, etc:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1608 ;; Register prevailing fill func for use by allout-auto-fill:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1609 (allout-resumptions 'allout-former-auto-filler (list auto-fill-function))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1610 ;; Register allout-auto-fill to be used if filling is active:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1611 (allout-resumptions 'auto-fill-function '(allout-auto-fill))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1612 (allout-resumptions 'allout-outside-normal-auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1613 (list normal-auto-fill-function))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1614 (allout-resumptions 'normal-auto-fill-function '(allout-auto-fill))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1615 ;; Paragraphs are broken by topic headlines.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1616 (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
1617 (allout-resumptions 'paragraph-start
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1618 (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
1619 allout-regexp "\\)")))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1620 (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
1621 (allout-resumptions 'paragraph-separate
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1622 (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
1623 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
1624
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1625 (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
1626 (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
1627 (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
1628
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1629 (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
1630
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1631 (if allout-layout
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1632 (setq do-layout t))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1633
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1634 (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
1635 (setq allout-mode t))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1636
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1637 ;; Reactivation:
7527
1f09079e18c4 (outline-mode): Use outline-this-or-next-heading.
Richard M. Stallman <rms@gnu.org>
parents: 7476
diff changeset
1638 ((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
1639 (allout-infer-body-reindent))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1640 ) ; cond
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1641
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1642 (let ((use-layout (if (listp allout-layout)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1643 allout-layout
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1644 allout-default-layout)))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1645 (if (and do-layout
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1646 allout-auto-activation
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1647 use-layout
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1648 (and (not (eq allout-auto-activation 'activate))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1649 (if (eq allout-auto-activation 'ask)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1650 (if (y-or-n-p (format "Expose %s with layout '%s'? "
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1651 (buffer-name)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1652 use-layout))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1653 t
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1654 (message "Skipped %s layout." (buffer-name))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1655 nil)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1656 t)))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1657 (save-excursion
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1658 (message "Adjusting '%s' exposure..." (buffer-name))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1659 (goto-char 0)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1660 (allout-this-or-next-heading)
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1661 (condition-case err
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1662 (progn
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1663 (apply 'allout-expose-topic (list use-layout))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1664 (message "Adjusting '%s' exposure... done." (buffer-name)))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1665 ;; Problem applying exposure - notify user, but don't
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1666 ;; interrupt, eg, file visit:
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1667 (error (message "%s" (car (cdr err)))
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1668 (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
1669 allout-mode
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1670 ) ; let*
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1671 ) ; defun
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
1672 ;;;_ > allout-minor-mode
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
1673 (defalias 'allout-minor-mode 'allout-mode)
68956
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1674
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1675 ;;;_ - Position Assessment
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1676 ;;;_ > allout-hidden-p (&optional pos)
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1677 (defsubst allout-hidden-p (&optional pos)
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1678 "Non-nil if the character after point is invisible."
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1679 (get-char-property (or pos (point)) 'invisible))
af2db645bc9d (allout-hidden-p): Move this defsubts before
Eli Zaretskii <eliz@gnu.org>
parents: 68953
diff changeset
1680
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1681 ;;;_ > allout-overlay-insert-in-front-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1682 ;;; &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1683 (defun allout-overlay-insert-in-front-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1684 &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1685 "Shift the overlay so stuff inserted in front of it are excluded."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1686 (if after
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1687 (move-overlay ol (1+ beg) (overlay-end ol))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1688 ;;;_ > allout-overlay-interior-modification-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1689 ;;; &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1690 (defun allout-overlay-interior-modification-handler (ol after beg end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1691 &optional prelen)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1692 "Get confirmation before making arbitrary changes to invisible text.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1693
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1694 We expose the invisible text and ask for confirmation. Refusal or
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1695 keyboard-quit abandons the changes, with keyboard-quit additionally
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1696 reclosing the opened text.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1697
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1698 No confirmation is necessary when inhibit-read-only is set - eg, allout
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1699 internal functions use this feature cohesively bunch changes."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1700
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1701 (when (and (not inhibit-read-only) (not after))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1702 (let ((start (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1703 (ol-start (overlay-start ol))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1704 (ol-end (overlay-end ol))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1705 (msg "Change within concealed text disallowed.")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1706 opened
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1707 first)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1708 (goto-char beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1709 (while (< (point) end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1710 (when (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1711 (allout-show-to-offshoot)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1712 (if (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1713 (save-excursion (forward-char 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1714 (allout-show-to-offshoot)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1715 (when (not first)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1716 (setq opened t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1717 (setq first (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1718 (goto-char (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1719 (next-property-change (1+ (point)) nil end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1720 (next-char-property-change (1+ (point)) end))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1721 (when first
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1722 (goto-char first)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1723 (condition-case nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1724 (if (not
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1725 (yes-or-no-p
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1726 (substitute-command-keys
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1727 (concat "Modify concealed text? (\"no\" just aborts,"
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1728 " \\[keyboard-quit] also reconceals) "))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1729 (progn (goto-char start)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1730 (error "Concealed-text change refused.")))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1731 (quit (allout-flag-region ol-start ol-end nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1732 (allout-flag-region ol-start ol-end t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1733 (error "Concealed-text change abandoned, text reconcealed."))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1734 (goto-char start))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1735 ;;;_ > allout-before-change-handler (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1736 (defun allout-before-change-handler (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1737 "Protect against changes to invisible text.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1738
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1739 See allout-overlay-interior-modification-handler for details.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1740
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1741 This before-change handler is used only where modification-hooks
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1742 overlay property is not supported."
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
1743 (if (not (allout-mode-p))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1744 nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1745 (allout-overlay-interior-modification-handler nil nil beg end nil)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1746 ;;;_ > allout-isearch-end-handler (&optional overlay)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1747 (defun allout-isearch-end-handler (&optional overlay)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1748 "Reconcile allout outline exposure on arriving in hidden text after isearch.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1749
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1750 Optional OVERLAY parameter is for when this function is used by
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1751 `isearch-open-invisible' overlay property. It is otherwise unused, so this
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1752 function can also be used as an `isearch-mode-end-hook'."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1753
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1754 (if (and (allout-mode-p) (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1755 (allout-show-to-offshoot)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1756
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1757 ;;;_ #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
1758 ;;; All the basic outline functions that directly do string matches to
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1759 ;;; 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
1760 ;;; `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
1761 ;;; 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
1762 ;;; 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
1763 ;;; 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
1764 ;;; 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
1765 ;;;_ = 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
1766 (defvar allout-recent-prefix-beginning 0
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1767 "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
1768 (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
1769 ;;;_ = 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
1770 (defvar allout-recent-prefix-end 0
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1771 "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
1772 (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
1773 ;;;_ = 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
1774 (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
1775 "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
1776 (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
1777 ;;;_ > 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
1778 (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
1779 "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
1780
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1781 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
1782 `(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
1783 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
1784 ;;;_ > 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
1785 (defmacro allout-recent-depth ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1786 "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
1787
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1788 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
1789 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
1790 `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
1791 to return the current depth."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1792
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1793 '(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
1794 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
1795 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
1796 ;;;_ > 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
1797 (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
1798 "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
1799
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1800 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
1801 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
1802 `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
1803 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
1804 '(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
1805 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
1806 ;;;_ > 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
1807 (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
1808 "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
1809
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1810 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
1811 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
1812 `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
1813 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
1814 '(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
1815 allout-recent-prefix-end))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1816
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1817 ;;;_ #4 Navigation
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1818
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
1819 ;;;_ - Position Assessment
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1820 ;;;_ : 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
1821 ;;;_ > 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
1822 (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
1823 "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
1824
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1825 Actually, returns prefix beginning point."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1826 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1827 (allout-beginning-of-current-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1828 (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
1829 (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
1830 ;;;_ > 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
1831 (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
1832 ;;;_ > 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
1833 (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
1834 "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
1835 (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
1836 (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
1837 (= (point)(save-excursion (allout-end-of-prefix)(point)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1838 ;;;_ : 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
1839 ;;;_ > allout-depth ()
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1840 (defun allout-depth ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1841 "Return depth of topic most immediately containing point.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1842
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1843 Return zero if point is not within any topic.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1844
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1845 Like `allout-current-depth', but respects hidden as well as visible topics."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1846 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1847 (let ((start-point (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1848 (if (and (allout-goto-prefix)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1849 (not (< start-point (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1850 (allout-recent-depth)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1851 (progn
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1852 ;; Oops, no prefix, zero prefix data:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1853 (allout-prefix-data (point)(point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1854 ;; ... and return 0:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1855 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
1856 ;;;_ > allout-current-depth ()
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1857 (defun allout-current-depth ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1858 "Return depth of visible topic most immediately containing point.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1859
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1860 Return zero if point is not within any topic."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1861 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1862 (if (allout-back-to-current-heading)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1863 (max 1
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1864 (- allout-recent-prefix-end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1865 allout-recent-prefix-beginning
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1866 allout-header-subtraction))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1867 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
1868 ;;;_ > 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
1869 (defun allout-get-current-prefix ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1870 "Topic prefix of the current topic."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1871 (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
1872 (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
1873 (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
1874 ;;;_ > 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
1875 (defun allout-get-bullet ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1876 "Return bullet of containing topic (visible or not)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1877 (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
1878 (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
1879 (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
1880 ;;;_ > 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
1881 (defun allout-current-bullet ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1882 "Return bullet of current (visible) topic heading, or none if none found."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1883 (condition-case nil
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1884 (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
1885 (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
1886 (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
1887 allout-recent-prefix-end))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1888 ;; Quick and dirty provision, ostensibly for missing bullet:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1889 ('args-out-of-range nil))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1890 )
48856
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-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
1892 (defun allout-get-prefix-bullet (prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1893 "Return the bullet of the header prefix string PREFIX."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1894 ;; Doesn't make sense if we're old-style prefixes, but this just
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1895 ;; 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
1896 (if (string-match allout-regexp prefix)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1897 (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
1898 ;;;_ > 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
1899 (defun allout-sibling-index (&optional depth)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1900 "Item number of this prospective topic among its siblings.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1901
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
1902 If optional arg DEPTH is greater than current depth, then we're
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1903 opening a new level, and return 0.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1904
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1905 If less than this depth, ascend to that depth and count..."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1906
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1907 (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1908 (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
1909 ((or (not depth) (= depth (allout-depth)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1910 (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
1911 (while (allout-previous-sibling (allout-recent-depth) nil)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1912 (setq index (1+ index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1913 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
1914 ((< 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
1915 (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
1916 (allout-sibling-index))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1917 (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
1918 ;;;_ > 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
1919 (defun allout-topic-flat-index ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1920 "Return a list indicating point's numeric section.subsect.subsubsect...
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1921 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
1922 (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
1923 (next-index (allout-sibling-index depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1924 (rev-sibls nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1925 (while (> next-index 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1926 (setq rev-sibls (cons next-index rev-sibls))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1927 (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
1928 (setq next-index (allout-sibling-index depth)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1929 rev-sibls)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1930 )
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1931
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1932 ;;;_ - Navigation routines
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1933 ;;;_ > allout-beginning-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1934 (defun allout-beginning-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1935 "Like beginning of line, but to visible text."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1936
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1937 ;; XXX We would use `(move-beginning-of-line 1)', but it gets
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1938 ;; stuck on some hidden newlines, eg at column 80, as of GNU Emacs 22.0.50.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1939 ;; Conversely, `beginning-of-line' can make no progress in other
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1940 ;; situations. Both are necessary, in the order used below.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1941 (move-beginning-of-line 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1942 (beginning-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1943 (while (or (not (bolp)) (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1944 (beginning-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1945 (if (or (allout-hidden-p) (not (bolp)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1946 (forward-char -1))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1947 ;;;_ > allout-end-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1948 (defun allout-end-of-current-line ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1949 "Move to the end of line, past concealed text if any."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1950 ;; XXX This is for symmetry with `allout-beginning-of-current-line' -
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1951 ;; `move-end-of-line' doesn't suffer the same problem as
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1952 ;; `move-beginning-of-line'.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1953 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1954 (while (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1955 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1956 (if (allout-hidden-p) (forward-char 1))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1957 ;;;_ > 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
1958 (defsubst allout-next-heading ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1959 "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
1960
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1961 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
1962
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1963 (if (and (bobp) (not (eobp)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1964 (forward-char 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1965
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1966 (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
1967 (allout-prefix-data ; Got valid location state - set vars:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
1968 (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
1969 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
1970 (or (match-end 2) allout-recent-prefix-end))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1971 ;;;_ > allout-this-or-next-heading
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
1972 (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
1973 "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
1974 ;; 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
1975 ;; 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
1976 (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
1977 ;;;_ > 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
1978 (defmacro allout-previous-heading ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
1979 "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
1980
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1981 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
1982
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1983 '(if (bobp)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1984 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
1985 (allout-goto-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1986 (if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1987 ;; 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
1988 (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
1989 (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
1990 (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
1991 (allout-prefix-data
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
1992 (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
1993 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
1994 (or (match-end 2) allout-recent-prefix-end))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1995 ;;;_ > allout-get-invisibility-overlay ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1996 (defun allout-get-invisibility-overlay ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1997 "Return the overlay at point that dictates allout invisibility."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1998 (let ((overlays (overlays-at (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
1999 got)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2000 (while (and overlays (not got))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2001 (if (equal (overlay-get (car overlays) 'invisible) 'allout)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2002 (setq got (car overlays))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2003 got))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2004 ;;;_ > allout-back-to-visible-text ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2005 (defun allout-back-to-visible-text ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2006 "Move to most recent prior character that is visible, and return point."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2007 (if (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2008 (goto-char (overlay-start (allout-get-invisibility-overlay))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2009 (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2010
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2011 ;;;_ - Subtree Charting
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2012 ;;;_ " 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
2013 ;;; 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
2014 ;;;
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2015 ;;; 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
2016 ;;; 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
2017 ;;; out the subtopic locations. The chart then serves as the basis
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2018 ;;; for assessment or adjustment of the subtree, without redundant
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2019 ;;; traversal of the structure.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2020
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2021 ;;;_ > 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
2022 (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
2023 "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
2024
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2025 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
2026 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
2027 use.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2028
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2029 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
2030
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2031 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
2032 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
2033 for their elaborate manipulations.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2034
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2035 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
2036 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
2037 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
2038 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
2039 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
2040 itself.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2041
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2042 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
2043 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
2044 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
2045
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2046 (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
2047 chart curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2048
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2049 (if original ; Just starting?
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2050 ; Register initial settings and
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2051 ; 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
2052 (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
2053 (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
2054 (allout-next-heading)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2055
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2056 ;; 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
2057 ;; 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
2058 ;; the typically quite constrained Emacs max-lisp-eval-depth.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2059 ;;
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2060 ;; 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
2061 ;; operation rather than recursing for lower levels. Bah.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2062
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2063 (while (and (not (eobp))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2064 ; 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
2065 (< 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
2066 (cond ((= prev-depth curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2067 ;; 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
2068 (setq chart (cons (point) chart))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2069 (if (and levels (<= levels 1))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2070 ;; 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
2071 (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
2072 ;; 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
2073 ;; 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
2074 (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
2075 (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
2076 (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
2077 (allout-next-heading)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2078
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2079 ((and (< prev-depth curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2080 (or (not levels)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2081 (> levels 0)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2082 ;; 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
2083 (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
2084 (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
2085 (1- levels))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2086 orig-depth
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2087 curr-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2088 chart))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2089 ;; ... then continue with this one.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2090 )
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2091
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2092 ;; ... 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
2093
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2094 )))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2095
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2096 (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
2097 ; the original level. Position
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2098 ; to the end of it:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2099 (progn (and (not (eobp)) (forward-char -1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2100 (and (= (preceding-char) ?\n)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2101 (= (aref (buffer-substring (max 1 (- (point) 3))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2102 (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2103 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2104 ?\n)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2105 (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
2106 (setq allout-recent-end-of-subtree (point))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2107
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2108 chart ; (nreverse chart) not necessary,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2109 ; and maybe not preferable.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2110 ))
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 ;;;_ > 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
2112 (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
2113 "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
2114 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
2115 for an explanation of charts."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2116 (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
2117 (if (allout-goto-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2118 (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
2119 (while (allout-next-sibling)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2120 (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
2121 (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
2122 ;;;_ > 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
2123 (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
2124
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2125 "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
2126
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2127 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
2128 start point."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2129
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2130 (let (result here)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2131 (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
2132 chart)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2133 (setq here (car chart))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2134 (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
2135 (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
2136 (1- depth)))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2137 ;; 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
2138 ;; more depth to go:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2139 (if further (setq result (append further result)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2140 (setq chart (cdr chart)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2141 (goto-char here)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2142 (if (allout-hidden-p)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2143 (setq result (cons here result)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2144 (setq chart (cdr chart))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2145 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
2146 ;;;_ 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
2147 ;; (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
2148 ;; "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
2149
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2150 ;; 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
2151
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2152 ;; 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
2153 ;; 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
2154 ;; 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
2155 ;; 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
2156 ;; 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
2157 ;; 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
2158
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2159 ;; 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
2160 ;; 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
2161 ;; exposed reside.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2162
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2163 ;; - 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
2164 ;; 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
2165 ;; 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
2166 ;; - 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
2167 ;; opened.
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2168 ;; - 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
2169 ;; 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
2170 ;; exposure:"
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2171 ;; (while spec
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2172 ;; (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
2173 ;; )
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2174 ;; )
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
2175 ;; (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
2176 ;; )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2177
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2178 ;;;_ - 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
2179 ;;;_ > 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
2180 (defun allout-goto-prefix ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2181 "Put point at beginning of immediately containing outline topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2182
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2183 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
2184
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2185 Not sensitive to topic visibility.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2186
46161
29f1f32aee5b (outline-goto-prefix): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 44182
diff changeset
2187 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
2188
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2189 (let (done)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2190 (while (and (not done)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2191 (search-backward "\n" nil 1))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2192 (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
2193 (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
2194 (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
2195 (match-end 0)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2196 (forward-char -1)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2197 (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
2198 (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
2199 (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
2200 ((allout-next-heading))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2201 (done))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2202 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
2203 ;;;_ > 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
2204 (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
2205 "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
2206
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2207 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
2208 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
2209
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2210 (if (not (allout-goto-prefix))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2211 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2212 (let ((match-data (match-data)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2213 (goto-char (match-end 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2214 (if ignore-decorations
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2215 t
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2216 (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
2217 (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2218 (store-match-data match-data))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2219 ;; 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
2220 (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
2221 ;;;_ > 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
2222 (defun allout-current-bullet-pos ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2223 "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
2224
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2225 (if (not (allout-current-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2226 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2227 (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
2228 ;;;_ > 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
2229 (defun allout-back-to-current-heading ()
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2230 "Move to heading line of current topic, or beginning if already on the line.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2231
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2232 Return value of point, unless we started outside of (before any) topics,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2233 in which case we return nil."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2234
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2235 (allout-beginning-of-current-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2236 (if (or (allout-on-current-heading-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2237 (and (re-search-backward (concat "^\\(" allout-regexp "\\)")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2238 nil 'move)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2239 (progn (while (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2240 (allout-beginning-of-current-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2241 (if (not (looking-at allout-regexp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2242 (re-search-backward (concat
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2243 "^\\(" allout-regexp "\\)")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2244 nil 'move)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2245 (allout-prefix-data (match-beginning 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2246 (match-end 1)))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2247 (if (interactive-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2248 (allout-end-of-prefix)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2249 (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
2250 ;;;_ > 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
2251 (defalias 'allout-back-to-heading 'allout-back-to-current-heading)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2252 ;;;_ > allout-pre-next-prefix ()
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2253 (defun allout-pre-next-prefix ()
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2254 "Skip forward to just before the next heading line.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2255
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2256 Returns that character position."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2257
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2258 (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
2259 (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
2260 (allout-prefix-data (match-beginning 2)(match-end 2)))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2261 ;;;_ > allout-end-of-subtree (&optional current include-trailing-blank)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2262 (defun allout-end-of-subtree (&optional current include-trailing-blank)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2263 "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
2264
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2265 Optional CURRENT means put point at the end of the containing
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2266 visible topic.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2267
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2268 Optional INCLUDE-TRAILING-BLANK means include a trailing blank line, if
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2269 any, as part of the subtree. Otherwise, that trailing blank will be
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2270 excluded as delimiting whitespace between topics.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2271
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2272 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
2273 (interactive "P")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2274 (if current
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2275 (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
2276 (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
2277 (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
2278 (allout-next-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2279 (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
2280 (> (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
2281 (allout-next-heading))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2282 (and (not (eobp)) (forward-char -1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2283 (if (and (not include-trailing-blank) (= ?\n (preceding-char)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2284 (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
2285 (setq allout-recent-end-of-subtree (point))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2286 ;;;_ > allout-end-of-current-subtree (&optional include-trailing-blank)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2287 (defun allout-end-of-current-subtree (&optional include-trailing-blank)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2288
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2289 "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
2290
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2291 Optional INCLUDE-TRAILING-BLANK means include a trailing blank line, if
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2292 any, as part of the subtree. Otherwise, that trailing blank will be
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2293 excluded as delimiting whitespace between topics.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2294
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2295 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
2296 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2297 (allout-end-of-subtree t include-trailing-blank))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2298 ;;;_ > 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
2299 (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
2300 "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
2301
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2302 If already there, move cursor to bullet for hot-spot operation.
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2303 \(See `allout-mode' doc string for details of hot-spot operation.)"
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2304 (interactive)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2305 (let ((start-point (point)))
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2306 (move-beginning-of-line 1)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2307 (allout-end-of-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2308 (if (and (interactive-p)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2309 (= (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
2310 (goto-char (allout-current-bullet-pos)))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2311 ;;;_ > allout-end-of-entry (&optional inclusive)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2312 (defun allout-end-of-entry (&optional inclusive)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2313 "Position the point at the end of the current topics' entry.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2314
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2315 Optional INCLUSIVE means also include trailing empty line, if any. When
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2316 unset, whitespace between items separates them even when the items are
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2317 collapsed."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2318 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2319 (allout-pre-next-prefix)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2320 (if (and (not inclusive) (not (bobp)) (= ?\n (preceding-char)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2321 (forward-char -1))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2322 (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
2323 ;;;_ > 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
2324 (defun allout-end-of-current-heading ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2325 (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
2326 (allout-beginning-of-current-entry)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2327 (search-forward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2328 (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
2329 (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
2330 ;;;_ > allout-get-body-text ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2331 (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
2332 "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
2333 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2334 (allout-end-of-prefix)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2335 (if (not (search-forward "\n" nil t))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2336 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2337 (backward-char 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2338 (let ((pre-body (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2339 (if (not pre-body)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2340 nil
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2341 (allout-end-of-entry t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2342 (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
2343 (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
2344 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2345 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2346 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2347 )
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2348
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2349 ;;;_ - 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
2350 ;;;_ > 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
2351 (defun allout-ascend-to-depth (depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2352 "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
2353 (if (and (> depth 0)(<= depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2354 (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
2355 (while (and (< depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2356 (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
2357 (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
2358 (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
2359 (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
2360 (progn (goto-char allout-recent-prefix-beginning)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2361 depth)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2362 (goto-char last-good)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2363 nil))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2364 (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
2365 ;;;_ > 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
2366 (defun allout-ascend ()
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2367 "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
2368 (prog1
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2369 (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
2370 (allout-previous-heading))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2371 (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
2372 ;;;_ > 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
2373 (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
2374 "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
2375
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2376 Returning depth if successful, nil if not."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2377 (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
2378 (start-depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2379 (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
2380 (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
2381 (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
2382 (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
2383 (< 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
2384 (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
2385 (= (allout-recent-depth) depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2386 depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2387 (goto-char start-point)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2388 nil))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2389 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2390 ;;;_ > allout-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
2391 (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
2392 "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
2393
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2394 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
2395 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
2396 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
2397 (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
2398 (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
2399 (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
2400 (last-good (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2401 failed)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2402 ;; 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
2403 (while (and (> (allout-recent-depth) 1)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2404 (> arg 0)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2405 (not (bobp))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2406 (not failed))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2407 (setq last-good (point))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2408 ;; 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
2409 (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
2410 (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
2411 (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
2412 (setq present-level (allout-current-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2413 (setq arg (- arg 1)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2414 (if (or failed
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2415 (> arg 0))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2416 (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
2417 (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
2418 (if (not dont-complain)
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
2419 (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
2420 (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
2421 nil))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2422 (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
2423 allout-recent-prefix-beginning)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2424
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2425 ;;;_ - 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
2426 ;;;_ > 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
2427 (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
2428 "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
2429
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2430 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
2431
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2432 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
2433
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2434 Return depth if successful, nil otherwise."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2435
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2436 (if (and backward (bobp))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2437 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
2438 (let ((start-depth (or depth (allout-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2439 (start-point (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2440 last-depth)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2441 (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
2442 (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
2443 (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
2444 (> (setq last-depth (allout-recent-depth)) start-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2445 (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
2446 (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
2447 (= (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
2448 allout-recent-prefix-beginning
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2449 (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
2450 (if depth (allout-depth) start-depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2451 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
2452 ;;;_ > 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
2453 (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
2454 "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
2455
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2456 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
2457
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2458 Optional BACKWARD reverses direction.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2459
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2460 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
2461 (allout-next-sibling depth (not backward))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2462 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2463 ;;;_ > 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
2464 (defun allout-snug-back ()
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
2465 "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
2466
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2467 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
2468 (if (or (bobp) (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2469 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2470 (forward-char -1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2471 (if (or (bobp) (not (= ?\n (preceding-char))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2472 nil
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2473 (forward-char -1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2474 (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
2475 ;;;_ > 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
2476 (defun allout-beginning-of-level ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2477 "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
2478 (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
2479 ;;;_ > 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
2480 (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
2481 "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
2482
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2483 (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
2484 (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
2485 (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
2486 (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
2487 ;;;_ > 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
2488 (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
2489 "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
2490
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2491 Move to buffer limit in indicated direction if headings are exhausted."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2492
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2493 (interactive "p")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2494 (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
2495 (step (if backward -1 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2496 prev got)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2497
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2498 (while (> arg 0) ; limit condition
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2499 (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
2500 ;; Move, skipping over all those concealed lines:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2501 (prog1 (condition-case nil (or (line-move step) t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2502 (error nil))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2503 (allout-beginning-of-current-line))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2504 (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
2505 ;; 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
2506 (if got (setq prev got))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2507 (setq arg (1- arg)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2508 (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
2509 (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
2510 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2511 (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
2512 (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
2513 ((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
2514 ;;;_ > 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
2515 (defun allout-previous-visible-heading (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2516 "Move to the previous heading line.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2517
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2518 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
2519 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
2520 matches)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2521 (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
2522 (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
2523 ;;;_ > 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
2524 (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
2525 "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
2526
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2527 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
2528
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2529 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
2530 (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
2531 (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
2532 (start-arg arg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2533 (backward (> 0 arg))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2534 last-depth
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2535 (last-good (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2536 at-boundary)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2537 (if (= 0 start-depth)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2538 (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
2539 (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
2540 (while (not (or (zerop arg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2541 at-boundary))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2542 (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
2543 (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
2544 (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
2545 (> (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
2546 (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
2547 (not (if backward (bobp) (eobp))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2548 (setq last-good (point)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2549 arg (1- arg))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2550 (setq at-boundary t)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2551 (if (and (not (eobp))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2552 (= 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
2553 (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
2554 (= (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
2555 allout-recent-prefix-beginning
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2556 (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
2557 (if (not (interactive-p))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2558 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
2559 (allout-end-of-prefix)
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
2560 (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
2561 (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
2562 (allout-recent-depth)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2563 (- (abs start-arg) arg)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2564 (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
2565 ;;;_ > 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
2566 (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
2567 "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
2568 (interactive "p")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2569 (if (interactive-p)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2570 (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
2571 (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
2572 (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
2573
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2574 ;;;_ #5 Alteration
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2575
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2576 ;;;_ - 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
2577 ;;;_ = 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
2578 (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
2579 "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
2580
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2581 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
2582 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
2583 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
2584 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
2585 `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
2586 (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
2587 ;;;_ > 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
2588 (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
2589 "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
2590
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
2591 - 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
2592 outline commands.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2593
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2594 - Decrypt topic currently being edited if it was encrypted for a save."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2595
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2596 ; 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
2597 (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
2598 nil
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2599
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2600 (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
2601 allout-after-save-decrypt)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2602 (allout-after-saves-handler))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2603
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2604 ;; Implement -post-goto-bullet, if set:
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2605 (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
2606 (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
2607 (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
2608 (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
2609 ))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2610 ;;;_ > 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
2611 (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
2612 "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
2613 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
2614
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2615 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
2616 reinterpreted as the corresponding control-character in the
13d146080936 (allout-pre-command-business): Fix docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 49588
diff changeset
2617 `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
2618 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
2619 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
2620
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2621 The upshot is that you can get easy, single (ie, unmodified) key
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2622 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
2623 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
2624 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
2625 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
2626
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2627 (if (not (allout-mode-p))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2628 nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2629 ;; Hot-spot navigation provisions:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2630 (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
2631 (eq (point)(allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2632 (let* ((this-key-num (cond
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2633 ((numberp last-command-char)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2634 last-command-char)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2635 ;; Only xemacs has characterp.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2636 ((and (fboundp 'characterp)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
2637 (apply 'characterp
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
2638 (list last-command-char)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
2639 (apply 'char-to-int (list last-command-char)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2640 (t 0)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2641 mapped-binding)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2642 (if (zerop this-key-num)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2643 nil
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2644 ; Map upper-register literals
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2645 ; to lower register:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2646 (if (<= 96 this-key-num)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2647 (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
2648 ; Check if we have a literal:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2649 (if (and (<= 64 this-key-num)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2650 (>= 96 this-key-num))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2651 (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
2652 (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
2653 (concat allout-command-prefix
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2654 (char-to-string (- this-key-num
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2655 64))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2656 (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
2657 (setq allout-post-goto-bullet t
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2658 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
2659 ;;;_ > 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
2660 (defun allout-find-file-hook ()
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
2661 "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'.
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2662
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2663 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
2664 (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
2665 (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
2666 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
2667 (allout-mode t)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2668
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2669 ;;;_ - 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
2670 ;;;_ > 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
2671 (defun allout-solicit-alternate-bullet (depth &optional current-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2672
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2673 "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
2674
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2675 Offer one suitable for current depth DEPTH as default."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2676
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2677 (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
2678 (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
2679 (sans-escapes (regexp-sans-escapes allout-bullets-string))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2680 choice)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2681 (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
2682 (goto-char (allout-current-bullet-pos))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2683 (setq choice (solicit-char-in-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2684 (format "Select bullet: %s ('%s' default): "
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2685 sans-escapes
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2686 default-bullet)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2687 sans-escapes
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2688 t)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2689 (message "")
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2690 (if (string= choice "") default-bullet choice))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2691 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2692 ;;;_ > 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
2693 (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
2694 "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
2695 (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
2696 ;;;_ > 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
2697 (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
2698 "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
2699 (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
2700 (string= allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2701 (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
2702 (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
2703 (allout-get-bullet)))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2704 ;;;_ > 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
2705 (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
2706 "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
2707 (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
2708 (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
2709 (if prefix
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2710 (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
2711 (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
2712 ;;;_ > 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
2713 (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
2714 "Return outline topic bullet suited to optional DEPTH, or current depth."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2715 ;; 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
2716 (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
2717 (char-to-string (aref allout-plain-bullets-string
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2718 (% (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
2719 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
2720 allout-primary-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2721 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2722
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2723 ;;;_ - 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
2724 ;;;_ > 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
2725 (defun allout-make-topic-prefix (&optional prior-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2726 new
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2727 depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2728 solicit
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2729 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2730 index)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2731 ;; Depth null means use current depth, non-null means we're either
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2732 ;; opening a new topic after current topic, lower or higher, or we're
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2733 ;; changing level of current topic.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2734 ;; Solicit dominates specified bullet-char.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2735 ;;;_ . Doc string:
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2736 "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
2737
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2738 All the arguments are optional.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2739
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2740 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
2741 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
2742 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
2743 for instance.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2744
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2745 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
2746 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
2747 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
2748 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
2749 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
2750 bullet or previous sibling.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2751
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2752 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
2753 the current topics' depth.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2754
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2755 If SOLICIT is non-nil, then the choice of bullet is solicited from
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2756 user. If it's a character, then that character is offered as the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2757 default, otherwise the one suited to the context \(according to
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2758 distinction or depth) is offered. \(This overrides other options,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2759 including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2760 context-specific bullet is used.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2761
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 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
2763 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
2764 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
2765 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
2766
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2767 \(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
2768
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2769 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
2770 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
2771 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
2772 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
2773 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
2774 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
2775 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
2776 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
2777 index for each successive sibling)."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2778 ;;;_ . Code:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2779 ;; The options are ordered in likely frequence of use, most common
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2780 ;; highest, least lowest. Ie, more likely to be doing prefix
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2781 ;; adjustments than soliciting, and yet more than numbering.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2782 ;; Current prefix is least dominant, but most likely to be commonly
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2783 ;; specified...
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2784
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2785 (let* (body
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2786 numbering
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2787 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
2788 (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
2789 (header-lead allout-header-prefix)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2790 (bullet-char
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2791
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2792 ;; Getting value for bullet char is practically the whole job:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2793
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2794 (cond
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2795 ; 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
2796 ((<= depth 1) (setq header-lead "") allout-primary-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2797 ; 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
2798 (allout-old-style-prefixes
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2799 ;; Cheat - make body the whole thing, null out header-lead and
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2800 ;; bullet-char:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2801 (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
2802 (string-to-char allout-primary-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2803 (setq header-lead "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2804 "")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2805
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2806 ;; (Neither level 1 nor old-style, so we're space padding.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2807 ;; Sneak it in the condition of the next case, whatever it is.)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2808
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2809 ;; Solicitation overrides numbering and other cases:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2810 ((progn (setq body (make-string (- depth 2) ?\ ))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2811 ;; The actual condition:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2812 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
2813 (let* ((got (allout-solicit-alternate-bullet depth solicit)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2814 ;; 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
2815 (setq numbering (and allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2816 (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
2817 (string= got allout-numbered-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2818 ;; Now return what we got, regardless:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2819 got))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2820
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2821 ;; 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
2822 ((and allout-numbered-bullet number-control)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2823 (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
2824 allout-numbered-bullet
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2825 (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
2826 (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
2827 prior-bullet)))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2828 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
2829 (allout-bullet-for-depth depth))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2830
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2831 ;;; Neither soliciting nor controlled numbering ;;;
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2832 ;;; (may be controlled denumbering, tho) ;;;
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2833
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2834 ;; Check wrt previous sibling:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2835 ((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
2836 (<= 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
2837 allout-numbered-bullet ; ... & numbering enabled
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2838 (not denumbering)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2839 (let ((sibling-bullet
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2840 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2841 ;; 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
2842 (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
2843 (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
2844 (allout-get-bullet))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2845 (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
2846 (string= allout-numbered-bullet sibling-bullet))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2847 (setq numbering sibling-bullet)))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2848
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2849 ;; Distinctive prior bullet?
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2850 ((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
2851 (allout-distinctive-bullet prior-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2852 ;; 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
2853 (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
2854 (string= prior-bullet allout-numbered-bullet)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2855 ;; or numbered, and not denumbering:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2856 (setq numbering (not denumbering)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2857 ;; Here 'tis:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2858 prior-bullet))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2859
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2860 ;; 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
2861 ((allout-bullet-for-depth depth)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2862
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2863 (concat header-lead
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2864 body
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2865 bullet-char
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2866 (if numbering
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2867 (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
2868 (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
2869 ((allout-sibling-index))))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2870 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2871 )
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2872 ;;;_ > allout-open-topic (relative-depth &optional before offer-recent-bullet)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2873 (defun allout-open-topic (relative-depth &optional before offer-recent-bullet)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2874 "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
2875
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
2876 New topic is situated after current one, unless optional flag BEFORE
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2877 is non-nil, or unless current line is completely empty - lacking even
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2878 whitespace - in which case open is done on the current line.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2879
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2880 When adding an offspring, it will be added immediately after the parent if
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2881 the other offspring are exposed, or after the last child if the offspring
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2882 are hidden. \(The intervening offspring will be exposed in the latter
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2883 case.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2884
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2885 If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2886
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2887 Nuances:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2888
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2889 - 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
2890 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
2891
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2892 - 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
2893 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
2894 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
2895 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
2896 deliberately dividing topic bodies.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2897
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2898 - 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
2899 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
2900 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
2901 single-spacing is used.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2902
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2903 - 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
2904 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
2905 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
2906 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
2907 from there."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2908
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2909 (allout-beginning-of-current-line)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
2910 (let* ((depth (+ (allout-current-depth) relative-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2911 (opening-on-blank (if (looking-at "^\$")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2912 (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
2913 ;; 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
2914 opening-numbered
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2915 ref-depth
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
2916 ref-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2917 (ref-topic (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2918 (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
2919 (allout-ascend-to-depth depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2920 ((>= 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
2921 (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
2922 (setq ref-depth (allout-recent-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2923 (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
2924 (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
2925 (allout-recent-bullet)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
2926 ""))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2927 (setq opening-numbered
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2928 (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
2929 (and allout-numbered-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2930 (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
2931 (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
2932 (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
2933 allout-numbered-bullet))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2934 (point)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2935 dbl-space
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2936 doing-beginning)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2937
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2938 (if (not opening-on-blank)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2939 ; Positioning and vertical
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2940 ; padding - only if not
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2941 ; opening-on-blank:
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
2942 (progn
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2943 (goto-char ref-topic)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2944 (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
2945 (or (and (<= relative-depth 0) ; not descending;
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2946 (save-excursion
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
2947 ;; 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
2948 (or (> 0 (forward-line -1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2949 (looking-at "^\\s-*$")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2950 (bobp)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2951 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2952 ;; 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
2953 (allout-end-of-current-subtree)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2954 (looking-at "\n\n")))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2955 (and (= ref-depth 1)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2956 (or before
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2957 (= depth 1)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2958 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2959 ;; Don't already have following
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2960 ;; vertical padding:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2961 (not (allout-pre-next-prefix)))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2962
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2963 ;; Position to prior heading, if inserting backwards, and not
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2964 ;; going outwards:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2965 (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
2966 (progn (allout-back-to-current-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2967 (setq doing-beginning (bobp))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2968 (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
2969 (allout-previous-heading)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2970 (if (and before (bobp))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2971 (open-line 1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2972
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2973 (if (<= relative-depth 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2974 ;; Not going inwards, don't snug up:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2975 (if doing-beginning
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2976 (if (not dbl-space)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2977 (open-line 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2978 (open-line 2))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2979 (if before
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2980 (progn (end-of-line)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2981 (allout-pre-next-prefix)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2982 (while (and (= ?\n (following-char))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2983 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2984 (forward-char 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2985 (allout-hidden-p)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2986 (forward-char 1))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
2987 (if (not (looking-at "^$"))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2988 (open-line 1)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2989 (allout-end-of-current-subtree)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2990 (if (looking-at "\n\n") (forward-char 1))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2991 ;; Going inwards - double-space if first offspring is
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2992 ;; double-spaced, otherwise snug up.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2993 (allout-end-of-entry)
69250
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2994 (if (eobp)
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2995 (newline 1)
85c3b33d6427 Restablished intermediate missing comment header to preserve outline structure.
Eli Zaretskii <eliz@gnu.org>
parents: 69124
diff changeset
2996 (line-move 1))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2997 (allout-beginning-of-current-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
2998 (backward-char 1)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2999 (if (bolp)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3000 ;; Blank lines between current header body and next
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3001 ;; header - get to last substantive (non-white-space)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3002 ;; line in body:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3003 (progn (setq dbl-space t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3004 (re-search-backward "[^ \t\n]" nil t)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3005 (if (looking-at "\n\n")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3006 (setq dbl-space t))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3007 (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
3008 (allout-next-heading)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3009 (when (> (allout-recent-depth) ref-depth)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3010 ;; This is an offspring.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3011 (forward-line -1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3012 (looking-at "^\\s-*$")))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3013 (progn (forward-line 1)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3014 (open-line 1)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3015 (forward-line 1)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3016 (allout-end-of-current-line))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3017
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3018 ;;(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
3019 (if (not (bobp))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3020 ;; 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
3021 ;; 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
3022 (progn (if (and (not (> depth ref-depth))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3023 (not before))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3024 (open-line 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3025 (if (and (not dbl-space) (> depth ref-depth))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3026 (newline 1)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3027 (if dbl-space
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3028 (open-line 1)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3029 (if (not before)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3030 (newline 1)))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3031 (if (and dbl-space (not (> relative-depth 0)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3032 (newline 1))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3033 (if (and (not (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3034 (not (bolp)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3035 (forward-char 1))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3036 ))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3037 (insert (concat (allout-make-topic-prefix opening-numbered t depth)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3038 " "))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3039
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3040 (allout-rebullet-heading (and offer-recent-bullet ref-bullet)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3041 depth nil nil t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3042 (if (> relative-depth 0)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3043 (save-excursion (goto-char ref-topic)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3044 (allout-show-children)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3045 (end-of-line)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3046 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3047 )
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-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
3049 (defun allout-open-subtopic (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3050 "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
3051
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3052 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
3053 prior to the current one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3054 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3055 (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
3056 ;;;_ > 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
3057 (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
3058 "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
3059
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3060 Positive universal arg means to use the bullet of the prior sibling.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3061
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3062 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
3063 one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3064 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3065 (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
3066 ;;;_ > 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
3067 (defun allout-open-supertopic (arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3068 "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
3069
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3070 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
3071 topic prior to the current one."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3072
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3073 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3074 (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
3075
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3076 ;;;_ - Outline Alteration
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3077 ;;;_ : 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
3078 ;;;_ = 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
3079 (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
3080 "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
3081 ;;;_ > 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
3082 (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
3083 "`allout-mode' autofill function.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3084
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3085 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
3086 `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
3087 (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
3088 ;; Check for topic header indentation:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3089 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3090 (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
3091 (if (looking-at allout-regexp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3092 ;; ... construct indentation to account for
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3093 ;; 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
3094 (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
3095 (current-column))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3096 ?\ )))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3097 (use-auto-fill-function (or allout-outside-normal-auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3098 auto-fill-function
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3099 '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
3100 (if (or allout-former-auto-filler allout-use-hanging-indents)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3101 (funcall use-auto-fill-function))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3102 ;;;_ > 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
3103 (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
3104 "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
3105
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3106 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
3107 be accommodated.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3108
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3109 Note that refill of indented paragraphs is not done."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3110
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3111 (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
3112 (allout-end-of-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3113 (let* ((new-margin (current-column))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3114 excess old-indent-begin old-indent-end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3115 ;; 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
3116 ;; *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
3117 ;; 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
3118 (old-margin (+ old-depth (- new-margin new-depth))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3119
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3120 ;; 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
3121 (allout-unprotected
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3122 (save-match-data
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3123 (while
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3124 (and (re-search-forward "\n\\(\\s-*\\)"
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3125 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3126 t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3127 ;; Register the indent data, before we reset the
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3128 ;; 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
3129 (setq old-indent-begin (match-beginning 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3130 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
3131 (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
3132 (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
3133 old-margin)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3134 ;; 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
3135 nil
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3136 ;; 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
3137 ;; reindent it, preserving its existing indentation
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3138 ;; beyond the old margin:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3139 (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
3140 (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
3141 ;;;_ > 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
3142 (defun allout-rebullet-current-heading (arg)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3143 "Solicit new bullet for current visible heading."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3144 (interactive "p")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3145 (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
3146 (on-bullet (eq (point)(allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3147 (backwards (if (< arg 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3148 (setq arg (* arg -1)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3149 (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
3150 (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
3151 (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
3152 (allout-rebullet-heading t ;;; solicit
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3153 nil ;;; depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3154 nil ;;; number-control
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3155 nil ;;; index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3156 t)) ;;; do-successors
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3157 (setq arg (1- arg))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3158 (if (<= arg 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3159 nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3160 (setq initial-col nil) ; Override positioning back to init col
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3161 (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
3162 (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
3163 (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
3164 (allout-next-visible-heading -1))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3165 (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
3166 (cond (on-bullet (goto-char (allout-current-bullet-pos)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3167 (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
3168 ;;;_ > 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
3169 (defun allout-rebullet-heading (&optional solicit
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3170 new-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3171 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3172 index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3173 do-successors)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3174
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3175 "Adjust bullet of current topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3176
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3177 All args are optional.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3178
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3179 If SOLICIT is non-nil, then the choice of bullet is solicited from
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3180 user. If it's a character, then that character is offered as the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3181 default, otherwise the one suited to the context \(according to
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3182 distinction or depth) is offered. If non-nil, then the
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3183 context-specific bullet is just used.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3184
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3185 Second arg DEPTH forces the topic prefix to that depth, regardless
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3186 of the topic's current depth.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3187
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3188 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
3189 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
3190 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
3191 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
3192 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
3193
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3194 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
3195 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
3196 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
3197 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
3198 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
3199 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
3200 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
3201
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3202 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
3203 siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3204
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3205 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
3206 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
3207 this function."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3208
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3209 (let* ((current-depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3210 (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
3211 (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
3212 (me allout-recent-prefix-end)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3213 (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
3214 (new-prefix (allout-make-topic-prefix current-bullet
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3215 nil
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3216 new-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3217 solicit
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3218 number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3219 index)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3220
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3221 ;; Is new one is identical to old?
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3222 (if (and (= current-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3223 (string= current-bullet
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3224 (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
3225 ;; Nothing to do:
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3226 t
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3227
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3228 ;; New prefix probably different from old:
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3229 ; 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
3230 (allout-unprotected (delete-region mb me))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3231 (goto-char mb)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3232 ; Dispense with number if
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3233 ; 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
3234 (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
3235 (string= allout-numbered-bullet current-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3236 (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
3237 (allout-unprotected
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3238 (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
3239
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3240 ; 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
3241 (allout-unprotected (insert new-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3242
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3243 ;; 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
3244 (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
3245 (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
3246 (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
3247 (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
3248
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3249 ;; 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
3250 ;; caller elected for it:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3251 (if do-successors
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3252 (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
3253 (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
3254 (setq index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3255 (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
3256 ((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
3257 (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
3258 (allout-rebullet-heading nil ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3259 new-depth ;;; new-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3260 number-control;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3261 index ;;; index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3262 nil))))) ;;;(dont!)do-successors
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3263 ) ; (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
3264 ) ; let* ((current-depth (allout-depth))...)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3265 ) ; 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
3266 ;;;_ > 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
3267 (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
3268 "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
3269
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3270 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
3271
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3272 With repeat count, shift topic depth by that amount."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3273 (interactive "P")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3274 (let ((start-col (current-column)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3275 (save-excursion
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3276 ;; Normalize arg:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3277 (cond ((null arg) (setq arg 0))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3278 ((listp arg) (setq arg (car arg))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3279 ;; Fill the user in, in case we're shifting a big topic:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3280 (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
3281 (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
3282 (if (<= (+ (allout-recent-depth) arg) 0)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3283 (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
3284 (allout-rebullet-topic-grunt arg)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3285 (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
3286 (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
3287 ;;;_ > 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
3288 (defun allout-rebullet-topic-grunt (&optional relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3289 starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3290 starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3291 index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3292 do-successors)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3293 "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
3294 \(visible or not).
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3295
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3296 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
3297
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3298 All arguments are optional.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3299
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3300 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
3301 topic that amount.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3302
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3303 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
3304 itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3305
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3306 (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
3307 (new-depth (allout-depth))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3308 (starting-depth (or starting-depth new-depth))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3309 (on-starting-call (null starting-point))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3310 (index (or index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3311 ;; Leave index null on starting call, so rebullet-heading
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3312 ;; calculates it at what might be new depth:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3313 (and (or (zerop relative-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3314 (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
3315 (allout-sibling-index))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3316 (moving-outwards (< 0 relative-depth))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3317 (starting-point (or starting-point (point))))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3318
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3319 ;; Sanity check for excessive promotion done only on starting call:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3320 (and on-starting-call
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3321 moving-outwards
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3322 (> 0 (+ starting-depth relative-depth))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
3323 (error "Attempt to shift topic out beyond level 1")) ;;; ====>
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3324
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3325 (cond ((= starting-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3326 ;; 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
3327 (allout-rebullet-heading nil ;;; solicit
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3328 (+ starting-depth ;;; starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3329 relative-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3330 nil ;;; number
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3331 index ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3332 ;; Every contained topic will get hit,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3333 ;; and we have to get to outside ones
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3334 ;; deliberately:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3335 nil) ;;; do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3336 ;; ... and work on subsequent ones which are at greater depth:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3337 (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
3338 (allout-next-heading)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3339 (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
3340 (< starting-depth (allout-recent-depth)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3341 (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
3342 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3343 (1+ starting-depth);;;starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3344 starting-point ;;; starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3345 index))) ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3346
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3347 ((< starting-depth new-depth)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3348 ;; Rare case - subtopic more than one level deeper than parent.
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3349 ;; 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
3350 (allout-rebullet-topic-grunt relative-depth ;;; relative-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3351 new-depth ;;; starting-depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3352 starting-point ;;; starting-point
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3353 index))) ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3354
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3355 (if on-starting-call
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3356 (progn
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3357 ;; Rectify numbering of former siblings of the adjusted topic,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3358 ;; if topic has changed depth
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3359 (if (or do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3360 (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
3361 (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
3362 (= (allout-recent-depth) (+ starting-depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3363 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
3364 (allout-rebullet-heading nil nil nil nil t))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3365 ;; Now rectify numbering of new siblings of the adjusted topic,
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3366 ;; if depth has been changed:
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3367 (progn (goto-char starting-point)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3368 (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
3369 (allout-rebullet-heading nil nil nil nil t)))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3370 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3371 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3372 ;;;_ > 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
3373 (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
3374 "Renumber siblings at current depth.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3375
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3376 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
3377
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3378 Returns final depth."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3379
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3380 ;; 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
3381 ;; 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
3382
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3383 (let ((ascender (allout-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3384 was-eobp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3385 (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
3386 (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
3387 (>= (allout-recent-depth) depth)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3388 (>= ascender depth))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3389 ; Skip over all topics at
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3390 ; lesser depths, which can not
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3391 ; have been disturbed:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3392 (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
3393 (> (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
3394 (allout-next-heading))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3395 ; 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
3396 (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
3397 (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
3398 (allout-rebullet-heading nil ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3399 nil ;;; depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3400 nil ;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3401 nil ;;; index
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3402 t)) ;;; do-successors
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3403 (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
3404 (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
3405 ;;;_ > 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
3406 (defun allout-number-siblings (&optional denumber)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3407 "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
3408
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3409 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
3410 topic and its siblings.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3411
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3412 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
3413 rebulleting each topic at this level."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3414
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3415 (interactive "P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3416
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3417 (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
3418 (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
3419 (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
3420 (let ((depth (allout-recent-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3421 (index (if (not denumber) 1))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3422 (use-bullet (equal '(16) denumber))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3423 (more t))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3424 (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
3425 (allout-rebullet-heading use-bullet ;;; solicit
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3426 depth ;;; depth
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3427 t ;;; number-control
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3428 index ;;; index
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3429 nil) ;;; do-successors
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3430 (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
3431 (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
3432 ;;;_ > 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
3433 (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
3434 "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
3435
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3436 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
3437 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
3438 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
3439 depth, however."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3440 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3441 (if (> arg 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3442 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3443 (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
3444 (if (not (bobp))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3445 (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
3446 (start-point (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3447 (predecessor-depth (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3448 (forward-char -1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3449 (allout-goto-prefix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3450 (if (< (point) start-point)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3451 (allout-recent-depth)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3452 0))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3453 (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
3454 (> (+ current-depth arg)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3455 (1+ predecessor-depth)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3456 (error (concat "Disallowed shift deeper than"
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3457 " containing topic's children.")))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3458 (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
3459 ;;;_ > 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
3460 (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
3461 "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
3462
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3463 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
3464 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
3465 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
3466 depth, however."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3467 (interactive "p")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3468 (if (< arg 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3469 (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
3470 (allout-rebullet-topic (* arg -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3471 ;;;_ : 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
3472 ;;;_ > 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
3473 (defun allout-kill-line (&optional arg)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3474 "Kill line, adjusting subsequent lines suitably for outline mode."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3475
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3476 (interactive "*P")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3477
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3478 (if (or (not (allout-mode-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3479 (not (bolp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3480 (not (looking-at allout-regexp)))
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
3481 ;; Just do a regular kill:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3482 (kill-line arg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3483 ;; Ah, have to watch out for adjustments:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3484 (let* ((beg (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3485 (beg-hidden (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3486 (end-hidden (save-excursion (allout-end-of-current-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3487 (allout-hidden-p)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3488 (depth (allout-depth))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3489 (collapsed (allout-current-topic-collapsed-p)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3490
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3491 (if collapsed
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3492 (put-text-property beg (1+ beg) 'allout-was-collapsed t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3493 (remove-text-properties beg (1+ beg) '(allout-was-collapsed t)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3494
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3495 (if (and (not beg-hidden) (not end-hidden))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3496 (allout-unprotected (kill-line arg))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3497 (kill-line arg))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3498 ; Provide some feedback:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3499 (sit-for 0)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3500 (if allout-numbered-bullet
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3501 (save-excursion ; Renumber subsequent topics if needed:
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3502 (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
3503 (allout-next-heading))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3504 (allout-renumber-to-depth depth))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3505 ;;;_ > 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
3506 (defun allout-kill-topic ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3507 "Kill topic together with subtopics.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3508
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3509 Trailing whitespace is killed with a topic if that whitespace:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3510
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3511 - would separate the topic from a subsequent sibling
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3512 - would separate the topic from the end of buffer
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3513 - would not be added to whitespace already separating the topic from the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3514 previous one.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3515
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3516 Completely collapsed topics are marked as such, for re-collapse
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3517 when yank with allout-yank into an outline as a heading."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3518
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3519 ;; Some finagling is done to make complex topic kills appear faster
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3520 ;; than they actually are. A redisplay is performed immediately
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3521 ;; after the region is deleted, though the renumbering process
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3522 ;; has yet to be performed. This means that there may appear to be
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3523 ;; a lag *after* a kill has been performed.
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3524
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3525 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3526 (let* ((collapsed (allout-current-topic-collapsed-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3527 (beg (prog1 (allout-back-to-current-heading) (beginning-of-line)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3528 (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
3529 (allout-end-of-current-subtree)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3530 (if (and (/= (current-column) 0) (not (eobp)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3531 (forward-char 1))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3532 (if (not (eobp))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3533 (if (and (looking-at "\n")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3534 (or (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3535 (or (not (allout-next-heading))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3536 (= depth (allout-recent-depth))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3537 (and (> (- beg (point-min)) 3)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3538 (string= (buffer-substring (- beg 2) beg) "\n\n"))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3539 (forward-char 1)))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3540
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3541 (if collapsed
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3542 (put-text-property beg (1+ beg) 'allout-was-collapsed t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3543 (remove-text-properties beg (1+ beg) '(allout-was-collapsed t)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3544 (allout-unprotected (kill-region beg (point)))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3545 (sit-for 0)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3546 (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
3547 (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
3548 ;;;_ > 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
3549 (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
3550
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3551 "Incidental allout-specific business to be done just after text yanks.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3552
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3553 Does depth adjustment of yanked topics, when:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3554
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3555 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
3556 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
3557 topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3558
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
3559 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
3560
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3561 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
3562 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
3563 header into which it's being yanked.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3564
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3565 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
3566 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
3567 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
3568
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3569 (interactive "*P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3570 ; Get to beginning, leaving
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3571 ; region around subject:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3572 (if (< (allout-mark-marker t) (point))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3573 (exchange-point-and-mark))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3574 (let* ((subj-beg (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3575 (into-bol (bolp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3576 (subj-end (allout-mark-marker t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3577 (was-collapsed (get-text-property subj-beg 'allout-was-collapsed))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3578 ;; '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
3579 (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
3580 (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
3581 (allout-prefix-data (match-beginning 1)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3582 (match-end 1))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3583 ;; `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
3584 ;; 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
3585 (rectify-numbering (or resituate
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3586 (and into-bol (looking-at allout-regexp)))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3587 (if resituate
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3588 ; The yanked stuff is a topic:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3589 (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
3590 (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
3591 (prefix-bullet (allout-recent-bullet))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3592 (adjust-to-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3593 ;; 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
3594 ;; adjustment should be made:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3595 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3596 (and (goto-char subj-end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3597 (eolp)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3598 (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
3599 (and (looking-at allout-regexp)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3600 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3601 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3602 (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
3603 (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
3604 (allout-prefix-data (match-beginning 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3605 (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
3606 (allout-recent-depth))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3607 (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
3608 (setq rectify-numbering allout-numbered-bullet)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3609 (if adjust-to-depth
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3610 ; Do the adjustment:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3611 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3612 (message "... yanking") (sit-for 0)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3613 (save-restriction
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3614 (narrow-to-region subj-beg subj-end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3615 ; Trim off excessive blank
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3616 ; line at end, if any:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3617 (goto-char (point-max))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3618 (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
3619 (allout-unprotected (delete-char -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3620 ; Work backwards, with each
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3621 ; shallowest level,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3622 ; successively excluding the
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3623 ; last processed topic from
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3624 ; the narrow region:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3625 (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
3626 (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3627 ; 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
3628 (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
3629 (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
3630 (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
3631 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
3632 (allout-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3633 (if (setq more (not (bobp)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3634 (progn (widen)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3635 (forward-char -1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3636 (narrow-to-region subj-beg (point))))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3637 (message "")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3638 ;; 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
3639 ;; use old one:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3640 (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
3641 allout-distinctive-bullets-string)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3642 ; Delete from bullet of old to
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3643 ; before bullet of new:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3644 (progn
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3645 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3646 (delete-region (point) subj-beg)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3647 (set-marker (allout-mark-marker t) subj-end)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3648 (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
3649 (allout-end-of-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3650 ; Delete base subj prefix,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3651 ; leaving old one:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3652 (delete-region (point) (+ (point)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3653 prefix-len
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3654 (- adjust-to-depth subj-depth)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3655 ; and delete residual subj
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3656 ; prefix digits and space:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3657 (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
3658 (if (looking-at " ") (delete-char 1))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3659 (exchange-point-and-mark))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3660 (if rectify-numbering
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3661 (progn
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3662 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3663 ; Give some preliminary feedback:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3664 (message "... reconciling numbers") (sit-for 0)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3665 ; ... and renumber, in case necessary:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3666 (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
3667 (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
3668 (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
3669 (allout-depth) ;;; depth
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3670 nil ;;; number-control
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3671 nil ;;; index
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3672 t))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3673 (message ""))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3674 (when (and (or into-bol resituate) was-collapsed)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3675 (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3676 (allout-hide-current-subtree))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3677 (if (not resituate)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3678 (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
3679 ;;;_ > 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
3680 (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
3681 "`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
3682
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
3683 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
3684
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3685 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
3686 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
3687
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3688 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
3689 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
3690 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
3691 topic prefix.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3692
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3693 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
3694 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
3695 header into which it's being yanked.
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 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
3698 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
3699 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
3700 exactly like normal yanks.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3701
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
3702 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
3703 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
3704
64283
d57ad48e7901 (my-mark-marker, allout-isearch-prior-pos, allout-unprotected,
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
3705 `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
3706 works with normal `yank' in non-outline buffers."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3707
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3708 (interactive "*P")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3709 (setq this-command 'yank)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3710 (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
3711 (if (allout-mode-p)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3712 (allout-yank-processing))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3713 )
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3714 ;;;_ > allout-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
3715 (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
3716 "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
3717
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3718 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
3719
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3720 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
3721 by pops to non-distinctive yanks. Bug..."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3722
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3723 (interactive "*p")
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3724 (setq this-command 'yank)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3725 (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
3726 (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
3727 (allout-yank-processing)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3728
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3729 ;;;_ - Specialty bullet functions
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3730 ;;;_ : 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
3731 ;;;_ > 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
3732 (defun allout-resolve-xref ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3733 "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
3734
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3735 \(Works according to setting of `allout-file-xref-bullet')."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3736 (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
3737 (if (not allout-file-xref-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3738 (error
64428
e55dd693f95b (allout-resolve-xref): Fix typos in error strings.
Juanma Barranquero <lekktu@gmail.com>
parents: 64400
diff changeset
3739 "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
3740 (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
3741 (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
3742 allout-file-xref-bullet)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3743 (let (file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3744 (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
3745 (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
3746 (heading-end (progn (end-of-line) (point))))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3747 (goto-char text-start)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3748 (setq file-name
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3749 (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3750 (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
3751 (setq file-name (expand-file-name file-name))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3752 (if (or (file-exists-p file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3753 (if (file-writable-p file-name)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3754 (y-or-n-p (format "%s not there, create one? "
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3755 file-name))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3756 (error "%s not found and can't be created" file-name)))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3757 (condition-case failure
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3758 (find-file-other-window file-name)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3759 ('error failure))
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3760 (error "%s not found" file-name))
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3761 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3762 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3763 )
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3764 )
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3765
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3766 ;;;_ #6 Exposure Control
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3767
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3768 ;;;_ - Fundamental
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3769 ;;;_ > 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
3770 (defun allout-flag-region (from to flag)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3771 "Conceal text from FROM to TO if FLAG is non-nil, else reveal it.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3772
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3773 Text is shown if flag is nil and hidden otherwise."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3774 ;; We use outline invisibility spec.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3775 (remove-overlays from to 'category 'allout-overlay-category)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3776 (when flag
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3777 (let ((o (make-overlay from to)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3778 (overlay-put o 'category 'allout-overlay-category)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3779 (when (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3780 (let ((props (symbol-plist 'allout-overlay-category)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3781 (while props
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3782 (overlay-put o (pop props) (pop props)))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3783 (run-hooks 'allout-view-change-hook))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3784 ;;;_ > 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
3785 (defun allout-flag-current-subtree (flag)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3786 "Conceal currently-visible topic's subtree if FLAG non-nil, else reveal it."
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3787
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3788 (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
3789 (allout-back-to-current-heading)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3790 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3791 (allout-flag-region (point)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3792 ;; Exposing must not leave trailing blanks hidden,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3793 ;; but can leave them exposed when hiding, so we
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3794 ;; can use flag's inverse as the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3795 ;; include-trailing-blank cue:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3796 (allout-end-of-current-subtree (not flag))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3797 flag)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3798
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3799 ;;;_ - Topic-specific
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3800 ;;;_ > allout-show-entry (&optional inclusive)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3801 (defun allout-show-entry (&optional inclusive)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3802 "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
3803
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3804 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
3805 expense of exposing its context, but can leave the outline with aberrant
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3806 exposure. `allout-show-offshoot' should be used after the peek to rectify
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3807 the exposure."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3808
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3809 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3810 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3811 (let (beg end)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3812 (allout-goto-prefix)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3813 (setq beg (if (allout-hidden-p) (1- (point)) (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3814 (setq end (allout-pre-next-prefix))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3815 (allout-flag-region beg end nil)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
3816 (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
3817 ;;;_ > 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
3818 (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
3819
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3820 "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
3821
48857
8641226163f1 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48856
diff changeset
3822 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
3823
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3824 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
3825 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
3826
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3827 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
3828 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
3829 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
3830 it.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3831
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3832 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
3833 point of non-opened subtree?)"
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3834
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3835 (interactive "p")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3836 (let ((start-point (point)))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3837 (if (and (not strict)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3838 (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3839
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3840 (progn (allout-show-to-offshoot) ; Point's concealed, open to
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3841 ; expose it.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3842 ;; Then recurse, but with "strict" set so we don't
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3843 ;; infinite regress:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3844 (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
3845
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3846 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3847 (allout-beginning-of-current-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3848 (save-restriction
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3849 (let* ((chart (allout-chart-subtree (or level 1)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3850 (to-reveal (allout-chart-to-reveal chart (or level 1))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3851 (goto-char start-point)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3852 (when (and strict (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3853 ;; Concealed root would already have been taken care of,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3854 ;; unless strict was set.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3855 (allout-flag-region (point) (allout-snug-back) nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3856 (when allout-show-bodies
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3857 (goto-char (car to-reveal))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3858 (allout-show-current-entry)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3859 (while to-reveal
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3860 (goto-char (car to-reveal))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3861 (allout-flag-region (save-excursion (allout-snug-back) (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3862 (progn (search-forward "\n" nil t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3863 (1- (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3864 nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3865 (when allout-show-bodies
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3866 (goto-char (car to-reveal))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3867 (allout-show-current-entry))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3868 (setq to-reveal (cdr to-reveal)))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3869 ;; Compensate for `save-excursion's maintenance of point
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3870 ;; within invisible text:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3871 (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
3872 ;;;_ > 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
3873 (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
3874 "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
3875
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3876 Useful for coherently exposing to a random point in a hidden region."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3877 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3878 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3879 (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
3880 (orig-pref (allout-goto-prefix))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3881 (last-at (point))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3882 bag-it)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3883 (while (or bag-it (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3884 (while (allout-hidden-p)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3885 ;; XXX We would use `(move-beginning-of-line 1)', but it gets
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3886 ;; stuck on hidden newlines at column 80, as of GNU Emacs 22.0.50.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3887 (beginning-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3888 (if (allout-hidden-p) (forward-char -1)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3889 (if (= last-at (setq last-at (point)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3890 ;; 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
3891 ;; topic completely, and bag this try.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3892 (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
3893 (allout-show-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3894 (goto-char orig-pt)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3895 (setq bag-it t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3896 (beep)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3897 (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
3898 "allout-show-to-offshoot: "
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3899 "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
3900 (allout-show-children)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3901 (goto-char orig-pref))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3902 (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
3903 (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
3904 (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
3905 ;;;_ > 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
3906 (defun allout-hide-current-entry ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3907 "Hide the body directly following this heading."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3908 (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
3909 (allout-back-to-current-heading)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3910 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3911 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3912 (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
3913 (progn (allout-end-of-entry) (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3914 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
3915 ;;;_ > 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
3916 (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
3917
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3918 "Show body following current heading, or hide entry with universal argument."
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3919
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3920 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3921 (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
3922 (allout-hide-current-entry)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3923 (save-excursion (allout-show-to-offshoot))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3924 (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
3925 (allout-flag-region (point)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3926 (progn (allout-end-of-entry t) (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3927 nil)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
3928 )))
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-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
3930 (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
3931 "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
3932 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
3933 (interactive "P")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3934 (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
3935 (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
3936 ;; 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
3937 (if (not (allout-next-heading))
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
3938 (error "No topics")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3939 ;; 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
3940 (message "Above outermost topic - exposing all.")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3941 (allout-flag-region (point-min)(point-max) nil))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3942 (allout-beginning-of-current-line)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3943 (if (not arg)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3944 (allout-flag-current-subtree nil)
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3945 (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
3946 (allout-expose-topic '(* :))))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3947 ;;;_ > allout-current-topic-collapsed-p (&optional include-single-liners)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3948 (defun allout-current-topic-collapsed-p (&optional include-single-liners)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3949 "True if the currently visible containing topic is already collapsed.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3950
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3951 If optional INCLUDE-SINGLE-LINERS is true, then include single-line
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3952 topics \(which intrinsically can be considered both collapsed and
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3953 not\), as collapsed. Otherwise they are considered uncollapsed."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3954 (save-excursion
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
3955 (and
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3956 (= (progn (allout-back-to-current-heading)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3957 (move-end-of-line 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3958 (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3959 (allout-end-of-current-subtree))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3960 (or include-single-liners
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3961 (progn (backward-char 1) (allout-hidden-p))))))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
3962 ;;;_ > 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
3963 (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
3964 "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
3965
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3966 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
3967 and its siblings.
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3968
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3969 If optional arg JUST-CLOSE is non-nil, do not close the parent or
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
3970 siblings, even if the target topic is already closed."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3971
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3972 (interactive)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3973 (let* ((from (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3974 (sibs-msg "Top-level topic already closed - closing siblings...")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3975 (current-exposed (not (allout-current-topic-collapsed-p t))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3976 (cond (current-exposed (allout-flag-current-subtree t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3977 (just-close nil)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3978 ((allout-up-current-level 1 t) (allout-hide-current-subtree))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3979 (t (goto-char 0)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3980 (message sibs-msg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3981 (allout-expose-topic '(0 :))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3982 (message (concat sibs-msg " Done."))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3983 (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
3984 ;;;_ > 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
3985 (defun allout-show-current-branches ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3986 "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
3987 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3988 (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
3989 (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
3990 ;;;_ > 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
3991 (defun allout-hide-current-leaves ()
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
3992 "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
3993 (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
3994 (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
3995 (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
3996 (point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3997
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
3998 ;;;_ - 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
3999 ;;;_ > 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
4000 (defun allout-show-all ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4001 "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
4002 (interactive)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4003 (message "Exposing entire buffer...")
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4004 (allout-flag-region (point-min) (point-max) nil)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4005 (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
4006 ;;;_ > 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
4007 (defun allout-hide-bodies ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4008 "Hide all of buffer except headings."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4009 (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
4010 (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
4011 ;;;_ > 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
4012 (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
4013 "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
4014 (save-excursion
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4015 (save-restriction
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4016 (narrow-to-region start end)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4017 (goto-char (point-min))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4018 (while (not (eobp))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4019 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4020 (allout-flag-region (point) (allout-end-of-entry) t)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4021 (if (not (eobp))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4022 (forward-char
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4023 (if (looking-at "\n\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4024 2 1)))))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4025
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4026 ;;;_ > 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
4027 (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
4028 "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
4029
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4030 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
4031 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
4032 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
4033 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
4034
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4035 Cursor is left at start position.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4036
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4037 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
4038
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4039 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
4040
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4041 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
4042 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
4043
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4044 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
4045 subtopics of the current topic.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4046
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4047 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
4048 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
4049 explicit specs following the `:'.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4050
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4051 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
4052
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4053 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
4054 - 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
4055 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
4056 that level.
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4057 - 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
4058 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
4059 - 0 means to close topic - hide all offspring.
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4060 : - `repeat'
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4061 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
4062 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
4063 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
4064 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
4065 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
4066 * - 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
4067 + - 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
4068 - - 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
4069
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4070 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
4071 \(allout-expose-topic '(-1 : 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4072 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
4073 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
4074 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
4075 \(allout-expose-topic '(-1 () : 1 0))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4076 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
4077 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
4078 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
4079 \(allout-expose-topic '(-2 : -1 *))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4080 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
4081 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
4082 last and completely open the last one."
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4083
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4084 (interactive "xExposure spec: ")
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4085 (if (not (listp spec))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4086 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
4087 (let ((depth (allout-depth))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4088 (max-pos 0)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4089 prev-elem curr-elem
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4090 stay)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4091 (while spec
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4092 (setq prev-elem curr-elem
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4093 curr-elem (car spec)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4094 spec (cdr spec))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4095 (cond ; Do current element:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4096 ((null curr-elem) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4097 ((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
4098 (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
4099 (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
4100 (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
4101 ((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
4102 (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
4103 (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
4104 ((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
4105 ((eq curr-elem ':)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4106 (setq stay t)
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4107 ;; 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
4108 ;; w.r.t. remaining siblings:
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4109 (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
4110 ;; 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
4111 (- (length (allout-chart-siblings))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4112 (length spec))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4113 (if (< 0 residue)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4114 ;; 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
4115 (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
4116 spec)))))))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4117 ((numberp curr-elem)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4118 (if (and (>= 0 curr-elem) (not (allout-hidden-p)))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4119 (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
4120 (if (> 0 curr-elem)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4121 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
4122 (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
4123 (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
4124 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
4125 (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
4126 (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
4127 (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
4128 (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
4129 ((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
4130 (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
4131 (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
4132 (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
4133 (cond (stay (setq stay nil))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4134 ((listp (car spec)) nil)
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4135 ((> max-pos (point))
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4136 ;; 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
4137 (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
4138 (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
4139 ((allout-next-sibling depth))))
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4140 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
4141 ;;;_ > 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
4142 (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
4143
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4144 "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
4145 format) instead.
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4146
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4147 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
4148
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4149 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
4150 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
4151
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4152 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
4153 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
4154 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
4155 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
4156 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
4157
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4158 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
4159
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4160 - 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
4161 - 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
4162 absolute value of the number.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4163 - 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
4164 - 0 just closes
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4165 - `*' completely opens the topic, including bodies.
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4166 - `+' shows all the sub headers, but not the bodies
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
4167 - `-' 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
4168
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4169 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
4170 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
4171 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
4172 for the corresponding offspring of the topic.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4173
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4174 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
4175
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4176 (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
4177 (let ((depth (allout-current-depth))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4178 max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4179 (cond ((null spec) nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4180 ((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
4181 (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
4182 (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
4183 (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
4184 ((numberp spec)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4185 (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
4186 (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
4187 (end-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4188 (if (or (not max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4189 (> (point) max-pos))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4190 (setq max-pos (point)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4191 (if (> 0 spec)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4192 (setq spec (* -1 spec)))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4193 (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
4194 (allout-show-children spec)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4195 ((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
4196 ;(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
4197 ; (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
4198 ; (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
4199 (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
4200 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
4201 (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
4202 (setq spec (cdr spec))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4203 (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
4204 (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
4205 (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
4206 (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
4207 (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
4208 (setq max-pos got)))))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4209 (while (and followers
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4210 (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
4211 (progn (goto-char max-pos)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4212 (setq max-pos nil)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4213 (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
4214 (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
4215 (allout-old-expose-topic (car followers))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4216 (setq followers (cdr followers)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4217 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
4218 ;;;_ > 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
4219 (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
4220 "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
4221 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
4222 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
4223
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4224 Cursor is left at start position.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4225
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4226 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
4227
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4228 Examples:
61969
38ca28ee68d6 (allout-exposure): Remove macro and obsolete declaration.
Nick Roberts <nickrob@snap.net.nz>
parents: 59996
diff changeset
4229 \(allout-new-exposure (-1 () () () 1) 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4230 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
4231 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
4232 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
4233 \(allout-new-exposure : -1 0)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4234 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
4235 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
4236 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
4237 \(allout-new-exposure -2 : -1 *)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4238 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
4239 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
4240 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
4241 (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
4242 '(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
4243 (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
4244 (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
4245 (list 'allout-expose-topic (list 'quote spec))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4246
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4247 ;;;_ #7 Systematic outline presentation - copying, printing, flattening
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4248
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4249 ;;;_ - Mapping and processing of topics
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4250 ;;;_ ( 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
4251 ;;;_ > 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
4252 (defun allout-stringify-flat-index (flat-index &optional context)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4253 "Convert list representing section/subsection/... to document string.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4254
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4255 Optional arg CONTEXT indicates interior levels to include."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4256 (let ((delim ".")
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
4257 result
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4258 numstr
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4259 (context-depth (or (and context 2) 1)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4260 ;; Take care of the explicit context:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4261 (while (> context-depth 0)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4262 (setq numstr (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4263 flat-index (cdr flat-index)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4264 result (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4265 (cons delim (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4266 (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4267 context-depth (if flat-index (1- context-depth) 0)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4268 (setq delim " ")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4269 ;; Take care of the indentation:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4270 (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4271 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4272 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4273 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4274 (cons delim
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4275 (cons (make-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4276 (1+ (truncate (if (zerop (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4277 1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4278 (log10 (car flat-index)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4279 ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4280 result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4281 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4282 ;; Dispose of single extra delim:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4283 (setq result (cdr result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4284 (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
4285 ;;;_ > 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
4286 (defun allout-stringify-flat-index-plain (flat-index)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4287 "Convert list representing section/subsection/... to document string."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4288 (let ((delim ".")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4289 result)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4290 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4291 (setq result (cons (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4292 (if result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4293 (cons delim result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4294 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4295 (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
4296 ;;;_ > 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
4297 (defun allout-stringify-flat-index-indented (flat-index)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4298 "Convert list representing section/subsection/... to document string."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4299 (let ((delim ".")
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
4300 result
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4301 numstr)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4302 ;; Take care of the explicit context:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4303 (setq numstr (int-to-string (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4304 flat-index (cdr flat-index)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4305 result (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4306 (cons delim (cons numstr result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4307 (cons numstr result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4308 (setq delim " ")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4309 ;; Take care of the indentation:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4310 (if flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4311 (progn
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4312 (while flat-index
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4313 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4314 (cons delim
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4315 (cons (make-string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4316 (1+ (truncate (if (zerop (car flat-index))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4317 1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4318 (log10 (car flat-index)))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4319 ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4320 result)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4321 (setq flat-index (cdr flat-index)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4322 ;; Dispose of single extra delim:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4323 (setq result (cdr result))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4324 (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
4325 ;;;_ > 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
4326 (defun allout-listify-exposed (&optional start end format)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4327
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4328 "Produce a list representing exposed topics in current region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4329
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4330 This list can then be used by `allout-process-exposed' to manipulate
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4331 the subject region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4332
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4333 Optional START and END indicate bounds of region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4334
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4335 optional arg, FORMAT, designates an alternate presentation form for
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4336 the prefix:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4337
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4338 list - Present prefix as numeric section.subsection..., starting with
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4339 section indicated by the list, innermost nesting first.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4340 `indent' \(symbol) - Convert header prefixes to all white space,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4341 except for distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4342
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4343 The elements of the list produced are lists that represents a topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4344 header and body. The elements of that list are:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4345
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4346 - a number representing the depth of the topic,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4347 - a string representing the header-prefix, including trailing whitespace and
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4348 bullet.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4349 - a string representing the bullet character,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4350 - and a series of strings, each containing one line of the exposed
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4351 portion of the topic entry."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4352
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4353 (interactive "r")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4354 (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4355 (let*
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4356 ;; state vars:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4357 (strings prefix result depth new-depth out gone-out bullet beg
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4358 next done)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4359
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4360 (goto-char start)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4361 (beginning-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4362 ;; 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
4363 (if (> (allout-goto-prefix) start)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4364 ;; First topic follows beginning point - register preliminary stuff:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4365 (setq result (list (list 0 "" nil
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4366 (buffer-substring start (1- (point)))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4367 (while (and (not done)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4368 (not (eobp)) ; Loop until we've covered the region.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4369 (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
4370 (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
4371 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
4372 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
4373 beg (progn (allout-end-of-prefix t) (point))) ; and beginning.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4374 (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
4375 (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
4376 (setq new-depth (allout-recent-depth))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4377 (setq gone-out out
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4378 out (< new-depth depth))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4379 (beginning-of-line)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4380 (setq next (point))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4381 (goto-char beg)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4382 (setq strings nil)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4383 (while (> next (point)) ; Get all the exposed text in
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4384 (setq strings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4385 (cons (buffer-substring
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4386 beg
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4387 ;To hidden text or end of line:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4388 (progn
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4389 (end-of-line)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4390 (allout-back-to-visible-text)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4391 strings))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4392 (when (< (point) next) ; Resume from after hid text, if any.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4393 (line-move 1))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4394 (setq beg (point)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4395 ;; Accumulate list for this topic:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4396 (setq strings (nreverse strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4397 (setq result
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4398 (cons
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4399 (if format
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4400 (let ((special (if (string-match
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4401 (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
4402 allout-distinctive-bullets-string)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4403 bullet)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4404 (cond ((listp format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4405 (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
4406 (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
4407 (allout-stringify-flat-index format
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4408 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
4409 (allout-stringify-flat-index-plain
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4410 format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4411 strings
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4412 special))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4413 ((eq format 'indent)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4414 (if special
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4415 (list depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4416 (concat (make-string (1+ depth) ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4417 (substring prefix -1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4418 strings)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4419 (list depth
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4420 (make-string depth ? )
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4421 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
4422 (t (error "allout-listify-exposed: %s %s"
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4423 "invalid format" format))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4424 (list depth prefix strings))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4425 result))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4426 ;; Reasses format, if any:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4427 (if (and format (listp format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4428 (cond ((= new-depth depth)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4429 (setq format (cons (1+ (car format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4430 (cdr format))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4431 ((> new-depth depth) ; descending - assume by 1:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4432 (setq format (cons 1 format)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4433 (t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4434 ; Pop the residue:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4435 (while (< new-depth depth)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4436 (setq format (cdr format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4437 (setq depth (1- depth)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4438 ; And increment the current one:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4439 (setq format
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4440 (cons (1+ (or (car format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4441 -1))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4442 (cdr format)))))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4443 ;; Put the list with first at front, to last at back:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4444 (nreverse result))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4445 ;;;_ > my-region-active-p ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4446 (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
4447 (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
4448 '(region-active-p)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4449 '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
4450 ;;;_ > allout-process-exposed (&optional func from to frombuf
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4451 ;;; 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
4452 (defun allout-process-exposed (&optional func from to frombuf tobuf
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4453 format start-num)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4454 "Map function on exposed parts of current topic; results to another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4455
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4456 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
4457
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4458 Apply FUNCTION to exposed portions FROM position TO position in buffer
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4459 FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4460 alternate presentation form:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4461
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4462 `flat' - Present prefix as numeric section.subsection..., starting with
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4463 section indicated by the start-num, innermost nesting first.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4464 X`flat-indented' - Prefix is like `flat' for first topic at each
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4465 X level, but subsequent topics have only leaf topic
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4466 X number, padded with blanks to line up with first.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4467 `indent' \(symbol) - Convert header prefixes to all white space,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4468 except for distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4469
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4470 Defaults:
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4471 FUNCTION: `allout-insert-listified'
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4472 FROM: region start, if region active, else start of buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4473 TO: region end, if region active, else end of buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4474 FROMBUF: current buffer
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4475 TOBUF: buffer name derived: \"*current-buffer-name exposed*\"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4476 FORMAT: nil"
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4477
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4478 ; Resolve arguments,
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4479 ; 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
4480 (if (not func) (setq func 'allout-insert-listified))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4481 (if (not (and from to))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4482 (if (my-region-active-p)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4483 (setq from (region-beginning) to (region-end))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4484 (setq from (point-min) to (point-max))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4485 (if frombuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4486 (if (not (bufferp frombuf))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4487 ;; Specified but not a buffer - get it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4488 (let ((got (get-buffer frombuf)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4489 (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
4490 (error (concat "allout-process-exposed: source buffer "
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4491 frombuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4492 " not found."))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4493 (setq frombuf got))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4494 ;; not specified - default it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4495 (setq frombuf (current-buffer)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4496 (if tobuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4497 (if (not (bufferp tobuf))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4498 (setq tobuf (get-buffer-create tobuf)))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4499 ;; not specified - default it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4500 (setq tobuf (concat "*" (buffer-name frombuf) " exposed*")))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4501 (if (listp format)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4502 (nreverse format))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4503
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4504 (let* ((listified
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4505 (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
4506 (allout-listify-exposed from to format))))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4507 (set-buffer tobuf)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4508 (mapcar func listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4509 (pop-to-buffer tobuf)))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4510
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4511 ;;;_ - 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
4512 ;;;_ > 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
4513 (defun allout-insert-listified (listified)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4514 "Insert contents of listified outline portion in current buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4515
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4516 LISTIFIED is a list representing each topic header and body:
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4517
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4518 \`(depth prefix text)'
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4519
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4520 or \`(depth prefix text bullet-plus)'
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4521
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4522 If `bullet-plus' is specified, it is inserted just after the entire prefix."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4523 (setq listified (cdr listified))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4524 (let ((prefix (prog1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4525 (car listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4526 (setq listified (cdr listified))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4527 (text (prog1
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4528 (car listified)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4529 (setq listified (cdr listified))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4530 (bullet-plus (car listified)))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4531 (insert prefix)
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4532 (if bullet-plus (insert (concat " " bullet-plus)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4533 (while text
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4534 (insert (car text))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4535 (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
4536 (insert "\n")))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4537 (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
4538 ;;;_ > 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
4539 (defun allout-copy-exposed-to-buffer (&optional arg tobuf format)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4540 "Duplicate exposed portions of current outline to another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4541
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4542 Other buffer has current buffers name with \" exposed\" appended to it.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4543
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4544 With repeat count, copy the exposed parts of only the current topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4545
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4546 Optional second arg TOBUF is target buffer name.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4547
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4548 Optional third arg FORMAT, if non-nil, symbolically designates an
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4549 alternate presentation format for the outline:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4550
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4551 `flat' - Convert topic header prefixes to numeric
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4552 section.subsection... identifiers.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4553 `indent' - Convert header prefixes to all white space, except for
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4554 distinctive bullets.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4555 `indent-flat' - The best of both - only the first of each level has
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4556 the full path, the rest have only the section number
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4557 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
4558
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4559 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4560 (if (not tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4561 (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
4562 (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
4563 (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
4564 (end (if arg (allout-end-of-current-subtree) (point-max)))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4565 (buf (current-buffer))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4566 (start-list ()))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4567 (if (eq format 'flat)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4568 (setq format (if arg (save-excursion
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4569 (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
4570 (allout-topic-flat-index))
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4571 '(1))))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4572 (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
4573 (allout-process-exposed 'allout-insert-listified
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4574 beg
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4575 end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4576 (current-buffer)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4577 tobuf
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4578 format start-list)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4579 (goto-char (point-min))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4580 (pop-to-buffer buf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4581 (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
4582 ;;;_ > 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
4583 (defun allout-flatten-exposed-to-buffer (&optional arg tobuf)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4584 "Present numeric outline of outline's exposed portions in another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4585
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4586 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
4587 `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
4588
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4589 Use `allout-indented-exposed-to-buffer' for indented presentation.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4590
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4591 With repeat count, copy the exposed portions of only current topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4592
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4593 Other buffer has current buffer's name with \" exposed\" appended to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4594 it, unless optional second arg TOBUF is specified, in which case it is
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4595 used verbatim."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4596 (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
4597 (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
4598 ;;;_ > 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
4599 (defun allout-indented-exposed-to-buffer (&optional arg tobuf)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4600 "Present indented outline of outline's exposed portions in another buffer.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4601
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4602 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
4603 `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
4604
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4605 Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation.
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4606
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4607 With repeat count, copy the exposed portions of only current topic.
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4608
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4609 Other buffer has current buffer's name with \" exposed\" appended to
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4610 it, unless optional second arg TOBUF is specified, in which case it is
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4611 used verbatim."
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4612 (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
4613 (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
4614
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4615 ;;;_ - 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
4616 ;;;_ > 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
4617 (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
4618 "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
4619 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
4620 string across LaTeX processing."
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4621 (mapconcat (function
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4622 (lambda (char)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4623 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4624 (concat "\\char" (number-to-string char) "{}"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4625 ((= char ?\n) "\\\\")
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4626 (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
4627 string
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4628 ""))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4629 ;;;_ > 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
4630 (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
4631 "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
4632
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
4633 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
4634 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
4635 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
4636 (beginning-of-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4637 (let ((beg (point))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4638 (end (progn (end-of-line)(point))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4639 (goto-char beg)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4640 (while (re-search-forward "\\\\"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4641 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4642 end ; bounded by end-of-line
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4643 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
4644 (goto-char (match-beginning 0))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4645 (insert "\\")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4646 (setq end (1+ end))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4647 (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
4648 ;;;_ > 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
4649 (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
4650 "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
4651 ;; 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
4652 ;; 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
4653 (set-buffer buffer)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4654 (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
4655 "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
4656 (page-numbering (if allout-number-pages
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4657 "\\pagestyle{empty}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4658 ""))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4659 (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
4660 allout-title-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4661 (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
4662 allout-label-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4663 (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
4664 allout-head-line-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4665 (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
4666 allout-body-line-style))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4667 (setlength (format "%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4668 "\\newlength{\\stepsize}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4669 "\\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
4670 allout-indent
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4671 "}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4672 (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
4673 "\\newcommand{\\OneHeadLine}[3]{%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4674 "\\noindent%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4675 "\\hspace*{#2\\stepsize}%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4676 "\\labelcmd{#1}\\hspace*{.2cm}"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4677 "\\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
4678 allout-line-skip
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4679 "]\n}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4680 (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
4681 "\\newcommand{\\OneBodyLine}[2]{%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4682 "\\noindent%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4683 "\\hspace*{#1\\stepsize}%\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4684 "\\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
4685 allout-line-skip
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4686 "]\n}\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4687 (begindoc "\\begin{document}\n\\begin{center}\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4688 (title (format "%s%s%s%s"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4689 "\\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
4690 (allout-latex-verb-quote (if allout-title
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4691 (condition-case nil
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4692 (eval allout-title)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4693 ('error "<unnamed buffer>"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4694 "Unnamed Outline"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4695 "}\n"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4696 "\\end{center}\n\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4697 (hsize "\\hsize = 7.5 true in\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4698 (hoffset "\\hoffset = -1.5 true in\n")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4699 (vspace "\\vspace{.1cm}\n\n"))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4700 (insert (concat doc-style
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4701 page-numbering
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4702 titlecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4703 labelcmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4704 headlinecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4705 bodylinecmd
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4706 setlength
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4707 oneheadline
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4708 onebodyline
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4709 begindoc
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4710 title
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4711 hsize
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4712 hoffset
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4713 vspace)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4714 )))
55717
50b099e608af (allout-chart-subtree, allout-rebullet-topic-grunt): Don't mention in the
Juanma Barranquero <lekktu@gmail.com>
parents: 54952
diff changeset
4715 ;;;_ > 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
4716 (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
4717 "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
4718 (set-buffer buffer)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4719 (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
4720 ;;;_ > 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
4721 (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
4722 "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
4723
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
4724 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
4725 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
4726 (let* ((head-line (if text (car text)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4727 (body-lines (cdr text))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4728 (curr-line)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4729 body-content bop)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4730 ; Do the head line:
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48859
diff changeset
4731 (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
4732 (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
4733 "\1}{"
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4734 depth
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4735 "}{\\verb\1 "
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4736 (if head-line
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4737 (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
4738 "")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4739 "\1}\n"))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4740 (if (not body-lines)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4741 nil
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4742 ;;(insert "\\beginlines\n")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4743 (insert "\\begin{verbatim}\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4744 (while body-lines
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4745 (setq curr-line (car body-lines))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4746 (if (and (not body-content)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4747 (not (string-match "^\\s-*$" curr-line)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4748 (setq body-content t))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4749 ; Mangle any occurrences of
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4750 ; "\end{verbatim}" in text,
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4751 ; it's special:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4752 (if (and body-content
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4753 (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
4754 (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
4755 ">"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4756 (substring curr-line bop))))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4757 ;;(insert "|" (car body-lines) "|")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4758 (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
4759 (allout-latex-verbatim-quote-curr-line)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4760 (insert "\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4761 (setq body-lines (cdr body-lines)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4762 (if body-content
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4763 (setq body-content nil)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4764 (forward-char -1)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4765 (insert "\\ ")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4766 (forward-char 1))
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4767 ;;(insert "\\endlines\n")
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
4768 (insert "\\end{verbatim}\n")
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4769 )))
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
4770 ;;;_ > 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
4771 (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
4772 "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
4773 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
4774 with \"*\" prepended and \" latex-formed*\" appended.
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4775
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4776 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
4777
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4778 (interactive "P")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4779 (if (not tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4780 (setq tobuf
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4781 (get-buffer-create (concat "*" (buffer-name) " latexified*"))))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4782 (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
4783 (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
4784 (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
4785 (buf (current-buffer)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4786 (set-buffer tobuf)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4787 (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
4788 (allout-insert-latex-header tobuf)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4789 (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
4790 (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
4791 beg
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4792 end
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4793 buf
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4794 tobuf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4795 (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
4796 (allout-insert-latex-trailer tobuf)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4797 (goto-char (point-min))
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4798 (pop-to-buffer buf)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4799 (goto-char start-pt)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
4800
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4801 ;;;_ #8 Encryption
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4802 ;;;_ > 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
4803 (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
4804 "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
4805
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4806 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
4807 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
4808 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
4809 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
4810 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
4811
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4812 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
4813
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4814 \**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
4815 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
4816
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4817 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
4818 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
4819
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4820 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
4821 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
4822 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
4823 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
4824 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
4825 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
4826 auto-encryption specifics.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4827
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4828 \**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
4829 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
4830 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
4831
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4832 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
4833 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
4834 \\[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
4835
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4836 Passphrase Caching
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4837
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4838 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
4839 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
4840
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4841 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
4842 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
4843 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
4844 `pgg-passphrase-cache-expiry'.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4845
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4846 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
4847
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4848 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
4849 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
4850 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
4851 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
4852 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
4853 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
4854 keys.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4855
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4856 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
4857 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
4858 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
4859 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
4860 verifier across emacs sessions.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4861
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4862 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
4863 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
4864 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
4865 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
4866 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
4867 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
4868 (interactive "P")
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4869 (save-excursion
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4870 (allout-back-to-current-heading)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4871 (allout-toggle-subtree-encryption fetch-pass)
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4872 )
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4873 )
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4874 ;;;_ > 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
4875 (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
4876 "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
4877
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4878 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
4879 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
4880 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
4881 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
4882 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
4883
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4884 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
4885
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4886 \**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
4887 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
4888
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4889 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
4890
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4891 (interactive "P")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4892 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4893 (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
4894
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4895 (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
4896 (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
4897 " 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
4898
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4899 (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
4900 ;; Asses location:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4901 (after-bullet-pos (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4902 (was-encrypted
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4903 (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
4904 (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
4905 (allout-encrypted-topic-p)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4906 (was-collapsed (if (not (search-forward "\n" nil t))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4907 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4908 (backward-char 1)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4909 (allout-hidden-p)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4910 (subtree-beg (1+ (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4911 (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
4912 (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
4913 subtree-end))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4914 (subtree-end-char (char-after (1- subtree-end)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4915 (subtree-trailing-char (char-after subtree-end))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4916 ;; kluge - result-text needs to be nil, but we also want to
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4917 ;; check for the error condition
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4918 (result-text (if (or (string= "" subject-text)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4919 (string= "\n" subject-text))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4920 (error "No topic contents to %scrypt"
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4921 (if was-encrypted "de" "en"))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4922 nil))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4923 ;; Assess key parameters:
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4924 (key-info (or
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4925 ;; 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
4926 (and was-encrypted
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4927 (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
4928 (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
4929 '(keypair nil))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4930 '(symmetric nil)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4931 (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
4932 (for-key-identity (cadr key-info))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4933 (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
4934
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4935 (setq result-text
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4936 (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
4937 (current-buffer)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4938 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
4939
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4940 ;; 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
4941 (allout-unprotected
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4942 (progn
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4943 (set-buffer allout-buffer)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4944 (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
4945 (insert result-text)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4946 (if was-collapsed
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4947 (allout-flag-region (1- subtree-beg) (point) t))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4948 ;; adjust trailing-blank-lines to preserve topic spacing:
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4949 (if (not was-encrypted)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4950 (if (and (= subtree-end-char ?\n)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4951 (= subtree-trailing-char ?\n))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
4952 (insert subtree-trailing-char)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4953 ;; 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
4954 (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
4955 (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
4956 allout-topic-encryption-bullet))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4957 (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
4958 (delete-char 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4959 (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
4960 (if was-encrypted
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4961 ;; 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
4962 (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
4963 (delete-char 1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4964 ;; 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
4965 (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
4966 (insert "*"))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4967 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4968 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4969 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4970 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4971 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4972 ;;;_ > 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
4973 ;;; 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
4974 ;;; passphrase)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4975 (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
4976 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
4977 passphrase)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4978 "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
4979
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4980 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
4981
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4982 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
4983
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4984 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
4985
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4986 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
4987 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
4988
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4989 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
4990 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
4991
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4992 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
4993 for verification purposes.
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4994
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
4995 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
4996
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4997 (require 'pgg)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
4998
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
4999 (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
5000 (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
5001
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5002 (let* ((scheme (upcase
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5003 (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
5004 (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
5005 (or for-key
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5006 (split-string (read-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5007 (format "%s message recipients: "
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5008 scheme))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5009 "[ \t,]+"))))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5010 (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
5011 (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
5012 (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
5013 (buffer-name allout-buffer)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5014 (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
5015 key-type
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5016 (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
5017 target-prompt-id
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5018 (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
5019 target-prompt-id))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5020 result-text status)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5021
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5022 (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
5023 ;; 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
5024 (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
5025
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5026 (catch 'encryption-failed
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5027
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5028 ;; 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
5029 ;; doing a keypair encryption:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5030 (if (not (or passphrase
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5031 (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
5032 (not decrypt))))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5033
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5034 (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
5035 target-cache-id
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5036 target-prompt-id
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5037 key-type
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5038 allout-buffer
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5039 retried fetch-pass)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5040 (with-temp-buffer
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5041
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5042 (insert text)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5043
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5044 (cond
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5045
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5046 ;; symmetric:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5047 ((equal key-type 'symmetric)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5048 (setq status
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5049 (if decrypt
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5050
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5051 (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
5052
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5053 (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
5054 passphrase)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5055
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5056 (if status
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5057 (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
5058 ;; failed - handle passphrase caching
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5059 (if verifying
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5060 (throw 'encryption-failed nil)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5061 (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
5062 (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
5063 "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
5064
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5065 ;; encrypt 'keypair:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5066 ((not decrypt)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5067
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5068 (setq status
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 (pgg-encrypt for-key
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5071 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
5072
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5073 (if status
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5074 (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
5075 (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
5076 (error "encryption failed"))))
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 ;; decrypt 'keypair:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5079 (t
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5080
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5081 (setq status
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5082 (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
5083
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5084 (if status
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5085 (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
5086 (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
5087 (error "decryption failed"))))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5088 )
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 (setq result-text
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5091 (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
5092
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5093 ;; validate result - non-empty
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5094 (cond ((not result-text)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5095 (if verifying
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5096 nil
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5097 ;; 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
5098 (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
5099 (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
5100 (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
5101 passphrase)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5102
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5103 ;; 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
5104 ((and (not decrypt)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5105 (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
5106 result-text))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5107 (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
5108 " non-armored text - reconfigure!")))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5109
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5110 ;; 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
5111 ((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
5112 (if (or verifying decrypt)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5113 (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
5114 passphrase t))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5115 result-text)
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 ;; 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
5118 ;; 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
5119 (t
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5120 (set-buffer allout-buffer)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5121 (if passphrase
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5122 (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
5123 passphrase t))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5124 (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
5125 allout-buffer)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5126 result-text)
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 )
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5129 )
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5130 )
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5131 )
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5132 ;;;_ > 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
5133 ;;; allout-buffer retried fetch-pass)
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5134 (defun allout-obtain-passphrase (for-key cache-id prompt-id key-type
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5135 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
5136 "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
5137
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5138 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
5139 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
5140 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
5141 user for corroboration.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5142
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5143 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
5144
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5145 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
5146
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5147 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
5148
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5149 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
5150
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5151 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
5152
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5153 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
5154
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5155 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
5156 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
5157
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5158 (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
5159 ;; 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
5160 (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
5161 (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
5162 pgg-default-scheme
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5163 "GPG")))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5164 (if prompt-id
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5165 (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
5166 ""))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5167 cache-id t)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5168
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5169 ;; Symmetric hereon:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5170
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5171 (save-excursion
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5172 (set-buffer allout-buffer)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5173 (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
5174 (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
5175 (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
5176 'needed)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5177 retried)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5178 (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
5179 ""))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5180 (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
5181 (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
5182 prompt-id retry-message))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5183 (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
5184 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
5185 (prompt full-prompt)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5186 (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
5187
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5188 (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
5189 (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
5190 (got-pass (or cached
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5191 (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
5192
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5193 confirmation)
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 (if (not got-pass)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5196 nil
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5197
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5198 ;; 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
5199 ;; deactivate-passwd memory clearing:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5200 (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
5201
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5202 (cond (verifier-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5203 (save-window-excursion
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5204 (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
5205 allout-buffer 'symmetric
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5206 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
5207 got-pass)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5208 (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
5209
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5210 (if (and (not confirmation)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5211 (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
5212 (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
5213 " - use new one instead? "))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5214 ;; deactivate password for subsequent
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5215 ;; confirmation:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5216 (progn
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5217 (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
5218 (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
5219 nil)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5220 t))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5221 (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
5222 (error "Wrong passphrase."))))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5223 ;; 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
5224 ;; (new) passphrase:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5225 ((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
5226 (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
5227 ;; 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
5228 ;; 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
5229 (if (not confirmation)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5230 (setq confirmation
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5231 (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
5232 " ... confirm spelling: ")
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5233 cache-id t)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5234 (prog1
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5235 (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
5236 confirmation
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5237 (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
5238 " confirmation differ - retry? "))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5239 (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
5240 (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
5241 ;; recurse to this routine:
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5242 (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
5243 (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
5244 (error "Confirmation failed.")))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5245 ;; 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
5246 (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
5247 (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
5248 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5249 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5250 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5251 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5252 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5253 ;;;_ > allout-encrypted-topic-p ()
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5254 (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
5255 "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
5256 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5257 (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
5258 (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
5259 allout-topic-encryption-bullet)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5260 (looking-at "\\*"))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5261 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5262 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5263 ;;;_ > 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
5264 ;; XXX gpg-specific, alas
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5265 (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
5266 "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
5267
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5268 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
5269
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5270 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
5271 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
5272 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
5273
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5274 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
5275 (require 'pgg-parse)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5276 (save-excursion
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5277 (with-temp-buffer
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5278 (insert text)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5279 (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
5280 (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
5281 'symmetric
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5282 'keypair))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5283 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
5284 (if (equal type 'keypair)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5285 (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
5286 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
5287 secret-keys)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5288 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
5289 (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
5290 first-secret-key))))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5291 (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
5292 )
66230
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 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5296 ;;;_ > 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
5297 (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
5298 "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
5299 ;; 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
5300 (random t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5301 (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
5302 (dotimes (i (length spew))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5303 (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
5304 (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
5305 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
5306 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5307 ;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5308 ;;; outline-buffer)
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5309 (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
5310 outline-buffer)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5311 "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
5312
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5313 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
5314 settings.
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5315
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5316 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
5317
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5318 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
5319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5320 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
5321 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
5322
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5323 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
5324 `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
5325 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
5326 `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
5327
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5328 ;; 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
5329 ;; - adjust the verifier
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5330 ;; - 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
5331 ;; - 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
5332
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5333 (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
5334 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
5335 (new-verifier-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5336 (if new-verifier-needed
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5337 ;; 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
5338 (subst-char-in-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5339 ?\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
5340 passphrase))))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5341 new-hint)
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5342 (when new-verifier-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5343 ;; 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
5344 (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
5345 (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
5346 (setq new-hint
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5347 (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
5348 allout-passphrase-hint-string))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5349 (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
5350 (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
5351 (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
5352 allout-passphrase-hint-string)))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5353 (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
5354 (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
5355 (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
5356 allout-passphrase-verifier-string))
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5357 )
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5358 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5359 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5360 ;;;_ > 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
5361 (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
5362 "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
5363
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5364 Derived from value of `allout-passphrase-verifier-string'."
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5365
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5366 (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
5367 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
5368 (if verifier-string
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5369 ;; Return it uncollapsed
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5370 (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
5371 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5372 )
66319
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5373 ;;;_ > 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
5374 (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
5375 "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
5376
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5377 \"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
5378 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5379 (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
5380 (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
5381 allout-passphrase-verifier-string
4b40c48a16ad Increment version number to 2.1, and use a literal
Eli Zaretskii <eliz@gnu.org>
parents: 66230
diff changeset
5382 (allout-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
5383 '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
5384 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
5385 t)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5386 ;;;_ > 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
5387 (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
5388 "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
5389
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5390 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
5391 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
5392 `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
5393
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5394 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
5395 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
5396 must also have content."
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5397 (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
5398 (while (not done)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5399
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5400 (if (not (re-search-forward
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5401 (format "\\(\\`\\|\n\\)%s *%s[^*]"
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5402 (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
5403 (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
5404 nil t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5405 (setq got nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5406 done t)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5407 (goto-char (setq got (match-beginning 0)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5408 (if (looking-at "\n")
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5409 (forward-char 1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5410 (setq got (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5411
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5412 (cond ((not got)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5413 (setq done t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5414
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5415 ((not (search-forward "\n"))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5416 (setq got nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5417 done t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5418
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5419 ((eobp)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5420 (setq got nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5421 done t))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5422
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5423 (t
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5424 (setq content-beg (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5425 (backward-char 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5426 (allout-end-of-subtree)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5427 (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
5428 (and except-mark
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5429 (<= content-beg except-mark)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5430 (>= (point) except-mark)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5431 ;; Continue looking
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5432 (setq got nil)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5433 ;; Got it!
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5434 (setq done t)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5435 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5436 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5437 (if got
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5438 (goto-char got))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5439 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5440 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5441 ;;;_ > 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
5442 (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
5443 "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
5444
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5445 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
5446 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
5447 `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
5448
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5449 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
5450 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
5451 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
5452 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
5453 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
5454
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5455 (interactive "p")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5456 (save-excursion
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5457 (let* ((current-mark (point-marker))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5458 (current-mark-position (marker-position current-mark))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5459 was-modified
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5460 bo-subtree
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5461 editing-topic editing-point)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5462 (goto-char (point-min))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5463 (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
5464 (setq was-modified (buffer-modified-p))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5465 (when (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5466 (and (boundp 'allout-encrypt-unencrypted-on-saves)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5467 allout-encrypt-unencrypted-on-saves
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5468 (setq bo-subtree (re-search-forward "$"))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5469 (not (allout-hidden-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5470 (>= current-mark (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5471 (allout-end-of-current-subtree)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5472 (<= current-mark (point))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5473 (setq editing-topic (point)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5474 ;; 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
5475 ;; encrypted, any relevant text shifts are in place:
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5476 editing-point (- current-mark-position
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5477 (count-trailing-whitespace-region
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5478 bo-subtree current-mark-position))))
67262
c3cfae9a5571 (eval-when-compile): Remove unnecessary load of 'cl. Add fset of
Eli Zaretskii <eliz@gnu.org>
parents: 66319
diff changeset
5479 (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
5480 (if (not was-modified)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5481 (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
5482 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5483 (if (not was-modified)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5484 (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
5485 (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
5486 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5487 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5488 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5489
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5490 ;;;_ #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
5491 ;;;_ > 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
5492 (defun allout-mark-topic ()
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5493 "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
5494 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5495 (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
5496 (allout-goto-prefix)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5497 (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
5498 (allout-end-of-current-subtree)
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5499 (exchange-point-and-mark))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5500 ;;;_ > outlineify-sticky ()
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5501 ;; 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
5502 ;;;###autoload
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5503 (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
5504 ;;;###autoload
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5505 (defun outlineify-sticky (&optional arg)
13964
4de229297f1f (outline-primary-bullet, outline-numbered-bullet,
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
5506 "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
5507
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5508 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
5509 setup for auto-startup."
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5510
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5511 (interactive "P")
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5512
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5513 (allout-mode t)
7416
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5514
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5515 (save-excursion
4996c50431de (outline-init) New user interface for control of
Richard M. Stallman <rms@gnu.org>
parents: 7218
diff changeset
5516 (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
5517 (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
5518 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
5519 (allout-open-topic 2)
41571
2902b21d2034 (outline-version, outline-open-topic)
Pavel Janík <Pavel@Janik.cz>
parents: 38431
diff changeset
5520 (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
5521 "`allout-mode' docstring: `^Hm'."))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5522 (allout-adjust-file-variable
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5523 "allout-layout" (or allout-layout '(-1 : 0))))))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5524 ;;;_ > 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
5525 (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
5526 "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
5527
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5528 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
5529 ;; 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
5530 (let (beg prefix suffix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5531 (save-excursion
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5532 (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
5533 (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
5534 (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
5535 (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
5536 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5537 (setq beg (- (point) 16))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5538 (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
5539 (point)
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5540 (progn (if (search-forward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5541 (forward-char -1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5542 (point))))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5543 (setq prefix (buffer-substring-no-properties
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5544 (progn (if (search-backward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5545 (forward-char 1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5546 (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5547 beg))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5548 (list beg prefix suffix))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5549 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5550 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5551 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5552 ;;;_ > 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
5553 (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
5554 "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
5555
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5556 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
5557 `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
5558
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5559 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
5560 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
5561 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
5562 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
5563 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
5564
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5565 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
5566 (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
5567 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
5568 nil
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5569 (save-excursion
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5570 (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
5571 beg prefix suffix)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5572 (if section-data
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5573 (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
5574 prefix (cadr section-data)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5575 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
5576 ;; create the section
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5577 (goto-char (point-max))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5578 (open-line 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5579 (allout-open-topic 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5580 (end-of-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5581 (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
5582 (allout-open-topic 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5583 (setq beg (point)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5584 suffix ""
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5585 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
5586 (beginning-of-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5587 (point))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5588 beg))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5589 (goto-char beg)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5590 (insert "Local variables:\n")
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5591 (allout-open-topic 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5592 (insert "End:\n")
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 ;; 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
5595 ;; of new value:
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5596 (goto-char beg)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5597 (allout-show-to-offshoot)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5598 (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
5599 (let* ((value-beg (point))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5600 (line-end (progn (if (search-forward "\n" nil t)
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5601 (forward-char -1))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5602 (point)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5603 (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
5604 (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
5605 (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
5606 (end-of-line)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5607 (open-line 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5608 (forward-line 1)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5609 (insert (concat prefix varname ":")))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5610 (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
5611 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5612 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5613 )
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5614 )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5615 ;;;_ > solicit-char-in-string (prompt string &optional do-defaulting)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5616 (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
5617 "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
5618
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5619 Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5620
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5621 (let ((new-prompt prompt)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5622 got)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5623
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5624 (while (not got)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5625 (message "%s" new-prompt)
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5626
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5627 ;; We do our own reading here, so we can circumvent, eg, special
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5628 ;; treatment for `?' character. (Oughta use minibuffer keymap instead.)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5629 (setq got
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5630 (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
5631
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5632 (setq got
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5633 (cond ((string-match (regexp-quote got) string) got)
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5634 ((and do-defaulting (string= got "\r"))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5635 ;; Return empty string to default:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5636 "")
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5637 ((string= got "\C-g") (signal 'quit nil))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5638 (t
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5639 (setq new-prompt (concat prompt
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5640 got
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5641 " ...pick from: "
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5642 string
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5643 ""))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5644 nil))))
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5645 ;; got something out of loop - return it:
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5646 got)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5647 )
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5648 ;;;_ > regexp-sans-escapes (string)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5649 (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
5650 "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
5651
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5652 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
5653 single backslash.
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5654
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5655 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
5656
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5657 (if (string= regexp "")
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5658 ""
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5659 ;; 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
5660 ;; backslash, or else to nil:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5661 (setq successive-backslashes
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5662 (if (= (aref regexp 0) ?\\)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5663 (if successive-backslashes (1+ successive-backslashes) 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5664 nil))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5665 (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
5666 ;; Include first char:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5667 (concat (substring regexp 0 1)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5668 (regexp-sans-escapes (substring regexp 1)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5669 ;; Exclude first char, but maintain count:
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5670 (regexp-sans-escapes (substring regexp 1) successive-backslashes))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5671 ;;;_ > count-trailing-whitespace-region (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5672 (defun count-trailing-whitespace-region (beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5673 "Return number of trailing whitespace chars between BEG and END.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5674
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5675 If BEG is bigger than END we return 0."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5676 (if (> beg end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5677 0
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5678 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5679 (goto-char beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5680 (let ((count 0))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5681 (while (re-search-forward "[ ][ ]*$" end t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5682 (goto-char (1+ (match-beginning 0)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5683 (setq count (1+ count)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5684 count))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5685 ;;;_ > allout-mark-marker to accommodate divergent emacsen:
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5686 (defun allout-mark-marker (&optional force buffer)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5687 "Accommodate the different signature for `mark-marker' across Emacsen.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5688
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5689 XEmacs takes two optional args, while mainline GNU Emacs does not,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5690 so pass them along when appropriate."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5691 (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5692 (apply 'mark-marker force buffer)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5693 (mark-marker)))
66230
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5694 ;;;_ > 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
5695 (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
5696 (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
5697 "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
5698 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
5699 (let ((i (length string))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5700 (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
5701 (while (> i 0)
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5702 (setq i (1- i))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5703 (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
5704 (aset newstr i tochar)))
4344fd52a670 Add autoloads of crypt++ and mailcrypt routines, all for encryption
Eli Zaretskii <eliz@gnu.org>
parents: 64762
diff changeset
5705 newstr)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5706 ;;;_ > wholenump if necessary
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5707 (if (not (fboundp 'wholenump))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5708 (defalias 'wholenump 'natnump))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5709 ;;;_ > remove-overlays if necessary
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5710 (if (not (fboundp 'remove-overlays))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5711 (defun remove-overlays (&optional beg end name val)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5712 "Clear BEG and END of overlays whose property NAME has value VAL.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5713 Overlays might be moved and/or split.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5714 BEG and END default respectively to the beginning and end of buffer."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5715 (unless beg (setq beg (point-min)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5716 (unless end (setq end (point-max)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5717 (if (< end beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5718 (setq beg (prog1 end (setq end beg))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5719 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5720 (dolist (o (overlays-in beg end))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5721 (when (eq (overlay-get o name) val)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5722 ;; Either push this overlay outside beg...end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5723 ;; or split it to exclude beg...end
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5724 ;; or delete it entirely (if it is contained in beg...end).
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5725 (if (< (overlay-start o) beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5726 (if (> (overlay-end o) end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5727 (progn
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5728 (move-overlay (copy-overlay o)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5729 (overlay-start o) beg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5730 (move-overlay o end (overlay-end o)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5731 (move-overlay o (overlay-start o) beg))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5732 (if (> (overlay-end o) end)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5733 (move-overlay o end (overlay-end o))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5734 (delete-overlay o)))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5735 )
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5736 ;;;_ > copy-overlay if necessary - xemacs ~ 21.4
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5737 (if (not (fboundp 'copy-overlay))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5738 (defun copy-overlay (o)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5739 "Return a copy of overlay O."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5740 (let ((o1 (make-overlay (overlay-start o) (overlay-end o)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5741 ;; FIXME: there's no easy way to find the
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5742 ;; insertion-type of the two markers.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5743 (overlay-buffer o)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5744 (props (overlay-properties o)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5745 (while props
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5746 (overlay-put o1 (pop props) (pop props)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5747 o1)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5748 ;;;_ > add-to-invisibility-spec if necessary - xemacs ~ 21.4
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5749 (if (not (fboundp 'add-to-invisibility-spec))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5750 (defun add-to-invisibility-spec (element)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5751 "Add ELEMENT to `buffer-invisibility-spec'.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5752 See documentation for `buffer-invisibility-spec' for the kind of elements
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5753 that can be added."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5754 (if (eq buffer-invisibility-spec t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5755 (setq buffer-invisibility-spec (list t)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5756 (setq buffer-invisibility-spec
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5757 (cons element buffer-invisibility-spec))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5758 ;;;_ > remove-from-invisibility-spec if necessary - xemacs ~ 21.4
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5759 (if (not (fboundp 'remove-from-invisibility-spec))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5760 (defun remove-from-invisibility-spec (element)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5761 "Remove ELEMENT from `buffer-invisibility-spec'."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5762 (if (consp buffer-invisibility-spec)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5763 (setq buffer-invisibility-spec (delete element
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5764 buffer-invisibility-spec)))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5765 ;;;_ > move-beginning-of-line if necessary - older emacs, xemacs
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5766 (if (not (fboundp 'move-beginning-of-line))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5767 (defun move-beginning-of-line (arg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5768 "Move point to beginning of current line as displayed.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5769 \(This disregards invisible newlines such as those
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5770 which are part of the text that an image rests on.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5771
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5772 With argument ARG not nil or 1, move forward ARG - 1 lines first.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5773 If point reaches the beginning or end of buffer, it stops there.
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5774 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5775 (interactive "p")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5776 (or arg (setq arg 1))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5777 (if (/= arg 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5778 (condition-case nil (line-move (1- arg)) (error nil)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5779
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5780 (let ((orig (point)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5781 ;; Move to beginning-of-line, ignoring fields and invisibles.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5782 (skip-chars-backward "^\n")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5783 (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5784 (goto-char (if (featurep 'xemacs)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5785 (previous-property-change (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5786 (previous-char-property-change (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5787 (skip-chars-backward "^\n"))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5788 (vertical-motion 0)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5789 (if (/= orig (point))
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5790 (goto-char orig))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5791 )
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5792 ;;;_ > move-end-of-line if necessary - older emacs, xemacs
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5793 (if (not (fboundp 'move-end-of-line))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5794 (defun move-end-of-line (arg)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5795 "Move point to end of current line as displayed.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5796 \(This disregards invisible newlines such as those
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5797 which are part of the text that an image rests on.)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5798
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5799 With argument ARG not nil or 1, move forward ARG - 1 lines first.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5800 If point reaches the beginning or end of buffer, it stops there.
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5801 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5802 (interactive "p")
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5803 (or arg (setq arg 1))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5804 (let ((orig (point))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5805 done)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5806 (while (not done)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5807 (let ((newpos
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5808 (save-excursion
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5809 (let ((goal-column 0))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5810 (and (condition-case nil
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5811 (or (line-move arg) t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5812 (error nil))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5813 (not (bobp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5814 (progn
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5815 (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5816 (goto-char (previous-char-property-change (point))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5817 (backward-char 1)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5818 (point)))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5819 (goto-char newpos)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5820 (if (and (> (point) newpos)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5821 (eq (preceding-char) ?\n))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5822 (backward-char 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5823 (if (and (> (point) newpos) (not (eobp))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5824 (not (eq (following-char) ?\n)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5825 ;; If we skipped something intangible
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5826 ;; and now we're not really at eol,
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5827 ;; keep going.
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5828 (setq arg 1)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5829 (setq done t)))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5830 (if (/= orig (point))
69481
be6a0491d438 * allout.el: Increment version to 2.2.1 in file commentary.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69250
diff changeset
5831 (goto-char orig))))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5832 )
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5833 ;;;_ > line-move-invisible-p if necessary
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5834 (if (not (fboundp 'line-move-invisible-p))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5835 (defun line-move-invisible-p (pos)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5836 "Return non-nil if the character after POS is currently invisible."
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5837 (let ((prop
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5838 (get-char-property pos 'invisible)))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5839 (if (eq buffer-invisibility-spec t)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5840 prop
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5841 (or (memq prop buffer-invisibility-spec)
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5842 (assq prop buffer-invisibility-spec))))))
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5843
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5844
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5845 ;;;_ #10 Unfinished
48856
e7aab76fa215 Avoid name conflicts with outline.el. Use 3 installments to keep
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47127
diff changeset
5846 ;;;_ > 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
5847 (defun allout-bullet-isearch (&optional bullet)
29490
81725432199b New version from Manheimer.
Dave Love <fx@gnu.org>
parents: 27269
diff changeset
5848 "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
5849 (interactive)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5850 (if (not bullet)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5851 (setq bullet (solicit-char-in-string
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5852 "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
5853 (regexp-sans-escapes allout-bullets-string))))
15664
a50ebf4ac764 (outline-auto-activation, outline-layout)
Karl Heuer <kwzh@gnu.org>
parents: 15663
diff changeset
5854
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5855 (let ((isearch-regexp t)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5856 (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
5857 allout-header-prefix
7218
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5858 "[ \t]*"
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5859 bullet)))
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5860 (isearch-repeat 'forward)
49f9f9a08b4c major code speedups, bug fixes, behavior
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
5861 (isearch-mode t)))
68953
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5862
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5863 ;;;_ #11 Provide
0ddd5b380ffb Use allout invisible-text overlays instead of
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
5864 (provide 'allout)
3430
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5865
400db0ca934f entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5866 ;;;_* Local emacs vars.
69124
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5867 ;; The following `allout-layout' local variable setting:
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5868 ;; - closes all topics from the first topic to just before the third-to-last,
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5869 ;; - shows the children of the third to last (config vars)
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5870 ;; - and the second to last (code section),
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5871 ;; - and closes the last topic (this local-variables section).
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5872 ;;Local variables:
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5873 ;;allout-layout: (0 : -1 -1 0)
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5874 ;;End:
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5875
f6b5ed4f7f58 Add 2006 copyright.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 68956
diff changeset
5876 ;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38250
diff changeset
5877 ;;; allout.el ends here