From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: A short defense of shorthands.el (but CL packages are still better) Date: Tue, 8 Nov 2022 05:18:30 +0000 Message-ID: References: <87leoqfbrh.fsf@gmail.com> <87tu3b9ifi.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000de597d05eceea7b3" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38918"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 08 06:18:19 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osH07-000A0L-0R for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Nov 2022 06:18:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osGzM-0005F3-4O; Tue, 08 Nov 2022 00:17:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osGzK-0005Ep-R2 for emacs-devel@gnu.org; Tue, 08 Nov 2022 00:17:30 -0500 Original-Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1osGzJ-0004L9-35; Tue, 08 Nov 2022 00:17:30 -0500 Original-Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-13bd19c3b68so15133400fac.7; Mon, 07 Nov 2022 21:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B5idMjVbJaFbWhEvPga/5fKDxMKANiQX3RRD6iPs+DE=; b=NZXvuerIN8KT2vWdvUp5vQ9/nDn9MjjVfRqlmJW9nwpCbm5ax7GL1+MfHPmRHUBRy+ UAWmVeafWtjQ8KyDbXg5a9E/eysdQ4s3WLGs3pvCHyBaG57iES0Qsj3SLEOuivew5lQc aaaiDv2qVq3KMwv08HaCL4bdj38dkSXfpBjX2F5QaSSiv6bxPprO/JuCdZxdtvRWp3Xk 2+yH7nAlSJdNwoRjk80F6ZsbTE+VuufPUL967X8HCyICHPuXPBRT8y+PFBsekFjnGX8h TYZ9QWr7VakFl2zZNkzwXJJWatwfF9Py4qQBbrtAgLDJJBMQUukupQ/FF4hZyB98NCN1 BALw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B5idMjVbJaFbWhEvPga/5fKDxMKANiQX3RRD6iPs+DE=; b=UNgO0+KTfcnYjiC15kKsBWc9W4xyuQue+1PUTVzaVr38p7scKy3yaqKpiuTIbhF+tN tV7sav6yvKuyArI4gceedl1g9qJ/Tl5eypwsCiDUphnk76peUuOF5aA3EbsSjzVhTWqa cgfUMtQJU9jeJ/Wo8K840vFgzcpeKrqxofdzAkDNBcEw535G0oaqvAuAujSlIS2RMdd6 2cEYAbkQZuwd1M22kvHIeEyoUHGU0phvBdBhAFO0nhIm4mtBXpV0DtVmx3juY46F4kAy g5Id5wDavSQqF6LLiMy6oO4MEwyyhlqmqwXfDOZSuJgjPs1AE6vtvMLgAcT6nBK7rsKj qIYg== X-Gm-Message-State: ACrzQf2BYfDreYBZbVISAyVcpkJTY7eBUUcAWgOPHu3y9wlhzJjdBZLM hi/If9RnQTt67TBgcEAZVveHNfVpadnYBwyqtPgoR/sARHc= X-Google-Smtp-Source: AMsMyM6PR4LVO3pVelcFZoWkeI7g9G4njkRgdCWPQvgRHQj2l2KVuaD5LcnevsSpeZEUjyRttD2ulq3o09H5jaXHDG0= X-Received: by 2002:a05:6870:e242:b0:13b:d561:ad02 with SMTP id d2-20020a056870e24200b0013bd561ad02mr32508183oac.215.1667884646290; Mon, 07 Nov 2022 21:17:26 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2001:4860:4864:20::2f; envelope-from=joaotavora@gmail.com; helo=mail-oa1-x2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299313 Archived-At: --000000000000de597d05eceea7b3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Nov 8, 2022 at 5:02 AM Richard Stallman wrote: > Is that behavior bar? What behavior would we prefer ElDoc to > implememt for such cases? Would we want it to show `x-foo' instead of > `xenomorph-foo' in the echo area?, I wouldn't. It would be misleading. The shorthand x-foo is only available locally. > That seems correct to me. `xenomorph-foo' is a defined function; why > shouldn't C-h f know about it? Yes it is the correct behaviour, and that's why I implemented it like so. > > way you invoke the interactive function defined above is > > M-x xenomorph-foo RET > > _not_ > > M-x x-foo > That too seems correct to me. Same here. > > xenomorph-foo(104) > > funcall-interactively(xenomorph-foo 104) > I think that is correct, too. It might be confusing > if you are looking at the source of x.el and you don't > notice it uses a shorthand. Nonetheless, it is correct. Right again. My point with these examples was simply to illustrate that a tool like grep looking for text strings in files "x-foo" isn't guaranteed to serve us in the presence of a namespacing system. Here, any grep for one of "xenomorph-foo", "x-foo" or "xeno-foo" will come up short in some way, even though these are all ways to reference the same symbol in some specific context. My point was also that we shouldn't try to force or limit our uses of said namespacing system to try and accommodate grep. So while the "breaks grep" objection does hold some water, it's because grep is "broken" extremely easily. But if a tool other than grep were to understand the locally defined shorthands for every file it visits, then it could very well be useful. I described such a tool some emails ago. Jo=C3=A3o --000000000000de597d05eceea7b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Nov 8, 2022 at 5:02 AM Richard Stallman <rms@gnu.org> wrote:

> Is that beh= avior bar?=C2=A0 What behavior would we prefer ElDoc to
> implememt f= or such cases?=C2=A0 Would we want it to show `x-foo' instead of
> `xenomorph-foo' in the echo area?,

I wo= uldn't.=C2=A0 It would be misleading.=C2=A0 The shorthand x-foo is only= available
locally.

> That seems correct to = me. =C2=A0`xenomorph-foo' is a defined function; why
> shoul= dn't C-h f know about it?

Yes it is the correc= t behaviour,=C2=A0 and that's why I implemented it like so.
> =C2=A0 > way you invoke the interactive function defined above is=
> =C2=A0 > =C2=A0 =C2=A0M-x xenomorph-foo RET
> =C2=A0 >= _not_
> =C2=A0 > =C2=A0 =C2=A0M-x x-foo
> That too see= ms correct to me.

Same here.

> =C2= =A0 > =C2=A0 =C2=A0 =C2=A0xenomorph-foo(104)
> =C2=A0 > =C2=A0 = =C2=A0 =C2=A0funcall-interactively(xenomorph-foo 104)
> I think that = is correct, too.=C2=A0 It might be confusing
> if you are looking at = the source of x.el and you don't
> notice it uses a shorthan= d.=C2=A0 Nonetheless, it is correct.

Right again.<= /div>

My point with these examples was simply to illustr= ate that a tool
like grep looking for text strings in files "= ;x-foo" isn't guaranteed
to serve us in the presenc= e of a namespacing system.=C2=A0 Here, any
grep for one of &= quot;xenomorph-foo", "x-foo" or "xeno-foo" will co= me up
short in some way, even though these are all ways to r= eference the
same symbol in some specific context.
=

My point was also that we shouldn't try to force or= limit our uses of
said namespacing system to try and accomm= odate grep. So while
the "breaks grep" objection does h= old some water, it's because grep
is "broken" = extremely easily.

But if a tool other than gre= p were to understand the locally defined
shorthands for every fil= e it visits, then it could very well be useful.=C2=A0
I desc= ribed such a tool some emails ago.

Jo=C3=A3o
--000000000000de597d05eceea7b3--