Mercurial > hg > xemacs-beta
comparison lisp/custom.el @ 5812:7b42a97af782
Don't bail out on :package-version in `defcustom'.
2014-09-27 Michael Sperber <mike@xemacs.org>
* custom.el (defcustom):
(custom-handle-keyword): Handle :package-version without bailing out.
author | Mike Sperber <sperber@deinprogramm.de> |
---|---|
date | Sat, 27 Sep 2014 14:16:11 +0200 |
parents | 10395934b99e |
children | a3234d587dc2 |
comparison
equal
deleted
inserted
replaced
5811:b527c25f36ce | 5812:7b42a97af782 |
---|---|
272 :safe Set SYMBOL's `safe-local-variable' property to VALUE. | 272 :safe Set SYMBOL's `safe-local-variable' property to VALUE. |
273 :version | 273 :version |
274 VALUE should be a string specifying that the variable was | 274 VALUE should be a string specifying that the variable was |
275 first introduced, or its default value was changed, in Emacs | 275 first introduced, or its default value was changed, in Emacs |
276 version VERSION. | 276 version VERSION. |
277 :package-version | |
278 VALUE should be a list with the form (PACKAGE . VERSION), | |
279 where PACKAGE and VERSION are strings. | |
280 | |
281 This specifies that the variable was first introduced, or its | |
282 default value was changed, in PACKAGE version VERSION. This | |
283 keyword takes priority over :version. | |
284 | |
285 Since PACKAGE must be unique and the user might see it in an | |
286 error message, a good choice is the official name of the | |
287 package, such as MH-E or Gnus. | |
277 :tag LABEL | 288 :tag LABEL |
278 Use LABEL, a string, instead of the item's name, to label the item | 289 Use LABEL, a string, instead of the item's name, to label the item |
279 in customization menus and buffers. | 290 in customization menus and buffers. |
280 :load FILE | 291 :load FILE |
281 Load file FILE (a string) before displaying this customization | 292 Load file FILE (a string) before displaying this customization |
456 Fourth argument TYPE is the custom option type." | 467 Fourth argument TYPE is the custom option type." |
457 (cond ((eq keyword :group) | 468 (cond ((eq keyword :group) |
458 (custom-add-to-group value symbol type)) | 469 (custom-add-to-group value symbol type)) |
459 ((eq keyword :version) | 470 ((eq keyword :version) |
460 (custom-add-version symbol value)) | 471 (custom-add-version symbol value)) |
472 ((eq keyword :package-version) | |
473 (custom-add-package-version symbol value)) | |
461 ((eq keyword :link) | 474 ((eq keyword :link) |
462 (custom-add-link symbol value)) | 475 (custom-add-link symbol value)) |
463 ((eq keyword :load) | 476 ((eq keyword :load) |
464 (custom-add-load symbol value)) | 477 (custom-add-load symbol value)) |
465 ((eq keyword :tag) | 478 ((eq keyword :tag) |
504 (put symbol 'custom-links (cons widget links))))) | 517 (put symbol 'custom-links (cons widget links))))) |
505 | 518 |
506 (defun custom-add-version (symbol version) | 519 (defun custom-add-version (symbol version) |
507 "To the custom option SYMBOL add the version VERSION." | 520 "To the custom option SYMBOL add the version VERSION." |
508 (put symbol 'custom-version version)) | 521 (put symbol 'custom-version version)) |
522 | |
523 (defun custom-add-package-version (symbol version) | |
524 "To the custom option SYMBOL add the package version VERSION." | |
525 (unless (and (consp version) | |
526 (stringp (car version)) | |
527 (stringp (cdr version))) | |
528 (error "Invalid package version `%s'" value)) | |
529 (put symbol 'custom-package-version version)) | |
509 | 530 |
510 (defun custom-add-load (symbol load) | 531 (defun custom-add-load (symbol load) |
511 "To the custom option SYMBOL add the dependency LOAD. | 532 "To the custom option SYMBOL add the dependency LOAD. |
512 LOAD should be either a library file name, or a feature name." | 533 LOAD should be either a library file name, or a feature name." |
513 (puthash symbol t custom-group-hash-table) | 534 (puthash symbol t custom-group-hash-table) |