On Thu, 25 Jul 2002, lists(a)hermans.net wrote:
Dear Bug Team!
When I attempt to run 'w3m' with the 'tinypath' function of Jari
Aalto's
Tiny Tools package, XEmacs immdiately dies without a trace. Not even a
stack dump. Just disappears from the screen.
By doing this many times I made out a minibuffer message just before it
dies:
ad-handle-definition, "require" got redefined
So I set "ad-redefinition-action" to "accept", and managed to get
this
backtrace. Unfortunately I don't have the expertise to take it much further
than this. It looks like it it's coming from "poe.el", part of the APEL
package (BTW it happens with the standard XEmacs apel package, but this
backtrace comes from the newer 10.3 version of APEL).
Has anyone seen this before? It makes me nervous.
Poe.el redefines require, using the following code
(fset 'si:require (symbol-function 'require))
(put 'require 'defun-maybe t)
(defun require (feature &optional filename noerror)
(if noerror
(condition-case nil
(si:require feature filename)
(file-error))
(si:require feature filename)))
This is a hard coded form of advice.
Tinypath.el does the following:
(defadvice require (around tinypath dis)
...)
Anybody who uses the advice mechanism will get screwed
when apel redefines the function.
The reason this breaks is that advice changes the symbol-function slot
to call the advice function. Here is an example.
(defun foo () 'foo)
(symbol-function 'foo) --> (lambda nil (quote foo))
(defadvice foo (around after-provided first activate protect) ad-do-it)
(symbol-function 'foo) --> (lambda nil "$ad-doc: foo$" (let
(ad-return-value) (setq ad-return-value (ad-Orig-foo)) ad-return-value))
(fset 'si:foo (symbol-function 'foo)) --> si:foo calls advised function
definition
(defun foo () (si:foo))
(symbol-function 'foo) --> ?
(foo) --> Lisp nesting exceeds `max-lisp-eval-depth'
The problem is that apel uses symbol-function to save the current
function away and is not aware of the advice mechanism, however,
defun which is used to redefine the function in apel is aware of
advised functions.
Try commenting out the code in poe.el that redefines require and
see if you still get the error - don't forget to recompile.
-jeff