CVS update by aidan packages/xemacs-packages/xemacs-devel ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Mon Dec 22 09:04:11 EST 2008


  User: aidan   
  Date: 08/12/22 15:04:11

  Modified:    packages/xemacs-packages/xemacs-devel ChangeLog find-func.el
Log:
Differentiate between symbol variables and functions, find-func.

Revision  Changes    Path
1.116     +9 -0      XEmacs/packages/xemacs-packages/xemacs-devel/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-devel/ChangeLog,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -p -r1.115 -r1.116
--- ChangeLog	2008/02/27 20:07:13	1.115
+++ ChangeLog	2008/12/22 14:04:11	1.116
@@ -1,3 +1,12 @@
+2008-12-22  Aidan Kehoe  <kehoea at parhasard.net>
+
+	* find-func.el (find-function-noselect): 
+	(find-variable-noselect): 
+	(find-definition-noselect): 
+	Call #'symbol-file with two arguments if that is allowing,
+	allowing us to differentiate between variables and functions with
+	the same symbol name. 
+
 2008-02-27  Norbert Koch  <viteno at xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.78 released.



1.13      +11 -4     XEmacs/packages/xemacs-packages/xemacs-devel/find-func.el

Index: find-func.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-devel/find-func.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- find-func.el	2007/12/30 14:24:59	1.12
+++ find-func.el	2008/12/22 14:04:11	1.13
@@ -289,7 +289,9 @@ in `load-path'."
     (let ((library
 	   (cond ((eq (car-safe def) 'autoload)
 		  (nth 1 def))
-		 ((symbol-file function))
+		 ((if (function-allows-args 'symbol-file 2)
+		      (symbol-file function 'defun)
+		    (symbol-file function)))
 		 ;; XEmacs addition: function annotations
 		 ((fboundp 'compiled-function-annotation)
 		  (cond ((compiled-function-p def)
@@ -408,7 +410,9 @@ The library where VARIABLE is defined is
 `find-function-source-path', if non nil, otherwise in `load-path'."
   (if (not variable)
       (error "You didn't specify a variable"))
-  (let ((library (or file (symbol-file variable))))
+  (let ((library (or file (if (function-allows-args 'symbol-file 2)
+			      (symbol-file variable 'defvar)
+			    (symbol-file variable)))))
     (unless (and (null library) (built-in-variable-type variable))
       (error "%s is a primitive variable" variable))
     (find-function-search-for-symbol variable 'variable library)))
@@ -449,7 +453,7 @@ See `find-variable' for more details."
 (defun find-definition-noselect (symbol type &optional file)
   "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL.
 TYPE says what type of definition: nil for a function,
-`defvar' or `defface' for a variable or face.  This functoin
+`defvar' or `defface' for a variable or face.  This function
 does not switch to the buffer or display it.
 
 The library where SYMBOL is defined is searched for in FILE or
@@ -458,7 +462,10 @@ The library where SYMBOL is defined is s
       (error "You didn't specify a symbol"))
   (if (null type)
       (find-function-noselect symbol)
-    (let ((library (or file (symbol-file symbol))))
+    (let ((library (or file 
+		       (if (function-allows-args 'symbol-file 2)
+			   (symbol-file symbol type)
+			 (symbol-file symbol)))))
       (find-function-search-for-symbol symbol type library))))
 
 ;; RMS says: 






More information about the XEmacs-CVS mailing list