aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleh Krehel2015-01-30 09:24:33 +0100
committerOleh Krehel2015-01-30 17:41:49 +0100
commit5a1b8a1179829e9c2aefb3e430a3d99cdbad4099 (patch)
tree8413b1d13e1927a0b0ef1320c0a83b6e8589a1e3
parent58aa0dad3645cec66aa4bdda87cfd5f67f0a1e93 (diff)
downloademacs-5a1b8a1179829e9c2aefb3e430a3d99cdbad4099.tar.gz
emacs-5a1b8a1179829e9c2aefb3e430a3d99cdbad4099.zip
lisp/outline.el (outline-mode): Clean up docstring
* lisp/outline.el (font-lock-warning-face): Remove unused declare. (outline-mode-prefix-map): Remove obsolete comment. (outline-font-lock-face): Remove obsolete comment.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/outline.el60
2 files changed, 14 insertions, 52 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0c5d2fe5a83..511bb869c3e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12015-01-30 Oleh Krehel <ohwoeowho@gmail.com> 12015-01-30 Oleh Krehel <ohwoeowho@gmail.com>
2 2
3 * outline.el (outline-mode): Clean up docstring.
4 (font-lock-warning-face): Remove obsolete declaration.
5 (outline-font-lock-face): Remove obsolete comment.
6
72015-01-30 Oleh Krehel <ohwoeowho@gmail.com>
8
3 * lisp/custom.el (defface): Set `indent' to 1. 9 * lisp/custom.el (defface): Set `indent' to 1.
4 10
52015-01-30 Oleh Krehel <ohwoeowho@gmail.com> 112015-01-30 Oleh Krehel <ohwoeowho@gmail.com>
diff --git a/lisp/outline.el b/lisp/outline.el
index 11d71fb1226..1f52998ef6b 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -35,9 +35,6 @@
35 35
36;;; Code: 36;;; Code:
37 37
38(defvar font-lock-warning-face)
39
40
41(defgroup outlines nil 38(defgroup outlines nil
42 "Support for hierarchical outlining." 39 "Support for hierarchical outlining."
43 :prefix "outline-" 40 :prefix "outline-"
@@ -84,7 +81,6 @@ in the file it applies to.")
84 (define-key map [(control ?<)] 'outline-promote) 81 (define-key map [(control ?<)] 'outline-promote)
85 (define-key map [(control ?>)] 'outline-demote) 82 (define-key map [(control ?>)] 'outline-demote)
86 (define-key map "\C-m" 'outline-insert-heading) 83 (define-key map "\C-m" 'outline-insert-heading)
87 ;; Where to bind outline-cycle ?
88 map)) 84 map))
89 85
90(defvar outline-mode-menu-bar-map 86(defvar outline-mode-menu-bar-map
@@ -190,7 +186,6 @@ in the file it applies to.")
190 outline-mode-menu-bar-map)))))) 186 outline-mode-menu-bar-map))))))
191 map)) 187 map))
192 188
193
194(defvar outline-mode-map 189(defvar outline-mode-map
195 (let ((map (make-sparse-keymap))) 190 (let ((map (make-sparse-keymap)))
196 (define-key map "\C-c" outline-mode-prefix-map) 191 (define-key map "\C-c" outline-mode-prefix-map)
@@ -198,7 +193,7 @@ in the file it applies to.")
198 map)) 193 map))
199 194
200(defvar outline-font-lock-keywords 195(defvar outline-font-lock-keywords
201 '(;; 196 '(
202 ;; Highlight headings according to the level. 197 ;; Highlight headings according to the level.
203 (eval . (list (concat "^\\(?:" outline-regexp "\\).+") 198 (eval . (list (concat "^\\(?:" outline-regexp "\\).+")
204 0 '(outline-font-lock-face) nil t))) 199 0 '(outline-font-lock-face) nil t)))
@@ -248,33 +243,13 @@ in the file it applies to.")
248 [outline-1 outline-2 outline-3 outline-4 243 [outline-1 outline-2 outline-3 outline-4
249 outline-5 outline-6 outline-7 outline-8]) 244 outline-5 outline-6 outline-7 outline-8])
250 245
251;; (defvar outline-font-lock-levels nil)
252;; (make-variable-buffer-local 'outline-font-lock-levels)
253
254(defun outline-font-lock-face () 246(defun outline-font-lock-face ()
255 ;; (save-excursion
256 ;; (outline-back-to-heading t)
257 ;; (let* ((count 0)
258 ;; (start-level (funcall outline-level))
259 ;; (level start-level)
260 ;; face-level)
261 ;; (while (not (setq face-level
262 ;; (if (or (bobp) (eq level 1)) 0
263 ;; (cdr (assq level outline-font-lock-levels)))))
264 ;; (outline-up-heading 1 t)
265 ;; (setq count (1+ count))
266 ;; (setq level (funcall outline-level)))
267 ;; ;; Remember for later.
268 ;; (unless (zerop count)
269 ;; (setq face-level (+ face-level count))
270 ;; (push (cons start-level face-level) outline-font-lock-levels))
271 ;; (condition-case nil
272 ;; (aref outline-font-lock-faces face-level)
273 ;; (error font-lock-warning-face))))
274 (save-excursion 247 (save-excursion
275 (goto-char (match-beginning 0)) 248 (goto-char (match-beginning 0))
276 (looking-at outline-regexp) 249 (looking-at outline-regexp)
277 (aref outline-font-lock-faces (% (1- (funcall outline-level)) (length outline-font-lock-faces))))) 250 (aref outline-font-lock-faces
251 (% (1- (funcall outline-level))
252 (length outline-font-lock-faces)))))
278 253
279(defvar outline-view-change-hook nil 254(defvar outline-view-change-hook nil
280 "Normal hook to be run after outline visibility changes.") 255 "Normal hook to be run after outline visibility changes.")
@@ -296,29 +271,10 @@ invisible, or visible again. Invisible lines are attached to the end
296of the heading, so they move with it, if the line is killed and yanked 271of the heading, so they move with it, if the line is killed and yanked
297back. A heading with text hidden under it is marked with an ellipsis (...). 272back. A heading with text hidden under it is marked with an ellipsis (...).
298 273
299Commands:\\<outline-mode-map> 274\\{outline-mode-map}
300\\[outline-next-visible-heading] outline-next-visible-heading move by visible headings 275The commands `hide-subtree', `show-subtree', `show-children',
301\\[outline-previous-visible-heading] outline-previous-visible-heading 276`hide-entry', `show-entry', `hide-leaves', and `show-branches'
302\\[outline-forward-same-level] outline-forward-same-level similar but skip subheadings 277are used when point is on a heading line.
303\\[outline-backward-same-level] outline-backward-same-level
304\\[outline-up-heading] outline-up-heading move from subheading to heading
305
306\\[hide-body] make all text invisible (not headings).
307\\[show-all] make everything in buffer visible.
308\\[hide-sublevels] make only the first N levels of headers visible.
309
310The remaining commands are used when point is on a heading line.
311They apply to some of the body or subheadings of that heading.
312\\[hide-subtree] hide-subtree make body and subheadings invisible.
313\\[show-subtree] show-subtree make body and subheadings visible.
314\\[show-children] show-children make direct subheadings visible.
315 No effect on body, or subheadings 2 or more levels down.
316 With arg N, affects subheadings N levels down.
317\\[hide-entry] make immediately following body invisible.
318\\[show-entry] make it visible.
319\\[hide-leaves] make body under heading and under its subheadings invisible.
320 The subheadings remain visible.
321\\[show-branches] make all subheadings at all levels visible.
322 278
323The variable `outline-regexp' can be changed to control what is a heading. 279The variable `outline-regexp' can be changed to control what is a heading.
324A line is a heading if `outline-regexp' matches something at the 280A line is a heading if `outline-regexp' matches something at the