|
@@ -5022,13 +5022,19 @@ will be prompted for."
|
|
'(display t invisible t intangible t))
|
|
'(display t invisible t intangible t))
|
|
t)))
|
|
t)))
|
|
|
|
|
|
|
|
+(defvar org-src-fontify-natively t
|
|
|
|
+ "When non-nil, fontify code in code blocks.")
|
|
|
|
+
|
|
(defun org-fontify-meta-lines-and-blocks (limit)
|
|
(defun org-fontify-meta-lines-and-blocks (limit)
|
|
"Fontify #+ lines and blocks, in the correct ways."
|
|
"Fontify #+ lines and blocks, in the correct ways."
|
|
(let ((case-fold-search t))
|
|
(let ((case-fold-search t))
|
|
(if (re-search-forward
|
|
(if (re-search-forward
|
|
- "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)\\(.*\\)\\)"
|
|
|
|
|
|
+ "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)[ \t]*\\(\\([^ \t\n]*\\)[ \t]*\\(.*\\)\\)\\)"
|
|
limit t)
|
|
limit t)
|
|
(let ((beg (match-beginning 0))
|
|
(let ((beg (match-beginning 0))
|
|
|
|
+ (block-start (match-end 0))
|
|
|
|
+ (block-end nil)
|
|
|
|
+ (lang (match-string 7))
|
|
(beg1 (line-beginning-position 2))
|
|
(beg1 (line-beginning-position 2))
|
|
(dc1 (downcase (match-string 2)))
|
|
(dc1 (downcase (match-string 2)))
|
|
(dc3 (downcase (match-string 3)))
|
|
(dc3 (downcase (match-string 3)))
|
|
@@ -5053,6 +5059,7 @@ will be prompted for."
|
|
(concat "^[ \t]*#\\+end" (match-string 4) "\\>.*")
|
|
(concat "^[ \t]*#\\+end" (match-string 4) "\\>.*")
|
|
nil t) ;; on purpose, we look further than LIMIT
|
|
nil t) ;; on purpose, we look further than LIMIT
|
|
(setq end (match-end 0) end1 (1- (match-beginning 0)))
|
|
(setq end (match-end 0) end1 (1- (match-beginning 0)))
|
|
|
|
+ (setq block-end (match-beginning 0))
|
|
(when quoting
|
|
(when quoting
|
|
(remove-text-properties beg end
|
|
(remove-text-properties beg end
|
|
'(display t invisible t intangible t)))
|
|
'(display t invisible t intangible t)))
|
|
@@ -5063,6 +5070,8 @@ will be prompted for."
|
|
(add-text-properties end1 (+ end 1) '(face org-meta-line))
|
|
(add-text-properties end1 (+ end 1) '(face org-meta-line))
|
|
; for end_src
|
|
; for end_src
|
|
(cond
|
|
(cond
|
|
|
|
+ ((and lang org-src-fontify-natively)
|
|
|
|
+ (org-src-font-lock-fontify-block lang block-start block-end))
|
|
(quoting
|
|
(quoting
|
|
(add-text-properties beg1 (+ end1 1) '(face
|
|
(add-text-properties beg1 (+ end1 1) '(face
|
|
org-block)))
|
|
org-block)))
|