[Top][All Lists]

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

Re: Imports / inclusion of s.el into Emacs

From: João Távora
Subject: Re: Imports / inclusion of s.el into Emacs
Date: Tue, 12 May 2020 22:18:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux)

Adam Porter <address@hidden> writes:

> João Távora <address@hidden> writes:

>> Yes, something like that is reasoanble.  Or we can just have a table of
>> "notable renamings", and then the bare (require 'magnar-string) would
>> come with that.  Or as Richard, suggested, the default renamings could
>> be given in the magnar-string.el file itself.  They could be collected
>> within each byte-compile-file or load-file, then restored.  
> I may be missing something, but it strikes me as almost duplicating the
> original problem, if libraries are allowed to define their own symbol
> abbreviations.

You can say that yes, but you wouldn't be duplicating the problem
because the symbols of the library foobarfaz.el that the library
imperiously wants you to access as with the prefix `f-` are still filed
under the prefix `foobarbaz-`, where now you they are filed under `f-`.

But yes, my suggestion to let the library itself decide opens the door
to some contention.

But if Emacs itself curates a list of notable cases, it's probably not
so bad.

> IOW, it seems almost like solving the problem of libraries'
> "polluting" the global symbol namespace by allowing libraries to
> "pollute" the global symbol *abbreviation* namespace (in the sense
> that one would exist).

Yes, exacly.

So maybe not such a good idea. :-)

>> Another thing that has to implemented is a special syntax to escape the
>> renamings (imagine that you want to use some legitimate "s-foo" function
>> that your renaming has shadowed)
> Would a table of buffer-local symbol aliases work?  Maybe it could even
> work something like:

I was thinking of making say sth like ##s-lines really tell the reader
to intern the symbol "s-lines", even if there's a renaming rule for
"^s-" active.

so (##s-lines) would call the function s-lines and (defface ##s-lines)
would define that face, etc...

Anyway, you raise good points.  I'm not married to any of these
solutions and I hope I made the code simple enough that others can hack
on it and experiment.


reply via email to

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