comparison lisp/autoload.el @ 5070:b0f4adffca7d

fix so that CL docstrings (with &key, etc.) handled properly -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-02-23 Ben Wing <ben@xemacs.org> * autoload.el: * autoload.el (make-autoload): * cl-macs.el (cl-function-arglist): * cl-macs.el (cl-transform-lambda): Don't add argument list with the tag "Common Lisp lambda list:"; instead add in "standard" form using "arguments:" and omitting the function name. Add an arg to `cl-function-arglist' to omit the name and use it in autoload.el instead of just hacking it off. * help.el: * help.el (function-arglist): * help.el (function-documentation-1): New. Extract out common code to recognize and/or strip the arglist from documentation into `function-documentation-1'. Use in `function-arglist' and `function-documentation'. Modify `function-arglist' so it looks for the `arguments: ' stuff in all doc strings, not just subrs/autoloads, so that CL functions get recognized properly. Change the regexp used to match "arguments: " specs to allow nested parens inside the arg list (happens when you have a default value specified in a CL arglist).
author Ben Wing <ben@xemacs.org>
date Tue, 23 Feb 2010 01:12:13 -0600
parents e29fcfd8df5f
children d555581e3cba
comparison
equal deleted inserted replaced
5069:14f0dd1fabdb 5070:b0f4adffca7d
1 ;;; autoload.el --- maintain autoloads in auto-autoloads files. 1 ;;; autoload.el --- maintain autoloads in auto-autoloads files.
2 2
3 ;; Copyright (C) 1991-1994, 1997, 2003 Free Software Foundation, Inc. 3 ;; Copyright (C) 1991-1994, 1997, 2003 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. 4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
5 ;; Copyright (C) 1996, 2000, 2002, 2003, 2004 Ben Wing. 5 ;; Copyright (C) 1996, 2000, 2002, 2003, 2004, 2010 Ben Wing.
6 6
7 ;; Original Author: Roland McGrath <roland@gnu.ai.mit.edu> 7 ;; Original Author: Roland McGrath <roland@gnu.ai.mit.edu>
8 ;; Heavily Modified: XEmacs Maintainers 8 ;; Heavily Modified: XEmacs Maintainers
9 ;; Keywords: maint 9 ;; Keywords: maint
10 10
288 (if (memq car '(defmacro defmacro* defun defun*)) 288 (if (memq car '(defmacro defmacro* defun defun*))
289 (let ((arglist (nth 2 form)) 289 (let ((arglist (nth 2 form))
290 (placeholder (eval-when-compile (gensym)))) 290 (placeholder (eval-when-compile (gensym))))
291 (setq doc (concat (or doc "") 291 (setq doc (concat (or doc "")
292 "\n\narguments: " 292 "\n\narguments: "
293 (replace-in-string 293 (cl-function-arglist placeholder arglist t)
294 (cl-function-arglist placeholder arglist) 294 "\n"))))
295 (format "^(%s ?" placeholder)
296 "(") "\n"))))
297 ;; `define-generic-mode' quotes the name, so take care of that 295 ;; `define-generic-mode' quotes the name, so take care of that
298 (list 'autoload (if (listp name) name (list 'quote name)) file doc 296 (list 'autoload (if (listp name) name (list 'quote name)) file doc
299 (or (and (memq car '(define-skeleton define-derived-mode 297 (or (and (memq car '(define-skeleton define-derived-mode
300 define-generic-mode 298 define-generic-mode
301 easy-mmode-define-global-mode 299 easy-mmode-define-global-mode