emacs-devel
[Top][All Lists]
Advanced

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

Re: Imports / inclusion of s.el into Emacs


From: Adam Porter
Subject: Re: Imports / inclusion of s.el into Emacs
Date: Tue, 12 May 2020 14:14:29 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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

> However, if people are looking for other constructs to manage
> namespaces, it very much possible to develop shorthand.el so that you
> can have:
>
>    (shorthand-in-namespace FOO :as "f")
>
> For more complicated cases where the library foo.el doesn't have a
> single prefix or renaming rule, we can use more sophisticated forms.
>
> I just provided the buffer-local-variable technique:
>
>    ;; Local Variables:
>    ;; shorthand-shorthands: (("^s-" . "magnar-string-"))
>    ;; End:
>
> because it's practical, understood, and would be self-evident, i.e. work
> without much "magic".

I'm hopeful that this solution, or something like it, will make it into
Emacs!  Thank you for working on this, João.

One minor drawback I see is that the symbol renaming is placed at the
bottom of an Elisp file, while the loading of the library whose symbols
are renamed is (usually) at the top of the file.

Would a macro something like this be feasible, to (require ...) the
library and specify the renamings together?

  (shorthand-require 'magnar-string :with "^s-" :as "magnar-string-")




reply via email to

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