Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-display-mime-function undefined -- resolved!
@ 1998-11-11 19:38 Hrvoje Niksic
  1998-11-13 18:56 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Hrvoje Niksic @ 1998-11-11 19:38 UTC (permalink / raw)
  Cc: ding

I've hunted down a weird bug that has been reported but not explained
before.  Scenario is like this:

    Start Gnus, enter a group with RET, and search for something --
    say `multipart' -- with `M-s'.  I often do this to test Gnus MIME
    thingies.  Now, when you find a multipart article, press `g' to
    render it.

At this point, I get the "gnus-display-mime-function undefined" error, 
which appears impossible, because all of gnus-art is loaded, and the
variable is clearly defined in that file.

What really happens is that `M-s' binds the variable to nil, and
gnus-art is loaded *within that let*.  So when let finishes, the
variable returns to its previous state, i.e. to being unbound.

This example is quite scary, since it proves that you have to be very
careful about binding variables also defined in other files that are
autoloaded at various inopportune moments.  The scary part is that the
buggy code looks quite innocuous, and yet it can mulfunction is some
rarely repeated circumstances.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Lost in Static 18 / And the storm is closing in now


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnus-display-mime-function undefined -- resolved!
  1998-11-11 19:38 gnus-display-mime-function undefined -- resolved! Hrvoje Niksic
@ 1998-11-13 18:56 ` Lars Magne Ingebrigtsen
  1998-11-14  0:58   ` Hrvoje Niksic
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-13 18:56 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> This example is quite scary, since it proves that you have to be very
> careful about binding variables also defined in other files that are
> autoloaded at various inopportune moments.  The scary part is that the
> buggy code looks quite innocuous, and yet it can mulfunction is some
> rarely repeated circumstances.

Yup.  And, indeed, the same function has bitten us before:

  ;; We have to require this here to make sure that the following
  ;; dynamic binding isn't shadowed by autoloading.
  (require 'gnus-async)

Which I'd forgotten all about.  I've now required `gnus-art' as well.

I do wonder, though, whether this is a reasonable way for a Lisp to
work.  I think

(progn
  (let (var)
    ...
    (load "file-where-var-is-defvarred"))
  (boundp 'var))
=> nil

is somewhat wierd, although totally understandable.  

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnus-display-mime-function undefined -- resolved!
  1998-11-13 18:56 ` Lars Magne Ingebrigtsen
@ 1998-11-14  0:58   ` Hrvoje Niksic
  0 siblings, 0 replies; 3+ messages in thread
From: Hrvoje Niksic @ 1998-11-14  0:58 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I do wonder, though, whether this is a reasonable way for a Lisp to
> work.
[...]

I think CL works the same way, at least for VAR being a special
variable.

(Note that "Emacs doesn't have lexical scoping" is not a valid
argument here because, even if Emacs had true lexical variables,
variables used in this fashion have to be special for code to work.)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
You know it's going to be a bad day when your twin brother forgot
your birthday.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-11-14  0:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-11 19:38 gnus-display-mime-function undefined -- resolved! Hrvoje Niksic
1998-11-13 18:56 ` Lars Magne Ingebrigtsen
1998-11-14  0:58   ` Hrvoje Niksic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).