Function: tramp-compat-rx--transform-item

tramp-compat-rx--transform-item is a byte-compiled function defined in tramp-compat.el.gz.

Signature

(tramp-compat-rx--transform-item ITEM)

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-compat.el.gz
;; There is an error in Emacs 26.  `(rx "a" (? ""))' => "a?".
;; We must protect the string in regexp and literal, therefore.
(defun tramp-compat-rx--transform-item (item)
  (pcase item
    ('anychar 'anything)
    ('multibyte 'nonascii)
    (`(not ,expr)
     (if (consp expr) item (list 'not (list 'any expr))))
    (`(regexp ,expr)
     (setq tramp-compat-rx--runtime-params t)
     `(regexp ,(list '\, `(concat "\\(?:" ,expr "\\)"))))
    (`(literal ,expr)
     (setq tramp-compat-rx--runtime-params t)
     `(regexp ,(list '\, `(concat "\\(?:" (regexp-quote ,expr) "\\)"))))
    (`(eval . ,_) item)
    (`(,head . ,rest) (cons head (tramp-compat-rx--transform-items rest)))
    (_ item)))