Summary
M-x jira-issues (and effectively the whole package, since jira.el requires jira-issues → jira-actions → jira-doc → jira-edit) fails to load on Emacs 29.3 because of an invalid rx expression in jira-edit.el.
Environment
- jira.el version: 2.21.1 (also reproduced on current
main, commit 1b1a436)
- Emacs version: GNU Emacs 29.3
- Installed via: package.el / elpa
Steps to reproduce
emacs -Q --batch --eval "(require 'jira)"
or simply (require 'jira) / M-x jira-issues in a normal Emacs session.
Actual behavior
Loading fails with:
Eager macro-expansion failure: (error "Bad character set: space")
Error: error ("Eager macro-expansion failure: (error \"Bad character set: space\")")
...
internal-macroexpand-for-load((defvar jira-mark-keywords `((,(jira-edit--mark-matcher (rx "*" (not (or "*" space)) ...
load-with-code-conversion(".../jira-edit.el" ...)
require(jira-edit)
load-with-code-conversion(".../jira-doc.el" ...)
require(jira-doc)
load-with-code-conversion(".../jira-actions.el" ...)
require(jira-actions)
load-with-code-conversion(".../jira-issues.el" ...)
require(jira-issues)
load-with-code-conversion(".../jira.el" ...)
require(jira)
Because jira-edit.el fails to load, the require chain jira → jira-issues → jira-actions → jira-doc → jira-edit aborts, so none of the package's commands (including jira-issues) work at all.
Root cause
In jira-edit.el, jira-mark-keywords uses two rx forms that mix a literal character with the named character class space inside (not (or ...)):
https://github.com/unmonoqueteclea/jira.el/blob/main/jira-edit.el#L81
https://github.com/unmonoqueteclea/jira.el/blob/main/jira-edit.el#L86
(rx "*" (not (or "*" space)) (*? (or "\\*" (not (or "\r" "\n")))) "*")
...
(rx bow "-" (not (or "-" space)) (+? (or "\\-" (not (or "\r" "\n")))) "-" eow)
rx's not/or combinator can build a negated character set when all alternatives are single literal characters (e.g. (not (or "\r" "\n")) works fine), but it cannot do so when one of the alternatives is a named character class such as space. This can be reproduced in isolation:
(require 'rx)
(rx (not (or "*" space)))
;; => error: "Bad character set: space"
(rx (not (any "*" space)))
;; => "[^*[:space:]]" (works)
Suggested fix
Use any instead of or when building the negated character set, since any (unlike or) is designed to combine literal characters and named classes into a single character set:
(rx "*" (not (any "*" space)) (*? (or "\\*" (not (any "\r" "\n")))) "*")
...
(rx bow "-" (not (any "-" space)) (+? (or "\\-" (not (any "\r" "\n")))) "-" eow)
Summary
M-x jira-issues(and effectively the whole package, sincejira.elrequiresjira-issues→jira-actions→jira-doc→jira-edit) fails to load on Emacs 29.3 because of an invalidrxexpression injira-edit.el.Environment
main, commit1b1a436)Steps to reproduce
emacs -Q --batch --eval "(require 'jira)"or simply
(require 'jira)/M-x jira-issuesin a normal Emacs session.Actual behavior
Loading fails with:
Because
jira-edit.elfails to load, therequirechainjira→jira-issues→jira-actions→jira-doc→jira-editaborts, so none of the package's commands (includingjira-issues) work at all.Root cause
In
jira-edit.el,jira-mark-keywordsuses tworxforms that mix a literal character with the named character classspaceinside(not (or ...)):https://github.com/unmonoqueteclea/jira.el/blob/main/jira-edit.el#L81
https://github.com/unmonoqueteclea/jira.el/blob/main/jira-edit.el#L86
rx'snot/orcombinator can build a negated character set when all alternatives are single literal characters (e.g.(not (or "\r" "\n"))works fine), but it cannot do so when one of the alternatives is a named character class such asspace. This can be reproduced in isolation:Suggested fix
Use
anyinstead oforwhen building the negated character set, sinceany(unlikeor) is designed to combine literal characters and named classes into a single character set: