diff options
author | Eli Zaretskii <eliz@gnu.org> | 2023-07-30 12:19:32 -0400 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2023-07-30 12:19:32 -0400 |
commit | 1198cdb55673d5f5545ee0ec9008b9832b830f06 (patch) | |
tree | 0a4db545f64735ba6255b9a050b31e07b552f1cd /lisp/emacs-lisp | |
parent | 23fc4793001e4de920bb8dae280133f4467a7797 (diff) | |
parent | 2b8796eea1979fe6891ab9d80cd126fe8980167a (diff) | |
download | emacs-1198cdb55673d5f5545ee0ec9008b9832b830f06.tar.gz emacs-1198cdb55673d5f5545ee0ec9008b9832b830f06.tar.bz2 emacs-1198cdb55673d5f5545ee0ec9008b9832b830f06.zip |
Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/rx.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 46f61c26bc4..30195cbae32 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -445,13 +445,19 @@ classes." (setcar dash-l ?.)) ; Reduce --x to .-x (setq items (nconc items '((?- . ?-)))))) - ;; Deal with leading ^ and range ^-x. - (when (and (consp (car items)) - (eq (caar items) ?^) - (cdr items)) - ;; Move ^ and ^-x to second place. - (setq items (cons (cadr items) - (cons (car items) (cddr items))))) + ;; Deal with leading ^ and range ^-x in non-negated set. + (when (and (eq (car-safe (car items)) ?^) + (not negated)) + (if (eq (cdar items) ?^) + ;; single leading ^ + (when (cdr items) + ;; Move the ^ to second place. + (setq items (cons (cadr items) + (cons (car items) (cddr items))))) + ;; Split ^-x to _-x^ + (setq items (cons (cons ?_ (cdar items)) + (cons '(?^ . ?^) + (cdr items)))))) (cond ;; Empty set: if negated, any char, otherwise match-nothing. |