• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:auto +defs:mode +defs:list

1 ;;; allout.el --- extensive outline mode for use alone and with other modes
32 ;; Allout outline minor mode provides extensive outline formatting and
33 ;; and manipulation beyond standard emacs outline mode. Some features:
35 ;; - Classic outline-mode topic-oriented navigation and exposure adjustment
53 ;; exposure control (see the allout-mode docstring)
57 ;; and maintenance of hanging indentation (in paragraph auto-fill and
63 ;; See the `allout-mode' function's docstring for an introduction to the
64 ;; mode.
72 ;; activation of allout-mode.
75 ;; `allout-auto-activation' for details on automatic activation of
76 ;; `allout-mode' as a minor mode. (It has changed since allout
106 "Extensive outline mode for use alone and with other modes."
112 ;;;_ = allout-auto-activation
113 (defcustom allout-auto-activation nil
114 "*Regulates auto-activation modality of allout outlines - see `allout-init'.
117 outline mode is automatically activated when the buffer-specific
119 dictated by `allout-layout' should be imposed on mode activation.
121 With value t, auto-mode-activation and auto-layout are enabled.
125 With value `ask', auto-mode-activation is enabled, and endorsement for
126 performing auto-layout is asked of the user each time.
128 With value `activate', only auto-mode-activation is enabled,
129 auto-layout is not.
131 With value nil, neither auto-mode-activation nor auto-layout are
149 A list value specifies a default layout for the current buffer,
150 to be applied upon activation of `allout-mode'. Any non-nil
151 value will automatically trigger `allout-mode', provided
166 following the `:' on the list. Ie, apply to all topics at level but
172 list - a nested layout spec, to be applied intricately to its
191 Also, allout's mode-specific provisions will make topic prefixes default
193 is modulo the setting of `allout-use-mode-specific-leader', which see."
299 with the original Emacs outline mode. See `allout-plain-bullets-string'
316 Outline mode has to be reactivated in order for changes to the value
356 `#' marks auto-numbered bullets - see `allout-numbered-bullet'.)
361 You must run `set-allout-regexp' in order for outline mode to
372 ;;;_ = allout-use-mode-specific-leader
373 (defcustom allout-use-mode-specific-leader t
374 "*When non-nil, use mode-specific topic-header prefixes.
376 Allout outline mode will use the mode-specific `allout-mode-leaders' or
384 Value t means to first check for assoc value in `allout-mode-leaders'
388 Set to the symbol for either of `allout-mode-leaders' or
400 `allout-mode-leaders' to override this behavior, when
403 (const allout-mode-leaders)
407 (put 'allout-use-mode-specific-leader 'safe-local-variable
408 '(lambda (x) (or (memq x '(t nil allout-mode-leaders comment-start))
410 ;;;_ = allout-mode-leaders
411 (defvar allout-mode-leaders '()
414 Use this if the mode's comment-start string isn't what you
415 prefer, or if the mode lacks a comment-start string. See
416 `allout-use-mode-specific-leader' for more details.
425 "*When non-nil, use only old-and-crusty `outline-mode' `*' topic prefixes.
491 "*String designating bullet of topics that have auto-numbering; nil for none.
620 mostly covers both deliberate file writes and auto-saves.
627 Auto-saves will use the \"All except current topic\" mode if this
633 This mode is used for auto-saves for both this option and \"Yes\".
636 For practical reasons, auto-saves always use the 'except-current policy
637 when auto-encryption is enabled. (Otherwise, spurious passphrase prompts
639 file requires that even the current topic is never auto-saved in the clear,
640 disable auto-saves for that file."
672 "*Key sequence to be used as prefix for outline mode command key bindings.
679 ;;;_ = allout-keybindings-list
680 ;;; You have to reactivate allout-mode - `(allout-mode t)' - to
682 (defvar allout-keybindings-list ()
683 "*List of `allout-mode' key / function bindings, for `allout-mode-map'.
687 (setq allout-keybindings-list
729 ;;;_ = allout-inhibit-auto-fill
730 (defcustom allout-inhibit-auto-fill nil
731 "*If non-nil, auto-fill will be inhibited in the allout buffers.
734 in individual buffers if you want to inhibit auto-fill only in particular
735 buffers. (You could use a function on `allout-mode-hook' to inhibit
736 auto-fill according, eg, to the major mode.)
738 If you don't set this and auto-fill-mode is enabled, allout will use the
739 value that `normal-auto-fill-function', if any, when allout mode starts, or
740 else allout's special hanging-indent maintaining auto-fill function,
741 `allout-auto-fill'."
744 (make-variable-buffer-local 'allout-inhibit-auto-fill)
748 "*If non-nil, topic body text auto-indent defaults to indent of the header.
750 relevant mostly for use with indented-text-mode, or other situations
751 where auto-fill occurs."
762 "*Non-nil enables auto-adjust of topic body hanging indent with depth shifts.
811 ;;;_ = allout-mode
812 (defvar allout-mode nil "Allout outline mode minor-mode flag.")
813 (make-variable-buffer-local 'allout-mode)
819 enable this behavior), `allout-mode' will be automatically activated. The
821 `allout-mode' is activated.
833 dictate activation of `allout-mode' mode when the file is visited
945 `allout-use-mode-specific-leader'
946 and `allout-mode-leaders'.
948 Apply this via (re)activation of `allout-mode', rather than
950 (let* ((use-leader (and (boundp 'allout-use-mode-specific-leader)
951 (if (or (stringp allout-use-mode-specific-leader)
952 (memq allout-use-mode-specific-leader
953 '(allout-mode-leaders
956 allout-use-mode-specific-leader
964 (t (or (and (memq use-leader '(t allout-mode-leaders))
965 ;; Get it from outline mode leaders?
966 (cdr (assq major-mode allout-mode-leaders)))
967 ;; ... didn't get from allout-mode-leaders...
1014 (let ((strings (list 'allout-plain-bullets-string
1123 ;;;_ = allout-mode-map
1124 (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.")
1125 ;;;_ > produce-allout-mode-map (keymap-alist &optional base-map)
1126 (defun produce-allout-mode-map (keymap-list &optional base-map)
1127 "Produce keymap for use as allout-mode-map, from KEYMAP-LIST.
1130 See doc string for allout-keybindings-list for format of binding list."
1132 (pref (list allout-command-prefix)))
1136 (key-suff (list (car cell))))
1138 (list map
1143 keymap-list)
1146 (defvar allout-mode-exposure-menu)
1147 (defvar allout-mode-editing-menu)
1148 (defvar allout-mode-navigation-menu)
1149 (defvar allout-mode-misc-menu)
1150 (defun produce-allout-mode-menubar-entries ()
1152 (easy-menu-define allout-mode-exposure-menu
1153 allout-mode-map
1163 (easy-menu-define allout-mode-editing-menu
1164 allout-mode-map
1180 (easy-menu-define allout-mode-navigation-menu
1181 allout-mode-map
1197 (easy-menu-define allout-mode-misc-menu
1198 allout-mode-map
1212 ;;;_ = allout-mode-prior-settings
1213 (defvar allout-mode-prior-settings nil
1214 "Internal `allout-mode' use; settings to be resumed on mode deactivation.
1217 (make-variable-buffer-local 'allout-mode-prior-settings)
1238 extended from the existing one by `append'ing a list containing the second
1242 functions - use the 'local mode of `add-hook' for that, instead.
1244 The settings are stored on `allout-mode-prior-settings'."
1258 (when (not (assoc name allout-mode-prior-settings))
1262 (push (list name prior-value) allout-mode-prior-settings)
1265 (push (list name) allout-mode-prior-settings)
1270 (error "extension of non-list prior value attempted")
1274 (error "appending of non-list prior value attempted")
1275 (set name (append prior-value (list value)))))
1283 This is used when concluding allout-mode, to resume selected variables to
1284 their settings before allout-mode was started."
1286 (while allout-mode-prior-settings
1287 (let* ((pair (pop allout-mode-prior-settings))
1302 ;;;_ = allout-mode-hook
1303 (defvar allout-mode-hook nil
1304 "*Hook that's run when allout mode starts.")
1305 ;;;_ = allout-mode-deactivate-hook
1306 (defvar allout-mode-deactivate-hook nil
1307 "*Hook that's run when allout mode ends.")
1329 - flag - change mode: nil for exposure, otherwise concealment.
1374 ;;;_ = allout-outside-normal-auto-fill-function
1375 (defvar allout-outside-normal-auto-fill-function nil
1376 "Value of normal-auto-fill-function outside of allout mode.
1378 Used by allout-auto-fill to do the mandated normal-auto-fill-function
1380 (make-variable-buffer-local 'allout-outside-normal-auto-fill-function)
1384 mode from prop-line file-var activation. Used by `allout-mode' function
1437 Each value can be a regexp or a list with a regexp followed by a
1447 incidentally contains strings that would disrupt mode operation -
1448 for example, a line that happens to look like an allout-mode topic prefix.
1463 ;;;_ > allout-mode-p ()
1466 (defmacro allout-mode-p ()
1467 "Return t if `allout-mode' is active in current buffer."
1468 'allout-mode)
1473 (if (or (not (allout-mode-p))
1483 (message "auto-encrypting pending topics")
1495 ;;;_ > allout-auto-save-hook-handler ()
1496 (defun allout-auto-save-hook-handler ()
1497 "Implement `allout-encrypt-unencrypted-on-saves' policy for auto save."
1499 (if (and (allout-mode-p) allout-encrypt-unencrypted-on-saves)
1512 (if (not (and (allout-mode-p)
1540 "If t, `allout-mode's last deactivation was deliberate.
1543 ;;;_ > allout-init (&optional mode)
1544 (defun allout-init (&optional mode)
1545 "Prime `allout-mode' to enable/disable auto-activation, wrt `allout-layout'.
1549 - nil (or no argument) deactivate auto-activation/layout;
1550 - `activate', enable auto-activation only;
1551 - `ask', enable auto-activation, and enable auto-layout but with
1553 - `report', just report and return the current auto-activation state;
1554 - anything else (eg, t) for auto-activation and auto-layout, without
1558 of allout outline mode, contingent to the buffer-specific setting of
1560 `allout-expose-topic' docstrings for more details on auto layout).
1562 `allout-init' works by setting up (or removing) the `allout-mode'
1563 find-file-hook, and giving `allout-auto-activation' a suitable
1566 To prime your Emacs session for full auto-outline operation, include
1575 (setq mode
1577 (concat "Select outline auto setup mode "
1583 (if (string= mode "")
1584 (setq mode 'report)
1585 (setq mode (intern-soft mode)))))
1592 (curr-mode 'allout-auto-activation))
1594 (cond ((not mode)
1598 (message "Allout outline mode auto-activation inhibited.")))
1599 ((eq mode 'report)
1603 (allout-init (symbol-value curr-mode))))
1605 (set curr-mode ; `set', not `setq'!
1606 (cond ((eq mode 'activate)
1608 "Outline mode auto-activation enabled.")
1610 ((eq mode 'report)
1611 ;; Return the current mode setting:
1612 (allout-init mode))
1613 ((eq mode 'ask)
1615 (concat "Outline mode auto-activation and "
1619 "Outline mode auto-activation and -layout enabled.")
1623 "Populate the current buffer's menubar with `allout-mode' stuff."
1624 (let ((menus (list allout-mode-exposure-menu
1625 allout-mode-editing-menu
1626 allout-mode-navigation-menu
1627 allout-mode-misc-menu))
1639 ;; XXX We use isearch-open-invisible *and* isearch-mode-end-hook. The
1653 ;;;_ > allout-mode (&optional toggle)
1656 (defun allout-mode (&optional toggle)
1658 "Toggle minor mode for controlling exposure and editing of text outlines.
1659 \\<allout-mode-map>
1661 Optional arg forces mode to re-initialize iff arg is positive num or
1662 symbol. Allout outline mode always runs as a minor mode.
1664 Allout outline mode provides extensive outline oriented formatting and
1685 special `allout-mode' features and terminology. See also the outline
1688 priming your emacs session for automatic activation of `allout-mode'.
1690 The bindings are dictated by the customizable `allout-keybindings-list'
1758 M-x outlineify-sticky Activate outline mode for current buffer,
1770 \\[eval-expression] (allout-init t) Setup Emacs session for outline mode
1771 auto-activation.
1775 Outline mode supports gpg encryption of topics, with support for
1778 mode, and auto-encryption of topics pending encryption on save.
1801 corresponding allout-mode keymap control chars. For example, \"f\"
1811 In allout-mode, the normal beginning-of-line command (\\[allout-beginning-of-line]]) is
1825 `allout-mode-hook'
1826 `allout-mode-deactivate-hook'
1880 `allout-header-prefix' and then reinitializing `allout-mode'.
1886 setting happens automatically when allout mode is used in
1887 programming-mode buffers. See `allout-use-mode-specific-leader'
1915 (let* ((active (and (not (equal major-mode 'outline))
1916 (allout-mode-p)))
1926 ;; allout-mode already called once during this complex command?
1944 ;; modes twice when file is visited. We have to avoid toggling mode
1948 ; as last time `allout-mode' invoked.
1970 (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t)
1972 (remove-hook 'auto-save-hook 'allout-auto-save-hook-handler t)
1977 (setq allout-mode nil)
1978 (run-hooks 'allout-mode-deactivate-hook))
2001 ;; Produce map from current version of allout-keybindings-list:
2002 (allout-setup-mode-map)
2003 (produce-allout-mode-menubar-entries)
2005 ;; Include on minor-mode-map-alist, if not already there:
2006 (if (not (member '(allout-mode . allout-mode-map)
2007 minor-mode-map-alist))
2008 (setq minor-mode-map-alist
2009 (cons '(allout-mode . allout-mode-map)
2010 minor-mode-map-alist)))
2019 (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler nil t)
2022 (add-hook 'auto-save-hook 'allout-auto-save-hook-handler
2025 ;; Stash auto-fill settings and adjust so custom allout auto-fill
2026 ;; func will be used if auto-fill is active or activated. (The
2029 (if (and auto-fill-function (not allout-inhibit-auto-fill))
2030 ;; allout-auto-fill will use the stashed values and so forth.
2031 (allout-add-resumptions '(auto-fill-function allout-auto-fill)))
2032 (allout-add-resumptions (list 'allout-former-auto-filler
2033 auto-fill-function)
2034 ;; Register allout-auto-fill to be used if
2036 (list 'allout-outside-normal-auto-fill-function
2037 normal-auto-fill-function)
2038 '(normal-auto-fill-function allout-auto-fill)
2040 (list 'paragraph-start
2043 (list 'paragraph-separate
2046 (or (assq 'allout-mode minor-mode-alist)
2047 (setq minor-mode-alist
2048 (cons '(allout-mode " Allout") minor-mode-alist)))
2055 (setq allout-mode t)
2056 (run-hooks 'allout-mode-hook))
2061 ) ;; end of activation-mode cases.
2063 ;; Do auto layout if warranted:
2068 allout-auto-activation
2070 (and (not (eq allout-auto-activation 'activate))
2071 (if (eq allout-auto-activation 'ask)
2085 (apply 'allout-expose-topic (list use-layout))
2091 allout-mode
2095 (defun allout-setup-mode-map ()
2096 "Establish allout-mode bindings."
2097 (setq-default allout-mode-map
2098 (produce-allout-mode-map allout-keybindings-list))
2099 (setq allout-mode-map
2100 (produce-allout-mode-map allout-keybindings-list))
2103 allout-mode-map global-map)
2106 allout-mode-map global-map)
2109 allout-mode-map global-map)
2112 allout-mode-map global-map)
2113 (fset 'allout-mode-map allout-mode-map))
2115 ;; ensure that allout-mode-map has some setting even if allout-mode hasn't
2117 (allout-setup-mode-map)
2119 ;;;_ > allout-minor-mode
2120 (defalias 'allout-minor-mode 'allout-mode)
2185 (if (and (allout-mode-p) undo-in-progress (allout-hidden-p))
2190 (when (and (featurep 'xemacs) (allout-mode-p))
2203 function can also be used as an `isearch-mode-end-hook'."
2205 (if (and (allout-mode-p) (allout-hidden-p))
2313 ;; them can occur naturally, eg a typical textual bullet list.) We
2442 "Return a list indicating point's numeric section.subsect.subsubsect...
2552 ;; and usable by allout-mode.
2623 prefix. Charts for offspring consists of a list containing,
2705 "Produce a list of locations of this and succeeding sibling topics.
2710 (let ((chart (list (point))))
2717 "Return a flat list of hidden points in subtree CHART, up to DEPTH.
2754 ;; The produced list can have two types of entries. Bare numbers
2906 \(See `allout-mode' doc string for details of hot-spot operation.)"
3266 `allout-mode-map'.")
3270 "Counter that monotonically increases in allout-mode buffers.
3285 (if (not (allout-mode-p)) ; In allout-mode.
3307 `allout-mode-map'. The `allout-mode' `post-command-hook' insures that
3313 char. When in this mode you can use regular cursor-positioning
3317 (if (not (allout-mode-p))
3340 (apply 'characterp (list last-command-char)))
3341 (apply 'char-to-int (list last-command-char)))
3352 (or (and (assoc key-string allout-keybindings-list)
3353 ;; translate literal membership on list:
3354 (cadr (assoc key-string allout-keybindings-list)))
3376 "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'.
3379 (if (and allout-auto-activation
3380 (not (allout-mode-p))
3382 (allout-mode t)))
3805 ;;;_ = allout-former-auto-filler
3806 (defvar allout-former-auto-filler nil
3807 "Name of modal fill function being wrapped by `allout-auto-fill'.")
3808 ;;;_ > allout-auto-fill ()
3809 (defun allout-auto-fill ()
3810 "`allout-mode' autofill function.
3815 (when (not allout-inhibit-auto-fill)
3826 (use-auto-fill-function (or allout-outside-normal-auto-fill-function
3827 auto-fill-function
3828 'do-auto-fill)))
3829 (if (or allout-former-auto-filler allout-use-hanging-indents)
3830 (funcall use-auto-fill-function)))))
4293 "Kill line, adjusting subsequent lines suitably for outline mode."
4297 (if (or (not (allout-mode-p))
4413 (let ((buffer-undo-list t))
4423 (buffer-undo-list t))
4596 "`allout-mode' yank, with depth and numbering adjustment of yanked topics.
4603 1 we're yanking in an `allout-mode' buffer
4627 (if (allout-mode-p)
4641 (if (allout-mode-p)
4738 (list beg end))))
4983 variable-keyed mode-activation/auto-exposure feature of allout outline
4984 mode. See the respective documentation strings for more details.
4988 SPEC is either a number or a list.
4990 Successive specs on a list are applied to successive sibling topics.
4993 list) dictates the exposure for the corresponding topic.
5002 Simple (numeric and null-list) specs are interpreted as follows:
5014 on the list. Ie, apply to all topics at level but the last
5069 (setq spec (append (make-list residue prev-elem)
5103 SPEC is either a number or a list. Optional successive args
5106 A simple spec (either a number, a special symbol, or the null list)
5109 a topic, with the subsequent elements in the list interpreted as specs
5112 Simple (numeric and null-list) specs are interpreted as follows:
5123 If the spec is a list, the first element must be a number, which
5125 elements of the list are nested SPECs, dictating the specific exposure
5196 (list 'save-excursion
5200 (list 'allout-expose-topic (list 'quote spec))))
5208 "Convert list representing section/subsection/... to document string.
5242 "Convert list representing section/subsection/... to document string."
5253 "Convert list representing section/subsection/... to document string."
5283 "Produce a list representing exposed topics in current region.
5285 This list can then be used by `allout-process-exposed' to manipulate
5293 list - Present prefix as numeric section.subsection..., starting with
5294 section indicated by the list, innermost nesting first.
5298 The elements of the list produced are lists that represents a topic
5299 header and body. The elements of that list are:
5321 (setq result (list (list 0 "" nil
5352 ;; Accumulate list for this topic:
5362 (list depth
5372 (list depth
5376 (list depth
5381 (list depth prefix strings))
5400 ;; Put the list with first at front, to last at back:
5473 LISTIFIED is a list representing each topic header and body:
5523 (start-list ()))
5535 format start-list)
5543 The resulting outline is not compatible with outline mode - use
5559 The resulting outline is not compatible with outline mode - use
5683 BULLET string, and a list of TEXT strings for the body."
5776 the default, use a single (x4) universal argument for keypair mode.
5784 auto-encryption specifics.
6142 "conflicts with allout mode - reconfigure!")))
6315 (list type (pgg-gpg-key-id-from-key-owner for-key-owner))
6415 from encryption. This supports 'except-current mode of
6470 from encryption. This supports 'except-current mode of
6473 If a topic that is currently being edited was encrypted, we return a list
6509 (if editing-topic (list editing-topic editing-point))
6522 "Activate outline mode and establish file var so it is started subsequently.
6525 setup for auto-startup."
6529 (allout-mode t)
6537 "`allout-mode' docstring: `^Hm'."))
6544 Returns list `(beginning-point prefix-string suffix-string)'."
6564 (list beg prefix suffix))
6634 "Return a list of values of the symbols in list bound to CONFIGVAR-NAME.
6741 ;;;_ > allout-flatten (list)
6742 (defun allout-flatten (list)
6743 "Return a list of all atoms in list."
6745 (cond ((null list) nil)
6746 ((atom (car list)) (cons (car list) (allout-flatten (cdr list))))
6747 (t (append (allout-flatten (car list)) (allout-flatten (cdr list))))))
6819 (setq buffer-invisibility-spec (list t)))
6920 (isearch-mode t)))