From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master) Date: Tue, 28 Sep 2021 08:40:05 -0400 Message-ID: References: <16338bdc2497fc51c6fb6d54ab370bfb@webmail.orcon.net.nz> <831r59kyhf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38831"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Phil Sainty , joaotavora@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 28 14:43:40 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 1mVCSS-0009qu-Dg for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 14:43:40 +0200 Original-Received: from localhost ([::1]:57554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVCSQ-0002dE-DH for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Sep 2021 08:43:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVCQg-0001V7-Cb for emacs-devel@gnu.org; Tue, 28 Sep 2021 08:41:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVCP4-0004xs-FI; Tue, 28 Sep 2021 08:41:49 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3D4D5441607; Tue, 28 Sep 2021 08:40:08 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9679D44086A; Tue, 28 Sep 2021 08:40:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1632832806; bh=ZUc9Hw4H8HzGtPabT30otb/xhq9QDS/lBbKWdr2oOJ8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=XKKz7z1FuepKQwQ5Pszlt0aDRG3WcabFUYOL+Ny4Kw4Cg5C0HOapGxY3ETd2BE67F NVarOxDaOoK2AN/a+aasjNJpGaEJhJvgT1RCS6WPI+qZNbJrYVeEzFXEx1jzFerZzv juPqNoxrohqXORMpMi8coOy25SnMdLVaGSIDvb6Mahu5gUxaDutCv+iKHA7Lbgv2N/ hrQN+h+m6HwZHrGbl/O8C+t3u0yszgbV8vquYHetkCH3tc2DR124ZMagV5NYoiQGCr XziGwQs1b4BsgPdUtbd+qnE7ih5AkNs/76FoEGBS0gQvCh6woqA5VTICVCMzyEDQev ogmAMnxuGxVlw== Original-Received: from milanesa (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3E1DF12018D; Tue, 28 Sep 2021 08:40:06 -0400 (EDT) In-Reply-To: <831r59kyhf.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Sep 2021 09:25:48 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:275685 Archived-At: > emacs -Q > M-x load-file RET lisp/profiler.el RET > C-x C-f lisp/profiler.el RET > C-u 10006 M-g c ;; this puts point on a call to profiler-make-calltree > M-. > > The result is an error message. This is a "loading order" bug: if you somehow load `cl-extra` (which tends to happen more often than I expected, so the bug "disappeared" when I tried to dig into it) you won't get the error any more. IOW the fix is this chunk of code in `cl-extra.el`: (with-eval-after-load 'find-func (defvar find-function-regexp-alist) (add-to-list 'find-function-regexp-alist '(define-type . cl--typedef-regexp))) we should probably move it to something like `cl-preloaded.el`. > This happens to me quite a lot recently, The above is a plain bug. > as more and more code is converted to using cl-defstruct. In the above example, the problem is fairly minor (I mean, after fixing the bug), but it gets worse in two cases: - when the `cl-defstruct` has several longish constructors: `M-.` jumps to the `cl-defstruct` but not to the actual place where `profiler-make-calltree` is defined within the `cl-defstruct`. - when jumping to an accessor (rather than a constructor) because the accessor's name is not present literally in the `cl-defstruct` so you jumped from `foo-bar` and you end up on a `cl-defstruct` for `foo` and need to know that the `bar` symbol you might find a few lines below is the one that caused the definition of `foo-bar`. It shouldn't be very hard [IOW, I encourage some of the readers here to go out and do it] to refine/extend the `find-function-regexp-alist` mechanism so that `M-.` jumps directly to the actual `:constructor` thingy or to the actual field corresponding to an accessor. > Then I guess you dislike cl-defstruct, add-function, pcase, and other > macros and features that change how the source code looks and produce > symbols under the hood? Neither `pcase` nor `add-function` generate symbols under the hood (other than gensym'd ones, admittedly, but these aren't relevant in this discussion). `cl-defstruct` does, tho only for field accessors and not for the constructor you showed in your example. >> Long names being "tedious" (quoting the new info manual) to read >> and write seems like an insufficient reason, IMHO. As a researcher in programming languages, I tend to take it for granted that "syntax doesn't matter", but in reality details of syntax have enormous impacts on how languages are used and perceived, so I really wouldn't dismiss "tedious" as an insufficient reason. Stefan