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#54100: 29.0.50; Allow project-buffers to ignore some buffers Date: Sat, 26 Feb 2022 03:50:47 +0200 Message-ID: <89fb4c32-8fc8-98b8-d447-2076762fe6c6@yandex.ru> References: <93b67902-a322-d0f1-e25a-97ff3ac70785@yandex.ru> <48d94136-bda9-091e-0370-788f3d706a9d@inventati.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="7273"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: Manuel Uberti , 54100@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 26 02:51:23 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 1nNmF1-0001hZ-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Feb 2022 02:51:23 +0100 Original-Received: from localhost ([::1]:34802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNmEz-0007cG-Mt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 20:51:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNmEg-0007br-NM for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 20:51:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNmEg-0002xl-5z for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 20:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNmEg-0000uI-2J for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 20:51: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: Sat, 26 Feb 2022 01:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54100 X-GNU-PR-Package: emacs Original-Received: via spool by 54100-submit@debbugs.gnu.org id=B54100.16458402563474 (code B ref 54100); Sat, 26 Feb 2022 01:51:02 +0000 Original-Received: (at 54100) by debbugs.gnu.org; 26 Feb 2022 01:50:56 +0000 Original-Received: from localhost ([127.0.0.1]:53972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNmEa-0000ty-3m for submit@debbugs.gnu.org; Fri, 25 Feb 2022 20:50:56 -0500 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:35839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNmEZ-0000tl-69 for 54100@debbugs.gnu.org; Fri, 25 Feb 2022 20:50:55 -0500 Original-Received: by mail-wr1-f52.google.com with SMTP id b5so6929215wrr.2 for <54100@debbugs.gnu.org>; Fri, 25 Feb 2022 17:50:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=9Vban9DMsrF1dVHT0AC8NSCKs2/C7NFtuGGkqhJtim4=; b=KbWBc5OgmjeN91b06c78UUL8LR+phXK24dHVEn38VZuXOeez8+mY1QNSwTI6d/lMWw uQb8DRtuOT/eTApl7PYB5OAe1aJReTHr9Ea88J/3U1WFDqQnVHoZVLw9FIBZLg7qG0Mw RvCzXe8W1nhOeSKwnKOVhmmysyWgfC3r0OOlVpN12D8HHY48QQiY0Bh2UUt11In6Pr70 /eZt8vxKljcCqpparKkdEwV1Xl3ukv1HGNeZLvvGGPqj8yBIvw1zCGPaeQn1ExftU8nH qBrZz1nXr0cat3kRLEaJKmb7pTFRTodR6jjeODWixLgOMznP2bEWJjF72YE34c5YZVt1 7OGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=9Vban9DMsrF1dVHT0AC8NSCKs2/C7NFtuGGkqhJtim4=; b=IJ7STxFa/0VVPUNZXLMqrvABX5kAuIp/eknjJehHFhhzpAkEE4p8343IPzZxPlcmqf VR9m08TxZhhceb6ee4ZlHUGhaw4eVJcBmJqs46Dk+tDL/3Mm4f3R18XR6bRhEPjCnDt5 m8W29P/Mt6PKZSBi92+u7u047x5Y9AxHFaJ8tlkIoT8ditQTx/E/CWPcJ78ylb09RN6x PqfQZe0UZl8RDrx3dwYlKgbq2tyPsOM/a02f1UiIUanmwDOJGcfmPuHIel5jxoj1ZYL4 pQSIHO8OdHIJjO9kcaWuA1zP8vx5URyeY5gINXQc9695a1GrdL/wl8XXo5dcVqLq8MEM My6Q== X-Gm-Message-State: AOAM530fbCyAnJvoPcvmTm0k1C5bDOY5KpKMBBZ7LUFVfbMj5SQD1oyX 3UFkqPcHdzJD1MWG0XYB1K0= X-Google-Smtp-Source: ABdhPJxlp/cMdEZ5u7VoIhHzUpIqLYoPICDf+OgjZVo2ad6pu7GER1UCF7wDPrKJ3ZBcyDyNYjfL3A== X-Received: by 2002:a5d:55c1:0:b0:1ea:961e:2ce4 with SMTP id i1-20020a5d55c1000000b001ea961e2ce4mr8400488wrw.45.1645840249146; Fri, 25 Feb 2022 17:50:49 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i14-20020adff30e000000b001ef7e945bc6sm1050760wro.105.2022.02.25.17.50.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Feb 2022 17:50:48 -0800 (PST) Content-Language: en-US In-Reply-To: <48d94136-bda9-091e-0370-788f3d706a9d@inventati.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" Xref: news.gmane.io gmane.emacs.bugs:227661 Archived-At: On 25.02.2022 08:44, Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > On 25/02/22 03:33, Dmitry Gutov wrote: >> Doesn't this mean that it won't do the (memq ... buffers) check and >> thus ignore the result of the (project-buffers pr) call? >> >> Instead, it could be a lambda like >> >>            (lambda (buffer) >>              ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist. >>              (and (memq (cdr buffer) buffers) >>                   (funcall predicate buffer))) >> >> Does that make sense? > > Totally, thank you! > >> (I would also try to shorten the new defcustom's docstring by >> referring to the existing one, but I can make that change myself.) > > Done. Very good. Looking at it more thoroughly, though, shouldn't we simply inline the check added to project-switch-to-buffer to the function project--read-project-buffer? It's used by two other related commands (project-display-buffer and project-display-buffer-other-frame), and users would probably expect them to have the same filtering. project-ignore-buffer-conditions's docstring can be updated accordingly. >> Or if you wanted to stay on "or" but make it easier for certain usage >> pattern, you could call the var 'project-ignore-buffer-conditions' (or >> "hide" or etc), and change its use appropriately. Then the value could >> contain >> >>    '((not mu-project-buffer-p) >>      (derived-mode . comint-mode)) >> >> ...and (not mu-project-buffer-p) could obviously be rewritten in a >> negated way in the function's definition. > > I followed your suggestion and used `project-ignore-buffer-conditions' > in the attached patch. > > Now everything works as expected when I use this: > > (defun mu-project-ignore-buffer-p (buffer) >   "Check if BUFFER is a member of `mu-ignored-buffers'." >   (seq-contains-p mu-ignored-buffers (buffer-name buffer) > #'string-match-p)) > > (setq-default project-ignore-buffer-conditions '(mu-project-ignore-buffer-p >                                                  (derived-mode . > dired-mode))) > > > Again, thank you for the help on this. No problem!