Function: custom-theme-load-confirm

custom-theme-load-confirm is a byte-compiled function defined in custom.el.gz.

Signature

(custom-theme-load-confirm HASH)

Documentation

Query the user about loading a Custom theme that may not be safe.

The theme should be in the current buffer. If the user agrees, query also about adding HASH to custom-safe-themes.

Source Code

;; Defined in /usr/src/emacs/lisp/custom.el.gz
(defun custom-theme-load-confirm (hash)
  "Query the user about loading a Custom theme that may not be safe.
The theme should be in the current buffer.  If the user agrees,
query also about adding HASH to `custom-safe-themes'."
  (unless noninteractive
    (save-window-excursion
      (rename-buffer "*Custom Theme*" t)
      (emacs-lisp-mode)
      (pop-to-buffer (current-buffer))
      (goto-char (point-min))
      (prog1 (when (y-or-n-p "Loading a theme can run Lisp code.  Really load? ")
	       ;; Offer to save to `custom-safe-themes'.
	       (and (or custom-file user-init-file)
		    (y-or-n-p "Treat this theme as safe in future sessions? ")
		    (customize-push-and-save 'custom-safe-themes (list hash)))
	       t)
	(quit-window)))))