diff lisp/prim/find-func.el @ 207:e45d5e7c476e r20-4b2

Import from CVS: tag r20-4b2
author cvs
date Mon, 13 Aug 2007 10:03:52 +0200
parents 850242ba4a81
children
line wrap: on
line diff
--- a/lisp/prim/find-func.el	Mon Aug 13 10:02:48 2007 +0200
+++ b/lisp/prim/find-func.el	Mon Aug 13 10:03:52 2007 +0200
@@ -8,7 +8,7 @@
 ;; Created: 97/07/25
 ;; URL: <http://www.kurims.kyoto-u.ac.jp/~petersen/emacs-lisp/>
 
-;; $Id: find-func.el,v 1.1 1997/10/10 01:39:52 steve Exp $
+;; $Id: find-func.el,v 1.2 1997/10/31 14:53:07 steve Exp $
 
 ;; This file is part of XEmacs.
 
@@ -96,10 +96,10 @@
 
 The library where FUNCTION is defined is searched for in
 `find-function-source-path', if non `nil', otherwise in `load-path'."
+  (if (not function)
+      (error "You didn't specify a function"))
   (and (subrp (symbol-function function))
        (error "%s is a primitive function" function))
-  (if (not function)
-      (error "You didn't specify a function"))
   (let ((def (symbol-function function))
 	library aliases)
     (while (symbolp def)
@@ -118,7 +118,10 @@
 		 (nth 1 def))
 		((describe-function-find-file function))
 		((compiled-function-p def)
-		 (substring (compiled-function-annotation def) 0 -4))))
+		 (substring (compiled-function-annotation def) 0 -4))
+		((eq 'macro (car-safe def))
+		 (and (compiled-function-p (cdr def))
+		      (substring (compiled-function-annotation (cdr def)) 0 -4)))))
     (if (null library)
 	(error (format "Don't know where `%s' is defined" function)))
     (if (string-match "\\.el\\(c\\)\\'" library)
@@ -153,9 +156,8 @@
 (defun find-function-read-function ()
   "Read and return a function, defaulting to the one near point.
 
-The function named by `find-function-function' is used to select the
-default function."
-  (let ((fn (funcall find-function-function))
+`function-at-point' is used to select the default function."
+  (let ((fn (function-at-point))
 	(enable-recursive-minibuffers t)
 	val)
     (setq val (completing-read
@@ -184,7 +186,7 @@
   "Find the definition of the function near point in the current window.
 
 Finds the Emacs Lisp library containing the definition of the function
-near point (selected by `find-function-function') in a buffer and
+near point (selected by `function-at-point') in a buffer and
 places point before the definition.  Point is saved in the buffer if
 it is one of the current buffers.
 
@@ -198,7 +200,7 @@
   "Find the definition of the function near point in the other window.
 
 Finds the Emacs Lisp library containing the definition of the function
-near point (selected by `find-function-function') in a buffer and
+near point (selected by `function-at-point') in a buffer and
 places point before the definition.  Point is saved in the buffer if
 it is one of the current buffers.
 
@@ -212,7 +214,7 @@
   "Find the definition of the function near point in the another frame.
 
 Finds the Emacs Lisp library containing the definition of the function
-near point (selected by `find-function-function') in a buffer and
+near point (selected by `function-at-point') in a buffer and
 places point before the definition.  Point is saved in the buffer if
 it is one of the current buffers.