emacs-devel
[Top][All Lists]
Advanced

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

Proper namespaces in Elisp


From: João Távora
Subject: Proper namespaces in Elisp
Date: Mon, 4 May 2020 11:52:18 +0100

Around 4 years ago, the "future of Emacs Lisp" came up, and
we discussed namespaces in Elisp. Well the future is now,
sort of.

Here's a sample of that thread:

https://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00145.html

An here's the idea: if the compiler uses the lexical-binding file-local var
when compiling specific files, or functions inside those files, why can't
it use a local-namespaces var when reading symbols?  I think this
very idea was floated at the time, but I can't find it.

It would solve part of the problem people have here, one could
use that variable to shadow/rename symbols locally.  A modern-string.el
library with a long discriminating "modern-string-" prefix could have
its symbols locally accessible by "ms-" or even the "" empty string,
if the the using file's author so desired.

Same for modern-regexp.el library. And whoever likes those
libraries (and maybe I would be one of them), wouldn't be constrained
by this aliasing proposal which is very limitative, since it has to
keep the order of arguments and other parts of the contract.

thing-at-point would also be taught about these local-namespaces
so xref and C-h f stuff would work  well.  Grep wouldn't know about it,
sure, that's true, but that's something that already afflicts other
languages with namespace qualifiers and isn't a terrible thing.
Any other great difficulties you can think ot?

João Távora

PS: There's also this, but it's not based on file-local variables.

https://github.com/ellerh/namespace.el



reply via email to

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