[COMMIT] Differentiate between symbol variables and functions, find-func
Vladimir G. Ivanovic
vgivanovic at comcast.net
Sat Dec 27 01:24:18 EST 2008
I have three questions/issues:
1. I'm unable to parse the comment:
Call #'symbol-file with two arguments if that is allowing,
allowing us to differentiate between variables and functions
with the same symbol name.
Is what's meant "Call #'symbol-file with two arguments, if that is
allowed, ..."?
2. The construct "#'" is not Emacs Lisp, but a Common Lisp extension.
Is the Common Lisp package always, always, always available?
(Appendix D "Porting Common Lisp" in the Common Lisp Extension info
file lists an alternative that's pure Emacs Lisp: use a regular
quote, e.g. "'symbol-file".)
3. Since the function 'symbol-file' takes one mandatory argument and
one optional one, so calling 'symbol-file' with two arguments is
*always* allowed, so I don't understand the intent of the comment.
--- Vladimir
on 12/22/2008 06:04 AM Aidan Kehoe said the following:
> APPROVE COMMIT
>
> NOTE: This patch has been committed.
>
> xemacs-packages/xemacs-devel/ChangeLog addition:
>
> 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.
>
>
> XEmacs Packages source patch:
> Diff command: cvs -q diff -Nu
> Files affected: xemacs-packages/xemacs-devel/find-func.el
> ===================================================================
> RCS
>
> Index: xemacs-packages/xemacs-devel/find-func.el
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-devel/find-func.el,v
> retrieving revision 1.12
> diff -u -u -r1.12 find-func.el
> --- xemacs-packages/xemacs-devel/find-func.el 2007/12/30 14:24:59 1.12
> +++ xemacs-packages/xemacs-devel/find-func.el 2008/12/22 14:03:33
> @@ -289,7 +289,9 @@
> (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 @@
> `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 @@
> (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 @@
> (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:
>
--
Vladimir G. Ivanovic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://calypso.tux.org/pipermail/xemacs-patches/attachments/20081226/c6824517/attachment-0001.bin
More information about the XEmacs-Patches
mailing list