HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/eval.c (Fbind_symbol): New function.
[bpt/emacs.git]
/
lisp
/
outline.el
diff --git
a/lisp/outline.el
b/lisp/outline.el
index
66f4e16
..
c7cad31
100644
(file)
--- a/
lisp/outline.el
+++ b/
lisp/outline.el
@@
-1,9
+1,9
@@
;;; outline.el --- outline mode commands for Emacs
;;; outline.el --- outline mode commands for Emacs
-;; Copyright (C) 1986, 1993
, 1994, 1995, 1997, 2000, 2001, 2002,
-;;
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software
Foundation, Inc.
+;; Copyright (C) 1986, 1993
-1995, 1997, 2000-2014 Free Software
+;; Foundation, Inc.
-;; Maintainer:
FSF
+;; Maintainer:
emacs-devel@gnu.org
;; Keywords: outlines
;; This file is part of GNU Emacs.
;; Keywords: outlines
;; This file is part of GNU Emacs.
@@
-41,27
+41,24
@@
(defgroup outlines nil
"Support for hierarchical outlining."
:prefix "outline-"
(defgroup outlines nil
"Support for hierarchical outlining."
:prefix "outline-"
- :group '
editing
)
+ :group '
wp
)
-(def
custom
outline-regexp "[*\^L]+"
+(def
var
outline-regexp "[*\^L]+"
"Regular expression to match the beginning of a heading.
Any line whose beginning matches this regexp is considered to start a heading.
Note that Outline mode only checks this regexp at the start of a line,
so the regexp need not (and usually does not) start with `^'.
The recommended way to set this is with a Local Variables: list
"Regular expression to match the beginning of a heading.
Any line whose beginning matches this regexp is considered to start a heading.
Note that Outline mode only checks this regexp at the start of a line,
so the regexp need not (and usually does not) start with `^'.
The recommended way to set this is with a Local Variables: list
-in the file it applies to. See also `outline-heading-end-regexp'."
- :type '(choice regexp (const nil))
- :group 'outlines)
-;;;###autoload(put 'outline-regexp 'safe-local-variable 'string-or-null-p)
+in the file it applies to. See also `outline-heading-end-regexp'.")
+;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp)
-(def
custom
outline-heading-end-regexp "\n"
+(def
var
outline-heading-end-regexp "\n"
"Regular expression to match the end of a heading line.
You can assume that point is at the beginning of a heading when this
regexp is searched for. The heading ends at the end of the match.
The recommended way to set this is with a `Local Variables:' list
"Regular expression to match the end of a heading line.
You can assume that point is at the beginning of a heading when this
regexp is searched for. The heading ends at the end of the match.
The recommended way to set this is with a `Local Variables:' list
-in the file it applies to."
- :type 'regexp
- :group 'outlines)
+in the file it applies to.")
+;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
(defvar outline-mode-prefix-map
(let ((map (make-sparse-keymap)))
(defvar outline-mode-prefix-map
(let ((map (make-sparse-keymap)))
@@
-136,24
+133,23
@@
in the file it applies to."
(cons "Headings" (make-sparse-keymap "Headings")))
(define-key map [headings demote-subtree]
(cons "Headings" (make-sparse-keymap "Headings")))
(define-key map [headings demote-subtree]
- '(menu-item "Demote
s
ubtree" outline-demote
+ '(menu-item "Demote
S
ubtree" outline-demote
:help "Demote headings lower down the tree"))
(define-key map [headings promote-subtree]
:help "Demote headings lower down the tree"))
(define-key map [headings promote-subtree]
- '(menu-item "Promote
s
ubtree" outline-promote
+ '(menu-item "Promote
S
ubtree" outline-promote
:help "Promote headings higher up the tree"))
(define-key map [headings move-subtree-down]
:help "Promote headings higher up the tree"))
(define-key map [headings move-subtree-down]
- '(menu-item "Move
subtree d
own" outline-move-subtree-down
- :help "Move the curr
r
ent subtree down past arg headlines of the same level"))
+ '(menu-item "Move
Subtree D
own" outline-move-subtree-down
+ :help "Move the current subtree down past arg headlines of the same level"))
(define-key map [headings move-subtree-up]
(define-key map [headings move-subtree-up]
- '(menu-item "Move
subtree u
p" outline-move-subtree-up
- :help "Move the curr
r
ent subtree up past arg headlines of the same level"))
+ '(menu-item "Move
Subtree U
p" outline-move-subtree-up
+ :help "Move the current subtree up past arg headlines of the same level"))
(define-key map [headings copy]
(define-key map [headings copy]
- '(menu-item "Copy to
kill r
ing" outline-headers-as-kill
+ '(menu-item "Copy to
Kill R
ing" outline-headers-as-kill
:enable mark-active
:help "Save the visible outline headers in region at the start of the kill ring"))
(define-key map [headings outline-insert-heading]
:enable mark-active
:help "Save the visible outline headers in region at the start of the kill ring"))
(define-key map [headings outline-insert-heading]
-
- '(menu-item "New heading" outline-insert-heading
+ '(menu-item "New Heading" outline-insert-heading
:help "Insert a new heading at same depth at point"))
(define-key map [headings outline-backward-same-level]
:help "Insert a new heading at same depth at point"))
(define-key map [headings outline-backward-same-level]
@@
-284,10
+280,10
@@
in the file it applies to."
"Normal hook to be run after outline visibility changes.")
(defvar outline-mode-hook nil
"Normal hook to be run after outline visibility changes.")
(defvar outline-mode-hook nil
- "
*
This hook is run when outline mode starts.")
+ "This hook is run when outline mode starts.")
(defvar outline-blank-line nil
(defvar outline-blank-line nil
- "
*
Non-nil means to leave unhidden blank line before heading.")
+ "Non-nil means to leave unhidden blank line before heading.")
;;;###autoload
(define-derived-mode outline-mode text-mode "Outline"
;;;###autoload
(define-derived-mode outline-mode text-mode "Outline"
@@
-356,7
+352,10
@@
After that, changing the prefix key requires manipulating keymaps."
;;;###autoload
(define-minor-mode outline-minor-mode
"Toggle Outline minor mode.
;;;###autoload
(define-minor-mode outline-minor-mode
"Toggle Outline minor mode.
-With arg, turn Outline minor mode on if arg is positive, off otherwise.
+With a prefix argument ARG, enable Outline minor mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil.
+
See the command `outline-mode' for more information on this mode."
nil " Outl" (list (cons [menu-bar] outline-minor-mode-menu-bar-map)
(cons outline-minor-mode-prefix outline-mode-prefix-map))
See the command `outline-mode' for more information on this mode."
nil " Outl" (list (cons [menu-bar] outline-minor-mode-menu-bar-map)
(cons outline-minor-mode-prefix outline-mode-prefix-map))
@@
-377,7
+376,7
@@
See the command `outline-mode' for more information on this mode."
(show-all)))
\f
(defvar outline-level 'outline-level
(show-all)))
\f
(defvar outline-level 'outline-level
- "
*
Function of no args to compute a header's nesting level in an outline.
+ "Function of no args to compute a header's nesting level in an outline.
It can assume point is at the beginning of a header line and that the match
data reflects the `outline-regexp'.")
;;;###autoload(put 'outline-level 'risky-local-variable t)
It can assume point is at the beginning of a header line and that the match
data reflects the `outline-regexp'.")
;;;###autoload(put 'outline-level 'risky-local-variable t)
@@
-445,10
+444,6
@@
at the end of the buffer."
"Non-nil if the character after point is invisible."
(get-char-property (or pos (point)) 'invisible))
"Non-nil if the character after point is invisible."
(get-char-property (or pos (point)) 'invisible))
-(defun outline-visible ()
- (not (outline-invisible-p)))
-(make-obsolete 'outline-visible 'outline-invisible-p "21.1")
-
(defun outline-back-to-heading (&optional invisible-ok)
"Move to previous heading line, or beg of this line if it's a heading.
Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
(defun outline-back-to-heading (&optional invisible-ok)
"Move to previous heading line, or beg of this line if it's a heading.
Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
@@
-643,12
+638,12
@@
the match data is set appropriately."
;; Vertical tree motion
(defun outline-move-subtree-up (&optional arg)
;; Vertical tree motion
(defun outline-move-subtree-up (&optional arg)
- "Move the curr
r
ent subtree up past ARG headlines of the same level."
+ "Move the current subtree up past ARG headlines of the same level."
(interactive "p")
(outline-move-subtree-down (- arg)))
(defun outline-move-subtree-down (&optional arg)
(interactive "p")
(outline-move-subtree-down (- arg)))
(defun outline-move-subtree-down (&optional arg)
- "Move the curr
r
ent subtree down past ARG headlines of the same level."
+ "Move the current subtree down past ARG headlines of the same level."
(interactive "p")
(let ((movfunc (if (> arg 0) 'outline-get-next-sibling
'outline-get-last-sibling))
(interactive "p")
(let ((movfunc (if (> arg 0) 'outline-get-next-sibling
'outline-get-last-sibling))
@@
-752,6
+747,7
@@
If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
;; very end of the heading, before the newline, so text inserted at FROM
;; belongs to the heading rather than to the entry.
(let ((o (make-overlay from to nil 'front-advance)))
;; very end of the heading, before the newline, so text inserted at FROM
;; belongs to the heading rather than to the entry.
(let ((o (make-overlay from to nil 'front-advance)))
+ (overlay-put o 'evaporate t)
(overlay-put o 'invisible 'outline)
(overlay-put o 'isearch-open-invisible
(or outline-isearch-open-invisible-function
(overlay-put o 'invisible 'outline)
(overlay-put o 'isearch-open-invisible
(or outline-isearch-open-invisible-function
@@
-803,7
+799,7
@@
If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
;; Function to be set as an outline-isearch-open-invisible' property
;; to the overlay that makes the outline invisible (see
;; `outline-flag-region').
;; Function to be set as an outline-isearch-open-invisible' property
;; to the overlay that makes the outline invisible (see
;; `outline-flag-region').
-(defun outline-isearch-open-invisible (overlay)
+(defun outline-isearch-open-invisible (
_
overlay)
;; We rely on the fact that isearch places point on the matched text.
(show-entry))
\f
;; We rely on the fact that isearch places point on the matched text.
(show-entry))
\f
@@
-915,7
+911,11
@@
Show the heading too, if it is currently invisible."
(lambda ()
(if (<= (funcall outline-level) levels)
(outline-show-heading)))
(lambda ()
(if (<= (funcall outline-level) levels)
(outline-show-heading)))
- beg end)))
+ beg end)
+ ;; Finally unhide any trailing newline.
+ (goto-char (point-max))
+ (if (and (bolp) (not (bobp)) (outline-invisible-p (1- (point))))
+ (outline-flag-region (1- (point)) (point) nil))))
(run-hooks 'outline-view-change-hook))
(defun hide-other ()
(run-hooks 'outline-view-change-hook))
(defun hide-other ()
@@
-1118,5
+1118,4
@@
convenient way to make a table of contents of the buffer."
(provide 'outline)
(provide 'noutline)
(provide 'outline)
(provide 'noutline)
-;; arch-tag: 1724410e-7d4d-4f46-b801-49e18171e874
;;; outline.el ends here
;;; outline.el ends here