Function: ansi-color-parse-sequence
ansi-color-parse-sequence is a byte-compiled function defined in
ansi-color.el.gz.
Signature
(ansi-color-parse-sequence ESCAPE-SEQ)
Documentation
Return the list of all the parameters in ESCAPE-SEQ.
ESCAPE-SEQ is a SGR control sequences such as \033[34m. The parameter
34 is used by ansi-color-get-face-1 to return a face definition.
Returns nil only if there's no match for ansi-color-parameter-regexp.
Source Code
;; Defined in /usr/src/emacs/lisp/ansi-color.el.gz
;; Helper functions
(defsubst ansi-color-parse-sequence (escape-seq)
"Return the list of all the parameters in ESCAPE-SEQ.
ESCAPE-SEQ is a SGR control sequences such as \\033[34m. The parameter
34 is used by `ansi-color-get-face-1' to return a face definition.
Returns nil only if there's no match for `ansi-color-parameter-regexp'."
(let ((i 0)
codes val)
(while (string-match ansi-color-parameter-regexp escape-seq i)
(setq i (match-end 0)
val (string-to-number (match-string 1 escape-seq) 10))
;; It so happens that (string-to-number "") => 0.
(push val codes))
(nreverse codes)))