emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Customize Rogue


From: Per Abrahamsen
Subject: Customize Rogue
Date: Thu, 06 Mar 2003 09:39:18 +0100
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8)

I wrote this function as a transition tool from "setq" to customize,
it list all "rogue" variables, that is, variables that have been
declared by defcustom but changed outside customize.

OK to add to to cus-edit.el?

Ideally, the only "rogue" variables would be those the user have set
in .emacs himself, unfortunately there are a number of rogue variables
even in a fresh Emacs.  These are all potential problems.  For some
it is just a question of initialization, menu-bar-mode was an example
of that.  Others are changed later from Lisp code, those should
probably not be declared with defcustom, as changed from Lisp will
conflict with changed made by the user.

;;;###autoload
(defun customize-rogue ()
  "Customize all user variable modified outside customize."
  (interactive)
  (let ((found nil))
    (mapatoms (lambda (symbol)
                (let ((cval (or (get symbol 'customized-value)
                                (get symbol 'saved-value)
                                (get symbol 'standard-value))))
                  (when (and cval       ;Declared with defcustom.
                             (default-boundp symbol) ;Has a value.
                             (not (equal (eval (car cval)) 
                                         ;; Which does not match customize.
                                         (default-value symbol))))
                    (push (list symbol 'custom-variable) found)))))
    (if (not found)
        (error "No rogue user options")
      (custom-buffer-create (custom-sort-items found t nil)
                            "*Customize Rogue*"))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]