unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: "Philip K." <philipk@posteo.net>, Eli Zaretskii <eliz@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Proposal: Forwards-Compatibility Library for Emacs
Date: Tue, 21 Sep 2021 14:49:08 +0100	[thread overview]
Message-ID: <87ilyuqbsb.fsf@gmail.com> (raw)
In-Reply-To: <CADwFkmkw8D3MdZKkX8vMbpdpN7VahPMZA_a30=UYiWt5FQxbuw@mail.gmail.com> (Stefan Kangas's message of "Tue, 21 Sep 2021 14:50:45 +0200")

Stefan Kangas <stefan@marxist.se> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> Can symbol-renaming help here, perhaps?  I believe João is trying to
>> get it ready in time for Emacs 28.
>
> This sounds potentially exciting, especially with the two recent
> posts, one from Richard and one from Eli, mentioning this work.  The
> last post on emacs-devel that I can find about "symbol renaming"
> before that is from May 2020, and AFAICT it was buried in a
> sub-thread.

Yes, it was discussed in a subthread about namespacing.  I think I
outlined the main approach there, and pointed to some code once or
twice.  I had originally an Elisp-only version, but then crafted a C
version.

Symbol renaming, also known as "shorthands", is a namespacing system for
Elisp.  Like all namespacing systems, it's about referring to the same
thing by different terms.  Much like in this thread, if I write "Eli"
it's obvious who I'm referring to: I don't have to write the full "Eli
Zaretskii".  But if I write "Stefan", there is ambiguity.

Elisp shorthands were designed to disturb Elisp's existing practice of
one global obarray as little as possible, and so their implementation is
fairly short, and they work at the reader level.  As always, only one
obarray exists, and symbols are always "interned" there under their full
names.  However, the developer may setup certain shorthands so that she
can write i.e. "s-concat" in her file, while still having the symbol
interned as the proper, more hygienic, and much harder to type
"the-magnificent-string-library-concat".  This can be customized
per-file using a file-local variable not unlike lexical-binding.  There
is no difference in what kind of Elisp entity (function, variable, plain
symbol) the symbols refer to: Elisp shorthands are agnostic to that.  

I'm currently working on the documentation, which I hope to be able to
clear the most obvious/burning questions.  I ask you to hold them off
for some days to give me time to clear things up there (yes,
xref-find-definitions and eldoc are working :-) )

> Perhaps this would be a good time for a new post that explains the
> current status of this, with a quick re-cap and perhaps even some
> code?  (If there exists a branch, I can't find it.)

If you're very curious, you can find some code (and tests) in the branch
scratch/shorthand-namespacing, but that _isn't_ the latest version.
(though it _should_ be working).  Indeed I thought I had published the
most recent version to our Git repo, but it seems I haven't (which means
I must get back to my other machine as push it asap).

João








  parent reply	other threads:[~2021-09-21 13:49 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 23:35 Proposal: Forwards-Compatibility Library for Emacs Philip Kaludercic
2021-09-21  0:30 ` Adam Porter
2021-09-21  4:10 ` Lars Ingebrigtsen
2021-09-21  8:28   ` Philip Kaludercic
2021-09-21 12:31 ` Stefan Monnier
2021-09-21 12:40   ` Eli Zaretskii
2021-09-21 12:50     ` Stefan Kangas
2021-09-21 13:38       ` Arthur Miller
2021-09-21 13:49       ` João Távora [this message]
2021-09-21 13:00     ` Philip Kaludercic
2021-09-21 13:12       ` Eli Zaretskii
2021-09-21 13:28         ` Philip Kaludercic
2021-09-21 13:24     ` João Távora
2021-09-21 13:29       ` Philip Kaludercic
2021-09-21 13:50         ` João Távora
2021-09-21 14:59     ` Lars Ingebrigtsen
2021-09-21 12:58   ` Philip Kaludercic
2021-09-21 13:37     ` Arthur Miller
2021-09-21 13:54       ` Philip Kaludercic
2021-09-21 14:18         ` Arthur Miller
2021-09-21 15:02   ` Lars Ingebrigtsen
2021-09-21 15:40     ` João Távora
2021-09-21 16:10       ` Philip Kaludercic
2021-09-21 16:22         ` João Távora
2021-09-21 17:22       ` Lars Ingebrigtsen
2021-09-21 17:29         ` João Távora
2021-09-21 19:24     ` Stefan Monnier
2021-09-21 21:06       ` Philip Kaludercic
2021-09-21 21:50         ` Stefan Monnier
2021-09-22  6:48           ` Philip Kaludercic
2021-09-22 17:53             ` Stefan Monnier
2021-09-22 18:54               ` Philip Kaludercic
2021-09-22 19:15                 ` Stefan Monnier
2021-09-21 21:57       ` Lars Ingebrigtsen
2021-09-21 22:08         ` João Távora
2021-09-21 22:16           ` Lars Ingebrigtsen
2021-09-21 22:24             ` João Távora
2021-09-21 22:25               ` Lars Ingebrigtsen
2021-09-21 22:34                 ` João Távora
2021-09-22  6:53           ` Philip Kaludercic
2021-09-22  7:12             ` João Távora
2021-09-22  7:14         ` Arthur Miller
2021-09-21 13:05 ` Philip Kaludercic
2021-09-21 13:27 ` Arthur Miller
2021-09-21 13:45   ` Philip Kaludercic
2021-09-21 14:05     ` Arthur Miller
2021-09-21 22:17 ` Richard Stallman
2021-09-21 22:24   ` Lars Ingebrigtsen
2021-09-22  9:54     ` Philip Kaludercic
2021-10-04 23:00 ` [ELPA] Add compat.el Philip Kaludercic
2021-10-07  7:03   ` Old (static) builds of Emacs Philip Kaludercic
2021-10-07  7:48     ` Michael Albinus
2021-10-07  7:56       ` Philip Kaludercic
2021-10-07 12:49     ` Stefan Monnier
2021-10-07 20:29       ` Philip Kaludercic
2021-10-07 21:21         ` Stefan Monnier
2021-11-30 21:21     ` Philip Kaludercic
2021-12-01 13:15       ` Stefan Monnier
2021-10-07 20:49   ` [ELPA] Add compat.el Philip Kaludercic
2021-10-08  5:56     ` Eli Zaretskii
2021-10-08  9:59       ` Philip Kaludercic
2021-10-08 11:10         ` Eli Zaretskii
2021-10-08 11:35           ` Philip Kaludercic
2021-10-08  7:45     ` Mattias Engdegård
2021-10-08 10:00       ` Philip Kaludercic
2021-10-15 19:08   ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilyuqbsb.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).