From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Incorrect interactive spec in customize-group Date: Fri, 27 Jul 2007 14:35:48 -0400 Message-ID: References: <18089.61699.894484.872465@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1185561363 4985 80.91.229.12 (27 Jul 2007 18:36:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 Jul 2007 18:36:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: raman@users.sf.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 27 20:35:57 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 1IEUfM-00008N-G3 for ged-emacs-devel@m.gmane.org; Fri, 27 Jul 2007 20:35:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEUfL-0000s1-PL for ged-emacs-devel@m.gmane.org; Fri, 27 Jul 2007 14:35:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IEUfI-0000l1-0H for emacs-devel@gnu.org; Fri, 27 Jul 2007 14:35:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IEUfG-0000fp-G1 for emacs-devel@gnu.org; Fri, 27 Jul 2007 14:35:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEUfG-0000fV-B0 for emacs-devel@gnu.org; Fri, 27 Jul 2007 14:35:50 -0400 Original-Received: from bc.sympatico.ca ([209.226.175.184] helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IEUfF-0003Xa-Vx for emacs-devel@gnu.org; Fri, 27 Jul 2007 14:35:50 -0400 Original-Received: from pastel.home ([70.53.195.62]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070727183548.LQNT18413.tomts22-srv.bellnexxia.net@pastel.home> for ; Fri, 27 Jul 2007 14:35:48 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 05C1180DA; Fri, 27 Jul 2007 14:35:47 -0400 (EDT) In-Reply-To: <18089.61699.894484.872465@gargle.gargle.HOWL> (T. V. Raman's message of "Fri\, 27 Jul 2007 06\:20\:03 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:75713 Archived-At: > Command customize-group appears to have an incorrect interactive > spec --- and consequently fails to prompt for the group to > customize when called interactively. Does the patch below fix it? Stefan --- cus-edit.el 26 jui 2007 14:47:51 -0400 1.323 +++ cus-edit.el 27 jui 2007 14:32:06 -0400 @@ -141,9 +141,9 @@ (require 'cus-face) (require 'wid-edit) -(eval-when-compile - (defvar custom-versions-load-alist) ; from cus-load - (defvar recentf-exclude)) ; from recentf.el + +(defvar custom-versions-load-alist) ; from cus-load +(defvar recentf-exclude) ; from recentf.el (condition-case nil (require 'cus-load) @@ -1032,22 +1032,20 @@ t nil nil (if group (symbol-name major-mode)))))))) (customize-group (custom-group-of-mode mode))) - -;;;###autoload -(defun customize-group (&optional group prompt-for-group other-window) - "Customize GROUP, which must be a customization group." - (interactive) - (and (null group) - (or prompt-for-group (called-interactively-p)) +(defun customize-read-group () (let ((completion-ignore-case t)) - (setq group (completing-read "Customize group (default emacs): " obarray (lambda (symbol) (or (and (get symbol 'custom-loads) (not (get symbol 'custom-autoload))) (get symbol 'custom-group))) - t)))) + t))) + +;;;###autoload +(defun customize-group (&optional group) + "Customize GROUP, which must be a customization group." + (interactive (list (customize-read-group))) (when (stringp group) (if (string-equal "" group) (setq group 'emacs) @@ -1055,15 +1053,8 @@ (let ((name (format "*Customize Group: %s*" (custom-unlispify-tag-name group)))) (if (get-buffer name) - (if other-window - (let ((pop-up-windows t) - (same-window-buffer-names nil) - (same-window-regexps nil)) - (pop-to-buffer name)) - (pop-to-buffer name)) - (funcall (if other-window - 'custom-buffer-create-other-window - 'custom-buffer-create) + (pop-to-buffer name) + (custom-buffer-create (list (list group 'custom-group)) name (concat " for group " @@ -1072,8 +1063,11 @@ ;;;###autoload (defun customize-group-other-window (&optional group) "Customize GROUP, which must be a customization group, in another window." - (interactive) - (customize-group group t t)) + (interactive (list (customize-read-group))) + (let ((pop-up-windows t) + (same-window-buffer-names nil) + (same-window-regexps nil)) + (customize-group group))) ;;;###autoload (defalias 'customize-variable 'customize-option) @@ -1254,30 +1248,22 @@ (< minor1 minor2))))) ;;;###autoload -(defun customize-face (&optional face prompt-for-face other-window) +(defun customize-face (&optional face) "Customize FACE, which should be a face name or nil. If FACE is nil, customize all faces. If FACE is actually a face-alias, customize the face it is aliased to. Interactively, when point is on text which has a face specified, suggest to customize that face, if it's customizable." - (interactive) - (and (null face) - (or prompt-for-face (called-interactively-p)) - (setq face (read-face-name "Customize face" "all faces" t))) + (interactive (list (read-face-name "Customize face" "all faces" t))) (if (member face '(nil "")) (setq face (face-list))) (if (and (listp face) (null (cdr face))) (setq face (car face))) - (let ((create-buffer-fn (if other-window - 'custom-buffer-create-other-window - 'custom-buffer-create))) (if (listp face) - (funcall create-buffer-fn + (custom-buffer-create (custom-sort-items - (mapcar (lambda (s) - (list s 'custom-face)) - face) + (mapcar (lambda (s) (list s 'custom-face)) face) t nil) "*Customize Faces*") ;; If FACE is actually an alias, customize the face it is aliased to. @@ -1285,10 +1271,10 @@ (setq face (get face 'face-alias))) (unless (facep face) (error "Invalid face %S" face)) - (funcall create-buffer-fn + (custom-buffer-create (list (list face 'custom-face)) (format "*Customize Face: %s*" - (custom-unlispify-tag-name face)))))) + (custom-unlispify-tag-name face))))) ;;;###autoload (defun customize-face-other-window (&optional face) @@ -1297,8 +1283,11 @@ Interactively, when point is on text which has a face specified, suggest to customize that face, if it's customizable." - (interactive) - (customize-face face t t)) + (interactive (list (read-face-name "Customize face" "all faces" t))) + (let ((pop-up-windows t) + (same-window-buffer-names nil) + (same-window-regexps nil)) + (customize-face face))) (defalias 'customize-customized 'customize-unsaved)