emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change in bytecomp.el breaks Gnus


From: Stefan
Subject: Re: Change in bytecomp.el breaks Gnus
Date: Thu, 11 Nov 2004 16:55:07 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)

> Your patch does not seem to solve a related problem I reported earlier
> on emacs-devel, so it probably is not a complete solution:

>    Changes in byte compilation which must be less than a day old, have
>    strange effects.  `winner' is no longer usable when winner.elc is
>    used, but still seems to work fine when winner.el is used.

>    After `emacs -q' I get the following ielm run:

>    *** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (load "winner")
>    t
ELISP> (winner-sorted-window-list)
>    *** Eval error ***  Symbol's function definition is void: t
ELISP> (load "winner.el")
>    t
ELISP> (winner-sorted-window-list)
>    (#<window 3 on *ielm*>)

Hmm... the problem seems to be related to the fact that some `defsubst's are
first turned into `defalias' but that the new defalias code gets surprised
when it encounters those `defalias'es.

I've installed the patch below which I think does The Right Thing(tm).
But the distinction between top-level and non-top-level forms as well as
several aspects of the byte-compiler are still a bit fuzzy in my mind.

I think the patch not only fixes the problem but also fixes an older
"problem" which is that code such as:

   (defun toto ()
     (foobsfg x)
     (if toto
         (defalias 'foobsfg 'y)))

did not complain about calling an unknown function `foobsfg'.
Can someone who's already played a bit with bytecomp.el do a reality check?


        Stefan


--- bytecomp.el 09 Nov 2004 09:27:47 -0500      2.157
+++ bytecomp.el 11 Nov 2004 16:35:49 -0500      
@@ -3614,7 +3613,6 @@
 (byte-defop-compiler-1 defconst byte-compile-defvar)
 (byte-defop-compiler-1 autoload)
 (byte-defop-compiler-1 lambda byte-compile-lambda-form)
-(byte-defop-compiler-1 defalias)
 
 (defun byte-compile-defun (form)
   ;; This is not used for file-level defuns with doc strings.
@@ -3716,7 +3714,8 @@
   (error "`lambda' used as function name is invalid"))
 
 ;; Compile normally, but deal with warnings for the function being defined.
-(defun byte-compile-defalias (form)
+(put 'defalias 'byte-hunk-handler 'byte-compile-file-form-defalias)
+(defun byte-compile-file-form-defalias (form)
   (if (and (consp (cdr form)) (consp (nth 1 form))
           (eq (car (nth 1 form)) 'quote)
           (consp (cdr (nth 1 form)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]