Function: help-fns--customize-variable

help-fns--customize-variable is a byte-compiled function defined in help-fns.el.gz.

Signature

(help-fns--customize-variable VARIABLE &optional TEXT)

Source Code

;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
(defun help-fns--customize-variable (variable &optional text)
  ;; Make a link to customize if this variable can be customized.
  (when (custom-variable-p variable)
    (let ((customize-label "customize")
          (custom-set (get variable 'custom-set))
          (opoint (with-current-buffer standard-output
                    (point))))
      (princ (concat "  You can " customize-label (or text " this variable.")))
      (when (and custom-set
                 ;; Don't override manually written documentation.
                 (not (string-match (rx word-start "setopt" word-end)
                                    (documentation-property
                                     variable 'variable-documentation))))
        (princ (substitute-quotes
                (concat "\n  Setting this variable directly with `setq' may not take effect;"
                        "\n  use either customize or `setopt'"
                        ;; Skip text if `custom-set' property is an
                        ;; anonymous function.
                        (when (symbolp custom-set)
                          (concat ", or call `" (symbol-name custom-set) "'"))
                        "."))))
      (with-current-buffer standard-output
	(save-excursion
          (while (re-search-backward (concat "\\(" customize-label "\\)") opoint t)
	    (help-xref-button 1 'help-customize-variable variable))))
      (terpri))))