all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Ami Fischman" <ami@fischman.org>
Cc: emacs-devel@gnu.org
Subject: Re: crazy interaction between buffer-locality and function-locality of variables
Date: Sun, 02 Nov 2008 15:05:21 -0500	[thread overview]
Message-ID: <jwvej1tucc3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <9aa0cfde0811020943l24121f8cj78bbf82709036f9d@mail.gmail.com> (Ami Fischman's message of "Sun, 2 Nov 2008 09:43:15 -0800")

> My point was that the only way to avoid mixing the behaviors is to
> make variable names unwieldy.  As an async-event-handler-writer all
> function arguments and local variables must be
> globally-uniquely-named, and as a major-mode writer all buffer-local
> variables must be globally-uniquely-named.

Actually, function arguments (and typical local variables) don't need to
be globally unique: they just need to use a name space that's not used
for buffer-local variables.

In Emacs we get this behavior as follows: buffer-local variables should
use a package prefix.

> The latter is perhaps not too terrible a burden, but the former would
> make coding in elisp unbearable IMO.

Indeed, which is why the convention moves the responsability to the
buffer-local side.

>> > 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?

> At least also at the same place as the warning about the conflict
> between buffer-locals and let-binding in elisp.info that I pointed to
> in my original email.  But also this should be a great big warning in
> the defun docs of the make-variable-*-local and make-local-variable
> since it's the authors using those functions (and friends?  I don't
> have a complete list) that must shoulder the burden of avoiding
> collisions.

Hmm... at the place you mentioned in the elisp.info, we're kind of far
from discussing naming conventions, but I'll try and add a cross-ref.


        Stefan




  reply	other threads:[~2008-11-02 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-02  3:34 crazy interaction between buffer-locality and function-locality of variables Ami Fischman
2008-11-02 16:57 ` Stefan Monnier
2008-11-02 17:43   ` Ami Fischman
2008-11-02 20:05     ` Stefan Monnier [this message]
2008-11-02 20:31       ` crazy interaction between buffer-locality and function-localityof variables Drew Adams
2008-11-02 23:19 ` crazy interaction between buffer-locality and function-locality of variables Richard M. Stallman
2008-11-02 23:59   ` Ami Fischman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvej1tucc3.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=ami@fischman.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.