changeset 8458:a95ca44cec95

(ad-subr-arglist): Adapted to new DOC file format.
author Richard M. Stallman <rms@gnu.org>
date Fri, 05 Aug 1994 05:31:36 +0000
parents c0492d7043b2
children e1a2458245cb
files lisp/emacs-lisp/advice.el
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/advice.el	Fri Aug 05 05:11:30 1994 +0000
+++ b/lisp/emacs-lisp/advice.el	Fri Aug 05 05:31:36 1994 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Hans Chalupsky <hans@cs.buffalo.edu>
 ;; Created: 12 Dec 1992
-;; Version: advice.el,v 2.13 1994/08/03 23:27:05 hans Exp
+;; Version: advice.el,v 2.14 1994/08/05 03:42:04 hans Exp
 ;; Keywords: extensions, lisp, tools
 
 ;; This file is part of GNU Emacs.
@@ -26,7 +26,7 @@
 ;; LCD Archive Entry:
 ;; advice|Hans Chalupsky|hans@cs.buffalo.edu|
 ;; Overloading mechanism for Emacs Lisp functions|
-;; 1994/08/03 23:27:05|2.13|~/packages/advice.el.Z|
+;; 1994/08/05 03:42:04|2.14|~/packages/advice.el.Z|
 
 
 ;;; Commentary:
@@ -1830,7 +1830,7 @@
 ;; @@ Variable definitions:
 ;; ========================
 
-(defconst ad-version "2.13")
+(defconst ad-version "2.14")
 
 ;;;###autoload
 (defvar ad-redefinition-action 'warn
@@ -2567,10 +2567,19 @@
 	;; one with args `(a &rest c)' using that mechanism. Also, the argument
 	;; names from the docstring are more meaningful. Hence, I'll stick with
 	;; the old way of doing things.
-	(t (let ((doc (ad-real-documentation subr-name t)))
-	     (cond ((and doc
-			 (string-match
-			  "[\n\t ]*\narguments: ?\\((.*)\\)\n?\\'" doc))
+	(t (let ((doc (or (ad-real-documentation subr-name t) "")))
+	     (cond ((string-match "^\\(([^\)]+)\\)\n?\\'" doc)
+		    (ad-define-subr-args
+		     subr-name
+		     (cdr (car (read-from-string
+				(downcase
+				 (substring doc
+					    (match-beginning 1)
+					    (match-end 1)))))))
+		    (ad-get-subr-args subr-name))
+		   ;; this is the old format used before Emacs 19.24:
+		   ((string-match
+		     "[\n\t ]*\narguments: ?\\((.*)\\)\n?\\'" doc)
 		    (ad-define-subr-args
 		     subr-name
 		     (car (read-from-string