[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cannot find a variable that sets the "abbreviation" of a library nam
From: |
João Távora |
Subject: |
Re: Cannot find a variable that sets the "abbreviation" of a library name/prefix |
Date: |
Sat, 29 Apr 2023 22:46:54 +0100 |
On Sat, Apr 29, 2023 at 3:58 PM Ruijie Yu via Emacs development
discussions. <emacs-devel@gnu.org> wrote:
>
> Hello,
>
> I'm definitely not dreaming, but I saw a variable from a patch somewhere
> the other day, that works like this:
>
> When one sets this variable to an alist of full-name (string) ->
> short-name (string), the file itself defines symbols with short names,
> while the loader pretends they are using the long names. For example,
> lets say the full name is "library", and short name is "lib". Then, you
> can define functions or variables like this:
This would be read-symbol-shorthands. Look in up in the manual and see
the following for a practical example of a library that uses it:
https://github.com/joaotavora/beardbolt/edit/master/beardbolt.el
> And the outside Elisp environment, when loading this file, now pretends
> that the variable `library-foo' and the function `library-bar' are
> defined.
It's actually the other way round. It's `lib-foo` and `lib-bar` that
were never really names of symbols. They were always `library-foo` and
`library-bar` underneath, they're just written in abbreviated shorthand
form.
It's not only when loading the file from the "outside": it's also when
compiling definitions from inside, and looking up ElDoc documentation,
etc.
João