comparison lisp/cus-edit.el @ 2118:e28998a020ec

[xemacs-hg @ 2004-06-07 21:50:57 by adrian] xemacs-21.5: Cleanup sync to 21.4 and typo fixes for lisp/cus-edit.el -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2004-06-07 Adrian Aichner <adrian@xemacs.org> * cus-edit.el (custom-browse-visibility): Typo fix. * cus-edit.el (custom-variable-value-create): Ditto. * cus-edit.el (custom-save-variables): Simply use push instead of make-list and nconc, as suggested by Hrvoje and already used in 21.4. * cus-edit.el (custom-save-faces): Ditto.
author adrian
date Mon, 07 Jun 2004 21:50:57 +0000
parents 6f3d0f871934
children 3c70cbcc7ae8
comparison
equal deleted inserted replaced
2117:0684198d3161 2118:e28998a020ec
1232 :value group)) 1232 :value group))
1233 (widget-add-change) 1233 (widget-add-change)
1234 (goto-char (point-min))) 1234 (goto-char (point-min)))
1235 1235
1236 (define-widget 'custom-browse-visibility 'item 1236 (define-widget 'custom-browse-visibility 'item
1237 "Control visibility of of items in the customize tree browser." 1237 "Control visibility of items in the customize tree browser."
1238 :format "%[[%t]%]" 1238 :format "%[[%t]%]"
1239 :action 'custom-browse-visibility-action) 1239 :action 'custom-browse-visibility-action)
1240 1240
1241 (defun custom-browse-visibility-action (widget &rest ignore) 1241 (defun custom-browse-visibility-action (widget &rest ignore)
1242 (let ((custom-buffer-style 'tree)) 1242 (let ((custom-buffer-style 'tree))
2039 :value (or comment "")))) 2039 :value (or comment ""))))
2040 (widget-put widget :comment-widget comment-widget) 2040 (widget-put widget :comment-widget comment-widget)
2041 ;; Don't push it !!! Custom assumes that the first child is the 2041 ;; Don't push it !!! Custom assumes that the first child is the
2042 ;; value one. 2042 ;; value one.
2043 (setq children (append children (list comment-widget))))) 2043 (setq children (append children (list comment-widget)))))
2044 ;; Update the rest of the properties properties. 2044 ;; Update the rest of the properties.
2045 (widget-put widget :custom-form form) 2045 (widget-put widget :custom-form form)
2046 (widget-put widget :children children) 2046 (widget-put widget :children children)
2047 ;; Now update the state. 2047 ;; Now update the state.
2048 (if (eq state 'hidden) 2048 (if (eq state 'hidden)
2049 (widget-put widget :custom-state state) 2049 (widget-put widget :custom-state state)
3469 ;; 'custom-reset-variables 3469 ;; 'custom-reset-variables
3470 ;; 'custom-set-variables) 3470 ;; 'custom-set-variables)
3471 (custom-save-loaded-themes) 3471 (custom-save-loaded-themes)
3472 (custom-save-resets 'theme-value 'custom-reset-variables nil) 3472 (custom-save-resets 'theme-value 'custom-reset-variables nil)
3473 (let ((standard-output (current-buffer)) 3473 (let ((standard-output (current-buffer))
3474 ;; To make nconc work 3474 (sorted-list ()))
3475 (sorted-list (make-list 1 t)))
3476 ;; First create a sorted list of saved variables. 3475 ;; First create a sorted list of saved variables.
3477 (mapatoms 3476 (mapatoms
3478 (lambda (symbol) 3477 (lambda (symbol)
3479 (when (custom-save-variable-p symbol) 3478 (when (custom-save-variable-p symbol)
3480 (nconc sorted-list (list symbol))))) 3479 (push symbol sorted-list))))
3481 (setq sorted-list (sort (cdr sorted-list) 'string<)) 3480 (setq sorted-list (sort (cdr sorted-list) 'string<))
3482 3481
3483 (unless (bolp) 3482 (unless (bolp)
3484 (princ "\n")) 3483 (princ "\n"))
3485 (princ "(custom-set-variables") 3484 (princ "(custom-set-variables")
3542 ;; a bad behavior <npak@ispras.ru> 3541 ;; a bad behavior <npak@ispras.ru>
3543 ;;(custom-save-delete-any 'custom-reset-faces 3542 ;;(custom-save-delete-any 'custom-reset-faces
3544 ;; 'custom-set-faces) 3543 ;; 'custom-set-faces)
3545 (custom-save-resets 'theme-face 'custom-reset-faces '(default)) 3544 (custom-save-resets 'theme-face 'custom-reset-faces '(default))
3546 (let ((standard-output (current-buffer)) 3545 (let ((standard-output (current-buffer))
3547 ;; To make nconc work 3546 (sorted-list ()))
3548 (sorted-list (make-list 1 t)))
3549 ;; Create a sorted list of faces 3547 ;; Create a sorted list of faces
3550 (mapatoms 3548 (mapatoms
3551 (lambda (symbol) 3549 (lambda (symbol)
3552 (when (custom-save-face-p symbol) 3550 (when (custom-save-face-p symbol)
3553 (nconc sorted-list (list symbol))))) 3551 (push symbol sorted-list))))
3554 (setq sorted-list (sort (cdr sorted-list) 'string<)) 3552 (setq sorted-list (sort (cdr sorted-list) 'string<))
3555 3553
3556 (unless (bolp) 3554 (unless (bolp)
3557 (princ "\n")) 3555 (princ "\n"))
3558 (princ "(custom-set-faces") 3556 (princ "(custom-set-faces")