From 0e90a43c1860e00dea1fee0973017abc401f18d9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 21 Jun 2008 04:10:26 +0000 Subject: [PATCH] Run rst-define-level-faces when loading. (rst-mode): Don't set the font-lock-multiline var. (rst-font-lock-find-unindented-line, rst-font-lock-handle-adornment): Set the font-lock-multiline property by hand. --- lisp/ChangeLog | 5 +++++ lisp/textmodes/rst.el | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 817dc58ecdd..5011a6e93d7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2008-06-21 Stefan Monnier + * textmodes/rst.el: Run rst-define-level-faces when loading. + (rst-mode): Don't set the font-lock-multiline var. + (rst-font-lock-find-unindented-line, rst-font-lock-handle-adornment): + Set the font-lock-multiline property by hand. + * loadup.el: Don't add emacs- name when bootstrapping. * Makefile.in (emacs-deps): Remove. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 0d6771ec793..fdd3585b599 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -406,7 +406,6 @@ blocks." (set (make-local-variable 'font-lock-defaults) '(rst-font-lock-keywords-function t nil nil nil - (font-lock-multiline . t) (font-lock-mark-block-function . mark-paragraph))) ;; `jit-lock-mode' has been the default since Emacs-21.1, so there's no ;; point messing around with font-lock-support-mode any more. @@ -2749,6 +2748,7 @@ details check the Rst Faces Defaults group." (set sym sym) (setq i (1+ i)))))) +(rst-define-level-faces) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -3044,15 +3044,21 @@ point is not moved." ;; Always succeeds because the limit set by PRE-MATCH-FORM is the ;; ultimate point to find (goto-char (or (rst-forward-indented-block nil limit) limit)) + (save-excursion + ;; Include subsequent empty lines in the font-lock block, + ;; in case the user subsequently changes the indentation of the next + ;; non-empty line to move it into the indented element. + (skip-chars-forward " \t\n") + (put-text-property beg-pnt (point) 'font-lock-multiline t)) (set-match-data (list beg-pnt (point))) t))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Adornments -;; Stores the point where the current adornment ends. Also used as a trigger -;; for `rst-font-lock-handle-adornment'. -(defvar rst-font-lock-adornment-point nil) +(defvar rst-font-lock-adornment-point nil + "Stores the point where the current adornment ends. Also used as a trigger +for `rst-font-lock-handle-adornment'.") ;; Here `rst-font-lock-handle-adornment' stores the section level of the ;; current adornment or t for a transition. @@ -3174,6 +3180,7 @@ entered.") (mtc (cdr ado))) (setq rst-font-lock-level (rst-adornment-level key t)) (goto-char (nth 1 mtc)) + (put-text-property (nth 0 mtc) (nth 1 mtc) 'font-lock-multiline t) (set-match-data mtc) t)))) -- 2.39.2