0

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.
3
  • Works for me out of the box: I use Liberation Mono as my default font which allows for italics, bold, underline and crossed-out. Underline is hard to see because the time stamp is also a link and the default fontification for a link underlines it; similarly verbatim/code does not show, since the font is monospaced to begin with. But the rest are plainly visible. See the screenshot.
    – NickD
    Sep 27, 2023 at 17:00
  • @NickD What value do you have for org-emphasis-regexp-components? Sep 27, 2023 at 21:42
  • Default out of the box, same as you: ("-[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]" "." 1)
    – NickD
    Sep 28, 2023 at 0:44

1 Answer 1

0

The problem was caused by doom-themes. Disabling doom-themes fixed the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.