From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= 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:52:50 +0000 Message-ID: <87iljxsmx9.fsf@gmail.com> References: <87sfj8umwb.fsf@posteo.net> <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> <87v8nxafoz.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33330"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 58839@debbugs.gnu.org, Dmitry Gutov To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 02 10:52:16 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 1oqAPv-0008Pl-Vo for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Nov 2022 10:52:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqAPj-0000kJ-Js; Wed, 02 Nov 2022 05:52:03 -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 1oqAPi-0000jx-KH for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 05:52:02 -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 1oqAPi-0002hf-Ce for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 05:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqAPi-0004h6-05 for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2022 05:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2022 09:52:01 +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.166738270818012 (code B ref 58839); Wed, 02 Nov 2022 09:52:01 +0000 Original-Received: (at 58839) by debbugs.gnu.org; 2 Nov 2022 09:51:48 +0000 Original-Received: from localhost ([127.0.0.1]:44940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqAPT-0004gO-I5 for submit@debbugs.gnu.org; Wed, 02 Nov 2022 05:51:48 -0400 Original-Received: from mail-wr1-f51.google.com ([209.85.221.51]:38594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqAPS-0004g6-93 for 58839@debbugs.gnu.org; Wed, 02 Nov 2022 05:51:46 -0400 Original-Received: by mail-wr1-f51.google.com with SMTP id a14so23693693wru.5 for <58839@debbugs.gnu.org>; Wed, 02 Nov 2022 02:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=DQxZ+TIJnmlG5FyUAsgo/jcWJ7hSylBkCT7OzA+18K4=; b=CMl8qqjoYrAe0TYZ8aT7Uzh25IAtV7PRJfvbRvJckBC/f9KD1y2brQYCKHV5v3qjJi XJnYUba/+0HoNyrowI36rVw3uniNY5BiZBMmS1BBuhx+aKFt4gstJ33KH0SJ7yGeTy+o ty1zvkuopqrW1S4eVqspEVIO3MCrwQ44YkIFhZeZse0Cf5njZ5d73ZdCHM1GMBjsF5jD 4YInJ4JOetduzVLu9hVVeSgvbS7fV6WGh3Xah1IYHllK4SpWi1O/fwH0lLdk7RvqpBZz SrMncKifX8ywHTyGRccyk1XmS86ikUPe9cWrXagiOL9RyJt6sspG4PZeui4k1Wq8+PHn FmAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DQxZ+TIJnmlG5FyUAsgo/jcWJ7hSylBkCT7OzA+18K4=; b=NpJCpqFi6/VXKFU0sogMpzw48Y2krzXW0+muw9XfOKquaPt4F5bT8etByE0dzyGU51 6DT8dUArv7IJkZAs9z1iomKTfsi5wHRfntSw1smoxMAypep01xuAl0bmv3b0Z4IN4lev Bvli3vAJDbLq7sisR3Mg7YemRyxLhmiHuDfHNhR0PDQnKd2DrjCjeEP2pq6poa9R0/vl vxl5I/1ZDgvbI3tdDLP1XVhJd2eNSl7TmOs4mnNlj2d5jE+oJTMLAVlbu/jEa/fUZudR OC18sdl2GwLHfuL3NjvXc208mY824mHI7ooBeaNv6+x+Jbx9jjbOLDqVXQmtGIfmk+FO kTcg== X-Gm-Message-State: ACrzQf0h7OfTOqBnwt3fzns+3UEpvB4AOkoU1J/FdcmWEUqEoO9m2qlr CwEjo3uculNzoXFJPZaY7RNtu/en4BA= X-Google-Smtp-Source: AMsMyM7ErRsvKilVFiZdVq4nREd7oE43kw+zWhg24EwNpD+bUhMgpQ8ZruOXlCVjtVKhkZkWZrN44Q== X-Received: by 2002:adf:ef4e:0:b0:236:6608:f6ce with SMTP id c14-20020adfef4e000000b002366608f6cemr14467325wrp.85.1667382700005; Wed, 02 Nov 2022 02:51:40 -0700 (PDT) Original-Received: from krug (87-196-81-36.net.novis.pt. [87.196.81.36]) by smtp.gmail.com with ESMTPSA id j19-20020a05600c1c1300b003a8434530bbsm1621429wms.13.2022.11.02.02.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 02:51:39 -0700 (PDT) In-Reply-To: <87v8nxafoz.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 02 Nov 2022 09:06:20 +0000") 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:246855 Archived-At: Philip Kaludercic writes: >> 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. If you want introspection, i.e. see the translated Elisp code when inspecting the value of display-buffer-alist, then pass another argument to buffer-matcher which makes it return an uncompiled function. Furthermore, as debugging goes, the buffer-matcher idea is much better: if the user does a mistake in his mini-language program, that mistake can be caught when buffer-matcher is called, i.e. during her init. Not when display-buffer-alist is about to run the program. And if your mini-language ever evolves, you can also issue warnings at this point. This is what compilation and compilers have always existed for. Lisp gives you this power in a few lines (something which takes a lot of hard in other languages). >> 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. That's not what a super-set is. A super-set language is C++ to C, because C++ can compile (almost any) C program. The mini-language is a DSL. In my opinion, one that brings very few advantages, but there's no accounting for taste. So the common way to do DSL's in Elisp is use the approach I provided. You make them more useful, and you don't force people to use them. > 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. OK. It's not so much a mistake as lost opportunity to make a more reusable, less britlle piece of software using less code, less docstrings, less manual writing, etc. Cuts down on the mental overload, potentially teaches some people Elisp instead of mini-language, and reduces CPU usage and laptop battery time. >>> 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. This is not a best practice, really it's not. MAKE-SYMBOL and GENSYM are for macro that take forms hygiene: this is simply not that case. > 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." Ahaha, that was just a joke. Keep documenting all your functions, you're very right to do so. Trust me, don't make defvar's for (make-symbol). Noone does this: it's just cruft.