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

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

Re: require printing causes an error


From: Stefan
Subject: Re: require printing causes an error
Date: Sat, 13 Nov 2004 18:23:01 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)

> The menu manipulation (and other code) is done in a eval-and-compile to
> avoid some compilations gripes.

Then I suggest to not use eval-and-compile there.  It may not cause serious
problems in practice, but it causes byte-compilation of the file to have
undesriable side effects (to the Emacs process from which you byte-compile
the file).  This is more undesirable than some spurious harmless warnings.

BTW if you want to remove warnings for code like

   (cond
     (some-condition-A
       (defun foo-A () code-for-A ))
     (t
       (defun foo-A () code-for-B)))

Then you could use

   (defalias 'foo-A
     (cond
       (some-condition-A
         (lambda () code-for-A ))
       (t
         (lambda () code-for-B))))

This makes it obvious to the byte-compiler that `foo-A' will be defined.
Admittedly, the byte-compiler only started to recognize the above form a few
days ago.

> In pr-region-test:
> test.el:13:4:Warning: attempt to inline `t' before it was defined
> test.el:14:4:Warning: `t' called as a function

This was a bug in the byte-compiler which should be fixed now.

> To avoid these warnings (a lot of them!), I changed some defsubst to defun.

Well, I think changing them to defun was a good thing in itself since these
functions probably do not have a significant impact on performance (they
aren't used inside a loop, for one).


        Stefan




reply via email to

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