comparison lisp/outline.el @ 91040:14c4a6aac623

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 866-879) - Merge multi-tty branch - Update from CVS - Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
author Miles Bader <miles@gnu.org>
date Thu, 11 Oct 2007 16:14:00 +0000
parents f55f9811f5d7 5039706521c9
children 606f2d163a64
comparison
equal deleted inserted replaced
91039:eefadc1e1d5e 91040:14c4a6aac623
185 '((t :inherit font-lock-keyword-face)) 185 '((t :inherit font-lock-keyword-face))
186 "Level 3." 186 "Level 3."
187 :group 'outlines) 187 :group 'outlines)
188 188
189 (defface outline-4 189 (defface outline-4
190 '((t :inherit font-lock-builtin-face)) 190 '((t :inherit font-lock-comment-face))
191 "Level 4." 191 "Level 4."
192 :group 'outlines) 192 :group 'outlines)
193 193
194 (defface outline-5 194 (defface outline-5
195 '((t :inherit font-lock-comment-face)) 195 '((t :inherit font-lock-type-face))
196 "Level 5." 196 "Level 5."
197 :group 'outlines) 197 :group 'outlines)
198 198
199 (defface outline-6 199 (defface outline-6
200 '((t :inherit font-lock-constant-face)) 200 '((t :inherit font-lock-constant-face))
201 "Level 6." 201 "Level 6."
202 :group 'outlines) 202 :group 'outlines)
203 203
204 (defface outline-7 204 (defface outline-7
205 '((t :inherit font-lock-type-face)) 205 '((t :inherit font-lock-builtin-face))
206 "Level 7." 206 "Level 7."
207 :group 'outlines) 207 :group 'outlines)
208 208
209 (defface outline-8 209 (defface outline-8
210 '((t :inherit font-lock-string-face)) 210 '((t :inherit font-lock-string-face))
213 213
214 (defvar outline-font-lock-faces 214 (defvar outline-font-lock-faces
215 [outline-1 outline-2 outline-3 outline-4 215 [outline-1 outline-2 outline-3 outline-4
216 outline-5 outline-6 outline-7 outline-8]) 216 outline-5 outline-6 outline-7 outline-8])
217 217
218 (defvar outline-font-lock-levels nil) 218 ;; (defvar outline-font-lock-levels nil)
219 (make-variable-buffer-local 'outline-font-lock-levels) 219 ;; (make-variable-buffer-local 'outline-font-lock-levels)
220 220
221 (defun outline-font-lock-face () 221 (defun outline-font-lock-face ()
222 ;; (save-excursion 222 ;; (save-excursion
223 ;; (outline-back-to-heading t) 223 ;; (outline-back-to-heading t)
224 ;; (let* ((count 0) 224 ;; (let* ((count 0)
239 ;; (aref outline-font-lock-faces face-level) 239 ;; (aref outline-font-lock-faces face-level)
240 ;; (error font-lock-warning-face)))) 240 ;; (error font-lock-warning-face))))
241 (save-excursion 241 (save-excursion
242 (goto-char (match-beginning 0)) 242 (goto-char (match-beginning 0))
243 (looking-at outline-regexp) 243 (looking-at outline-regexp)
244 (condition-case nil 244 (aref outline-font-lock-faces (% (1- (funcall outline-level)) (length outline-font-lock-faces)))))
245 (aref outline-font-lock-faces (1- (funcall outline-level)))
246 (error font-lock-warning-face))))
247 245
248 (defvar outline-view-change-hook nil 246 (defvar outline-view-change-hook nil
249 "Normal hook to be run after outline visibility changes.") 247 "Normal hook to be run after outline visibility changes.")
250 248
251 (defvar outline-mode-hook nil 249 (defvar outline-mode-hook nil
710 (defun outline-flag-region (from to flag) 708 (defun outline-flag-region (from to flag)
711 "Hide or show lines from FROM to TO, according to FLAG. 709 "Hide or show lines from FROM to TO, according to FLAG.
712 If FLAG is nil then text is shown, while if FLAG is t the text is hidden." 710 If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
713 (remove-overlays from to 'invisible 'outline) 711 (remove-overlays from to 'invisible 'outline)
714 (when flag 712 (when flag
715 (let ((o (make-overlay from to))) 713 ;; We use `front-advance' here because the invisible text begins at the
714 ;; very end of the heading, before the newline, so text inserted at FROM
715 ;; belongs to the heading rather than to the entry.
716 (let ((o (make-overlay from to nil 'front-advance)))
716 (overlay-put o 'invisible 'outline) 717 (overlay-put o 'invisible 'outline)
717 (overlay-put o 'isearch-open-invisible 718 (overlay-put o 'isearch-open-invisible
718 (or outline-isearch-open-invisible-function 719 (or outline-isearch-open-invisible-function
719 'outline-isearch-open-invisible)))) 720 'outline-isearch-open-invisible))))
720 ;; Seems only used by lazy-lock. I.e. obsolete. 721 ;; Seems only used by lazy-lock. I.e. obsolete.