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: Mon, 07 Nov 2022 10:18:25 +0000 Message-ID: <87tu3b9ifi.fsf@gmail.com> References: <87leoqfbrh.fsf@gmail.com> 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="6918"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 07 11:17:47 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 1orzCM-0001gW-D5 for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Nov 2022 11:17:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orzC4-0000gr-JT; Mon, 07 Nov 2022 05:17:28 -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 1orzBw-0000fn-2Q for emacs-devel@gnu.org; Mon, 07 Nov 2022 05:17:22 -0500 Original-Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1orzBr-0007V2-Qo; Mon, 07 Nov 2022 05:17:18 -0500 Original-Received: by mail-wr1-x431.google.com with SMTP id bs21so15434395wrb.4; Mon, 07 Nov 2022 02:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EjEKOyzDA48Rcu0zedaqffWpPx8tbvCpxu5cjFb3raI=; b=a4eGdBRre6MV2vy4uls5BRbF9oz6qylsSemMqNHVxh199VtC+zDCdtzz2dOz27kMxI +jtKQzJpWJx8P5a++Pw6R+LdAIu0e+e3QK0tCEvToO6vtiluMI93SnQnYsIwZ9HunbmZ AMiA133dCffXy3L0loLPZTwxGpn+arvqY4NRWfIfQmRJdNUu25O1MpTtApFs9SeextSG J6mBb0M8U9IlYNz9qQi7CBnqYLYn6AyxhnMXcs+NwHoEEMpv3/GBI/r3TcmdBnEBZMHD DxmsDwmsrgkjS7ln86QeL3k3g70gIOXiVAR8utAcp10TH3yu4l8LXL5RPk6nbPE5Vavo hdCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EjEKOyzDA48Rcu0zedaqffWpPx8tbvCpxu5cjFb3raI=; b=0Zy4oJlP66FmJGF8Dd6m5M/ehZsZXOdHMNG66RJ/PeP49h45XDLJ4uz1/8wwRLP/oc lD2ccKHUaJynj/Mm6mguOrt0V4J2VCH97wgD0JrA0J3l7poyrfMwnXa0mW5EUbKzyOLp IpTC6MoTc/89j46wXxdDIhYlNoyf1+9CfxFuoSaZIpuwAIjqt9X2ZOpUFGAKfBGf5bvW /dQi0hPvRl8QJ7ygckQiUb1bho5XJiZ4AtCO2cOUjzqVsLaw527MQkuB9FogCbgQvfZg eaFPv6eOccUq0gTcA7JLE5kndd86aUuB5ZYCRERDWYs6AWLOj8tERBrKbCwTbyEM6yN4 31vg== X-Gm-Message-State: ACrzQf257GsghqbzJPH3npp1g0AM7XvZBijjmnmzvIQTrsjvW7KbVCBu 3T+8LNjm3xAy0vtKzSNAtLMZDmWkdF4= X-Google-Smtp-Source: AMsMyM6vq+bc7qox7rsLY6cJkZ5XcY116yMKWwVe0CzYGw1nb5GieY9fmRwciLhMNL3dHdTeZEYlaA== X-Received: by 2002:adf:d1c2:0:b0:236:9033:8ead with SMTP id b2-20020adfd1c2000000b0023690338eadmr32089559wrd.653.1667816233527; Mon, 07 Nov 2022 02:17:13 -0800 (PST) Original-Received: from krug (87-196-81-1.net.novis.pt. [87.196.81.1]) by smtp.gmail.com with ESMTPSA id v4-20020a5d4a44000000b002365254ea42sm6961800wrs.1.2022.11.07.02.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 02:17:13 -0800 (PST) In-Reply-To: (Richard Stallman's message of "Mon, 07 Nov 2022 02:44:02 -0500") Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x431.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, 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:299288 Archived-At: Richard Stallman writes: > I've never used ElDoc and I don't know what it does. ElDoc is Emacs's built-in at-point documentation system. It displays the docstring of the symbol under point in the echo are. It is active by default in Elisp files, and nothing has to be done by the user to benefit from it, so you've probably used it unknowingly. If x.el's contents were: (defun x-foo (point) "Conjure xenomorph foos." (interactive "d") (message "42 %s" point)) (provide 'x) ;; x.el ends here ;; Local Variables: ;; read-symbol-shorthands: (("x-" . "xenomorph-")) ;; End: You would see, in the Emacs echo area line, the indication xenomorph-foo: (POINT) every time point is over a reference to the function > Maybe you're right about C-h f, but you have not specified the > scenario fully. What does the user actually type, to invoke it? Type this: C-h f x e n o TAB RET This will most likely lead to a *Help* buffer displaying xenomorph-foo's docstring. But here's a much better example. Even without any clients of x.el the way you invoke the interactive function defined above is M-x xenomorph-foo RET _not_ M-x x-foo And if the function ever signals an error, and you have the debugger activated, then this is what shows up in the Backtrace: Debugger entered--Lisp error: (error "ohno") signal(error ("ohno")) error("ohno") xenomorph-foo(104) funcall-interactively(xenomorph-foo 104) This is all consistent with the fact that the symbol actually interned is always xenomorph-foo, not x-foo or any other context-dependent shorthand to xenomorph-foo. Understanding that a shorthand is just a convened-upon shortcut to a name is key to a full proper name, with given spatial and temporal validity, is key to operating within a namespacing system. Curiously, most people have no problem grasping this concept when operating namespacing systems of non-programming realities: it's well understood that in this conversation the string "Richard" refers to you. "RMS", a shorter string, also refers to you. But if Richard Wagner were to join the conversation, the first string would become ambiguous and we could decide to replace it with something else. We could use the latter "RMS" shorthand for you and "WRW" for the famous composer. But if this were a discussion on electrical engineering, then also the shorthand "RMS" would become ambiguous as it usually means "Root-Mean-Square" in that context. > I think the same grep issue will occur with actual CL packages, or > anything that mimics them. Shorthands are neither better nor worse in > this case. We are absolutely in agreement here. This "breaks grep" characteristic is an innate characteristc of any namespacing system. But it is not impossible to design cross-referencing systems that understand namespaces. There is a good amount of prior art for the CL package system, for example. Jo=C3=A3o