04d2828ad9
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Enhance regex for finding the end of blocks (i.e., `beg-of-endline') to detect headlines (i.e., (rx bol (one-or-more "*") space) so that fontification matches the behavior of org mode (i.e., that headlines are healines, even in vertabim). This change aligns the behavior and the visual appearance of verbatim blocks that contain headlines. When `font-lock-mode' is enabled this change makes situations like those in (info "(org) Literal Examples") literally jump off the page. Overview of new fontification Source | fontification before | fontification after | \#+BEGIN_EXAMPLE | org-block-begin-line | org-block-begin-line | I look verbatim! | org-block | org-block | * Org headers in | org-block | org-level-1 | verbatim blocks | org-block | nil | ** highly accordingly | org-block | org-level-2 | \#+END_EXAMPLE | org-block-end-line | org-meta-line | This commit also makes some improvements to the reability of org-fontify-meta-lines-and-blocks-1. 1. Use the `rx' macro for better readability. Note that the strings below return with literal tabs when using `rx'. Expansion included for reference here. Begin regex. old: "^\\([ \t]*#\\(\\(\\+[a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)[ \t]*\\(\\([^ \t\n]*\\)[ \t]*\\(.*\\)\\)\\)" new: "^\\([[:blank:]]*#\\(\\(\\+[A-Za-z]+:?\\|[[:space:]]\\|$\\)\\(_\\([A-Za-z]+\\)\\)?\\)[[:blank:]]*\\(\\([^ \n ]*\\)[[:blank:]]*\\(.*\\)\\)\\)" End regex. Note match-string call is stringified for documentation here. old: (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*") new: "\\(?:\\(^\\(?:\\*+[[:space:]]\\|[[:blank:]]*#\\+end(match-string 4)\\>.*\\)\\)\\)" Caption regex: old: "\\([ \t]*#\\+caption\\(?:\\[.*\\]\\)?:\\)[ \t]*" new: "\\([[:blank:]]*#\\+caption\\(?:\\[.*]\\)?:\\)[[:blank:]]*" 2. Refactor fontification of #+end blocks for readability and to reduce the number of calls to point-max to one per branch. TINYCHANGE |
||
---|---|---|
contrib | ||
doc | ||
etc | ||
lisp | ||
mk | ||
testing | ||
.dir-locals.el | ||
.gitignore | ||
.gitmodules | ||
COPYING | ||
Makefile | ||
README | ||
README_ELPA | ||
README_contribute | ||
README_git | ||
README_maintainer | ||
request-assign-future.txt |
README
This is a distribution of Org, a plain text notes and project planning tool for Emacs. The homepage of Org is at: https://orgmode.org The installations instructions are at: https://orgmode.org/org.html#Installation This distribution contains: README This file. COPYING The GNU General Public License. Makefile The makefile to compile and install Org. For installation instructions, see the manual or the more detailed procedure on Worg: https://orgmode.org/worg/dev/org-build-system.html mk/ Files needed for building Org. lisp/ Directory with all the Emacs Lisp files that make up Org. doc/ The documentation files. org.texi is the source of the documentation, org.html and org.pdf are formatted versions of it. contrib/ A directory with third-party additions for Org. Some really cool stuff is in there. etc/ Files needed for the ODT exporter. testing/ Testing suite for Org. request-assign-future.txt The form that contributors have to sign and get processed with the FSF before contributed changes can be integrated into the Org core. All files in this distribution except the contrib/ directory have copyright assigned to the FSF.