comparison lisp/autoload.el @ 4425:bfb8a26de3cb

Move autoload operator definitions to xemacs-base. 2008-02-16 Michael Sperber <mike@xemacs.org> * autoload.el (autoload-make-autoload-operators, autoload-make-autoload-complex-operators): Move autoload operator definitons to autoload-operators.el in xemacs-base package. Continue to work with older packages.
author Mike Sperber <sperber@deinprogramm.de>
date Sat, 23 Feb 2008 14:32:19 +0100
parents d2f4dd8611d9
children fee33ab25966
comparison
equal deleted inserted replaced
4424:42711a251efd 4425:bfb8a26de3cb
224 224
225 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 225 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
226 ;; Parsing the source file text. 226 ;; Parsing the source file text.
227 ;; Autoloads in C source differ from those in Lisp source. 227 ;; Autoloads in C source differ from those in Lisp source.
228 228
229 ;; #### Eventually operators like defclass and defmethod (defined in an 229 ; Add operator definitions to autoload-operators.el in the xemacs-base
230 ;; external package, EIEIO) may be factored out. Don't add operators here 230 ; package.
231 ;; without discussing whether and how to do that on the developers' channel. 231 (ignore-errors (require 'autoload-operators))
232 (defvar autoload-make-autoload-operators 232
233 '(defun define-skeleton defmacro define-derived-mode define-generic-mode 233 ; As autoload-operators is new, provide stopgap measure for a while.
234 easy-mmode-define-minor-mode easy-mmode-define-global-mode 234 (if (not (boundp 'autoload-make-autoload-operators))
235 define-minor-mode defun* defmacro* defclass defmethod) 235 (progn
236 "`defun'-like operators that use `autoload' to load the library.") 236 (defvar autoload-make-autoload-operators
237 237 '(defun define-skeleton defmacro define-derived-mode define-generic-mode
238 (defvar autoload-make-autoload-complex-operators 238 easy-mmode-define-minor-mode easy-mmode-define-global-mode
239 '(easy-mmode-define-minor-mode easy-mmode-define-global-mode 239 define-minor-mode defun* defmacro*)
240 define-minor-mode) 240 "`defun'-like operators that use `autoload' to load the library.")
241 "`defun'-like operators to macroexpand before using `autoload'.") 241
242 (defvar autoload-make-autoload-complex-operators
243 '(easy-mmode-define-minor-mode easy-mmode-define-global-mode
244 define-minor-mode)
245 "`defun'-like operators to macroexpand before using `autoload'.")
246
247 (put 'autoload 'doc-string-elt 3)
248 (put 'defun 'doc-string-elt 3)
249 (put 'defun* 'doc-string-elt 3)
250 (put 'defvar 'doc-string-elt 3)
251 (put 'defcustom 'doc-string-elt 3)
252 (put 'defconst 'doc-string-elt 3)
253 (put 'defmacro 'doc-string-elt 3)
254 (put 'defmacro* 'doc-string-elt 3)
255 (put 'defsubst 'doc-string-elt 3)
256 (put 'define-skeleton 'doc-string-elt 2)
257 (put 'define-derived-mode 'doc-string-elt 4)
258 (put 'easy-mmode-define-minor-mode 'doc-string-elt 2)
259 (put 'define-minor-mode 'doc-string-elt 2)
260 (put 'define-generic-mode 'doc-string-elt 7)
261 ;; defin-global-mode has no explicit docstring.
262 (put 'easy-mmode-define-global-mode 'doc-string-elt 1000)))
242 263
243 (defun make-autoload (form file) 264 (defun make-autoload (form file)
244 "Turn FORM into an autoload or defvar for source file FILE. 265 "Turn FORM into an autoload or defvar for source file FILE.
245 Returns nil if FORM is not a special autoload form (i.e. a function definition 266 Returns nil if FORM is not a special autoload form (i.e. a function definition
246 or macro definition or a defcustom)." 267 or macro definition or a defcustom)."
778 (while (search-forward "\^L" p2 t) 799 (while (search-forward "\^L" p2 t)
779 (delete-char -1) 800 (delete-char -1)
780 (insert "\\^L"))) 801 (insert "\\^L")))
781 (goto-char p2)))))))) 802 (goto-char p2))))))))
782 803
783 ;;; Forms which have doc-strings which should be printed specially.
784 ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is
785 ;;; the doc-string in FORM.
786 ;;;
787 ;;; There used to be the following note here:
788 ;;; ;;; Note: defconst and defvar should NOT be marked in this way.
789 ;;; ;;; We don't want to produce defconsts and defvars that
790 ;;; ;;; make-docfile can grok, because then it would grok them twice,
791 ;;; ;;; once in foo.el (where they are given with ;;;###autoload) and
792 ;;; ;;; once in loaddefs.el.
793 ;;;
794 ;;; Counter-note: Yes, they should be marked in this way.
795 ;;; make-docfile only processes those files that are loaded into the
796 ;;; dumped Emacs, and those files should never have anything
797 ;;; autoloaded here. The above-feared problem only occurs with files
798 ;;; which have autoloaded entries *and* are processed by make-docfile;
799 ;;; there should be no such files.
800
801 (put 'autoload 'doc-string-elt 3)
802 (put 'defun 'doc-string-elt 3)
803 (put 'defun* 'doc-string-elt 3)
804 (put 'defvar 'doc-string-elt 3)
805 (put 'defcustom 'doc-string-elt 3)
806 (put 'defconst 'doc-string-elt 3)
807 (put 'defmacro 'doc-string-elt 3)
808 (put 'defmacro* 'doc-string-elt 3)
809 (put 'defsubst 'doc-string-elt 3)
810 (put 'define-skeleton 'doc-string-elt 2)
811 (put 'define-derived-mode 'doc-string-elt 4)
812 (put 'easy-mmode-define-minor-mode 'doc-string-elt 2)
813 (put 'define-minor-mode 'doc-string-elt 2)
814 (put 'define-generic-mode 'doc-string-elt 7)
815 (put 'defclass 'doc-string-elt 4)
816 (put 'defmethod 'doc-string-elt 3)
817 ;; defin-global-mode has no explicit docstring.
818 (put 'easy-mmode-define-global-mode 'doc-string-elt 1000)
819
820 (defun autoload-trim-file-name (file) 804 (defun autoload-trim-file-name (file)
821 "Returns relative pathname of FILE including the last directory. 805 "Returns relative pathname of FILE including the last directory.
822 806
823 Hard-codes the directory separator as a forward slash." 807 Hard-codes the directory separator as a forward slash."
824 (setq file (expand-file-name file)) 808 (setq file (expand-file-name file))