comparison lisp/cus-edit.el @ 22538:2649d061d370

*** empty log message ***
author Dan Nicolaescu <done@ece.arizona.edu>
date Mon, 22 Jun 1998 02:10:41 +0000
parents 86cb09249796
children 2f3b4c74e9a1
comparison
equal deleted inserted replaced
22537:7947a4ea28a8 22538:2649d061d370
878 This means, in other words, variables and groups defined with a `:version' 878 This means, in other words, variables and groups defined with a `:version'
879 option." 879 option."
880 (interactive "sCustomize options changed, since version (default all versions): ") 880 (interactive "sCustomize options changed, since version (default all versions): ")
881 (if (equal since-version "") 881 (if (equal since-version "")
882 (setq since-version nil)) 882 (setq since-version nil))
883 (let ((found nil)) 883 (let ((found nil)
884 (versions nil))
884 (mapatoms (lambda (symbol) 885 (mapatoms (lambda (symbol)
885 (and (or (boundp symbol) 886 (and (or (boundp symbol)
887 ;; For variables not yet loaded.
888 (get symbol 'standard-value)
886 ;; For groups the previous test fails, this one 889 ;; For groups the previous test fails, this one
887 ;; could be used to determine if symbol is a 890 ;; could be used to determine if symbol is a
888 ;; group. Is there a better way for this? 891 ;; group. Is there a better way for this?
889 (get symbol 'group-documentation)) 892 (get symbol 'group-documentation))
890 (let ((version (get symbol 'custom-version))) 893 (let ((version (get symbol 'custom-version)))
891 (and version 894 (and version
892 (or (null since-version) 895 (or (null since-version)
893 (customize-version-lessp since-version version)))) 896 (customize-version-lessp since-version version))
897 (if (member version versions)
898 t
899 ;;; Collect all versions that we use.
900 (push version versions))))
894 (setq found 901 (setq found
895 ;; We have to set the right thing here, 902 ;; We have to set the right thing here,
896 ;; depending if we have a group or a 903 ;; depending if we have a group or a
897 ;; variable. 904 ;; variable.
898 (if (get symbol 'group-documentation) 905 (if (get symbol 'group-documentation)
899 (cons (list symbol 'custom-group) found) 906 (cons (list symbol 'custom-group) found)
900 (cons (list symbol 'custom-variable) found)))))) 907 (cons (list symbol 'custom-variable) found))))))
901 (if (not found) 908 (if (not found)
902 (error "No user options have changed defaults in recent Emacs versions") 909 (error "No user options have changed defaults in recent Emacs versions")
903 (custom-buffer-create (custom-sort-items found t nil) 910 (put 'custom-versions-load-alist 'custom-loads
911 ;; Get all the files that correspond to element from the
912 ;; VERSIONS list. This could use some simplification.
913 (let ((flist nil))
914 (while versions
915 (push (copy-sequence
916 (cdr (assoc (car versions) custom-versions-load-alist)))
917 flist)
918 (setq versions (cdr versions)))
919 (apply 'nconc flist)))
920 ;; Because we set all the files needed to be loaded as a
921 ;; `custom-loads' property to `custom-versions-load-alist' this
922 ;; call will actually load them.
923 (custom-load-symbol 'custom-versions-load-alist)
924 ;; Clean up
925 (put 'custom-versions-load-alist 'custom-loads nil)
926 (custom-buffer-create (custom-sort-items found t 'first)
904 "*Customize Changed Options*")))) 927 "*Customize Changed Options*"))))
905 928
906 (defun customize-version-lessp (version1 version2) 929 (defun customize-version-lessp (version1 version2)
907 (let (major1 major2 minor1 minor2) 930 (let (major1 major2 minor1 minor2)
908 (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1) 931 (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1)
1181 options) 1204 options)
1182 (let ((count 0) 1205 (let ((count 0)
1183 (length (length options))) 1206 (length (length options)))
1184 (mapcar (lambda (entry) 1207 (mapcar (lambda (entry)
1185 (prog2 1208 (prog2
1186 (message "Creating customization items %2d%%..." 1209 (message "Creating customization items ...%2d%%"
1187 (/ (* 100.0 count) length)) 1210 (/ (* 100.0 count) length))
1188 (widget-create (nth 1 entry) 1211 (widget-create (nth 1 entry)
1189 :tag (custom-unlispify-tag-name 1212 :tag (custom-unlispify-tag-name
1190 (nth 0 entry)) 1213 (nth 0 entry))
1191 :value (nth 0 entry)) 1214 :value (nth 0 entry))
1194 (widget-insert "\n")) 1217 (widget-insert "\n"))
1195 (widget-insert "\n"))) 1218 (widget-insert "\n")))
1196 options)))) 1219 options))))
1197 (unless (eq (preceding-char) ?\n) 1220 (unless (eq (preceding-char) ?\n)
1198 (widget-insert "\n")) 1221 (widget-insert "\n"))
1199 (message "Creating customization items %2d%%...done" 100) 1222 (message "Creating customization items ...%2d%%done" 100)
1200 (unless (eq custom-buffer-style 'tree) 1223 (unless (eq custom-buffer-style 'tree)
1201 (mapcar 'custom-magic-reset custom-options)) 1224 (mapcar 'custom-magic-reset custom-options))
1202 (message "Creating customization setup...") 1225 (message "Creating customization setup...")
1203 (widget-setup) 1226 (widget-setup)
1204 (goto-char (point-min)) 1227 (goto-char (point-min))