diff options
author | Bastien Guerry <bastien.guerry@data.gouv.fr> | 2020-09-10 11:06:12 +0200 |
---|---|---|
committer | Bastien Guerry <bastien.guerry@data.gouv.fr> | 2020-09-10 11:06:12 +0200 |
commit | dcb6eb613a665434c153cca31c00f5db78280b36 (patch) | |
tree | 35f012b76b2396433753cbf6a032c302aa0917fc | |
parent | 1e3aa1ce0a311c338674d0fb94b8cf588437580e (diff) | |
download | org-mode-dcb6eb613a665434c153cca31c00f5db78280b36.tar.gz |
Revert "Use the `org-block' face for every true blocks"
This reverts commit 7769518f3a1a43e8e63dd0dcf5e74d6fb98b6ebc.
-rw-r--r-- | lisp/org-faces.el | 2 | ||||
-rw-r--r-- | lisp/org.el | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/lisp/org-faces.el b/lisp/org-faces.el index 8b0e387..4e4dc68 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -411,7 +411,7 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." (defface org-block `((t :inherit shadow ,@(and (>= emacs-major-version 27) '(:extend t)))) "Face text in #+begin ... #+end blocks. -For source-blocks, `org-src-block-faces' takes precedence." +For source-blocks `org-src-block-faces' takes precedence." :group 'org-faces :version "26.1") diff --git a/lisp/org.el b/lisp/org.el index 3264694..8913fa8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5231,9 +5231,9 @@ by a #." limit t) (let ((beg (match-beginning 0)) (end-of-beginline (match-end 0)) - (block-start (match-end 0)) ; Includes the \n at end of #+begin line + (block-start (match-end 0)) ; includes the \n at end of #+begin line (block-end nil) ; will include \n after end of block content - (lang (match-string 7)) ; the language, if it is an src block. + (lang (match-string 7)) ; the language, if it is an src block (bol-after-beginline (line-beginning-position 2)) (dc1 (downcase (match-string 2))) (dc3 (downcase (match-string 3))) @@ -5251,12 +5251,12 @@ by a #." ,(match-string 4) word-end (zero-or-more any))))) - nil t) ; On purpose, we look further than LIMIT. - ;; We do have a matching #+end line. + nil t) ;; on purpose, we look further than LIMIT + ;; We do have a matching #+end line (setq beg-of-endline (match-beginning 0) end-of-endline (match-end 0) nl-before-endline (1- (match-beginning 0))) - (setq block-end (match-beginning 0)) ; Includes the final newline. + (setq block-end (match-beginning 0)) ; includes the final newline. (when quoting (org-remove-flyspell-overlays-in bol-after-beginline nl-before-endline) (remove-text-properties beg end-of-endline @@ -5285,10 +5285,7 @@ by a #." ((string= block-type "verse") (add-face-text-property bol-after-beginline beg-of-endline 'org-verse t))) - ;; Use the org-block face for all true blocks. - (add-text-properties - bol-after-beginline beg-of-endline (list 'face 'org-block)) - ;; Fontify the #+begin and #+end lines of the blocks. + ;; Fontify the #+begin and #+end lines of the blocks (add-text-properties beg (if whole-blockline bol-after-beginline end-of-beginline) '(face org-block-begin-line)) |