diff options
| author | Markus Rost | 2002-10-09 22:40:24 +0000 |
|---|---|---|
| committer | Markus Rost | 2002-10-09 22:40:24 +0000 |
| commit | bd08d86ae97729dcefe57d793c2225895d33db79 (patch) | |
| tree | ac734fd7ea6450b89f3b64961a4baa0696d8ddb3 /admin/cus-test.el | |
| parent | 6b212e4721463d8fba766ecc3423c06ebd9ce456 (diff) | |
| download | emacs-bd08d86ae97729dcefe57d793c2225895d33db79.tar.gz emacs-bd08d86ae97729dcefe57d793c2225895d33db79.zip | |
Clean up Workarounds. Shorten variable names. Use
cus-test-vars-with-changed-state in a different way.
Diffstat (limited to 'admin/cus-test.el')
| -rw-r--r-- | admin/cus-test.el | 114 |
1 files changed, 51 insertions, 63 deletions
diff --git a/admin/cus-test.el b/admin/cus-test.el index c7580ef0786..9280587156c 100644 --- a/admin/cus-test.el +++ b/admin/cus-test.el | |||
| @@ -73,85 +73,70 @@ | |||
| 73 | ;; bugs/problems. Therefore this file contains a "Workaround" | 73 | ;; bugs/problems. Therefore this file contains a "Workaround" |
| 74 | ;; section, to be edited once in a while. | 74 | ;; section, to be edited once in a while. |
| 75 | ;; | 75 | ;; |
| 76 | ;; There is an additional experimental option | ||
| 77 | ;; `cus-test-include-changed-variables'. | ||
| 78 | ;; | ||
| 79 | ;; Options with a custom-get property, usually defined by a :get | 76 | ;; Options with a custom-get property, usually defined by a :get |
| 80 | ;; declararation, are stored in the variable | 77 | ;; declaration, are stored in the variable |
| 81 | ;; `cus-test-variables-with-custom-get', just in case one wants to | 78 | ;; |
| 82 | ;; investigate them further. | 79 | ;; `cus-test-vars-with-custom-get' |
| 80 | ;; | ||
| 81 | ;; Options with a state of 'changed ("changed outside the customize | ||
| 82 | ;; buffer") are stored in the variable | ||
| 83 | ;; | ||
| 84 | ;; `cus-test-vars-with-changed-state' | ||
| 85 | ;; | ||
| 86 | ;; These lists are prepared just in case one wants to investigate | ||
| 87 | ;; those options further. | ||
| 88 | ;; | ||
| 89 | ;; Current result (Oct 6, 2002) of cus-test-all: | ||
| 90 | ;; | ||
| 91 | ;; Cus Test tested 4514 variables. | ||
| 92 | ;; The following variables might have problems: | ||
| 93 | ;; (ps-mule-font-info-database-default) | ||
| 83 | 94 | ||
| 84 | ;;; Code: | 95 | ;;; Code: |
| 85 | 96 | ||
| 86 | ;;; User variables: | 97 | ;;; User variables: |
| 87 | 98 | ||
| 88 | (defvar cus-test-strange-variables nil | 99 | (defvar cus-test-strange-vars nil |
| 89 | "*List of variables to disregard by `cus-test-apropos'.") | 100 | "*List of variables to disregard by `cus-test-apropos'.") |
| 90 | 101 | ||
| 91 | (defvar cus-test-strange-libs nil | 102 | (defvar cus-test-strange-libs nil |
| 92 | "*List of libraries to avoid by `cus-test-load-libs'.") | 103 | "*List of libraries to avoid by `cus-test-load-libs'.") |
| 93 | 104 | ||
| 94 | (defvar cus-test-after-load-libraries-hook nil | 105 | (defvar cus-test-after-load-libs-hook nil |
| 95 | "*Hook to repair the worst side effects of loading buggy libraries. | 106 | "*Hook to repair the worst side effects of loading buggy libraries. |
| 96 | It is run after `cus-test-load-custom-loads' and `cus-test-load-libs'") | 107 | It is run after `cus-test-load-custom-loads' and `cus-test-load-libs'") |
| 97 | 108 | ||
| 98 | (defvar cus-test-include-changed-variables nil | ||
| 99 | "*If non-nil, consider variables with state 'changed as buggy.") | ||
| 100 | |||
| 101 | ;;; Workarounds: | 109 | ;;; Workarounds: |
| 102 | 110 | ||
| 103 | ;; avoid error when loading speedbar.el | ||
| 104 | ;; bug in speedbar.el in 20.3: | ||
| 105 | ;; (define-key speedbar-key-map "Q" 'delete c-frame) | ||
| 106 | ;; (setq speedbar-key-map (make-keymap)) | ||
| 107 | |||
| 108 | ;; avoid binding of M-x to `save-buffers-exit-emacs' after loading | ||
| 109 | ;; crisp.el (in 20.3): | ||
| 110 | ;; (setq crisp-override-meta-x nil) | ||
| 111 | |||
| 112 | ;; Work around bugs in 21.0: | ||
| 113 | |||
| 114 | ;; (defvar msb-after-load-hooks) | ||
| 115 | |||
| 116 | ;; The file eudc-export.el loads libraries "bbdb" and "bbdb-com" which | 111 | ;; The file eudc-export.el loads libraries "bbdb" and "bbdb-com" which |
| 117 | ;; are not part of GNU Emacs. | 112 | ;; are not part of GNU Emacs. |
| 118 | (provide 'bbdb) | 113 | (provide 'bbdb) |
| 119 | (provide 'bbdb-com) | 114 | (provide 'bbdb-com) |
| 120 | ;; (locate-library "bbdb") | 115 | ;; (locate-library "bbdb") |
| 121 | 116 | ||
| 122 | ;; Work around bugs in 21.3.50: | 117 | ;; reftex must be loaded before reftex-vars. |
| 118 | (load "reftex") | ||
| 119 | |||
| 120 | ;; eshell must be loaded before em-script. eshell loads esh-util, | ||
| 121 | ;; which must be loaded before em-cmpl, em-dirs and similar libraries. | ||
| 122 | (load "eshell") | ||
| 123 | 123 | ||
| 124 | ;; ada load problems are fixed now. | 124 | ;; Loading dunnet in batch mode leads to a dead end. |
| 125 | ;; (add-to-list 'cus-test-strange-libs "ada-xref") | 125 | (when noninteractive |
| 126 | (let (noninteractive) (load "dunnet")) | ||
| 127 | (add-to-list 'cus-test-strange-libs "dunnet")) | ||
| 126 | 128 | ||
| 127 | ;; Loading filesets.el currently disables mini-buffer echoes. | 129 | ;; Loading filesets.el currently disables mini-buffer echoes. |
| 128 | ;; (add-to-list 'cus-test-strange-libs "filesets") | 130 | ;; (add-to-list 'cus-test-strange-libs "filesets") |
| 129 | (add-hook | 131 | (add-hook |
| 130 | 'cus-test-after-load-libraries-hook | 132 | 'cus-test-after-load-libs-hook |
| 131 | (lambda nil | 133 | (lambda nil |
| 132 | (remove-hook 'menu-bar-update-hook 'filesets-build-menu-maybe) | 134 | (remove-hook 'menu-bar-update-hook 'filesets-build-menu-maybe) |
| 133 | (remove-hook 'kill-emacs-hook 'filesets-exit) | 135 | (remove-hook 'kill-emacs-hook 'filesets-exit) |
| 134 | (remove-hook 'kill-buffer-hook 'filesets-remove-from-ubl) | 136 | (remove-hook 'kill-buffer-hook 'filesets-remove-from-ubl) |
| 135 | (remove-hook 'first-change-hook 'filesets-reset-filename-on-change) | 137 | (remove-hook 'first-change-hook 'filesets-reset-filename-on-change) |
| 136 | )) | 138 | )) |
| 137 | ;; (setq cus-test-after-load-libraries-hook nil) | 139 | ;; (setq cus-test-after-load-libs-hook nil) |
| 138 | |||
| 139 | ;; After loading many libraries there appears an error: | ||
| 140 | ;; Loading filesets... | ||
| 141 | ;; tpu-current-line: Args out of range: 44, 84185 | ||
| 142 | |||
| 143 | ;; vc-cvs-registered in loaddefs.el runs a loop if vc-cvs.el is | ||
| 144 | ;; already loaded. | ||
| 145 | (eval-after-load "loaddefs" '(load-library "vc-cvs")) | ||
| 146 | |||
| 147 | ;; reftex must be loaded before reftex-vars. | ||
| 148 | (require 'reftex) | ||
| 149 | |||
| 150 | ;;; Current result (Oct 6, 2002) of cus-test-all: | ||
| 151 | |||
| 152 | ;; Cus Test tested 4514 variables. | ||
| 153 | ;; The following variables might have problems: | ||
| 154 | ;; (ps-mule-font-info-database-default) | ||
| 155 | 140 | ||
| 156 | ;;; Silencing: | 141 | ;;; Silencing: |
| 157 | 142 | ||
| @@ -183,10 +168,13 @@ It is run after `cus-test-load-custom-loads' and `cus-test-load-libs'") | |||
| 183 | 168 | ||
| 184 | ;; I haven't understood this :get stuff. However, there are only very | 169 | ;; I haven't understood this :get stuff. However, there are only very |
| 185 | ;; few variables with a custom-get property. Such symbols are stored | 170 | ;; few variables with a custom-get property. Such symbols are stored |
| 186 | ;; in `cus-test-variables-with-custom-get'. | 171 | ;; in `cus-test-vars-with-custom-get'. |
| 187 | (defvar cus-test-variables-with-custom-get nil | 172 | (defvar cus-test-vars-with-custom-get nil |
| 188 | "Set by `cus-test-apropos' to a list of options with :get property.") | 173 | "Set by `cus-test-apropos' to a list of options with :get property.") |
| 189 | 174 | ||
| 175 | (defvar cus-test-vars-with-changed-state nil | ||
| 176 | "Set by `cus-test-apropos' to a list of options with state 'changed.") | ||
| 177 | |||
| 190 | (require 'cus-edit) | 178 | (require 'cus-edit) |
| 191 | (require 'cus-load) | 179 | (require 'cus-load) |
| 192 | 180 | ||
| @@ -226,19 +214,19 @@ The detected problematic options are stored in `cus-test-errors'." | |||
| 226 | values) | 214 | values) |
| 227 | 215 | ||
| 228 | ;; Changed outside the customize buffer? | 216 | ;; Changed outside the customize buffer? |
| 229 | (when cus-test-include-changed-variables | 217 | ;; This routine is not very much tested. |
| 230 | (let ((c-value | 218 | (let ((c-value |
| 231 | (or (get symbol 'customized-value) | 219 | (or (get symbol 'customized-value) |
| 232 | (get symbol 'saved-value) | 220 | (get symbol 'saved-value) |
| 233 | (get symbol 'standard-value)))) | 221 | (get symbol 'standard-value)))) |
| 234 | (if c-value | 222 | (and (consp c-value) |
| 235 | (unless (equal (eval (car c-value)) | 223 | (boundp symbol) |
| 236 | (symbol-value symbol)) | 224 | (not (equal (eval (car c-value)) (symbol-value symbol))) |
| 237 | (setq mismatch 'changed))))) | 225 | (add-to-list 'cus-test-vars-with-changed-state symbol))) |
| 238 | 226 | ||
| 239 | ;; Store symbols with a custom-get property. | 227 | ;; Store symbols with a custom-get property. |
| 240 | (when (get symbol 'custom-get) | 228 | (when (get symbol 'custom-get) |
| 241 | (add-to-list 'cus-test-variables-with-custom-get symbol) | 229 | (add-to-list 'cus-test-vars-with-custom-get symbol) |
| 242 | ;; No need anymore to ignore them. | 230 | ;; No need anymore to ignore them. |
| 243 | ;; (setq mismatch nil) | 231 | ;; (setq mismatch nil) |
| 244 | ) | 232 | ) |
| @@ -258,7 +246,6 @@ The detected problematic options are stored in `cus-test-errors'." | |||
| 258 | (length cus-test-tested-variables)) | 246 | (length cus-test-tested-variables)) |
| 259 | ;; (describe-variable 'cus-test-errors) | 247 | ;; (describe-variable 'cus-test-errors) |
| 260 | (cus-test-errors-display) | 248 | (cus-test-errors-display) |
| 261 | ;; (describe-variable 'cus-test-variables-with-custom-get) | ||
| 262 | ) | 249 | ) |
| 263 | 250 | ||
| 264 | (defun cus-test-get-options (regexp) | 251 | (defun cus-test-get-options (regexp) |
| @@ -273,7 +260,7 @@ The detected problematic options are stored in `cus-test-errors'." | |||
| 273 | ;; (get symbol 'saved-value) | 260 | ;; (get symbol 'saved-value) |
| 274 | (get symbol 'custom-type)) | 261 | (get symbol 'custom-type)) |
| 275 | (string-match regexp (symbol-name symbol)) | 262 | (string-match regexp (symbol-name symbol)) |
| 276 | (not (member symbol cus-test-strange-variables)) | 263 | (not (member symbol cus-test-strange-vars)) |
| 277 | (push symbol found)))) | 264 | (push symbol found)))) |
| 278 | found)) | 265 | found)) |
| 279 | 266 | ||
| @@ -301,7 +288,7 @@ The detected problematic options are stored in `cus-test-errors'." | |||
| 301 | "Call `custom-load-symbol' on all atoms." | 288 | "Call `custom-load-symbol' on all atoms." |
| 302 | (interactive) | 289 | (interactive) |
| 303 | (mapatoms 'custom-load-symbol) | 290 | (mapatoms 'custom-load-symbol) |
| 304 | (run-hooks 'cus-test-after-load-libraries-hook)) | 291 | (run-hooks 'cus-test-after-load-libs-hook)) |
| 305 | 292 | ||
| 306 | (defun cus-test-load-libs () | 293 | (defun cus-test-load-libs () |
| 307 | "Load the libraries with autoloads in loaddefs.el. | 294 | "Load the libraries with autoloads in loaddefs.el. |
| @@ -331,7 +318,7 @@ This function is useful to detect load problems of libraries." | |||
| 331 | file alpha)) | 318 | file alpha)) |
| 332 | (error "Load Error for %s: %s" file alpha)))) | 319 | (error "Load Error for %s: %s" file alpha)))) |
| 333 | )) | 320 | )) |
| 334 | (run-hooks 'cus-test-after-load-libraries-hook)) | 321 | (run-hooks 'cus-test-after-load-libs-hook)) |
| 335 | 322 | ||
| 336 | (defun cus-test-all nil | 323 | (defun cus-test-all nil |
| 337 | "Run a maximal test by cus-test. | 324 | "Run a maximal test by cus-test. |
| @@ -346,7 +333,8 @@ in the emacs source directory." | |||
| 346 | ;; (cus-test-load-libs) | 333 | ;; (cus-test-load-libs) |
| 347 | (message "Running %s" 'cus-test-load-custom-loads) | 334 | (message "Running %s" 'cus-test-load-custom-loads) |
| 348 | (cus-test-load-custom-loads) | 335 | (cus-test-load-custom-loads) |
| 349 | ;; A second call increases the number of tested options. | 336 | ;; If the second call loads libraries, this indicates that there |
| 337 | ;; were load errors in the first run. | ||
| 350 | (message "Running %s again" 'cus-test-load-custom-loads) | 338 | (message "Running %s again" 'cus-test-load-custom-loads) |
| 351 | (cus-test-load-custom-loads) | 339 | (cus-test-load-custom-loads) |
| 352 | (message "Running %s" 'cus-test-apropos) | 340 | (message "Running %s" 'cus-test-apropos) |