From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "T. V. Raman" Newsgroups: gmane.emacs.devel Subject: Re: Incorrect interactive spec in customize-group Date: Mon, 30 Jul 2007 06:31:09 -0700 Message-ID: <18093.59421.975882.751870@gargle.gargle.HOWL> References: <18089.61699.894484.872465@gargle.gargle.HOWL> Reply-To: raman@users.sf.net NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1185802292 29568 80.91.229.12 (30 Jul 2007 13:31:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 Jul 2007 13:31:32 +0000 (UTC) Cc: raman@users.sf.net, emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 30 15:31:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IFVLG-0006n2-4i for ged-emacs-devel@m.gmane.org; Mon, 30 Jul 2007 15:31:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFVLF-0002It-4n for ged-emacs-devel@m.gmane.org; Mon, 30 Jul 2007 09:31:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IFVLC-0002Im-BO for emacs-devel@gnu.org; Mon, 30 Jul 2007 09:31:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IFVLA-0002Ia-Ef for emacs-devel@gnu.org; Mon, 30 Jul 2007 09:31:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFVLA-0002IX-5e for emacs-devel@gnu.org; Mon, 30 Jul 2007 09:31:16 -0400 Original-Received: from alnrmhc13.comcast.net ([204.127.225.93]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IFVL9-0000tH-NP for emacs-devel@gnu.org; Mon, 30 Jul 2007 09:31:15 -0400 Original-Received: from localhost (c-71-202-191-236.hsd1.ca.comcast.net[71.202.191.236]) by comcast.net (alnrmhc13) with ESMTP id <20070730133110b13006j21ne>; Mon, 30 Jul 2007 13:31:14 +0000 Original-Received: by localhost (Postfix, from userid 1000) id 2C39D12A4071; Mon, 30 Jul 2007 06:31:10 -0700 (PDT) In-Reply-To: X-Mailer: VM alpha-478 under Emacs 22.1.50.6 (i686-pc-linux-gnu) x-attribution: tvr X-detected-kernel: NetCache Data OnTap 5.x X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75804 Archived-At: fixed now -- thanks! >>>>> "Stefan" == Stefan Monnier writes: >> Command customize-group appears to have an incorrect >> interactive spec --- and consequently fails to prompt for >> the group to customize when called interactively. Stefan> Stefan> Does the patch below fix it? Stefan> Stefan> Stefan> Stefan Stefan> Stefan> Stefan> --- cus-edit.el 26 jui 2007 14:47:51 -0400 1.323 +++ Stefan> cus-edit.el 27 jui 2007 14:32:06 -0400 @@ -141,9 Stefan> +141,9 @@ Stefan> Stefan> (require 'cus-face) (require 'wid-edit) Stefan> -(eval-when-compile - (defvar Stefan> custom-versions-load-alist) ; from cus-load - (defvar Stefan> recentf-exclude)) ; from recentf.el + +(defvar Stefan> custom-versions-load-alist) ; from cus-load +(defvar Stefan> recentf-exclude) ; from recentf.el Stefan> Stefan> (condition-case nil (require 'cus-load) @@ -1032,22 Stefan> +1032,20 @@ t nil nil (if group (symbol-name Stefan> major-mode)))))))) (customize-group Stefan> (custom-group-of-mode mode))) Stefan> Stefan> - -;;;###autoload -(defun customize-group (&optional Stefan> group prompt-for-group other-window) - "Customize Stefan> GROUP, which must be a customization group." - Stefan> (interactive) - (and (null group) - (or Stefan> prompt-for-group (called-interactively-p)) +(defun Stefan> customize-read-group () (let ((completion-ignore-case Stefan> t)) - (setq group (completing-read "Customize group Stefan> (default emacs): " obarray (lambda (symbol) (or (and Stefan> (get symbol 'custom-loads) (not (get symbol Stefan> 'custom-autoload))) (get symbol 'custom-group))) - Stefan> t)))) + t))) + +;;;###autoload +(defun Stefan> customize-group (&optional group) + "Customize GROUP, Stefan> which must be a customization group." + (interactive Stefan> (list (customize-read-group))) (when (stringp group) Stefan> (if (string-equal "" group) (setq group 'emacs) @@ Stefan> -1055,15 +1053,8 @@ (let ((name (format "*Customize Stefan> Group: %s*" (custom-unlispify-tag-name group)))) (if Stefan> (get-buffer name) - (if other-window - (let Stefan> ((pop-up-windows t) - (same-window-buffer-names nil) Stefan> - (same-window-regexps nil)) - (pop-to-buffer name)) Stefan> - (pop-to-buffer name)) - (funcall (if other-window - Stefan> 'custom-buffer-create-other-window - Stefan> 'custom-buffer-create) + (pop-to-buffer name) + Stefan> (custom-buffer-create (list (list group Stefan> 'custom-group)) name (concat " for group " @@ -1072,8 Stefan> +1063,11 @@ ;;;###autoload (defun Stefan> customize-group-other-window (&optional group) Stefan> "Customize GROUP, which must be a customization Stefan> group, in another window." - (interactive) - Stefan> (customize-group group t t)) + (interactive (list Stefan> (customize-read-group))) + (let ((pop-up-windows t) + Stefan> (same-window-buffer-names nil) + (same-window-regexps Stefan> nil)) + (customize-group group))) Stefan> Stefan> ;;;###autoload (defalias 'customize-variable Stefan> 'customize-option) @@ -1254,30 +1248,22 @@ (< minor1 Stefan> minor2))))) Stefan> Stefan> ;;;###autoload -(defun customize-face (&optional Stefan> face prompt-for-face other-window) +(defun Stefan> customize-face (&optional face) "Customize FACE, Stefan> which should be a face name or nil. If FACE is nil, Stefan> customize all faces. If FACE is actually a Stefan> face-alias, customize the face it is aliased to. Stefan> Stefan> Interactively, when point is on text which has a Stefan> face specified, suggest to customize that face, if Stefan> it's customizable." - (interactive) - (and (null Stefan> face) - (or prompt-for-face (called-interactively-p)) Stefan> - (setq face (read-face-name "Customize face" "all Stefan> faces" t))) + (interactive (list (read-face-name Stefan> "Customize face" "all faces" t))) (if (member face Stefan> '(nil "")) (setq face (face-list))) (if (and (listp Stefan> face) (null (cdr face))) (setq face (car face))) - Stefan> (let ((create-buffer-fn (if other-window - Stefan> 'custom-buffer-create-other-window - Stefan> 'custom-buffer-create))) (if (listp face) - (funcall Stefan> create-buffer-fn + (custom-buffer-create Stefan> (custom-sort-items - (mapcar (lambda (s) - (list s Stefan> 'custom-face)) - face) + (mapcar (lambda (s) (list s Stefan> 'custom-face)) face) t nil) "*Customize Faces*") ;; Stefan> If FACE is actually an alias, customize the face it Stefan> is aliased to. @@ -1285,10 +1271,10 @@ (setq face Stefan> (get face 'face-alias))) (unless (facep face) (error Stefan> "Invalid face %S" face)) - (funcall create-buffer-fn Stefan> + (custom-buffer-create (list (list face Stefan> 'custom-face)) (format "*Customize Face: %s*" - Stefan> (custom-unlispify-tag-name face)))))) + Stefan> (custom-unlispify-tag-name face))))) Stefan> Stefan> ;;;###autoload (defun customize-face-other-window Stefan> (&optional face) @@ -1297,8 +1283,11 @@ Stefan> Stefan> Interactively, when point is on text which has a Stefan> face specified, suggest to customize that face, if Stefan> it's customizable." - (interactive) - Stefan> (customize-face face t t)) + (interactive (list Stefan> (read-face-name "Customize face" "all faces" t))) + Stefan> (let ((pop-up-windows t) + (same-window-buffer-names Stefan> nil) + (same-window-regexps nil)) + (customize-face Stefan> face))) Stefan> Stefan> (defalias 'customize-customized 'customize-unsaved) Stefan> -- Best Regards, --raman Email: raman@users.sf.net WWW: http://emacspeak.sf.net/raman/ AIM: emacspeak GTalk: tv.raman.tv@gmail.com PGP: http://emacspeak.sf.net/raman/raman-almaden.asc Google: tv+raman IRC: irc://irc.freenode.net/#emacs