comparison lisp/cus-edit.el @ 90384:c156f6a9e7b5

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-56 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 204-225) - Update from CVS - Sync from erc--emacs--0 - Merge from gnus--rel--5.10 - Improve tq.el. - Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6. * gnus--rel--5.10 (patch 81-85) - Update from CVS - Merge from emacs--devo--0
author Miles Bader <miles@gnu.org>
date Mon, 17 Apr 2006 08:41:12 +0000
parents e6bf73e43cf4 8991a6461375
children 2ecafc6d5db7
comparison
equal deleted inserted replaced
90383:ab20fb198dda 90384:c156f6a9e7b5
784 (interactive) 784 (interactive)
785 (let ((children custom-options)) 785 (let ((children custom-options))
786 (if (or (and (= 1 (length children)) 786 (if (or (and (= 1 (length children))
787 (memq (widget-type (car children)) 787 (memq (widget-type (car children))
788 '(custom-variable custom-face))) 788 '(custom-variable custom-face)))
789 (y-or-n-p "Reset all settings' buffer text to show current values? ")) 789 (y-or-n-p "Reset all settings' buffer text to show current values? "))
790 (mapc (lambda (widget) 790 (mapc (lambda (widget)
791 (if (memq (widget-get widget :custom-state) 791 (if (memq (widget-get widget :custom-state)
792 '(modified changed)) 792 '(modified changed))
793 (widget-apply widget :custom-reset-current))) 793 (widget-apply widget :custom-reset-current)))
794 children) 794 children)
1077 (message "`%s' is an alias for `%s'" symbol basevar)))) 1077 (message "`%s' is an alias for `%s'" symbol basevar))))
1078 1078
1079 (defvar customize-changed-options-previous-release "21.1" 1079 (defvar customize-changed-options-previous-release "21.1"
1080 "Version for `customize-changed-options' to refer back to by default.") 1080 "Version for `customize-changed-options' to refer back to by default.")
1081 1081
1082 ;; Packages will update this variable, so make it available.
1083 ;;;###autoload
1084 (defvar customize-package-emacs-version-alist nil
1085 "Alist mapping versions of Emacs to versions of a package.
1086 These package versions are listed in the :package-version
1087 keyword used in `defcustom', `defgroup', and `defface'. Its
1088 elements look like this:
1089
1090 (PACKAGE (PVERSION . EVERSION)...)
1091
1092 For each PACKAGE, which is a symbol, there are one or more
1093 elements that contain a package version PVERSION with an
1094 associated Emacs version EVERSION. These versions are strings.
1095 For example, the MH-E package updates this alist with the
1096 following:
1097
1098 (add-to-list 'customize-package-emacs-version-alist
1099 '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\")
1100 (\"7.0\" . \"22.1\") (\"7.1\" . \"22.1\")
1101 (\"7.2\" . \"22.1\") (\"7.3\" . \"22.1\")
1102 (\"7.4\" . \"22.1\") (\"8.0\" . \"22.1\")))
1103
1104 The value of PACKAGE needs to be unique and it needs to match the
1105 PACKAGE value appearing in the :package-version keyword. Since
1106 the user might see the value in a error message, a good choice is
1107 the official name of the package, such as MH-E or Gnus.")
1108
1082 ;;;###autoload 1109 ;;;###autoload
1083 (defalias 'customize-changed 'customize-changed-options) 1110 (defalias 'customize-changed 'customize-changed-options)
1084 1111
1085 ;;;###autoload 1112 ;;;###autoload
1086 (defun customize-changed-options (since-version) 1113 (defun customize-changed-options (since-version)
1117 (put 'custom-versions-load-alist 'custom-loads nil) 1144 (put 'custom-versions-load-alist 'custom-loads nil)
1118 1145
1119 (let (found) 1146 (let (found)
1120 (mapatoms 1147 (mapatoms
1121 (lambda (symbol) 1148 (lambda (symbol)
1122 (let ((version (get symbol 'custom-version))) 1149 (let* ((package-version (get symbol 'custom-package-version))
1150 (version
1151 (or (and package-version
1152 (customize-package-emacs-version symbol
1153 package-version))
1154 (get symbol 'custom-version))))
1123 (if version 1155 (if version
1124 (when (customize-version-lessp since-version version) 1156 (when (customize-version-lessp since-version version)
1125 (if (or (get symbol 'custom-group) 1157 (if (or (get symbol 'custom-group)
1126 (get symbol 'group-documentation)) 1158 (get symbol 'group-documentation))
1127 (push (list symbol 'custom-group) found)) 1159 (push (list symbol 'custom-group) found))
1132 (if found 1164 (if found
1133 (custom-buffer-create (custom-sort-items found t 'first) 1165 (custom-buffer-create (custom-sort-items found t 'first)
1134 "*Customize Changed Options*") 1166 "*Customize Changed Options*")
1135 (error "No user option defaults have been changed since Emacs %s" 1167 (error "No user option defaults have been changed since Emacs %s"
1136 since-version)))) 1168 since-version))))
1169
1170 (defun customize-package-emacs-version (symbol package-version)
1171 "Return Emacs version of SYMBOL.
1172 PACKAGE-VERSION has the form (PACKAGE . VERSION). The VERSION of
1173 PACKAGE is looked up in the associated list
1174 `customize-package-emacs-version-alist' to find the version of
1175 Emacs that is associated with it."
1176 (let (package-versions emacs-version)
1177 ;; Use message instead of error since we want user to be able to
1178 ;; see the rest of the symbols even if a package author has
1179 ;; botched things up.
1180 (cond ((not (listp package-version))
1181 (message "Invalid package-version value for %s" symbol))
1182 ((setq package-versions (assq (car package-version)
1183 customize-package-emacs-version-alist))
1184 (setq emacs-version
1185 (cdr (assoc (cdr package-version) package-versions)))
1186 (unless emacs-version
1187 (message "%s version %s not found in %s" symbol
1188 (cdr package-version)
1189 "customize-package-emacs-version-alist")))
1190 (t
1191 (message "Package %s neglected to update %s"
1192 (car package-version)
1193 "customize-package-emacs-version-alist")))
1194 emacs-version))
1137 1195
1138 (defun customize-version-lessp (version1 version2) 1196 (defun customize-version-lessp (version1 version2)
1139 ;; Why are the versions strings, and given that they are, why aren't 1197 ;; Why are the versions strings, and given that they are, why aren't
1140 ;; they converted to numbers and compared as such here? -- fx 1198 ;; they converted to numbers and compared as such here? -- fx
1141 1199