comparison lisp/cus-edit.el @ 49126:697ca5db73b8

(customize-group, customize-group-other-window): Remove unnecessary calls to custom-load-symbol. (custom-group-value-create): Load widget deps if state is not hidden. If widget deps are loaded, load them in advance. (custom-menu-create): If widget deps are loaded, load them earlier.
author Markus Rost <rost@math.uni-bielefeld.de>
date Thu, 09 Jan 2003 22:32:24 +0000
parents b74a6560ecbb
children ddeb57b6c977
comparison
equal deleted inserted replaced
49125:7ce72b4a2d94 49126:697ca5db73b8
872 t)))) 872 t))))
873 (when (stringp group) 873 (when (stringp group)
874 (if (string-equal "" group) 874 (if (string-equal "" group)
875 (setq group 'emacs) 875 (setq group 'emacs)
876 (setq group (intern group)))) 876 (setq group (intern group))))
877 (custom-load-symbol group)
878 (let ((name (format "*Customize Group: %s*" 877 (let ((name (format "*Customize Group: %s*"
879 (custom-unlispify-tag-name group)))) 878 (custom-unlispify-tag-name group))))
880 (if (get-buffer name) 879 (if (get-buffer name)
881 (pop-to-buffer name) 880 (pop-to-buffer name)
882 (custom-buffer-create (list (list group 'custom-group)) 881 (custom-buffer-create (list (list group 'custom-group))
896 t)))) 895 t))))
897 (when (stringp group) 896 (when (stringp group)
898 (if (string-equal "" group) 897 (if (string-equal "" group)
899 (setq group 'emacs) 898 (setq group 'emacs)
900 (setq group (intern group)))) 899 (setq group (intern group))))
901 (custom-load-symbol group)
902 (let ((name (format "*Customize Group: %s*" 900 (let ((name (format "*Customize Group: %s*"
903 (custom-unlispify-tag-name group)))) 901 (custom-unlispify-tag-name group))))
904 (if (get-buffer name) 902 (if (get-buffer name)
905 (let ((window (selected-window)) 903 (let ((window (selected-window))
906 ;; Copied from `custom-buffer-create-other-window'. 904 ;; Copied from `custom-buffer-create-other-window'.
3299 (push entry members))) 3297 (push entry members)))
3300 (nreverse members)))) 3298 (nreverse members))))
3301 3299
3302 (defun custom-group-value-create (widget) 3300 (defun custom-group-value-create (widget)
3303 "Insert a customize group for WIDGET in the current buffer." 3301 "Insert a customize group for WIDGET in the current buffer."
3302 (unless (eq (widget-get widget :custom-state) 'hidden)
3303 (custom-load-widget widget))
3304 (let* ((state (widget-get widget :custom-state)) 3304 (let* ((state (widget-get widget :custom-state))
3305 (level (widget-get widget :custom-level)) 3305 (level (widget-get widget :custom-level))
3306 ;; (indent (widget-get widget :indent)) 3306 ;; (indent (widget-get widget :indent))
3307 (prefix (widget-get widget :custom-prefix)) 3307 (prefix (widget-get widget :custom-prefix))
3308 (buttons (widget-get widget :buttons)) 3308 (buttons (widget-get widget :buttons))
3338 buttons) 3338 buttons)
3339 (insert " " tag "\n") 3339 (insert " " tag "\n")
3340 (widget-put widget :buttons buttons)) 3340 (widget-put widget :buttons buttons))
3341 ((eq custom-buffer-style 'tree) 3341 ((eq custom-buffer-style 'tree)
3342 (custom-browse-insert-prefix prefix) 3342 (custom-browse-insert-prefix prefix)
3343 (custom-load-widget widget)
3344 (if (zerop (length members)) 3343 (if (zerop (length members))
3345 (progn 3344 (progn
3346 (custom-browse-insert-prefix prefix) 3345 (custom-browse-insert-prefix prefix)
3347 (insert "[ ]-- ") 3346 (insert "[ ]-- ")
3348 ;; (widget-glyph-insert nil "[ ]" "empty") 3347 ;; (widget-glyph-insert nil "[ ]" "empty")
3479 (custom-add-see-also widget 3478 (custom-add-see-also widget
3480 (make-string (* custom-buffer-indent level) 3479 (make-string (* custom-buffer-indent level)
3481 ?\ )) 3480 ?\ ))
3482 ;; Members. 3481 ;; Members.
3483 (message "Creating group...") 3482 (message "Creating group...")
3484 (custom-load-widget widget)
3485 (let* ((members (custom-sort-items members 3483 (let* ((members (custom-sort-items members
3486 custom-buffer-sort-alphabetically 3484 custom-buffer-sort-alphabetically
3487 custom-buffer-order-groups)) 3485 custom-buffer-order-groups))
3488 (prefixes (widget-get widget :custom-prefixes)) 3486 (prefixes (widget-get widget :custom-prefixes))
3489 (custom-prefix-list (custom-prefix-add symbol prefixes)) 3487 (custom-prefix-list (custom-prefix-add symbol prefixes))
3951 (let* ((item (vector (custom-unlispify-menu-entry symbol) 3949 (let* ((item (vector (custom-unlispify-menu-entry symbol)
3952 `(customize-group ',symbol) 3950 `(customize-group ',symbol)
3953 t))) 3951 t)))
3954 (if (and (or (not (boundp 'custom-menu-nesting)) 3952 (if (and (or (not (boundp 'custom-menu-nesting))
3955 (>= custom-menu-nesting 0)) 3953 (>= custom-menu-nesting 0))
3956 (< (length (get symbol 'custom-group)) widget-menu-max-size)) 3954 (progn
3955 (custom-load-symbol symbol)
3956 (< (length (get symbol 'custom-group)) widget-menu-max-size)))
3957 (let ((custom-prefix-list (custom-prefix-add symbol 3957 (let ((custom-prefix-list (custom-prefix-add symbol
3958 custom-prefix-list)) 3958 custom-prefix-list))
3959 (members (custom-sort-items (get symbol 'custom-group) 3959 (members (custom-sort-items (get symbol 'custom-group)
3960 custom-menu-sort-alphabetically 3960 custom-menu-sort-alphabetically
3961 custom-menu-order-groups))) 3961 custom-menu-order-groups)))
3962 (custom-load-symbol symbol)
3963 `(,(custom-unlispify-menu-entry symbol t) 3962 `(,(custom-unlispify-menu-entry symbol t)
3964 ,item 3963 ,item
3965 "--" 3964 "--"
3966 ,@(mapcar (lambda (entry) 3965 ,@(mapcar (lambda (entry)
3967 (widget-apply (if (listp (nth 1 entry)) 3966 (widget-apply (if (listp (nth 1 entry))