forked from mirrors/org-mode
org: Fontify whole table rows with `org-table-row' face
* lisp/org-faces.el (org-table-row): New face. * lisp/org.el (org-set-font-lock-defaults): Use ~org-table-row~ face to fontify the whole table rows, including indentation and newlines. * etc/ORG-NEWS (Org mode now fontifies whole table lines (including newline) according to ~org-table~ face): Announce the change.
This commit is contained in:
parent
788af56753
commit
14acf626fe
17
etc/ORG-NEWS
17
etc/ORG-NEWS
|
@ -13,6 +13,23 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
|
||||||
|
|
||||||
* Version 9.7 (not released yet)
|
* Version 9.7 (not released yet)
|
||||||
** Important announcements and breaking changes
|
** Important announcements and breaking changes
|
||||||
|
*** Org mode now fontifies whole table lines (including newline) according to ~org-table~ face
|
||||||
|
|
||||||
|
Previously, leading indentation and trailing newline in table rows
|
||||||
|
were not fontified using ~org-table~ face. ~default~ face was used instead.
|
||||||
|
This made it impossible to scale line height when ~org-table~ face has
|
||||||
|
smaller height than default (Emacs calculates line height using the tallest face).
|
||||||
|
|
||||||
|
Now, new ~org-table-row~ face is used on the whole table row lines,
|
||||||
|
including indentation and the final newline. This face, by default,
|
||||||
|
inherits from ~org-table~ face.
|
||||||
|
|
||||||
|
If the new behavior is not desired, ~org-table-row~ face can be
|
||||||
|
changed to inherit from ~default~ face.
|
||||||
|
|
||||||
|
~org-table~ takes precedence over ~org-table-row~ for the parts of
|
||||||
|
table rows without indentation and newline.
|
||||||
|
|
||||||
*** =ox-latex=: ~org-latex-line-break-safe~ is deprecated
|
*** =ox-latex=: ~org-latex-line-break-safe~ is deprecated
|
||||||
|
|
||||||
~org-latex-line-break-safe~ constant was previously introduced to deal
|
~org-latex-line-break-safe~ constant was previously introduced to deal
|
||||||
|
|
|
@ -389,6 +389,10 @@ changes."
|
||||||
"Face used for tables."
|
"Face used for tables."
|
||||||
:group 'org-faces)
|
:group 'org-faces)
|
||||||
|
|
||||||
|
(defface org-table-row '((t :inherit org-table))
|
||||||
|
"Face used to fontify whole table rows (including newlines and indentation)."
|
||||||
|
:group 'org-faces)
|
||||||
|
|
||||||
(defface org-table-header '((t :inherit org-table
|
(defface org-table-header '((t :inherit org-table
|
||||||
:background "LightGray"
|
:background "LightGray"
|
||||||
:foreground "Black"))
|
:foreground "Black"))
|
||||||
|
|
|
@ -5849,7 +5849,8 @@ needs to be inserted at a specific position in the font-lock sequence.")
|
||||||
(2 (org-get-level-face 2))
|
(2 (org-get-level-face 2))
|
||||||
(3 (org-get-level-face 3)))
|
(3 (org-get-level-face 3)))
|
||||||
;; Table lines
|
;; Table lines
|
||||||
'("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
|
'("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)\n?"
|
||||||
|
(0 'org-table-row t)
|
||||||
(1 'org-table t))
|
(1 'org-table t))
|
||||||
;; Table internals
|
;; Table internals
|
||||||
'("^[ \t]*|\\(?:.*?|\\)? *\\(:?=[^|\n]*\\)" (1 'org-formula t))
|
'("^[ \t]*|\\(?:.*?|\\)? *\\(:?=[^|\n]*\\)" (1 'org-formula t))
|
||||||
|
|
Loading…
Reference in New Issue