Function: custom-comment-preserve

custom-comment-preserve is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-comment-preserve WIDGET)

Documentation

Preserve the comment that belongs to WIDGET.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
;; This is useful when we want to redraw a widget, but we want to preserve
;; edits made by the user in the comment widget.  (See Bug#64649)
(defun custom-comment-preserve (widget)
  "Preserve the comment that belongs to WIDGET."
  (when (widget-get widget :comment-shown)
    (let ((comment-widget (widget-get widget :comment-widget)))
      (widget-put comment-widget :value (widget-value comment-widget)))))