Org-mode emphasis works fine in my org-mode buffers except with timestamps, i.e. =[2023-09-27 Wed]=
. Emphasis work fine with plain words.
Removing a square bracket or dash from the timestamp makes it work, i.e.:
=2023-09-27 Wed]=
or =[202309-27 Wed]=
both work.
However, the exact same line, =[2023-09-27 Wed]=
, does work in my *scratch* buffer for some reason when it is set to org-mode.
I thought a differing minor mode in my org-mode buffer might be the problem. So I tried matching the minor modes in my org-mode buffer to match my *scratch* buffer, but that didn't help.
I also tried modifying org-emphasis-regexp-components
. I don't think this variable is the cause of the problem though, since the default value is working fine in the *scratch* buffer.
Configuration Info
NOTE: Modes with an asterisk are not used in the opposite buffer.
Minor modes common to both buffers
- Abbrev
- Auto-Save
- Display-Line-Numbers
- Eldoc
- Evil-Collection-Unimpaired
- Evil-Local
- Font-Lock
- Jinx
- Org-Indent
- Org-Phscroll
- Phscroll
- Tab-Line
- Visual-Line
- List item
Minor modes only used in org-mode buffer
- Normal-Erase-Is-Backspace
Minor modes only used in *scratch* buffer
- Abbrev
- Auto-Save
- Jinx
- Org-Indent
org-emphasis-regexp-components
org-emphasis-regexp-components is set to the default:
("-[:space:]('\"{"
"-[:space:].,:!?;'\")}\\["
"[:space:]"
"."
1)
Here is the info for org-emphasis-regexp-components:
Components used to build the regular expression for emphasis.
This is a list with five entries. Terminology: In an emphasis string
like " *strong word* ", we call the initial space PREMATCH, the final
space POSTMATCH, the stars MARKERS, "s" and "d" are BORDER characters
and "trong wor" is the body. The different components in this variable
specify what is allowed/forbidden in each part:
pre Chars allowed as prematch. Beginning of line will be allowed too.
post Chars allowed as postmatch. End of line will be allowed too.
border The chars *forbidden* as border characters.
body-regexp A regexp like "." to match a body character. Don’t use
non-shy groups here, and don’t allow newline here.
newline The maximum number of newlines allowed in an emphasis exp.
You need to reload Org or to restart Emacs after setting this.
org-emphasis-regexp-components
?("-[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]" "." 1)