comparison lisp/allout.el @ 83492:203c9b24206b

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-153 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-154 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-155 Remove nick-abbrevs stuff from rcirc.el * emacs@sv.gnu.org/emacs--devo--0--patch-156 rcirc.el update from Ryan Yeske * emacs@sv.gnu.org/emacs--devo--0--patch-157 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-158 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-159 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-532
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 15 Mar 2006 17:22:12 +0000
parents a380ca43a190 be6a0491d438
children 2d2f6f096f6e
comparison
equal deleted inserted replaced
83491:16813e8005ce 83492:203c9b24206b
4 ;; 2005, 2006 Free Software Foundation, Inc. 4 ;; 2005, 2006 Free Software Foundation, Inc.
5 5
6 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com> 6 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
7 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com> 7 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
8 ;; Created: Dec 1991 - first release to usenet 8 ;; Created: Dec 1991 - first release to usenet
9 ;; Version: 2.2 9 ;; Version: 2.2.1
10 ;; Keywords: outlines wp languages 10 ;; Keywords: outlines wp languages
11 11
12 ;; This file is part of GNU Emacs. 12 ;; This file is part of GNU Emacs.
13 13
14 ;; GNU Emacs is free software; you can redistribute it and/or modify 14 ;; GNU Emacs is free software; you can redistribute it and/or modify
124 :type '(choice (const :tag "On" t) 124 :type '(choice (const :tag "On" t)
125 (const :tag "Ask about layout" "ask") 125 (const :tag "Ask about layout" "ask")
126 (const :tag "Mode only" "activate") 126 (const :tag "Mode only" "activate")
127 (const :tag "Off" nil)) 127 (const :tag "Off" nil))
128 :group 'allout) 128 :group 'allout)
129 ;;;_ = allout-layout 129 ;;;_ = allout-default-layout
130 (defvar allout-layout nil 130 (defcustom allout-default-layout '(-2 : 0)
131 "*Layout specification and provisional mode trigger for allout outlines. 131 "*Default allout outline layout specification.
132 132
133 Buffer-specific. 133 This setting specifies the outline exposure to use when
134 134 `allout-layout' has the local value `t'. This docstring describes the
135 A list value specifies a default layout for the current buffer, to be 135 layout specifications.
136 applied upon activation of `allout-mode'. Any non-nil value will 136
137 automatically trigger `allout-mode' \(provided `allout-init' has been called 137 A list value specifies a default layout for the current buffer,
138 to enable this behavior). 138 to be applied upon activation of `allout-mode'. Any non-nil
139 139 value will automatically trigger `allout-mode', provided
140 See the docstring for `allout-init' for details on setting up for 140 `allout-init' has been called to enable this behavior.
141 auto-mode-activation, and for `allout-expose-topic' for the format of 141
142 the layout specification. 142 The types of elements in the layout specification are:
143 143
144 You can associate a particular outline layout with a file by setting 144 integer - dictate the relative depth to open the corresponding topic(s),
145 this var via the file's local variables. For example, the following 145 where:
146 lines at the bottom of an Emacs Lisp file: 146 - negative numbers force the topic to be closed before opening
147 147 to the absolute value of the number, so all siblings are open
148 ;;;Local variables: 148 only to that level.
149 ;;;allout-layout: \(0 : -1 -1 0) 149 - positive numbers open to the relative depth indicated by the
150 ;;;End: 150 number, but do not force already opened subtopics to be closed.
151 151 - 0 means to close topic - hide all subitems.
152 will, modulo the above-mentioned conditions, cause the mode to be 152 : - repeat spec - apply the preceeding element to all siblings at
153 activated when the file is visited, followed by the equivalent of 153 current level, *up to* those siblings that would be covered by specs
154 `\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for 154 following the `:' on the list. Ie, apply to all topics at level but
155 the allout.el source file.) 155 trailing ones accounted for by trailing specs. \(Only the first of
156 multiple colons at the same level is honored - later ones are ignored.)
157 * - completely exposes the topic, including bodies
158 + - exposes all subtopics, but not the bodies
159 - - exposes the body of the corresponding topic, but not subtopics
160 list - a nested layout spec, to be applied intricately to its
161 corresponding item(s)
162
163 Examples:
164 '(-2 : 0)
165 Collapse the top-level topics to show their children and
166 grandchildren, but completely collapse the final top-level topic.
167 '(-1 () : 1 0)
168 Close the first topic so only the immediate subtopics are shown,
169 leave the subsequent topics exposed as they are until the second
170 second to last topic, which is exposed at least one level, and
171 completely close the last topic.
172 '(-2 : -1 *)
173 Expose children and grandchildren of all topics at current
174 level except the last two; expose children of the second to
175 last and completely expose the last one, including its subtopics.
176
177 See `allout-expose-topic' for more about the exposure process.
156 178
157 Also, allout's mode-specific provisions will make topic prefixes default 179 Also, allout's mode-specific provisions will make topic prefixes default
158 to the comment-start string, if any, of the language of the file. This 180 to the comment-start string, if any, of the language of the file. This
159 is modulo the setting of `allout-use-mode-specific-leader', which see.") 181 is modulo the setting of `allout-use-mode-specific-leader', which see."
160 (make-variable-buffer-local 'allout-layout) 182 :type 'allout-layout-type
183 :group 'allout)
184 ;;;_ : allout-layout-type
185 (define-widget 'allout-layout-type 'lazy
186 "Allout layout format customization basic building blocks."
187 :type '(repeat
188 (choice (integer :tag "integer (<= zero is strict)")
189 (const :tag ": (repeat prior)" :)
190 (const :tag "* (completely expose)" *)
191 (const :tag "+ (expose all offspring, headlines only)" +)
192 (const :tag "- (expose topic body but not offspring)" -)
193 (allout-layout-type :tag "<Nested layout>"))))
194
161 ;;;_ = allout-show-bodies 195 ;;;_ = allout-show-bodies
162 (defcustom allout-show-bodies nil 196 (defcustom allout-show-bodies nil
163 "*If non-nil, show entire body when exposing a topic, rather than 197 "*If non-nil, show entire body when exposing a topic, rather than
164 just the header." 198 just the header."
165 :type 'boolean 199 :type 'boolean
588 ;;;_* CODE - no user customizations below. 622 ;;;_* CODE - no user customizations below.
589 623
590 ;;;_ #1 Internal Outline Formatting and Configuration 624 ;;;_ #1 Internal Outline Formatting and Configuration
591 ;;;_ : Version 625 ;;;_ : Version
592 ;;;_ = allout-version 626 ;;;_ = allout-version
593 (defvar allout-version "2.2" 627 (defvar allout-version "2.2.1"
594 "Version of currently loaded outline package. \(allout.el)") 628 "Version of currently loaded outline package. \(allout.el)")
595 ;;;_ > allout-version 629 ;;;_ > allout-version
596 (defun allout-version (&optional here) 630 (defun allout-version (&optional here)
597 "Return string describing the loaded outline version." 631 "Return string describing the loaded outline version."
598 (interactive "P") 632 (interactive "P")
602 msg)) 636 msg))
603 ;;;_ : Mode activation (defined here because it's referenced early) 637 ;;;_ : Mode activation (defined here because it's referenced early)
604 ;;;_ = allout-mode 638 ;;;_ = allout-mode
605 (defvar allout-mode nil "Allout outline mode minor-mode flag.") 639 (defvar allout-mode nil "Allout outline mode minor-mode flag.")
606 (make-variable-buffer-local 'allout-mode) 640 (make-variable-buffer-local 'allout-mode)
641 ;;;_ = allout-layout nil
642 (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL - see docstring.
643 "Buffer-specific setting for allout layout.
644
645 In buffers where this is non-nil \(and if `allout-init' has been run, to
646 enable this behavior), `allout-mode' will be automatically activated. The
647 layout dictated by the value will be used to set the initial exposure when
648 `allout-mode' is activated.
649
650 \*You should not setq-default this variable non-nil unless you want every
651 visited file to be treated as an allout file.*
652
653 The value would typically be set by a file local variable. For
654 example, the following lines at the bottom of an Emacs Lisp file:
655
656 ;;;Local variables:
657 ;;;allout-layout: \(0 : -1 -1 0)
658 ;;;End:
659
660 dictate activation of `allout-mode' mode when the file is visited
661 \(presuming allout-init was already run), followed by the
662 equivalent of `\(allout-expose-topic 0 : -1 -1 0)'. \(This is
663 the layout used for the allout.el source file.)
664
665 `allout-default-layout' describes the specification format.
666 `allout-layout' can additionally have the value `t', in which
667 case the value of `allout-default-layout' is used.")
668 (make-variable-buffer-local 'allout-layout)
669 (put 'allout-layout 'safe-local-variable t)
670
607 ;;;_ : Topic header format 671 ;;;_ : Topic header format
608 ;;;_ = allout-regexp 672 ;;;_ = allout-regexp
609 (defvar allout-regexp "" 673 (defvar allout-regexp ""
610 "*Regular expression to match the beginning of a heading line. 674 "*Regular expression to match the beginning of a heading line.
611 675
971 ;;;_ = file-var-bug hack 1035 ;;;_ = file-var-bug hack
972 (defvar allout-v18/19-file-var-hack nil 1036 (defvar allout-v18/19-file-var-hack nil
973 "Horrible hack used to prevent invalid multiple triggering of outline 1037 "Horrible hack used to prevent invalid multiple triggering of outline
974 mode from prop-line file-var activation. Used by `allout-mode' function 1038 mode from prop-line file-var activation. Used by `allout-mode' function
975 to track repeats.") 1039 to track repeats.")
976 ;;;_ = allout-file-passphrase-verifier-string
977 (defvar allout-file-passphrase-verifier-string nil
978 "Name for use as a file variable for verifying encryption passphrase
979 across sessions.")
980 (make-variable-buffer-local 'allout-file-passphrase-verifier-string)
981 ;;;_ = allout-passphrase-verifier-string 1040 ;;;_ = allout-passphrase-verifier-string
982 (defvar allout-passphrase-verifier-string nil 1041 (defvar allout-passphrase-verifier-string nil
983 "Setting used to test solicited encryption passphrases against the one 1042 "Setting used to test solicited encryption passphrases against the one
984 already associated with a file. 1043 already associated with a file.
985 1044
991 1050
992 The verifier string is retained as an Emacs file variable, as well as in 1051 The verifier string is retained as an Emacs file variable, as well as in
993 the emacs buffer state, if file variable adjustments are enabled. See 1052 the emacs buffer state, if file variable adjustments are enabled. See
994 `allout-enable-file-variable-adjustment' for details about that.") 1053 `allout-enable-file-variable-adjustment' for details about that.")
995 (make-variable-buffer-local 'allout-passphrase-verifier-string) 1054 (make-variable-buffer-local 'allout-passphrase-verifier-string)
1055 (put 'allout-passphrase-verifier-string 'safe-local-variable t)
996 ;;;_ = allout-passphrase-hint-string 1056 ;;;_ = allout-passphrase-hint-string
997 (defvar allout-passphrase-hint-string "" 1057 (defvar allout-passphrase-hint-string ""
998 "Variable used to retain reminder string for file's encryption passphrase. 1058 "Variable used to retain reminder string for file's encryption passphrase.
999 1059
1000 See the description of `allout-passphrase-hint-handling' for details about how 1060 See the description of `allout-passphrase-hint-handling' for details about how
1002 1062
1003 The hint is retained as an Emacs file variable, as well as in the emacs buffer 1063 The hint is retained as an Emacs file variable, as well as in the emacs buffer
1004 state, if file variable adjustments are enabled. See 1064 state, if file variable adjustments are enabled. See
1005 `allout-enable-file-variable-adjustment' for details about that.") 1065 `allout-enable-file-variable-adjustment' for details about that.")
1006 (make-variable-buffer-local 'allout-passphrase-hint-string) 1066 (make-variable-buffer-local 'allout-passphrase-hint-string)
1067 (put 'allout-passphrase-hint-string 'safe-local-variable t)
1007 (setq-default allout-passphrase-hint-string "") 1068 (setq-default allout-passphrase-hint-string "")
1008 ;;;_ = allout-after-save-decrypt 1069 ;;;_ = allout-after-save-decrypt
1009 (defvar allout-after-save-decrypt nil 1070 (defvar allout-after-save-decrypt nil
1010 "Internal variable, is nil or has the value of two points: 1071 "Internal variable, is nil or has the value of two points:
1011 1072
1576 ;; Reactivation: 1637 ;; Reactivation:
1577 ((setq do-layout t) 1638 ((setq do-layout t)
1578 (allout-infer-body-reindent)) 1639 (allout-infer-body-reindent))
1579 ) ; cond 1640 ) ; cond
1580 1641
1581 (if (and do-layout 1642 (let ((use-layout (if (listp allout-layout)
1582 allout-auto-activation 1643 allout-layout
1583 (listp allout-layout) 1644 allout-default-layout)))
1584 (and (not (eq allout-auto-activation 'activate)) 1645 (if (and do-layout
1585 (if (eq allout-auto-activation 'ask) 1646 allout-auto-activation
1586 (if (y-or-n-p (format "Expose %s with layout '%s'? " 1647 use-layout
1587 (buffer-name) 1648 (and (not (eq allout-auto-activation 'activate))
1588 allout-layout)) 1649 (if (eq allout-auto-activation 'ask)
1589 t 1650 (if (y-or-n-p (format "Expose %s with layout '%s'? "
1590 (message "Skipped %s layout." (buffer-name)) 1651 (buffer-name)
1591 nil) 1652 use-layout))
1592 t))) 1653 t
1593 (save-excursion 1654 (message "Skipped %s layout." (buffer-name))
1594 (message "Adjusting '%s' exposure..." (buffer-name)) 1655 nil)
1595 (goto-char 0) 1656 t)))
1596 (allout-this-or-next-heading) 1657 (save-excursion
1597 (condition-case err 1658 (message "Adjusting '%s' exposure..." (buffer-name))
1598 (progn 1659 (goto-char 0)
1599 (apply 'allout-expose-topic (list allout-layout)) 1660 (allout-this-or-next-heading)
1600 (message "Adjusting '%s' exposure... done." (buffer-name))) 1661 (condition-case err
1601 ;; Problem applying exposure - notify user, but don't 1662 (progn
1602 ;; interrupt, eg, file visit: 1663 (apply 'allout-expose-topic (list use-layout))
1603 (error (message "%s" (car (cdr err))) 1664 (message "Adjusting '%s' exposure... done." (buffer-name)))
1604 (sit-for 1))))) 1665 ;; Problem applying exposure - notify user, but don't
1666 ;; interrupt, eg, file visit:
1667 (error (message "%s" (car (cdr err)))
1668 (sit-for 1))))))
1605 allout-mode 1669 allout-mode
1606 ) ; let* 1670 ) ; let*
1607 ) ; defun 1671 ) ; defun
1608 ;;;_ > allout-minor-mode 1672 ;;;_ > allout-minor-mode
1609 (defalias 'allout-minor-mode 'allout-mode) 1673 (defalias 'allout-minor-mode 'allout-mode)
1658 (goto-char first) 1722 (goto-char first)
1659 (condition-case nil 1723 (condition-case nil
1660 (if (not 1724 (if (not
1661 (yes-or-no-p 1725 (yes-or-no-p
1662 (substitute-command-keys 1726 (substitute-command-keys
1663 (concat "Modify this concealed text? (\"no\" aborts," 1727 (concat "Modify concealed text? (\"no\" just aborts,"
1664 " \\[keyboard-quit] also reconceals) ")))) 1728 " \\[keyboard-quit] also reconceals) "))))
1665 (progn (goto-char start) 1729 (progn (goto-char start)
1666 (error "Concealed-text change refused."))) 1730 (error "Concealed-text change refused.")))
1667 (quit (allout-flag-region ol-start ol-end nil) 1731 (quit (allout-flag-region ol-start ol-end nil)
1668 (allout-flag-region ol-start ol-end t) 1732 (allout-flag-region ol-start ol-end t)
1674 1738
1675 See allout-overlay-interior-modification-handler for details. 1739 See allout-overlay-interior-modification-handler for details.
1676 1740
1677 This before-change handler is used only where modification-hooks 1741 This before-change handler is used only where modification-hooks
1678 overlay property is not supported." 1742 overlay property is not supported."
1679 (if (not allout-mode) 1743 (if (not (allout-mode-p))
1680 nil 1744 nil
1681 (allout-overlay-interior-modification-handler nil nil beg end nil))) 1745 (allout-overlay-interior-modification-handler nil nil beg end nil)))
1682 ;;;_ > allout-isearch-end-handler (&optional overlay) 1746 ;;;_ > allout-isearch-end-handler (&optional overlay)
1683 (defun allout-isearch-end-handler (&optional overlay) 1747 (defun allout-isearch-end-handler (&optional overlay)
1684 "Reconcile allout outline exposure on arriving in hidden text after isearch. 1748 "Reconcile allout outline exposure on arriving in hidden text after isearch.
2559 char. When in this mode you can use regular cursor-positioning 2623 char. When in this mode you can use regular cursor-positioning
2560 command/keystrokes to relocate the cursor off of a bullet character to 2624 command/keystrokes to relocate the cursor off of a bullet character to
2561 return to regular interpretation of self-insert characters." 2625 return to regular interpretation of self-insert characters."
2562 2626
2563 (if (not (allout-mode-p)) 2627 (if (not (allout-mode-p))
2564 ;; Shouldn't be invoked if not in allout-mode, but just in case:
2565 nil 2628 nil
2566 ;; Hot-spot navigation provisions: 2629 ;; Hot-spot navigation provisions:
2567 (if (and (eq this-command 'self-insert-command) 2630 (if (and (eq this-command 'self-insert-command)
2568 (eq (point)(allout-current-bullet-pos))) 2631 (eq (point)(allout-current-bullet-pos)))
2569 (let* ((this-key-num (cond 2632 (let* ((this-key-num (cond
2593 (if mapped-binding 2656 (if mapped-binding
2594 (setq allout-post-goto-bullet t 2657 (setq allout-post-goto-bullet t
2595 this-command mapped-binding))))))) 2658 this-command mapped-binding)))))))
2596 ;;;_ > allout-find-file-hook () 2659 ;;;_ > allout-find-file-hook ()
2597 (defun allout-find-file-hook () 2660 (defun allout-find-file-hook ()
2598 "Activate `allout-mode' when `allout-auto-activation', `allout-layout' non-nil. 2661 "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'.
2599 2662
2600 See `allout-init' for setup instructions." 2663 See `allout-init' for setup instructions."
2601 (if (and allout-auto-activation 2664 (if (and allout-auto-activation
2602 (not (allout-mode-p)) 2665 (not (allout-mode-p))
2603 allout-layout) 2666 allout-layout)
3413 (interactive "*P") 3476 (interactive "*P")
3414 3477
3415 (if (or (not (allout-mode-p)) 3478 (if (or (not (allout-mode-p))
3416 (not (bolp)) 3479 (not (bolp))
3417 (not (looking-at allout-regexp))) 3480 (not (looking-at allout-regexp)))
3418 ;; Above conditions do not obtain - just do a regular kill: 3481 ;; Just do a regular kill:
3419 (kill-line arg) 3482 (kill-line arg)
3420 ;; Ah, have to watch out for adjustments: 3483 ;; Ah, have to watch out for adjustments:
3421 (let* ((beg (point)) 3484 (let* ((beg (point))
3422 (beg-hidden (allout-hidden-p)) 3485 (beg-hidden (allout-hidden-p))
3423 (end-hidden (save-excursion (allout-end-of-current-line) 3486 (end-hidden (save-excursion (allout-end-of-current-line)
3887 3950
3888 If optional INCLUDE-SINGLE-LINERS is true, then include single-line 3951 If optional INCLUDE-SINGLE-LINERS is true, then include single-line
3889 topics \(which intrinsically can be considered both collapsed and 3952 topics \(which intrinsically can be considered both collapsed and
3890 not\), as collapsed. Otherwise they are considered uncollapsed." 3953 not\), as collapsed. Otherwise they are considered uncollapsed."
3891 (save-excursion 3954 (save-excursion
3892 (and 3955 (and
3893 (= (progn (allout-back-to-current-heading) 3956 (= (progn (allout-back-to-current-heading)
3894 (move-end-of-line 1) 3957 (move-end-of-line 1)
3895 (point)) 3958 (point))
3896 (allout-end-of-current-subtree)) 3959 (allout-end-of-current-subtree))
3897 (or include-single-liners 3960 (or include-single-liners
5066 ) 5129 )
5067 ) 5130 )
5068 ) 5131 )
5069 ;;;_ > allout-obtain-passphrase (for-key cache-id prompt-id key-type 5132 ;;;_ > allout-obtain-passphrase (for-key cache-id prompt-id key-type
5070 ;;; allout-buffer retried fetch-pass) 5133 ;;; allout-buffer retried fetch-pass)
5071 (defun allout-obtain-passphrase (for-key cache-id prompt-id key-type 5134 (defun allout-obtain-passphrase (for-key cache-id prompt-id key-type
5072 allout-buffer retried fetch-pass) 5135 allout-buffer retried fetch-pass)
5073 "Obtain passphrase for a key from the cache or else from the user. 5136 "Obtain passphrase for a key from the cache or else from the user.
5074 5137
5075 When obtaining from the user, symmetric-cipher passphrases are verified 5138 When obtaining from the user, symmetric-cipher passphrases are verified
5076 against either, if available and enabled, a random string that was 5139 against either, if available and enabled, a random string that was
5240 (aset spew i (1+ (random 254)))) 5303 (aset spew i (1+ (random 254))))
5241 (allout-encrypt-string spew nil (current-buffer) 'symmetric 5304 (allout-encrypt-string spew nil (current-buffer) 'symmetric
5242 nil nil 0 passphrase)) 5305 nil nil 0 passphrase))
5243 ) 5306 )
5244 ;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase 5307 ;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase
5245 ;;; outline-buffer) 5308 ;;; outline-buffer)
5246 (defun allout-update-passphrase-mnemonic-aids (for-key passphrase 5309 (defun allout-update-passphrase-mnemonic-aids (for-key passphrase
5247 outline-buffer) 5310 outline-buffer)
5248 "Update passphrase verifier and hint strings if necessary. 5311 "Update passphrase verifier and hint strings if necessary.
5249 5312
5250 See `allout-passphrase-verifier-string' and `allout-passphrase-hint-string' 5313 See `allout-passphrase-verifier-string' and `allout-passphrase-hint-string'
5296 ) 5359 )
5297 ;;;_ > allout-get-encryption-passphrase-verifier () 5360 ;;;_ > allout-get-encryption-passphrase-verifier ()
5298 (defun allout-get-encryption-passphrase-verifier () 5361 (defun allout-get-encryption-passphrase-verifier ()
5299 "Return text of the encrypt passphrase verifier, unmassaged, or nil if none. 5362 "Return text of the encrypt passphrase verifier, unmassaged, or nil if none.
5300 5363
5301 Derived from value of `allout-file-passphrase-verifier-string'." 5364 Derived from value of `allout-passphrase-verifier-string'."
5302 5365
5303 (let ((verifier-string (and (boundp 'allout-passphrase-verifier-string) 5366 (let ((verifier-string (and (boundp 'allout-passphrase-verifier-string)
5304 allout-passphrase-verifier-string))) 5367 allout-passphrase-verifier-string)))
5305 (if verifier-string 5368 (if verifier-string
5306 ;; Return it uncollapsed 5369 ;; Return it uncollapsed
5455 t 5518 t
5456 (allout-open-topic 2) 5519 (allout-open-topic 2)
5457 (insert (concat "Dummy outline topic header - see" 5520 (insert (concat "Dummy outline topic header - see"
5458 "`allout-mode' docstring: `^Hm'.")) 5521 "`allout-mode' docstring: `^Hm'."))
5459 (allout-adjust-file-variable 5522 (allout-adjust-file-variable
5460 "allout-layout" (format "%s" (or allout-layout '(-1 : 0))))))) 5523 "allout-layout" (or allout-layout '(-1 : 0))))))
5461 ;;;_ > allout-file-vars-section-data () 5524 ;;;_ > allout-file-vars-section-data ()
5462 (defun allout-file-vars-section-data () 5525 (defun allout-file-vars-section-data ()
5463 "Return data identifying the file-vars section, or nil if none. 5526 "Return data identifying the file-vars section, or nil if none.
5464 5527
5465 Returns list `(beginning-point prefix-string suffix-string)'." 5528 Returns list `(beginning-point prefix-string suffix-string)'."
5706 \(This disregards invisible newlines such as those 5769 \(This disregards invisible newlines such as those
5707 which are part of the text that an image rests on.) 5770 which are part of the text that an image rests on.)
5708 5771
5709 With argument ARG not nil or 1, move forward ARG - 1 lines first. 5772 With argument ARG not nil or 1, move forward ARG - 1 lines first.
5710 If point reaches the beginning or end of buffer, it stops there. 5773 If point reaches the beginning or end of buffer, it stops there.
5711 To ignore intangibility, bind `inhibit-point-motion-hooks' to t. 5774 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5712
5713 This function does not move point across a field boundary unless that
5714 would move point to a different line than the original, unconstrained
5715 result. If N is nil or 1, and a front-sticky field starts at point,
5716 the point does not move. To ignore field boundaries bind
5717 `inhibit-field-text-motion' to t."
5718 (interactive "p") 5775 (interactive "p")
5719 (or arg (setq arg 1)) 5776 (or arg (setq arg 1))
5720 (if (/= arg 1) 5777 (if (/= arg 1)
5721 (condition-case nil (line-move (1- arg)) (error nil))) 5778 (condition-case nil (line-move (1- arg)) (error nil)))
5722 5779
5728 (previous-property-change (point)) 5785 (previous-property-change (point))
5729 (previous-char-property-change (point)))) 5786 (previous-char-property-change (point))))
5730 (skip-chars-backward "^\n")) 5787 (skip-chars-backward "^\n"))
5731 (vertical-motion 0) 5788 (vertical-motion 0)
5732 (if (/= orig (point)) 5789 (if (/= orig (point))
5733 (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))) 5790 (goto-char orig))))
5734 ) 5791 )
5735 ;;;_ > move-end-of-line if necessary - older emacs, xemacs 5792 ;;;_ > move-end-of-line if necessary - older emacs, xemacs
5736 (if (not (fboundp 'move-end-of-line)) 5793 (if (not (fboundp 'move-end-of-line))
5737 (defun move-end-of-line (arg) 5794 (defun move-end-of-line (arg)
5738 "Move point to end of current line as displayed. 5795 "Move point to end of current line as displayed.
5739 \(This disregards invisible newlines such as those 5796 \(This disregards invisible newlines such as those
5740 which are part of the text that an image rests on.) 5797 which are part of the text that an image rests on.)
5741 5798
5742 With argument ARG not nil or 1, move forward ARG - 1 lines first. 5799 With argument ARG not nil or 1, move forward ARG - 1 lines first.
5743 If point reaches the beginning or end of buffer, it stops there. 5800 If point reaches the beginning or end of buffer, it stops there.
5744 To ignore intangibility, bind `inhibit-point-motion-hooks' to t. 5801 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5745
5746 This function does not move point across a field boundary unless that
5747 would move point to a different line than the original, unconstrained
5748 result. If N is nil or 1, and a rear-sticky field ends at point,
5749 the point does not move. To ignore field boundaries bind
5750 `inhibit-field-text-motion' to t."
5751 (interactive "p") 5802 (interactive "p")
5752 (or arg (setq arg 1)) 5803 (or arg (setq arg 1))
5753 (let ((orig (point)) 5804 (let ((orig (point))
5754 done) 5805 done)
5755 (while (not done) 5806 (while (not done)
5775 ;; and now we're not really at eol, 5826 ;; and now we're not really at eol,
5776 ;; keep going. 5827 ;; keep going.
5777 (setq arg 1) 5828 (setq arg 1)
5778 (setq done t))))) 5829 (setq done t)))))
5779 (if (/= orig (point)) 5830 (if (/= orig (point))
5780 (goto-char (constrain-to-field (point) orig (/= arg 1) t 5831 (goto-char orig))))
5781 nil)))))
5782 ) 5832 )
5783 ;;;_ > line-move-invisible-p if necessary 5833 ;;;_ > line-move-invisible-p if necessary
5784 (if (not (fboundp 'line-move-invisible-p)) 5834 (if (not (fboundp 'line-move-invisible-p))
5785 (defun line-move-invisible-p (pos) 5835 (defun line-move-invisible-p (pos)
5786 "Return non-nil if the character after POS is currently invisible." 5836 "Return non-nil if the character after POS is currently invisible."