all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: raman@users.sf.net
Cc: emacs-devel@gnu.org
Subject: Re: Incorrect interactive spec in customize-group
Date: Fri, 27 Jul 2007 14:35:48 -0400	[thread overview]
Message-ID: <jwvbqdxhfru.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <18089.61699.894484.872465@gargle.gargle.HOWL> (T. V. Raman's message of "Fri\, 27 Jul 2007 06\:20\:03 -0700")

> 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)

  reply	other threads:[~2007-07-27 18:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27 13:20 Incorrect interactive spec in customize-group T. V. Raman
2007-07-27 18:35 ` Stefan Monnier [this message]
2007-07-30 13:31   ` T. V. Raman
2007-07-28 14:11 ` Richard Stallman
2007-07-28 20:06   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvbqdxhfru.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=raman@users.sf.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.