[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shorthands have landed on master
From: |
Philip Kaludercic |
Subject: |
Re: Shorthands have landed on master |
Date: |
Tue, 28 Sep 2021 07:15:18 +0000 |
João Távora <joaotavora@gmail.com> writes:
> On Mon, Sep 27, 2021 at 11:40 PM Philip Kaludercic <philipk@posteo.net> wrote:
>>
>> João Távora <joaotavora@gmail.com> writes:
>>
>> > Hello all.
>> >
>> > Anyway, as you may have noticed, "Shorthands" have landed on master.
>> > Please check out the NEWS entry and the manual section on "Shorthands".
>> >
>> > For the impatient, I leave with with a tiny animated gif.
>>
>> From what I see, elisp-shorthands only allows a shorter prefix to be
>> mapped to a longer prefix, right? So this doesn't allow me to use cl-lib
>> without the cl- prefix,
>
> You need to have _some_ prefix. It cannot be of 0 length. Best
> you can do is '-loop' and '-destructuring-bind', for example.
>
> In fact, I lie. You _can_ map 'loop' to 'cl-loop' explicitly.
> 'loop' is the shorthand. 'cl-loop' is still the symbol.
> But you have to do it symbol by symbol.
>
> That's because I've purposely turned off "freer" renamings in
> favor of prefixes, simplicity and read speed. But they are
> not impossible.
I see. Do you think it would make sense to use predefined shorthand
groups, in case someone *would* want to use cl-lib without the prefix?
>> or remove the compat-- prefix from compatibility
>> functions?
>
> It's too late in the day for me to understand what you mean by
> "remove" here :-) You must first understand what shorthands are:
> they are merely file-local aliases to symbols which keep their
> full names.
This was in reference to the compat.el discussion from a few days
ago. It was mentioned that shorthands might provide an alternative to
aliasing function definitions. But this doesn't make much sense, if a
prefix has to be used, short or long: I want to call
(macroexp-file-name), not (co-macroexp-file-name), (~macroexp-file-name)
or (compat--macroexp-file-name) to provide transparent compatibility.
> Does this help in answering your question?
After trying out
;; elisp-shorthands: (("" . "cl-"))
I saw what went wrong and I understand why. On that topic, I think the
behaviour was inadequate, because a lot of unrelated commands also
broke that might become annoying.
> If it doesn't, provide a toy example with files and code in it,
> and illustrate clearly what you would like to be able to write,
> but can't (right now) Then maybe I can say if shorthands can
> help you.
>
> João
>
>
--
Philip Kaludercic
- Better way to require with shorthands/renamed symbols, Stefan Kangas, 2021/09/27
- Re: Better way to require with shorthands/renamed symbols, Dmitry Gutov, 2021/09/27
- Shorthands have landed on master (Was: Better way to require with shorthands/renamed symbols), João Távora, 2021/09/27
- Re: Shorthands have landed on master (Was: Better way to require with shorthands/renamed symbols), Dmitry Gutov, 2021/09/27
- Re: Shorthands have landed on master, Philip Kaludercic, 2021/09/27
- Re: Shorthands have landed on master, João Távora, 2021/09/27
- Re: Shorthands have landed on master,
Philip Kaludercic <=
- Re: Shorthands have landed on master, João Távora, 2021/09/28
- Re: Shorthands have landed on master, Eli Zaretskii, 2021/09/28
- Re: Shorthands have landed on master, João Távora, 2021/09/28
- Re: Shorthands have landed on master, Philip Kaludercic, 2021/09/28
- Re: Shorthands have landed on master (Was: Better way to require with shorthands/renamed symbols), Richard Stallman, 2021/09/28
Re: Better way to require with shorthands/renamed symbols, João Távora, 2021/09/27