diff options
| author | Zoey Hewll <zoeyhewll@gmail.com> | 2026-03-12 20:51:03 +0800 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-17 15:12:22 +0100 |
| commit | c8e4251fd165acd32e014e6310f2219991bea357 (patch) | |
| tree | 1cc3d34dd813c489a42f27b4edcea780633f2cb1 /lisp/transient.el | |
| parent | 2902b29ace6f75f7da83f692d2bf5bc3b2d0e3ae (diff) | |
transient-init-value: Handle multiline values
Allow `transient-init-value' to respect multiline string values, rather
than truncating them to the first line.
As a regex pattern, ".*" does not match multiline strings because the
"." pattern matches any character besides a line terminator. Emacs regex
syntax uses the "[^z-a]" pattern to match any character including line
terminators. This distinction is represented by `(rx (* nonl))' vs`(rx
(* anychar))' in the `rx' macro syntax, and the expression implemented
here is as produced by `(rx string-start (literal "%s") (group
(* anychar)) string-end)'.
Fixes #432
Diffstat (limited to 'lisp/transient.el')
| -rw-r--r-- | lisp/transient.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/transient.el b/lisp/transient.el index bf761fa..9ca41b6 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3891,7 +3891,7 @@ Call `transient-default-value' but because that is a noop for (case-fold-search nil) (regexp (if (slot-exists-p obj 'argument-regexp) (oref obj argument-regexp) - (format "\\`%s\\(.*\\)" (oref obj argument))))) + (format "\\`%s\\([^z-a]*\\)\\'" (oref obj argument))))) (if (memq multi-value '(t rest)) (cdr (assoc argument value)) (let ((match (lambda (v) |
