From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running Date: Wed, 02 Nov 2022 09:06:20 +0000 Message-ID: <87v8nxafoz.fsf@posteo.net> References: <87sfj8umwb.fsf@posteo.net> <837d0hhlke.fsf@gnu.org> <46ff0065-5645-ef1e-2621-242fb6a73f98@yandex.ru> <87v8o0uxn5.fsf@gmail.com> <787a4362-7ff5-7dbb-9118-16e4bee5f328@yandex.ru> <87edunvhf2.fsf@gmail.com> <6d4d9e72-1bae-4d64-b7c1-c2b9c11e396f@yandex.ru> <87tu3jgdbv.fsf@posteo.net> <87h6zihq3q.fsf@posteo.net> <877d0ehlnb.fsf@posteo.net> <87edumg4fd.fsf@posteo.net> <874jvig2rp.fsf@posteo.net> <87edulu8ly.fsf@gmail.com> <87wn8dbyq1.fsf@posteo.net> <871qqlu79b.fsf@gmail.com> <877d0dbwbu.fsf@posteo.net> <87r0ylsq7o.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="5373"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 58839@debbugs.gnu.org, Dmitry Gutov To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 02 10:07:35 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 1oq9ig-00013Y-F3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Nov 2022 10:07:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oq9iD-0000ON-Fc; Wed, 02 Nov 2022 05:07:05 -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 1oq9iB-0000OF-A4 for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 05:07:03 -0400 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 1oq9iB-0006n5-2l for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 05:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oq9iA-0003UI-Fb for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 05:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2022 09:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58839 X-GNU-PR-Package: emacs Original-Received: via spool by 58839-submit@debbugs.gnu.org id=B58839.166737999713373 (code B ref 58839); Wed, 02 Nov 2022 09:07:02 +0000 Original-Received: (at 58839) by debbugs.gnu.org; 2 Nov 2022 09:06:37 +0000 Original-Received: from localhost ([127.0.0.1]:44915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oq9hl-0003Td-4h for submit@debbugs.gnu.org; Wed, 02 Nov 2022 05:06:37 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:57853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oq9hi-0003TP-BP for 58839@debbugs.gnu.org; Wed, 02 Nov 2022 05:06:35 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AA20B240107 for <58839@debbugs.gnu.org>; Wed, 2 Nov 2022 10:06:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667379988; bh=D/MMZN0u3wA0q1CiPMdlRRfIgDygp0wIW5mRrLBnn9s=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=UJeZGbz/TQBvwU57snwHdZ8Z8rGh57ej5N8LNVPxsmzc6AGY66Fn7W/q77gjxh1Pr V98sOnsRa3ctKtELKeH16RhwFtqlrxD6IGtZTpY5TzzXxkPHgFCDC5+qzZHTMyHfTw Lql1t1emhUUqKOYrLTJcoaNYphuU9iWV5tGRfFx6dn2EniCHfZ2I6Rf4dN94L9jwGM do1oatojzOFCq74am3LWQyezs5abuNlkEs/rJspWvOO7tvFq3ZWFb1IvTfOTdCzkEl Zut6DsLUT2Pb0YqutLxTsPiO6kaqfdLZcJw2qYe8mlOj+WvJ3mbTmWg0JS4g2jTnIT xfzhG6CBX9RBg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N2Lbk4D3Cz6tm6; Wed, 2 Nov 2022 10:06:25 +0100 (CET) In-Reply-To: <87r0ylsq7o.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Wed, 02 Nov 2022 08:41:47 +0000") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246853 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Philip Kaludercic writes: > >>> I couldn't figure out where this argument arise or who should provides >>> it (the condition?). It wasn't clear. At any rate, if you understand >>> this you can probably re-add it and I'm sure it won't make any >>> difference to the time. >> >> See `display-buffer-assq-regexp' in window.el. > > Sorry, I'm not following. Anyway, as I said, this seems to be a detail: > feel free to add back arg wherever it is needed. I just meant to give an example where and how the argument is used. >>> More importantly, you're >>> forcing the byte-compilation process to run every one of those 100000 >>> repetitions, which is not something we want to measure: the point of any >>> code compilation is to do it once and then reuse the results of >>> compilation many times. >> >> Exactly, but if the byte-compilation would take place in buffer-match-p, >> then the measurement is relevant. > > But then you're throwing away the benefits of compilation. But my > suggestion is for you to get rid of "buffer-match-p". Rather, make a > 'buffer-matcher' that does the compilation, and then place the return > value of that, which is a plain old (possibly very fast, if compiled) > function object in the display-buffer-alist variables and everywhere > where you can put functions. I see, but I don't agree. My main objection here is that the conditions aren't introspectable (e.g. when using ECI) any more and that it all becomes more verbose. > That way you still get your mini-language, you get a much faster version > of it, and you don't force your mini-language to other people who prefer > just typing plain old Elisp. That is not the case to begin with, as the "mini-language" is just a super-set of Emacs Lisp, seeing as any function is a legal word of the language. As I have said before, it just makes it easier to write common operations like matching buffer names or major modes. >>> (and I'm still confused by the purpose of the hash table usage) >> >> The rationale is the same as for regular expressions in the core. They >> are also compiled and stored, to avoid the need for them to be >> interpreted over and over again. >> >> This should all be explained in the bug report I pointed you to, and >> where this discussion should continue. > > Well, I think you're overcomplicating this. If you insulate > display-buffer-alist from the mini-language (i.e. you keep it the way it > was), then you don't need this hash table, and you can still use the > mini-language. > > (add-to-list 'display-buffer-alist > `(,(philips-mini-language-buffer-matcher > '(and (mode . x) (or (not (and "123"))))) > . display-buffer-in-side-window)) > > Again: you keep your mini-language and you can suggest people use > philips-mini-language-buffer-matcher in many other library APIs in > Emacs, not just window.el, but without needing to ever touch those > libraries. > > It's a much more modular design, less impositive, much smaller and much > faster. I have not much elese to say on the issue here, that hasn't already been said. If you think it is such a mistake, please report a bug or post on emacs-devel and we can clarify the issue there. >> This is currently not the case, but if the language extended in the >> future, there is the possibility that naming conflicts could arise. I >> am just following the same principle used when writing macros that >> avoids name capturing. > > You don't need to cargo cult that principle blindly. This kind of macro > hygiene you are talking about is for macros that take arbitrary lisp > forms, which is not the case of the mini-language. If it ever is, add > the hygiene then and likely not in a top-level defvar. I don't see any disadvantage from following best practices, even if it is not immediately relevant. There is no reason why `buffer' ought to be a special symbol, so I would like to avoid the possibility of this leading to issues that hack to be back-hacked at some point in the future. But this is just a matter of personal style. I have seen you write documentations strings like "[...] This docstring appeases checkdoc, that's all.", while I insist on documenting every function I commit, even if I am the only one who uses the package. We just have different principles. > Jo=C3=A3o