From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#58950: [PATCH] * lisp/subr.el (buffer-match-p): Optimise performance Date: Sun, 8 Jan 2023 23:48:23 +0200 Message-ID: <268ed8c9-f56e-dc79-8e57-eeaaab98adc1@yandex.ru> References: <875yfyebi0.fsf@posteo.net> <87a6331xts.fsf@posteo.net> <1119f0ff-aacf-b41e-e7f7-b0a00132b35f@yandex.ru> <255D9E93-422C-4A43-9876-751FDB8E61DB@acm.org> <73923B98-E4B8-44F8-9445-2FD05564ADA0@acm.org> <34AFCB0F-5F53-4033-BCDF-1B3001285169@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25497"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: Philip Kaludercic , 58950@debbugs.gnu.org, Stefan Monnier To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 08 22:49:19 2023 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 1pEdXa-0006OU-S0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Jan 2023 22:49:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEdXP-0001vK-Id; Sun, 08 Jan 2023 16:49:07 -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 1pEdXK-0001up-W3 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 16:49:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEdXK-0001Gb-OM for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 16:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEdXK-0001Me-EA for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 16:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2023 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58950 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58950-submit@debbugs.gnu.org id=B58950.16732145145210 (code B ref 58950); Sun, 08 Jan 2023 21:49:02 +0000 Original-Received: (at 58950) by debbugs.gnu.org; 8 Jan 2023 21:48:34 +0000 Original-Received: from localhost ([127.0.0.1]:34837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEdWr-0001Lx-Km for submit@debbugs.gnu.org; Sun, 08 Jan 2023 16:48:34 -0500 Original-Received: from mail-wm1-f47.google.com ([209.85.128.47]:44573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEdWp-0001Lk-K5 for 58950@debbugs.gnu.org; Sun, 08 Jan 2023 16:48:32 -0500 Original-Received: by mail-wm1-f47.google.com with SMTP id g19-20020a05600c4ed300b003d9eb1dbc0aso2270013wmq.3 for <58950@debbugs.gnu.org>; Sun, 08 Jan 2023 13:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=RWl2KwFOaO/ZrAROrChuxxClW+VlU7fKVInf84RPRRE=; b=bjvg0o0fUcEj14vC5ToeCp81tQrPyiBrBjSEpDmQ70UeZKwwzMQg79MZPNNJcXOrXs X0Jp0PsCjkKKHln+XWk9vVyVSBd5UkAJvic+QA8Krdy4kvPhAucc1Y15pAzeTMCij6rU kg/+VVOxGqrh3ZqGIbuLHUsmoPtiIuKU0EgcdpockVhfaDSNc4E8VhzG1w0cwMnRhFpv Cef67JKxupnWot7mqrTtdHL/g0pBiqs5MFXVOaCau5sHyjV7B7NTA60TxJhNLjug6UsS EU4wYMSiuTbPGng6Y2MXU5vZDrWhA2hOogg2V94m17/nzeFnOpUV45vAi+qtcjC5jy0m p6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RWl2KwFOaO/ZrAROrChuxxClW+VlU7fKVInf84RPRRE=; b=kFv1kzZFZU+Dg3Ar9UZg5YMhEBaDmMb3l+jmTpPqJ8/TPwLsTOi+g2kPuFgnKCHdU0 +qZ4sTJ8scxu7C6XPX5w1Ps+oBmhqac0CyKNOojwY6dWtOv01BaQn5h7qp6POGvFcEk+ AzYVWGVsaQF6U+eK7oMPxofXAI7MRTakNuT2h4oaW9nXDP1dRUHEtfavdZK+joJ5uTfp aBJS6+JNqMN4VtHHfRAdQND1/k5MvO4oIlj5DuXaXwMWKba61i/spBh87KOnWnnsANu9 7kWnTa2yg3Ga9WMJQnhAPkh18mZaTCbk7xroC+Wq9sDNE8G/ouc2UBHqJeU372z1saQv plGA== X-Gm-Message-State: AFqh2koF3m/eOKfRdLmvSJieMd62LAKBAzH9N1lLOt97YqWjOjkmeB5/ dPtI2hnzOMmf33dquV6NZO4= X-Google-Smtp-Source: AMrXdXtP8/ZgN0fkgzk2SBon+L1xZ+EIJfepWJor2sqZ9wLECAt1PtTd1GYy7wkXedU2VIFngrRU9A== X-Received: by 2002:a05:600c:4c21:b0:3cf:f18b:327e with SMTP id d33-20020a05600c4c2100b003cff18b327emr45279901wmp.4.1673214505552; Sun, 08 Jan 2023 13:48:25 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f6-20020adffcc6000000b002bbdcd15e44sm3308713wrs.37.2023.01.08.13.48.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Jan 2023 13:48:24 -0800 (PST) Content-Language: en-US In-Reply-To: <34AFCB0F-5F53-4033-BCDF-1B3001285169@acm.org> 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:252962 Archived-At: On 07/01/2023 14:57, Mattias EngdegÄrd wrote: > 6 jan. 2023 kl. 22.41 skrev Dmitry Gutov : > >>> (I wish we had (byte-)compiled elisp functions carrying their own source, either as s-exp, string of formatted source text, or source file reference -- that would allow for sensible editing in Customise without performance penalty. But Santa gave me a wool jumper instead, that's nice too.) >> >> We kind of have that already, if we just made the type for be 'sexp', or a Lisp form. With all the freedom associated with it, just lower performance compared to a compiled function. > > That's short in two respects: performance, and non-retention of formatting and comments. We could store source refs in: > > - a hash table weakly keyed on the code object > - some back corner of byte-code objects > - OClosures That's still seems like an overkill for font-lock-global-modes. And it's hard to draw a line between defcustoms which should have their own mini-languages, and those that do not. Or to look at it the other way -- perhaps the line has been drawn now, since we haven't received any further requests for extending the syntax. > We have a similar problem with regexps, which are only retained and edited in the traditional syntax. > > We are veering off-topic. Sorry about that. > >> I'm on the fence regarding changing it, though, for compatibility and ergonomical reasons (it's easier for the user to avoid typing a dot). > > Is compatibility a serious concern given that buffer-match-p is new in 29? This close to a release, it most likely is. Another compatibility goal (though probably not a hard requirement) is being able to replace project--buffer-check with the standard code, while keeping all existing user customizations in project-kill-buffer-conditions and project-ignore-buffer-conditions. The alternative would be to have a prolonged migration procedure.