Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 63785:1220f6122b90
(make-autoload): Add the :setter for defcustoms corresponding to minor modes.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 26 Jun 2005 18:18:04 +0000 |
parents | 64c207ce6c20 |
children | 18a818a2ee7c bb71c6cf2009 |
comparison
equal
deleted
inserted
replaced
63784:7f1bb68ec043 | 63785:1220f6122b90 |
---|---|
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 |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
121 (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form))))) | 121 (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form))))) |
122 ;; (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form))))) | 122 ;; (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form))))) |
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)))) |
130 | 140 |
131 ;; Forms which have doc-strings which should be printed specially. | 141 ;; Forms which have doc-strings which should be printed specially. |
564 (apply 'update-directory-autoloads command-line-args-left) | 574 (apply 'update-directory-autoloads command-line-args-left) |
565 (setq command-line-args-left nil)) | 575 (setq command-line-args-left nil)) |
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 |