From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#67455: (Record source position, etc., in doc strings, and use this in *Help* and backtraces.) Date: Wed, 27 Mar 2024 22:00:09 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6736"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , 67455@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 27 23:01:26 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rpbKo-0001au-BV for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Mar 2024 23:01:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpbKW-0005WA-Eq; Wed, 27 Mar 2024 18:01:08 -0400 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 1rpbKR-0005Vs-NC for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 18:01:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpbKR-0003EN-F3 for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 18:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpbKR-0000YH-Na for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 18:01:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Mar 2024 22:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67455 X-GNU-PR-Package: emacs Original-Received: via spool by 67455-submit@debbugs.gnu.org id=B67455.17115768221923 (code B ref 67455); Wed, 27 Mar 2024 22:01:03 +0000 Original-Received: (at 67455) by debbugs.gnu.org; 27 Mar 2024 22:00:22 +0000 Original-Received: from localhost ([127.0.0.1]:38482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpbJl-0000Ul-1a for submit@debbugs.gnu.org; Wed, 27 Mar 2024 18:00:22 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:54072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpbJf-0000SJ-Rs for 67455@debbugs.gnu.org; Wed, 27 Mar 2024 18:00:19 -0400 Original-Received: (qmail 62400 invoked by uid 3782); 27 Mar 2024 23:00:09 +0100 Original-Received: from acm.muc.de (pd953a0c3.dip0.t-ipconnect.de [217.83.160.195]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 27 Mar 2024 23:00:09 +0100 Original-Received: (qmail 9444 invoked by uid 1000); 27 Mar 2024 22:00:09 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282163 Archived-At: Hello, Stefan. On Wed, Mar 27, 2024 at 08:23:52 -0400, Stefan Monnier wrote: > >> > r-p-defined-s positions only lambdas and NAMEs defined by defun, > >> > defmacro, defvar, .... (around 50 defining symbols). r-p-s positions > >> > every symbol apart from nil. They have different purposes. r-p-d-s > >> > gets info for the doc strings, which requires SWPs only for some > >> > symbols. r-p-s is needed to get warning message locations. Were r-p-s > >> > used for the doc string position information, most of the symbols would > >> > need to be stripped of their positions before the form could be used. > >> > It is simpler and faster not to position them at all. > >> In terms of code, I can't see why it'd be simpler: we already have the > >> r-p-s function, .... > > We also already have r-p-d-s. > You're playing on words here: we don't "already have" `r-p-d-s` on master. I'm not playing on words. My point is that read-positioning-defined-symbols exists and works. It is not a speculative "would be nice to have". The work has already been done. > > Both functions (together with plain read) have read0 as their core > > engine. The enhancement to read0 to support r-p-d-s was only moderate > > in size and not complicated to anybody who understands finite > > state machines. > Just because it's not a complex change doesn't mean it's "simpler" than > no change at all. No change isn't an option, here. Something has to determine which symbols are to be positioned / stripped of their positions. Currently, this is done economically in r-p-d-s. > >> .... and we already have a function to strip that info when we don't > >> need it any more, so it would be less new code to write if we just > >> used r-p-s, I think. > > I think you're envisaging an extensive redesign where SWPs would not be > > tightly and individually controlled as they are at the moment, but > > instead would be created en masse and stripped en masse a bit later. > Yes, that's the starting design I had in mind (and that I described > a few emails back). it's also what we do in the byte-compilation case, ... It's not. In each case, the optimum number of symbols gets positioned. Positioning "everything" is sub-optimal for everything bar byte compilation. > so it's code we already have and use. See above. > The "en masse" doesn't make it complex. It changes the design extensively, thus introducing new complications. Why do you think this design change will be better than the existing design? > Stefan -- Alan Mackenzie (Nuremberg, Germany).