* lisp/ol.el (org-link-make-regexps): Update regexp to forbid any
un-escaped square bracket in the URI.
(org-link-escape):
(org-link-unescape):
* testing/lisp/test-ol.el (test-ol/escape):
(test-ol/unescape):
(test-ol/store-link):
* testing/lisp/test-org.el (test-org/custom-id):
(test-org/fuzzy-links):
* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Adapt
to new syntax.
* doc/org-manual.org (Link Format): Update documentation.
The new syntax allowed un-escaped opening square brackets in the URI
part of bracket links. Unfortunately, it led to bug as described here:
<https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00312.html>
Now, we require to escape every square bracket in the URI.
* lisp/ox-odt.el (org-odt-template): The file `styles.xml' might be
copied from a location where it is read-only. Since we need to modify
it (and its copied under /tmp, so we can modify it), we need to ensure
we have write persmissions on it. Set mode to 600.
This is especially needed for projects like Guix, where all system
files are stored in a read-only location.
TINYCHANGE
* 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
* lisp/org.el (org-create-formula-image): Ensure user input ends
with a % character to remove trailing whitespace. Also, add %
characters between macros and newlines purely visual.
TINYCHANGE
* doc/org-manual.org (Computed tag filtering): Do not suggest using
one-armed `if' constructs. Remove misleading "org" prefix, and source
block indentation.
* doc/org-manual.org (Computed tag filtering): Use proper
markup. E.g., use verbatim for anything meant to appear in an Org
document. Use fixed-width for single line examples. Fix spacing after
"e.g.". Use active voice and present tense.
* lisp/ox.el (org-export--dispatch-action): Replace error with
user-error a user-error so that user can quit `org-export-dispatch'
without entering debugging mode.
Modified from a patch proposal by Takaaki Ishikawa.
<https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00071.html>
* lisp/org-agenda.el (org-agenda-filter): Fix unescaped literal ‘+’ in
regexp. Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org.el (org-clone-subtree-with-time-shift): Fix a regexp typo
that mishandled strings like ‘\1d’, reported by the same email.
2019-12-05 regexp lint fixes
4c933077157ba409d645f4649c8a3a8e534d53d5
Paul Eggert
Thu Dec 5 19:32:12 2019 -0800
* lisp/org.el (org-mode): Add pcomplete-completions-at-point to capf.
This lets the normal `completion-at-point` and `complete-symbol`
use `pcomplete` for completion.
(org-mode-map): Leave M-TAB bound to the global default since
`pcomplete` is now obsolete.
5bc97ebceb54e0eb2804bef4c1bc32a40d8a2371
Stefan Monnier
Mon Nov 18 17:47:06 2019 -0500