From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#45333: complex command history should not save optional nil parameters Date: Thu, 07 Jul 2022 09:29:22 +0200 Message-ID: <87v8s9idnx.fsf@gnus.org> References: <0DJzRuBn1S9jW_MoJt5HXcLQWrzb7Vjkfmlwa9zPvgLIFeEfdPLoiguSztbL4TnuHyxd59Z7BpS9qJo5BinMO3n1mDlWjcytLjq9HmoGIl0=@protonmail.com> <8735ggk7nz.fsf@gnus.org> <83ee007gxo.fsf@gnu.org> <87o7z3bcsp.fsf@gnus.org> <875ykbabl1.fsf@web.de> <87o7y31pho.fsf@gnus.org> <87wncrs8js.fsf@web.de> <87sfnfmm41.fsf@gnus.org> <87k08rs7jg.fsf@web.de> <87bku3ml4x.fsf@gnus.org> <87fsjfs5v2.fsf@web.de> <871quzmj9a.fsf@gnus.org> <87o7y3l1xm.fsf@gnus.org> 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="11591"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Michael Heerdegen , laszlomail@protonmail.com, Eli Zaretskii , 45333@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 07 09:30:54 2022 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 1o9LyQ-0002mf-98 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 09:30:54 +0200 Original-Received: from localhost ([::1]:39430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9LyM-0004zc-0N for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 03:30:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9Lxa-0004wu-Va for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 03:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9Lxa-0001P2-LI for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 03:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9Lxa-00086u-E2 for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 03:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2022 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45333 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 45333-submit@debbugs.gnu.org id=B45333.165717899231134 (code B ref 45333); Thu, 07 Jul 2022 07:30:02 +0000 Original-Received: (at 45333) by debbugs.gnu.org; 7 Jul 2022 07:29:52 +0000 Original-Received: from localhost ([127.0.0.1]:55597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9LxP-000865-7E for submit@debbugs.gnu.org; Thu, 07 Jul 2022 03:29:52 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:35930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9LxA-00085Z-50 for 45333@debbugs.gnu.org; Thu, 07 Jul 2022 03:29:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=52jG02m4cCmtqo/Uh2ZyYAT8tWyz6/mtFQlEopbAa2U=; b=DcRIf/UL78Qmh1aG3nqk/9cEBw aGVDvUFZ8xMw3n6urY6rNSxnmUl1Vod7bXzqdBAnAygTMj29sBYc063PVLBYx0hOKtFtjQKTmOnYz eN0gZ6Trar942UJ1eSyAUrFa5XW8lCdb5NxS1hp/1vEnT3jNHPc5G8wp4GWWavp8J2cM=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9Lwx-0005bq-PG; Thu, 07 Jul 2022 09:29:27 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 06 Jul 2022 14:41:19 -0400") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAG1BMVEX69tjPyqDe28X+ /eZ+QSv74hzZrB7by07///9TK0gMAAAAAWJLR0QIht6VegAAAAd0SU1FB+YHBwY6A5sTRecAAAGv SURBVDjLdZTLTgMxDEU9CRLbcRpgO0kL63TCB9QoYk2R2v4AnXWLBPw+TjKP9HUXo9bH13acaQGU hSznwUsHElqAGEOU3gNHFFbKImITH4oTwDMAEKRfiZAoLMIdVcDpLNeDlViFcLfQxCW9zI72LWik dsWuKiTA+S42F40VAipEWxtjC5D1GnRNC1qCPwNLBjqVctyhABUDpdHHUlACcNIgGgWOz1LGeYYF aYPQIsZDjpLCRkcElFYygBYECKPmUOkwK2stCVHzsgAD1X7MV8YQ6h681bwqX/ZvlW24lJlJJ3sg YcmNWXUct+hgrNGaMGiKS5tL79gUJxO2scZaZW3aZgPnEgDPm6v6hIfxc8e6Brouk4w/p1IZ7LcZ J8dPjG+7Sft9duwmQ6/tZj2AXdd9hfA+WhLY7P5ipcDqEucmuVQNT78jCBP4diB68B4N/MzgwDu4 CuYMHgfQnQL5UvYYwCw7vsqpPlIPB26Xcsej9+NKf3968mGJR/w53dXldvebSzBc1MV9xFB5tTfv /AZYx9cH8fh3rkP6DV6R6/8ALnXL4W+XKr7wuz0Z/gELNfD8YtB30QAAACV0RVh0ZGF0ZTpjcmVh dGUAMjAyMi0wNy0wN1QwNjo1ODowMiswMDowMMDx/g4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjIt MDctMDdUMDY6NTg6MDIrMDA6MDCxrEayAAAAAElFTkSuQmCC X-Now-Playing: Steve Reich's _New Sounds in Electronic Music_: "Come Out" 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" Xref: news.gmane.io gmane.emacs.bugs:236321 Archived-At: Stefan Monnier writes: > I can't think of any reason we'd ever want to use that function anywhere > near performance critical code, so I'd rather keep it in ELisp if > possible. I think it'd be nice to have eldoc generate less garbage, though. > OClosure or not doesn't make much of a difference here, I think (the > previous version of the code would also be quite hideous in C). > Why not just call `advice--cd*r`? Sure, that's possible, but just seems a bit backwards. Anyway, looking at the functionality in this area, things just seem a bit messy overall, and I wonder whether there's any scope here for making things better. For instance, this code: (help-function-arglist 'car t) =3D> (list) What it does is call `documentation', find the "(fn LIST)" at the end, do a `downcase' and `read-from-string' which seems to suggest that upcasing the arguments in the first place before putting them into etc/DOC was the wrong thing to do. Not only do we lose the capitalisation -- if the argument was really `List', that's lost. (Perhaps fortunately, some might say -- we don't really use case much in symbols in Emacs Lisp.) Moreover, looking at the code in make-docfile, it seems to be upcasing wrong, so if the argument had been `l=C3=AFst', we'd put (fn L=C3=AFST) into etc/DOC. (And again, it doesn't really matter that much, because we don't really use anything but ASCII.) And even more moreover, if the doc string had (fn [FOO]), `help-function-arglist' would just ignore that and return (arg1), but if it has (fn foo bar zot), it'll return (foo bar zot). (Some of the same issues are with doc strings/arg lists in .elc files.) So two issues: 1) If we have an advertised calling convention, the original arg list can't be recoved. 2) We can't recover the original case of the arguments at all. (Except for lambda/closure forms.) For 2), I think we could stop upcasing arguments and adjust callers -- but old .elc files would still have upcased arguments until recompiled. For 1), we could also stash the actual arglist in addition to the advertised calling convention into .elc/DOC (i.e., two (fn ...) forms, for instance). We could then have (function-arglist FUNC &optional ADVERTISED) that would return either form. (And there's also `advertised-signature-table', which perhaps we could then get rid of?) Of course, I don't really know whether it's worth doing anything about any of this -- but it just seems a bit messy at the moment, and not very satisfactory. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no