Browse Source

Fix fontification error

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): blocks cannot be
  correctly fontified when the buffer is missing a final newline.
Nicolas Goaziou 13 years ago
parent
commit
c59da42c4e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/org.el

+ 4 - 4
lisp/org.el

@@ -5207,8 +5207,8 @@ will be prompted for."
 	       beg end
 	       beg end
 	       '(font-lock-fontified t font-lock-multiline t))
 	       '(font-lock-fontified t font-lock-multiline t))
 	      (add-text-properties beg beg1 '(face org-meta-line))
 	      (add-text-properties beg beg1 '(face org-meta-line))
-	      (add-text-properties end1 (+ end 1) '(face org-meta-line))
-					; for end_src
+	      (add-text-properties end1 (min (point-max) (1+ end))
+				   '(face org-meta-line)) ; for end_src
 	      (cond
 	      (cond
 	       ((and lang (not (string= lang "")) org-src-fontify-natively)
 	       ((and lang (not (string= lang "")) org-src-fontify-natively)
 		(org-src-font-lock-fontify-block lang block-start block-end)
 		(org-src-font-lock-fontify-block lang block-start block-end)
@@ -5222,8 +5222,8 @@ will be prompted for."
                 (overlay-put ovl 'face 'org-block-background)
                 (overlay-put ovl 'face 'org-block-background)
                 (overlay-put ovl 'evaporate t))  ;; make it go away when empty
                 (overlay-put ovl 'evaporate t))  ;; make it go away when empty
 	       (quoting
 	       (quoting
-		(add-text-properties beg1 (+ end1 1) '(face org-block)))
-					; end of source block
+		(add-text-properties beg1 (min (point-max) (1+ end1))
+				     '(face org-block))) ; end of source block
 	       ((not org-fontify-quote-and-verse-blocks))
 	       ((not org-fontify-quote-and-verse-blocks))
 	       ((string= block-type "quote")
 	       ((string= block-type "quote")
 		(add-text-properties beg1 (1+ end1) '(face org-quote)))
 		(add-text-properties beg1 (1+ end1) '(face org-quote)))