Function: erc--prepare-custom-module-type

erc--prepare-custom-module-type is a byte-compiled function defined in erc-common.el.gz.

Signature

(erc--prepare-custom-module-type NAME)

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-common.el.gz
(defun erc--prepare-custom-module-type (name)
  `(let* ((name (erc--normalize-module-symbol ',name))
          (fmtd (format " `%s' " name)))
     `(boolean
       :format "%{%t%}: %i %[Deprecated Toggle%] %v \n%h\n"
       :format-handler
       ,(lambda (widget escape)
          (erc--make-show-me-widget
           widget escape
           :button-face '(custom-variable-obsolete custom-button)
           :tag "Show Me"
           :action (apply-partially #'erc--tick-module-checkbox name)
           :help-echo (lambda (_)
                        (let ((hasp (memq name erc-modules)))
                          (concat (if hasp "Remove" "Add") fmtd
                                  (if hasp "from" "to")
                                  " `erc-modules'.")))))
       :action widget-toggle-action
       :documentation-property
       ,(lambda (_)
          (let ((hasp (memq name erc-modules)))
            (concat
             "Setting a module's minor-mode variable is "
             (propertize "ineffective" 'face 'error)
             ".\nPlease " (if hasp "remove" "add") fmtd
             (if hasp "from" "to") " `erc-modules' directly instead.\n"
             "You can do so now by clicking "
             (propertize "Show Me" 'face 'custom-variable-obsolete)
             " above."))))))