bastibe / org-journal

A simple org-mode based journaling mode
BSD 3-Clause "New" or "Revised" License
1.24k stars 123 forks source link

org-journal--format->regex: Use FIXEDCASE #340

Closed stettberger closed 3 years ago

stettberger commented 3 years ago

In some settings, when the format string is uppercase, this function makes replacements uppercase, which makes the character classes invalid:

(org-journal--format->regex "%B") -> "\\(?4:[A-ZA-Z]\\{3,\\}\\)"

This can be fixed by setting the FIXEDCASE flag on replace-regexp-in-string in the function

    do (setq format (replace-regexp-in-string (car x) (cdr x) format t))

I'm currently out of time to make a pull request. Therefore, I only drop a bug report here.

bastibe commented 3 years ago

Does anyone feel like implementing this? Pull Requests are welcome.

casch-at commented 3 years ago

Thanks for the report. Fixed via 919abc9. Interesting though is that the case wasn't altered for me. What Emacs version do you use, also the OS you use would interesting?

stettberger commented 3 years ago

Thanks for the report. Fixed via 919abc9. Interesting though is that the case wasn't altered for me. What Emacs version do you use, also the OS you use would interesting?

I'm using debian 28.0.50 on Debian unstable. The problem occurred after loading gnus, which seems to mess around with all kinds of variables. The problem manifested also only in some buffers. In one buffer I could perform (org-journal--format->regex "%B") without triggering the problem, while it occurred in other buffers. Really misterious. Probably there is some kind of buffer-local dynamic-variable default for FIXEDCASE?