emacs-devel
[Top][All Lists]
Advanced

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

Re: crazy interaction between buffer-locality and function-locality of v


From: Stefan Monnier
Subject: Re: crazy interaction between buffer-locality and function-locality of variables
Date: Sun, 02 Nov 2008 11:57:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> Is the behavior of binding function arguments variables subject to the
> locality of the current buffer at function call time intentional?  It makes

Yes.  It's not great, but there's no easy fix for it.

> writing functions that respond to asynchronous events require using
> local variables with names that are globally unique (prefixed with
> package name, presumably), which is a PITA.  An example of where this
> bit me: gnus makes 'timestamp buffer-local in *Summary* buffers, and
> emacs-jabber has a function that uses "timestamp" as the name of one
> of its arguments and then calls with-temp-buffer inside that function.

Indeed, it's a Gnus bug.  Please report it there.

> It seems to me that this behavior is broken, but if it's to be kept

It's partly broken, but other behaviors are broken in other ways.
The only good solution is to be careful not to mix them up (except when
it's really wanted, such as with default-directory which is often
let-bound).

> there needs to be strong guidance against making variables whose names
> /aren't/ prefixed with the package name buffer-local.

Agreed.  Where would you like to see it?  In the coding conventions?


        Stefan




reply via email to

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