1 |
;;; allout.el --- extensive outline mode for use alone and with other modes |
;;; allout.el --- extensive outline mode for use alone and with other modes |
2 |
|
|
3 |
;; Copyright (C) 1992, 1993, 1994, 2001, 2002 Free Software Foundation, Inc. |
;; Copyright (C) 1992, 93, 94, 2001, 02, 2004 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Ken Manheimer <klm@zope.com> |
;; Author: Ken Manheimer <klm@zope.com> |
6 |
;; Maintainer: Ken Manheimer <klm@zope.com> |
;; Maintainer: Ken Manheimer <klm@zope.com> |
46 |
;; |
;; |
47 |
;; The outline menubar additions provide quick reference to many of |
;; The outline menubar additions provide quick reference to many of |
48 |
;; the features, and see the docstring of the function `allout-init' |
;; the features, and see the docstring of the function `allout-init' |
49 |
;; for instructions on priming your emacs session for automatic |
;; for instructions on priming your Emacs session for automatic |
50 |
;; activation of `allout-mode'. |
;; activation of `allout-mode'. |
51 |
;; |
;; |
52 |
;; See the docstring of the variables `allout-layout' and |
;; See the docstring of the variables `allout-layout' and |
162 |
var and the respective allout-*-bullets-string vars. |
var and the respective allout-*-bullets-string vars. |
163 |
|
|
164 |
The value of an asterisk (`*') provides for backwards compatibility |
The value of an asterisk (`*') provides for backwards compatibility |
165 |
with the original emacs outline mode. See `allout-plain-bullets-string' |
with the original Emacs outline mode. See `allout-plain-bullets-string' |
166 |
and `allout-distinctive-bullets-string' for the range of available |
and `allout-distinctive-bullets-string' for the range of available |
167 |
bullets." |
bullets." |
168 |
:type 'string |
:type 'string |
263 |
|
|
264 |
Non-nil restricts the topic creation and modification |
Non-nil restricts the topic creation and modification |
265 |
functions to asterix-padded prefixes, so they look exactly |
functions to asterix-padded prefixes, so they look exactly |
266 |
like the original emacs-outline style prefixes. |
like the original Emacs-outline style prefixes. |
267 |
|
|
268 |
Whatever the setting of this variable, both old and new style prefixes |
Whatever the setting of this variable, both old and new style prefixes |
269 |
are always respected by the topic maneuvering functions." |
are always respected by the topic maneuvering functions." |
491 |
(defcustom allout-inhibit-protection nil |
(defcustom allout-inhibit-protection nil |
492 |
"*Non-nil disables warnings and confirmation-checks for concealed-text edits. |
"*Non-nil disables warnings and confirmation-checks for concealed-text edits. |
493 |
|
|
494 |
Outline mode uses emacs change-triggered functions to detect unruly |
Outline mode uses Emacs change-triggered functions to detect unruly |
495 |
changes to concealed regions. Set this var non-nil to disable the |
changes to concealed regions. Set this var non-nil to disable the |
496 |
protection, potentially increasing text-entry responsiveness a bit. |
protection, potentially increasing text-entry responsiveness a bit. |
497 |
|
|
708 |
(defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.") |
(defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.") |
709 |
;;;_ > produce-allout-mode-map (keymap-alist &optional base-map) |
;;;_ > produce-allout-mode-map (keymap-alist &optional base-map) |
710 |
(defun produce-allout-mode-map (keymap-list &optional base-map) |
(defun produce-allout-mode-map (keymap-list &optional base-map) |
711 |
"Produce keymap for use as allout-mode-map, from keymap-list. |
"Produce keymap for use as allout-mode-map, from KEYMAP-LIST. |
712 |
|
|
713 |
Built on top of optional BASE-MAP, or empty sparse map if none specified. |
Built on top of optional BASE-MAP, or empty sparse map if none specified. |
714 |
See doc string for allout-keybindings-list for format of binding list." |
See doc string for allout-keybindings-list for format of binding list." |
939 |
- anything else \(eg, t) for auto-activation and auto-layout, without |
- anything else \(eg, t) for auto-activation and auto-layout, without |
940 |
any confirmation check. |
any confirmation check. |
941 |
|
|
942 |
Use this function to setup your emacs session for automatic activation |
Use this function to setup your Emacs session for automatic activation |
943 |
of allout outline mode, contingent to the buffer-specific setting of |
of allout outline mode, contingent to the buffer-specific setting of |
944 |
the `allout-layout' variable. (See `allout-layout' and |
the `allout-layout' variable. (See `allout-layout' and |
945 |
`allout-expose-topic' docstrings for more details on auto layout). |
`allout-expose-topic' docstrings for more details on auto layout). |
948 |
`allout-find-file-hook' in `find-file-hook', and giving |
`allout-find-file-hook' in `find-file-hook', and giving |
949 |
`allout-auto-activation' a suitable setting. |
`allout-auto-activation' a suitable setting. |
950 |
|
|
951 |
To prime your emacs session for full auto-outline operation, include |
To prime your Emacs session for full auto-outline operation, include |
952 |
the following two lines in your emacs init file: |
the following two lines in your Emacs init file: |
953 |
|
|
954 |
\(require 'allout) |
\(require 'allout) |
955 |
\(allout-init t)" |
\(allout-init t)" |
1044 |
special `allout-mode' features and terminology. See also the outline |
special `allout-mode' features and terminology. See also the outline |
1045 |
menubar additions for quick reference to many of the features, and see |
menubar additions for quick reference to many of the features, and see |
1046 |
the docstring of the function `allout-init' for instructions on |
the docstring of the function `allout-init' for instructions on |
1047 |
priming your emacs session for automatic activation of `allout-mode'. |
priming your Emacs session for automatic activation of `allout-mode'. |
1048 |
|
|
1049 |
|
|
1050 |
The bindings are dictated by the `allout-keybindings-list' and |
The bindings are dictated by the `allout-keybindings-list' and |
1102 |
Like above 'copy-exposed', but convert topic |
Like above 'copy-exposed', but convert topic |
1103 |
prefixes to section.subsection... numeric |
prefixes to section.subsection... numeric |
1104 |
format. |
format. |
1105 |
ESC ESC (allout-init t) Setup emacs session for outline mode |
ESC ESC (allout-init t) Setup Emacs session for outline mode |
1106 |
auto-activation. |
auto-activation. |
1107 |
|
|
1108 |
HOT-SPOT Operation |
HOT-SPOT Operation |
1132 |
|
|
1133 |
Topic hierarchy constituents - TOPICS and SUBTOPICS: |
Topic hierarchy constituents - TOPICS and SUBTOPICS: |
1134 |
|
|
1135 |
TOPIC: A basic, coherent component of an emacs outline. It can |
TOPIC: A basic, coherent component of an Emacs outline. It can |
1136 |
contain other topics, and it can be subsumed by other topics, |
contain other topics, and it can be subsumed by other topics, |
1137 |
CURRENT topic: |
CURRENT topic: |
1138 |
The visible topic most immediately containing the cursor. |
The visible topic most immediately containing the cursor. |
1303 |
) |
) |
1304 |
|
|
1305 |
; selective-display is the |
; selective-display is the |
1306 |
; emacs conditional exposure |
; Emacs conditional exposure |
1307 |
; mechanism: |
; mechanism: |
1308 |
(allout-resumptions 'selective-display '(t)) |
(allout-resumptions 'selective-display '(t)) |
1309 |
(if allout-inhibit-protection |
(if allout-inhibit-protection |
1537 |
(defun allout-sibling-index (&optional depth) |
(defun allout-sibling-index (&optional depth) |
1538 |
"Item number of this prospective topic among its siblings. |
"Item number of this prospective topic among its siblings. |
1539 |
|
|
1540 |
If optional arg depth is greater than current depth, then we're |
If optional arg DEPTH is greater than current depth, then we're |
1541 |
opening a new level, and return 0. |
opening a new level, and return 0. |
1542 |
|
|
1543 |
If less than this depth, ascend to that depth and count..." |
If less than this depth, ascend to that depth and count..." |
1622 |
"Produce a location \"chart\" of subtopics of the containing topic. |
"Produce a location \"chart\" of subtopics of the containing topic. |
1623 |
|
|
1624 |
Optional argument LEVELS specifies the depth \(relative to start |
Optional argument LEVELS specifies the depth \(relative to start |
1625 |
depth) for the chart. Subsequent optional args are not for public |
depth) for the chart. |
|
use. |
|
1626 |
|
|
1627 |
Charts are used to capture outline structure, so that outline altering |
Charts are used to capture outline structure, so that outline altering |
1628 |
routines need assess the structure only once, and then use the chart |
routines need assess the structure only once, and then use the chart |
1635 |
The chart for a topics' offspring precedes the entry for the topic |
The chart for a topics' offspring precedes the entry for the topic |
1636 |
itself. |
itself. |
1637 |
|
|
1638 |
The other function parameters are for internal recursion, and should |
\(fn &optional levels)" |
1639 |
not be specified by external callers. ORIG-DEPTH is depth of topic at |
|
1640 |
starting point, and PREV-DEPTH is depth of prior topic." |
;; The other function parameters are for internal recursion, and should |
1641 |
|
;; not be specified by external callers. ORIG-DEPTH is depth of topic at |
1642 |
|
;; starting point, and PREV-DEPTH is depth of prior topic." |
1643 |
|
|
1644 |
(let ((original (not orig-depth)) ; `orig-depth' set only in recursion. |
(let ((original (not orig-depth)) ; `orig-depth' set only in recursion. |
1645 |
chart curr-depth) |
chart curr-depth) |
1653 |
|
|
1654 |
;; Loop over the current levels' siblings. Besides being more |
;; Loop over the current levels' siblings. Besides being more |
1655 |
;; efficient than tail-recursing over a level, it avoids exceeding |
;; efficient than tail-recursing over a level, it avoids exceeding |
1656 |
;; the typically quite constrained emacs max-lisp-eval-depth. |
;; the typically quite constrained Emacs max-lisp-eval-depth. |
1657 |
;; |
;; |
1658 |
;; Probably would speed things up to implement loop-based stack |
;; Probably would speed things up to implement loop-based stack |
1659 |
;; operation rather than recursing for lower levels. Bah. |
;; operation rather than recursing for lower levels. Bah. |
1742 |
(setq chart (cdr chart)))) |
(setq chart (cdr chart)))) |
1743 |
result)) |
result)) |
1744 |
;;;_ X allout-chart-spec (chart spec &optional exposing) |
;;;_ X allout-chart-spec (chart spec &optional exposing) |
1745 |
(defun allout-chart-spec (chart spec &optional exposing) |
;; (defun allout-chart-spec (chart spec &optional exposing) |
1746 |
"Not yet \(if ever) implemented. |
;; "Not yet \(if ever) implemented. |
1747 |
|
|
1748 |
Produce exposure directives given topic/subtree CHART and an exposure SPEC. |
;; Produce exposure directives given topic/subtree CHART and an exposure SPEC. |
1749 |
|
|
1750 |
Exposure spec indicates the locations to be exposed and the prescribed |
;; Exposure spec indicates the locations to be exposed and the prescribed |
1751 |
exposure status. Optional arg EXPOSING is an integer, with 0 |
;; exposure status. Optional arg EXPOSING is an integer, with 0 |
1752 |
indicating pending concealment, anything higher indicating depth to |
;; indicating pending concealment, anything higher indicating depth to |
1753 |
which subtopic headers should be exposed, and negative numbers |
;; which subtopic headers should be exposed, and negative numbers |
1754 |
indicating (negative of) the depth to which subtopic headers and |
;; indicating (negative of) the depth to which subtopic headers and |
1755 |
bodies should be exposed. |
;; bodies should be exposed. |
1756 |
|
|
1757 |
The produced list can have two types of entries. Bare numbers |
;; The produced list can have two types of entries. Bare numbers |
1758 |
indicate points in the buffer where topic headers that should be |
;; indicate points in the buffer where topic headers that should be |
1759 |
exposed reside. |
;; exposed reside. |
1760 |
|
|
1761 |
- bare negative numbers indicates that the topic starting at the |
;; - bare negative numbers indicates that the topic starting at the |
1762 |
point which is the negative of the number should be opened, |
;; point which is the negative of the number should be opened, |
1763 |
including their entries. |
;; including their entries. |
1764 |
- bare positive values indicate that this topic header should be |
;; - bare positive values indicate that this topic header should be |
1765 |
opened. |
;; opened. |
1766 |
- Lists signify the beginning and end points of regions that should |
;; - Lists signify the beginning and end points of regions that should |
1767 |
be flagged, and the flag to employ. (For concealment: `\(\?r\)', and |
;; be flagged, and the flag to employ. (For concealment: `\(\?r\)', and |
1768 |
exposure:" |
;; exposure:" |
1769 |
(while spec |
;; (while spec |
1770 |
(cond ((listp spec) |
;; (cond ((listp spec) |
1771 |
) |
;; ) |
1772 |
) |
;; ) |
1773 |
(setq spec (cdr spec))) |
;; (setq spec (cdr spec))) |
1774 |
) |
;; ) |
1775 |
|
|
1776 |
;;;_ - Within Topic |
;;;_ - Within Topic |
1777 |
;;;_ > allout-goto-prefix () |
;;;_ > allout-goto-prefix () |
2139 |
writes, like crypt and zip modes.) |
writes, like crypt and zip modes.) |
2140 |
|
|
2141 |
Locally bound in outline buffers to `before-change-functions', which |
Locally bound in outline buffers to `before-change-functions', which |
2142 |
in emacs 19 is run before any change to the buffer. |
in Emacs 19 is run before any change to the buffer. |
2143 |
|
|
2144 |
Any functions which set [`this-command' to `undo', or which set] |
Any functions which set [`this-command' to `undo', or which set] |
2145 |
`allout-override-protect' non-nil (as does, eg, allout-flag-chars) |
`allout-override-protect' non-nil (as does, eg, allout-flag-chars) |
2154 |
; Both beginning and end chars must |
; Both beginning and end chars must |
2155 |
; be exposed: |
; be exposed: |
2156 |
(save-excursion (if (memq this-command '(newline open-line)) |
(save-excursion (if (memq this-command '(newline open-line)) |
2157 |
;; Compensate for stupid emacs {new, |
;; Compensate for stupid Emacs {new, |
2158 |
;; open-}line display optimization: |
;; open-}line display optimization: |
2159 |
(setq beg (1+ beg) |
(setq beg (1+ beg) |
2160 |
end (1+ end))) |
end (1+ end))) |
2166 |
(save-match-data |
(save-match-data |
2167 |
(if (equal this-command 'undo) |
(if (equal this-command 'undo) |
2168 |
;; Allow undo without inhibition. |
;; Allow undo without inhibition. |
2169 |
;; - Undoing new and open-line hits stupid emacs redisplay |
;; - Undoing new and open-line hits stupid Emacs redisplay |
2170 |
;; optimization (em 19 cmds.c, ~ line 200). |
;; optimization (em 19 cmds.c, ~ line 200). |
2171 |
;; - Presumably, undoing what was properly protected when |
;; - Presumably, undoing what was properly protected when |
2172 |
;; done. |
;; done. |
2332 |
(let* ((this-key-num (cond |
(let* ((this-key-num (cond |
2333 |
((numberp last-command-char) |
((numberp last-command-char) |
2334 |
last-command-char) |
last-command-char) |
2335 |
;; XXX Only xemacs has characterp. |
;; XXX Only XEmacs has characterp. |
2336 |
((and (fboundp 'characterp) |
((and (fboundp 'characterp) |
2337 |
(characterp last-command-char)) |
(characterp last-command-char)) |
2338 |
(char-to-int last-command-char)) |
(char-to-int last-command-char)) |
2386 |
|
|
2387 |
;;;_ > allout-flag-region (from to flag) |
;;;_ > allout-flag-region (from to flag) |
2388 |
(defmacro allout-flag-region (from to flag) |
(defmacro allout-flag-region (from to flag) |
2389 |
"Hide or show lines from FROM to TO, via emacs selective-display FLAG char. |
"Hide or show lines from FROM to TO, via Emacs selective-display FLAG char. |
2390 |
Ie, text following flag C-m \(carriage-return) is hidden until the |
Ie, text following flag C-m \(carriage-return) is hidden until the |
2391 |
next C-j (newline) char. |
next C-j (newline) char. |
2392 |
|
|
2399 |
|
|
2400 |
;;;_ > allout-isearch-expose (mode) |
;;;_ > allout-isearch-expose (mode) |
2401 |
(defun allout-isearch-expose (mode) |
(defun allout-isearch-expose (mode) |
2402 |
"Mode is either 'clear, 'start, 'continue, or 'final." |
"MODE is either 'clear, 'start, 'continue, or 'final." |
2403 |
;; allout-isearch-prior-pos encodes exposure status of prior pos: |
;; allout-isearch-prior-pos encodes exposure status of prior pos: |
2404 |
;; (pos was-vis header-pos end-pos) |
;; (pos was-vis header-pos end-pos) |
2405 |
;; pos - point of concern |
;; pos - point of concern |
2508 |
) |
) |
2509 |
;;;_ > allout-distinctive-bullet (bullet) |
;;;_ > allout-distinctive-bullet (bullet) |
2510 |
(defun allout-distinctive-bullet (bullet) |
(defun allout-distinctive-bullet (bullet) |
2511 |
"True if bullet is one of those on `allout-distinctive-bullets-string'." |
"True if BULLET is one of those on `allout-distinctive-bullets-string'." |
2512 |
(string-match (regexp-quote bullet) allout-distinctive-bullets-string)) |
(string-match (regexp-quote bullet) allout-distinctive-bullets-string)) |
2513 |
;;;_ > allout-numbered-type-prefix (&optional prefix) |
;;;_ > allout-numbered-type-prefix (&optional prefix) |
2514 |
(defun allout-numbered-type-prefix (&optional prefix) |
(defun allout-numbered-type-prefix (&optional prefix) |
2680 |
) |
) |
2681 |
;;;_ > allout-open-topic (relative-depth &optional before use_sib_bullet) |
;;;_ > allout-open-topic (relative-depth &optional before use_sib_bullet) |
2682 |
(defun allout-open-topic (relative-depth &optional before use_sib_bullet) |
(defun allout-open-topic (relative-depth &optional before use_sib_bullet) |
2683 |
"Open a new topic at depth DEPTH. |
"Open a new topic at depth RELATIVE-DEPTH. |
2684 |
|
|
2685 |
New topic is situated after current one, unless optional flag BEFORE |
New topic is situated after current one, unless optional flag BEFORE |
2686 |
is non-nil, or unless current line is complete empty (not even |
is non-nil, or unless current line is complete empty (not even |
2901 |
(do-auto-fill)))) |
(do-auto-fill)))) |
2902 |
;;;_ > allout-reindent-body (old-depth new-depth &optional number) |
;;;_ > allout-reindent-body (old-depth new-depth &optional number) |
2903 |
(defun allout-reindent-body (old-depth new-depth &optional number) |
(defun allout-reindent-body (old-depth new-depth &optional number) |
2904 |
"Reindent body lines which were indented at old-depth to new-depth. |
"Reindent body lines which were indented at OLD-DEPTH to NEW-DEPTH. |
2905 |
|
|
2906 |
Optional arg NUMBER indicates numbering is being added, and it must |
Optional arg NUMBER indicates numbering is being added, and it must |
2907 |
be accommodated. |
be accommodated. |
2975 |
|
|
2976 |
"Adjust bullet of current topic prefix. |
"Adjust bullet of current topic prefix. |
2977 |
|
|
|
All args are optional. |
|
|
|
|
2978 |
If SOLICIT is non-nil, then the choice of bullet is solicited from |
If SOLICIT is non-nil, then the choice of bullet is solicited from |
2979 |
user. If it's a character, then that character is offered as the |
user. If it's a character, then that character is offered as the |
2980 |
default, otherwise the one suited to the context \(according to |
default, otherwise the one suited to the context \(according to |
2981 |
distinction or depth) is offered. If non-nil, then the |
distinction or depth) is offered. If non-nil, then the |
2982 |
context-specific bullet is just used. |
context-specific bullet is just used. |
2983 |
|
|
2984 |
Second arg DEPTH forces the topic prefix to that depth, regardless |
Second arg NEW-DEPTH forces the topic prefix to that depth, regardless |
2985 |
of the topic's current depth. |
of the topic's current depth. |
2986 |
|
|
2987 |
Third arg NUMBER-CONTROL can force the prefix to or away from |
Third arg NUMBER-CONTROL can force the prefix to or away from |
3094 |
contained subtopics. See `allout-rebullet-heading' for rebulleting |
contained subtopics. See `allout-rebullet-heading' for rebulleting |
3095 |
behavior. |
behavior. |
3096 |
|
|
3097 |
All arguments are optional. |
Arg RELATIVE-DEPTH means to shift the depth of the entire |
|
|
|
|
First arg RELATIVE-DEPTH means to shift the depth of the entire |
|
3098 |
topic that amount. |
topic that amount. |
3099 |
|
|
3100 |
The rest of the args are for internal recursive use by the function |
\(fn &optional RELATIVE-DEPTH)" |
3101 |
itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." |
|
3102 |
|
;; All args except the first one are for internal recursive use by the |
3103 |
|
;; function itself. |
3104 |
|
|
3105 |
(let* ((relative-depth (or relative-depth 0)) |
(let* ((relative-depth (or relative-depth 0)) |
3106 |
(new-depth (allout-depth)) |
(new-depth (allout-depth)) |
3899 |
max-pos))) |
max-pos))) |
3900 |
;;;_ > allout-old-expose-topic (spec &rest followers) |
;;;_ > allout-old-expose-topic (spec &rest followers) |
3901 |
(defun allout-old-expose-topic (spec &rest followers) |
(defun allout-old-expose-topic (spec &rest followers) |
3902 |
|
"Dictate wholesale exposure scheme for current topic, according to SPEC. |
|
"Deprecated. Use `allout-expose-topic' \(with different schema |
|
|
format) instead. |
|
|
|
|
|
Dictate wholesale exposure scheme for current topic, according to SPEC. |
|
3903 |
|
|
3904 |
SPEC is either a number or a list. Optional successive args |
SPEC is either a number or a list. Optional successive args |
3905 |
dictate exposure for subsequent siblings of current topic. |
dictate exposure for subsequent siblings of current topic. |
3926 |
elements of the list are nested SPECs, dictating the specific exposure |
elements of the list are nested SPECs, dictating the specific exposure |
3927 |
for the corresponding offspring of the topic. |
for the corresponding offspring of the topic. |
3928 |
|
|
3929 |
Optional FOLLOWER arguments dictate exposure for succeeding siblings." |
Optional FOLLOWERS arguments dictate exposure for succeeding siblings." |
3930 |
|
|
3931 |
(interactive "xExposure spec: ") |
(interactive "xExposure spec: ") |
3932 |
(let ((depth (allout-current-depth)) |
(let ((depth (allout-current-depth)) |
3971 |
(allout-old-expose-topic (car followers)) |
(allout-old-expose-topic (car followers)) |
3972 |
(setq followers (cdr followers))) |
(setq followers (cdr followers))) |
3973 |
max-pos)) |
max-pos)) |
3974 |
|
(make-obsolete 'allout-old-expose-topic |
3975 |
|
"use `allout-expose-topic' (with different schema format) instead." |
3976 |
|
"19.23") |
3977 |
;;;_ > allout-new-exposure '() |
;;;_ > allout-new-exposure '() |
3978 |
(defmacro allout-new-exposure (&rest spec) |
(defmacro allout-new-exposure (&rest spec) |
3979 |
"Literal frontend for `allout-expose-topic', doesn't evaluate arguments. |
"Literal frontend for `allout-expose-topic', doesn't evaluate arguments. |
4004 |
(list 'allout-expose-topic (list 'quote spec)))) |
(list 'allout-expose-topic (list 'quote spec)))) |
4005 |
;;;_ > allout-exposure '() |
;;;_ > allout-exposure '() |
4006 |
(defmacro allout-exposure (&rest spec) |
(defmacro allout-exposure (&rest spec) |
4007 |
"Being deprecated - use more recent `allout-new-exposure' instead. |
"Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments |
|
|
|
|
Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments |
|
4008 |
and retains start position." |
and retains start position." |
4009 |
(list 'save-excursion |
(list 'save-excursion |
4010 |
'(if (not (or (allout-goto-prefix) |
'(if (not (or (allout-goto-prefix) |
4012 |
(error "Can't find any outline topics")) |
(error "Can't find any outline topics")) |
4013 |
(cons 'allout-old-expose-topic |
(cons 'allout-old-expose-topic |
4014 |
(mapcar (function (lambda (x) (list 'quote x))) spec)))) |
(mapcar (function (lambda (x) (list 'quote x))) spec)))) |
4015 |
|
(make-obsolete 'allout-exposure 'allout-new-exposure "19.23") |
4016 |
|
|
4017 |
;;;_ #7 Systematic outline presentation - copying, printing, flattening |
;;;_ #7 Systematic outline presentation - copying, printing, flattening |
4018 |
|
|
4220 |
;;;_ > allout-process-exposed (&optional func from to frombuf |
;;;_ > allout-process-exposed (&optional func from to frombuf |
4221 |
;;; tobuf format) |
;;; tobuf format) |
4222 |
(defun allout-process-exposed (&optional func from to frombuf tobuf |
(defun allout-process-exposed (&optional func from to frombuf tobuf |
4223 |
format &optional start-num) |
format start-num) |
4224 |
"Map function on exposed parts of current topic; results to another buffer. |
"Map function on exposed parts of current topic; results to another buffer. |
4225 |
|
|
4226 |
All args are options; default values itemized below. |
Apply FUNC to exposed portions FROM position TO position in buffer |
|
|
|
|
Apply FUNCTION to exposed portions FROM position TO position in buffer |
|
4227 |
FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an |
FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an |
4228 |
alternate presentation form: |
alternate presentation form: |
4229 |
|
|
4236 |
except for distinctive bullets. |
except for distinctive bullets. |
4237 |
|
|
4238 |
Defaults: |
Defaults: |
4239 |
FUNCTION: `allout-insert-listified' |
FUNC: `allout-insert-listified' |
4240 |
FROM: region start, if region active, else start of buffer |
FROM: region start, if region active, else start of buffer |
4241 |
TO: region end, if region active, else end of buffer |
TO: region end, if region active, else end of buffer |
4242 |
FROMBUF: current buffer |
FROMBUF: current buffer |
4281 |
(defun allout-insert-listified (listified) |
(defun allout-insert-listified (listified) |
4282 |
"Insert contents of listified outline portion in current buffer. |
"Insert contents of listified outline portion in current buffer. |
4283 |
|
|
4284 |
Listified is a list representing each topic header and body: |
LISTIFIED is a list representing each topic header and body: |
4285 |
|
|
4286 |
\`(depth prefix text)' |
\`(depth prefix text)' |
4287 |
|
|
4288 |
or \`(depth prefix text bullet-plus)' |
or |
4289 |
|
|
4290 |
|
\`(depth prefix text bullet-plus)' |
4291 |
|
|
4292 |
If `bullet-plus' is specified, it is inserted just after the entire prefix." |
If `bullet-plus' is specified, it is inserted just after the entire prefix." |
4293 |
(setq listified (cdr listified)) |
(setq listified (cdr listified)) |
4353 |
(defun allout-flatten-exposed-to-buffer (&optional arg tobuf) |
(defun allout-flatten-exposed-to-buffer (&optional arg tobuf) |
4354 |
"Present numeric outline of outline's exposed portions in another buffer. |
"Present numeric outline of outline's exposed portions in another buffer. |
4355 |
|
|
4356 |
The resulting outline is not compatable with outline mode - use |
The resulting outline is not compatible with outline mode - use |
4357 |
`allout-copy-exposed-to-buffer' if you want that. |
`allout-copy-exposed-to-buffer' if you want that. |
4358 |
|
|
4359 |
Use `allout-indented-exposed-to-buffer' for indented presentation. |
Use `allout-indented-exposed-to-buffer' for indented presentation. |
4360 |
|
|
4361 |
With repeat count, copy the exposed portions of only current topic. |
With repeat count, copy the exposed portions of only current topic. |
4362 |
|
|
4363 |
Other buffer has current buffers name with \" exposed\" appended to |
Other buffer has current buffer's name with \" exposed\" appended to |
4364 |
it, unless optional second arg TOBUF is specified, in which case it is |
it, unless optional second arg TOBUF is specified, in which case it is |
4365 |
used verbatim." |
used verbatim." |
4366 |
(interactive "P") |
(interactive "P") |
4369 |
(defun allout-indented-exposed-to-buffer (&optional arg tobuf) |
(defun allout-indented-exposed-to-buffer (&optional arg tobuf) |
4370 |
"Present indented outline of outline's exposed portions in another buffer. |
"Present indented outline of outline's exposed portions in another buffer. |
4371 |
|
|
4372 |
The resulting outline is not compatable with outline mode - use |
The resulting outline is not compatible with outline mode - use |
4373 |
`allout-copy-exposed-to-buffer' if you want that. |
`allout-copy-exposed-to-buffer' if you want that. |
4374 |
|
|
4375 |
Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. |
Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. |
4376 |
|
|
4377 |
With repeat count, copy the exposed portions of only current topic. |
With repeat count, copy the exposed portions of only current topic. |
4378 |
|
|
4379 |
Other buffer has current buffers name with \" exposed\" appended to |
Other buffer has current buffer's name with \" exposed\" appended to |
4380 |
it, unless optional second arg TOBUF is specified, in which case it is |
it, unless optional second arg TOBUF is specified, in which case it is |
4381 |
used verbatim." |
used verbatim." |
4382 |
(interactive "P") |
(interactive "P") |
4383 |
(allout-copy-exposed-to-buffer arg tobuf 'indent)) |
(allout-copy-exposed-to-buffer arg tobuf 'indent)) |
4384 |
|
|
4385 |
;;;_ - LaTeX formatting |
;;;_ - LaTeX formatting |
4386 |
;;;_ > allout-latex-verb-quote (str &optional flow) |
;;;_ > allout-latex-verb-quote (string &optional flow) |
4387 |
(defun allout-latex-verb-quote (str &optional flow) |
(defun allout-latex-verb-quote (string &optional flow) |
4388 |
"Return copy of STRING for literal reproduction across latex processing. |
"Return copy of STRING for literal reproduction across latex processing. |
4389 |
Expresses the original characters \(including carriage returns) of the |
Expresses the original characters \(including carriage returns) of the |
4390 |
string across latex processing." |
string across latex processing." |
4394 |
(concat "\\char" (number-to-string char) "{}")) |
(concat "\\char" (number-to-string char) "{}")) |
4395 |
((= char ?\n) "\\\\") |
((= char ?\n) "\\\\") |
4396 |
(t (char-to-string char))))) |
(t (char-to-string char))))) |
4397 |
str |
string |
4398 |
"")) |
"")) |
4399 |
;;;_ > allout-latex-verbatim-quote-curr-line () |
;;;_ > allout-latex-verbatim-quote-curr-line () |
4400 |
(defun allout-latex-verbatim-quote-curr-line () |
(defun allout-latex-verbatim-quote-curr-line () |
4415 |
(insert "\\") |
(insert "\\") |
4416 |
(setq end (1+ end)) |
(setq end (1+ end)) |
4417 |
(goto-char (1+ (match-end 0)))))) |
(goto-char (1+ (match-end 0)))))) |
4418 |
;;;_ > allout-insert-latex-header (buf) |
;;;_ > allout-insert-latex-header (buffer) |
4419 |
(defun allout-insert-latex-header (buf) |
(defun allout-insert-latex-header (buffer) |
4420 |
"Insert initial latex commands at point in BUFFER." |
"Insert initial latex commands at point in BUFFER." |
4421 |
;; Much of this is being derived from the stuff in appendix of E in |
;; Much of this is being derived from the stuff in appendix of E in |
4422 |
;; the TeXBook, pg 421. |
;; the TeXBook, pg 421. |
4423 |
(set-buffer buf) |
(set-buffer buffer) |
4424 |
(let ((doc-style (format "\n\\documentstyle{%s}\n" |
(let ((doc-style (format "\n\\documentstyle{%s}\n" |
4425 |
"report")) |
"report")) |
4426 |
(page-numbering (if allout-number-pages |
(page-numbering (if allout-number-pages |
4489 |
hoffset |
hoffset |
4490 |
vspace) |
vspace) |
4491 |
))) |
))) |
4492 |
;;;_ > allout-insert-latex-trailer (buf) |
;;;_ > allout-insert-latex-trailer (buffer) |
4493 |
(defun allout-insert-latex-trailer (buf) |
(defun allout-insert-latex-trailer (buffer) |
4494 |
"Insert concluding latex commands at point in BUFFER." |
"Insert concluding latex commands at point in BUFFER." |
4495 |
(set-buffer buf) |
(set-buffer buffer) |
4496 |
(insert "\n\\end{document}\n")) |
(insert "\n\\end{document}\n")) |
4497 |
;;;_ > allout-latexify-one-item (depth prefix bullet text) |
;;;_ > allout-latexify-one-item (depth prefix bullet text) |
4498 |
(defun allout-latexify-one-item (depth prefix bullet text) |
(defun allout-latexify-one-item (depth prefix bullet text) |
4703 |
(cons function (symbol-value hook))))))) |
(cons function (symbol-value hook))))))) |
4704 |
;;;_ : my-mark-marker to accommodate divergent emacsen: |
;;;_ : my-mark-marker to accommodate divergent emacsen: |
4705 |
(defun my-mark-marker (&optional force buffer) |
(defun my-mark-marker (&optional force buffer) |
4706 |
"Accommodate the different signature for mark-marker across emacsen. |
"Accommodate the different signature for mark-marker across Emacsen. |
4707 |
|
|
4708 |
GNU XEmacs takes two optional args, while mainline GNU Emacs does not, |
XEmacs takes two optional args, while GNU Emacs does not, |
4709 |
so pass them along when appropriate." |
so pass them along when appropriate." |
4710 |
(if (featurep 'xemacs) |
(if (featurep 'xemacs) |
4711 |
(mark-marker force buffer) |
(mark-marker force buffer) |