changeset 28700:a57bafeec17c

(Custom-set, Custom-save, Custom-reset-current) (Custom-reset-saved, Custom-reset-standard) (custom-group-value-create, custom-group-set, custom-group-save) (custom-group-reset-current, custom-group-reset-saved) (custom-group-reset-standard): Use mapc. (custom-buffer-create-internal): Disable undo when creating items. Use mapc. (custom-face): Avoid superfluous lambda.
author Dave Love <fx@gnu.org>
date Mon, 24 Apr 2000 20:11:27 +0000
parents 5d002ac53c60
children de35af6ab1ad
files lisp/cus-edit.el
diffstat 1 files changed, 43 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Mon Apr 24 18:48:24 2000 +0000
+++ b/lisp/cus-edit.el	Mon Apr 24 20:11:27 2000 +0000
@@ -636,19 +636,19 @@
   "Set changes in all modified options."
   (interactive)
   (let ((children custom-options))
-    (mapcar (lambda (child)
-	      (when (eq (widget-get child :custom-state) 'modified)
-		(widget-apply child :custom-set)))
+    (mapc (lambda (child)
+	    (when (eq (widget-get child :custom-state) 'modified)
+	      (widget-apply child :custom-set)))
 	    children)))
 
 (defun Custom-save ()
   "Set all modified group members and save them."
   (interactive)
   (let ((children custom-options))
-    (mapcar (lambda (child)
-	      (when (memq (widget-get child :custom-state)
-			  '(modified set changed rogue))
-		(widget-apply child :custom-save)))
+    (mapc (lambda (child)
+	    (when (memq (widget-get child :custom-state)
+			'(modified set changed rogue))
+	      (widget-apply child :custom-save)))
 	    children))
   (custom-save-all))
 
@@ -674,22 +674,22 @@
   "Reset all modified group members to their current value."
   (interactive)
   (let ((children custom-options))
-    (mapcar (lambda (widget)
-	      (and (default-boundp (widget-value widget))
-		   (if (memq (widget-get widget :custom-state)
-			     '(modified changed))
-		       (widget-apply widget :custom-reset-current))))
+    (mapc (lambda (widget)
+	    (and (default-boundp (widget-value widget))
+		 (if (memq (widget-get widget :custom-state)
+			   '(modified changed))
+		     (widget-apply widget :custom-reset-current))))
 	    children)))
 
 (defun Custom-reset-saved (&rest ignore)
   "Reset all modified or set group members to their saved value."
   (interactive)
   (let ((children custom-options))
-    (mapcar (lambda (widget)
-	      (and (get (widget-value widget) 'saved-value)
-		   (if (memq (widget-get widget :custom-state)
-			     '(modified set changed rogue))
-		       (widget-apply widget :custom-reset-saved))))
+    (mapc (lambda (widget)
+	    (and (get (widget-value widget) 'saved-value)
+		 (if (memq (widget-get widget :custom-state)
+			   '(modified set changed rogue))
+		     (widget-apply widget :custom-reset-saved))))
 	    children)))
 
 (defun Custom-reset-standard (&rest ignore)
@@ -699,11 +699,11 @@
 making them as if they had never been customized at all."
   (interactive)
   (let ((children custom-options))
-    (mapcar (lambda (widget)
-	      (and (get (widget-value widget) 'standard-value)
-		   (if (memq (widget-get widget :custom-state)
-			     '(modified set changed saved rogue))
-		       (widget-apply widget :custom-reset-standard))))
+    (mapc (lambda (widget)
+	    (and (get (widget-value widget) 'standard-value)
+		 (if (memq (widget-get widget :custom-state)
+			   '(modified set changed saved rogue))
+		     (widget-apply widget :custom-reset-standard))))
 	    children)))
 
 ;;; The Customize Commands
@@ -1291,6 +1291,7 @@
 		 :action #'Custom-buffer-done)
   (widget-insert "\n\n")
   (message "Creating customization items...")
+  (buffer-disable-undo)
   (setq custom-options
 	(if (= (length options) 1)
 	    (mapcar (lambda (entry)
@@ -1320,9 +1321,10 @@
     (widget-insert "\n"))
   (message "Creating customization items ...%2d%%done" 100)
   (unless (eq custom-buffer-style 'tree)
-    (mapcar 'custom-magic-reset custom-options))
+    (mapc 'custom-magic-reset custom-options))
   (message "Creating customization setup...")
   (widget-setup)
+  (buffer-enable-undo)
   (goto-char (point-min))
   (message "Creating customization buffer...done"))
 
@@ -2547,7 +2549,7 @@
   "Customize face."
   :sample-face 'custom-face-tag-face
   :help-echo "Set or reset this face."
-  :documentation-property (lambda (face) (face-doc-string face))
+  :documentation-property #'face-doc-string)
   :value-create 'custom-face-value-create
   :action 'custom-face-action
   :custom-category 'face
@@ -3273,7 +3275,7 @@
 					  (widget-insert "\n"))))
 				    members)))
 	     (message "Creating group magic...")
-	     (mapcar 'custom-magic-reset children)
+	     (mapc 'custom-magic-reset children)
 	     (message "Creating group state...")
 	     (widget-put widget :children children)
 	     (custom-group-state-update widget)
@@ -3326,42 +3328,42 @@
 (defun custom-group-set (widget)
   "Set changes in all modified group members."
   (let ((children (widget-get widget :children)))
-    (mapcar (lambda (child)
-	      (when (eq (widget-get child :custom-state) 'modified)
-		(widget-apply child :custom-set)))
+    (mapc (lambda (child)
+	    (when (eq (widget-get child :custom-state) 'modified)
+	      (widget-apply child :custom-set)))
 	    children )))
 
 (defun custom-group-save (widget)
   "Save all modified group members."
   (let ((children (widget-get widget :children)))
-    (mapcar (lambda (child)
-	      (when (memq (widget-get child :custom-state) '(modified set))
-		(widget-apply child :custom-save)))
+    (mapc (lambda (child)
+	    (when (memq (widget-get child :custom-state) '(modified set))
+	      (widget-apply child :custom-save)))
 	    children )))
 
 (defun custom-group-reset-current (widget)
   "Reset all modified group members."
   (let ((children (widget-get widget :children)))
-    (mapcar (lambda (child)
-	      (when (eq (widget-get child :custom-state) 'modified)
-		(widget-apply child :custom-reset-current)))
+    (mapc (lambda (child)
+	    (when (eq (widget-get child :custom-state) 'modified)
+	      (widget-apply child :custom-reset-current)))
 	    children )))
 
 (defun custom-group-reset-saved (widget)
   "Reset all modified or set group members."
   (let ((children (widget-get widget :children)))
-    (mapcar (lambda (child)
-	      (when (memq (widget-get child :custom-state) '(modified set))
-		(widget-apply child :custom-reset-saved)))
+    (mapc (lambda (child)
+	    (when (memq (widget-get child :custom-state) '(modified set))
+	      (widget-apply child :custom-reset-saved)))
 	    children )))
 
 (defun custom-group-reset-standard (widget)
   "Reset all modified, set, or saved group members."
   (let ((children (widget-get widget :children)))
-    (mapcar (lambda (child)
-	      (when (memq (widget-get child :custom-state)
-			  '(modified set saved))
-		(widget-apply child :custom-reset-standard)))
+    (mapc (lambda (child)
+	    (when (memq (widget-get child :custom-state)
+			'(modified set saved))
+	      (widget-apply child :custom-reset-standard)))
 	    children )))
 
 (defun custom-group-state-update (widget)