From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Shorthands have landed on master Date: Tue, 28 Sep 2021 07:15:18 +0000 Message-ID: <871r596uih.fsf@posteo.net> References: <20210927003203.15806.29864@vcs0.savannah.gnu.org> <20210927003205.EF26620A5E@vcs0.savannah.gnu.org> <87y27iqiun.fsf_-_@gmail.com> <87wnn1wsla.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32099"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Adam Porter , Dmitry Gutov , Stefan Kangas , emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 28 09:17:07 2021 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 1mV7MR-00087X-0X for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 09:17:07 +0200 Original-Received: from localhost ([::1]:60834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mV7MP-0005sn-64 for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 03:17:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mV7Kn-0004Rv-Qj for emacs-devel@gnu.org; Tue, 28 Sep 2021 03:15:25 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:46909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mV7Kl-0006ka-Be for emacs-devel@gnu.org; Tue, 28 Sep 2021 03:15:25 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id E7B30240026 for ; Tue, 28 Sep 2021 09:15:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1632813320; bh=eh7+86Pq2OymxTfurJc3UK82pNDITYmZ54yetAR/jB0=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=XprFg0CJMhVkuktE+nHHCq0fqYvo0URYsnuW98rdSa62ulMJfsrjU/1esI55pTh2o rSY7oqoyKYdefvvMtCuSNPc+EphmM0RYN0n6K0vFrzIi5Q1/9XHd37bX7e55ZBVzXy 02OLusPLdSZc/fNCMnaUAA9n4KioJnLO2RriaahO5vE47Ct8U6XT2Wd8kHGyBjKBN7 +Vx78BUTN6vs7DLLozZty6x2CwQ/KhXAQesLgXuahpGyfn7f8wsAzwmmc7YGSzFPDC WP88M5ACmdUuT+sD52c+mnh5ZjSRl0LmKsvOXZXeKCHYXOE74Aq2O9Dv5CkWTDqOdm U223hoZAiUvzw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HJW476Ft0z9rxB; Tue, 28 Sep 2021 09:15:19 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Mon, 27 Sep 2021 23:58:39 +0100") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:275660 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Mon, Sep 27, 2021 at 11:40 PM Philip Kaludercic w= rote: >> >> Jo=C3=A3o T=C3=A1vora 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=C3=A3o > > --=20 Philip Kaludercic