From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Per Abrahamsen Newsgroups: gmane.emacs.devel Subject: Customize Rogue Date: Thu, 06 Mar 2003 09:39:18 +0100 Organization: The Church of Emacs Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046940873 2954 80.91.224.249 (6 Mar 2003 08:54:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2003 08:54:33 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Mar 06 09:54:32 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18qr96-0000lW-00 for ; Thu, 06 Mar 2003 09:54:32 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18qrTL-0000GJ-00 for ; Thu, 06 Mar 2003 10:15:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qr9E-0006O8-00 for emacs-devel@quimby.gnus.org; Thu, 06 Mar 2003 03:54:40 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18qqwF-0001xJ-00 for emacs-devel@gnu.org; Thu, 06 Mar 2003 03:41:15 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18qquw-0001Xq-00 for emacs-devel@gnu.org; Thu, 06 Mar 2003 03:39:54 -0500 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qquP-0001Fe-00 for emacs-devel@gnu.org; Thu, 06 Mar 2003 03:39:21 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18qqts-0008Lu-00 for ; Thu, 06 Mar 2003 09:38:48 +0100 Mail-Followup-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18qqtr-0008Ll-00 for ; Thu, 06 Mar 2003 09:38:47 +0100 Original-Lines: 33 Original-X-Complaints-To: usenet@main.gmane.org X-Face: +kRV2]2q}lixHkE{U)mY#+6]{AH=yN~S9@IFiOa@X6?GM|8MBp/ Mail-Copies-To: nobody User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8) Cancel-Lock: sha1:ufTaOWuqY9lfv7ERIt3r7iRH2iQ= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12125 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12125 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*"))))