Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Use rx-let and rx for regex
Browse files Browse the repository at this point in the history
also, change "FDB#-_il" to  "-FDB#_il" to fix issue with incorrect
range.
  • Loading branch information
vanicat committed Oct 27, 2020
1 parent d9a1330 commit ff56aa9
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions weechat-color.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,28 @@ This will look very bland!"
:group 'weechat-faces)

(defvar weechat-formatting-regex
(let* ((attr `(in "*!/_|")) ;NOTE: is not documented
(std `(= 2 digit))
(astd `(seq ,attr (= 2 digit)))
(ext `(seq "@" (= 5 digit)))
(aext `(seq "@" ,attr (= 5 digit))))
(rx-form
`(or (seq ""
(or ,std
,ext
(seq "F" (or ,std ,astd ,ext ,aext))
(seq "B" (or ,std ,ext))
(seq "*" (or ,std
,astd
,ext
,aext
(seq (or ,std ,astd ,ext ,aext)
","
(or ,std ,astd ,ext ,aext))))
(seq "b" (in "FDB_-#il"))
(rx-let ((attr (in "*!/_|")) ;NOTE: is not documented
(std (= 2 digit))
(astd (seq attr (= 2 digit)))
(ext (seq "@" (= 5 digit)))
(aext (seq "@" attr (= 5 digit))))
(rx
(or (seq ""
(or std
ext
(seq "F" (or std astd ext aext))
(seq "B" (or std ext))
(seq "*" (or std
astd
ext
aext
(seq (or std astd ext aext)
""
(or std astd ext aext))))
(seq "b" (in "-FDB#_il"))
""))
(seq "" ,attr)
(seq "" ,attr)
(seq "" attr)
(seq "" attr)
""))))

(defun weechat-strip-formatting (string)
Expand Down

0 comments on commit ff56aa9

Please sign in to comment.