diff options
| author | Stefan Monnier | 2005-06-26 18:18:04 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-06-26 18:18:04 +0000 |
| commit | b7a45ee15002961526c2528b151abe4687dedaf5 (patch) | |
| tree | 8ac3157f7699ed9fd634c1e335aa612a59cfa7ee | |
| parent | f1b6d70fba9c219934513f61ab5e711421e89440 (diff) | |
| download | emacs-b7a45ee15002961526c2528b151abe4687dedaf5.tar.gz emacs-b7a45ee15002961526c2528b151abe4687dedaf5.zip | |
(make-autoload): Add the :setter for defcustoms corresponding to minor modes.
| -rw-r--r-- | lisp/emacs-lisp/autoload.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 68d1287d98c..7dbf61c5bf3 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;; autoload.el --- maintain autoloads in loaddefs.el | 1 | ;; autoload.el --- maintain autoloads in loaddefs.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1991,92,93,94,95,96,97, 2001,02,03,04 | 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2004, 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Roland McGrath <roland@gnu.org> | 6 | ;; Author: Roland McGrath <roland@gnu.org> |
| 7 | ;; Keywords: maint | 7 | ;; Keywords: maint |
| @@ -123,7 +123,17 @@ or macro definition or a defcustom)." | |||
| 123 | ) | 123 | ) |
| 124 | `(progn | 124 | `(progn |
| 125 | (defvar ,varname ,init ,doc) | 125 | (defvar ,varname ,init ,doc) |
| 126 | (custom-autoload ',varname ,file)))) | 126 | (custom-autoload ',varname ,file) |
| 127 | ;; The use of :require in a defcustom can be annoying, especially | ||
| 128 | ;; when defcustoms are moved from one file to another between | ||
| 129 | ;; releases because the :require arg gets placed in the user's | ||
| 130 | ;; .emacs. In order for autoloaded minor modes not to need the | ||
| 131 | ;; use of :require, we arrange to store their :setter. | ||
| 132 | ,(let ((setter (condition-case nil | ||
| 133 | (cadr (memq :set form)) | ||
| 134 | (error nil)))) | ||
| 135 | (if (equal setter ''custom-set-minor-mode) | ||
| 136 | `(put ',varname 'custom-set 'custom-set-minor-mode)))))) | ||
| 127 | 137 | ||
| 128 | ;; nil here indicates that this is not a special autoload form. | 138 | ;; nil here indicates that this is not a special autoload form. |
| 129 | (t nil)))) | 139 | (t nil)))) |
| @@ -566,5 +576,5 @@ Calls `update-directory-autoloads' on the command line arguments." | |||
| 566 | 576 | ||
| 567 | (provide 'autoload) | 577 | (provide 'autoload) |
| 568 | 578 | ||
| 569 | ;;; arch-tag: 00244766-98f4-4767-bf42-8a22103441c6 | 579 | ;; arch-tag: 00244766-98f4-4767-bf42-8a22103441c6 |
| 570 | ;;; autoload.el ends here | 580 | ;;; autoload.el ends here |