Function: which-key--replace-in-binding

which-key--replace-in-binding is a byte-compiled function defined in which-key.el.gz.

Signature

(which-key--replace-in-binding KEY-BINDING REPL)

Source Code

;; Defined in /usr/src/emacs/lisp/which-key.el.gz
(defsubst which-key--replace-in-binding (key-binding repl)
  (cond ((or (not (consp repl)) (null (cdr repl)))
         key-binding)
        ((functionp (cdr repl))
         (funcall (cdr repl) key-binding))
        ((consp (cdr repl))
         (cons
          (cond ((and (caar repl) (cadr repl))
                 (replace-regexp-in-string
                  (caar repl) (cadr repl) (car key-binding) t))
                ((cadr repl) (cadr repl))
                (t (car key-binding)))
          (cond ((and (cdar repl) (cddr repl))
                 (replace-regexp-in-string
                  (cdar repl) (cddr repl) (cdr key-binding) t))
                ((cddr repl) (cddr repl))
                (t (cdr key-binding)))))))