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: Fri, 25 Feb 2022 04:33:53 +0200 Message-ID: <93b67902-a322-d0f1-e25a-97ff3ac70785@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20145"; 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 Fri Feb 25 03:35:11 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 1nNQRr-00054m-0A for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 03:35:11 +0100 Original-Received: from localhost ([::1]:38106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNQRp-0001iO-Ub for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 21:35:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNQRi-0001iF-SF for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 21:35:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNQRi-0007Vi-HX for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 21:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNQRi-00060Z-Ft for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 21:35: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: Fri, 25 Feb 2022 02:35: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.164575644322984 (code B ref 54100); Fri, 25 Feb 2022 02:35:02 +0000 Original-Received: (at 54100) by debbugs.gnu.org; 25 Feb 2022 02:34:03 +0000 Original-Received: from localhost ([127.0.0.1]:50899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNQQl-0005yX-C8 for submit@debbugs.gnu.org; Thu, 24 Feb 2022 21:34:03 -0500 Original-Received: from mail-wm1-f43.google.com ([209.85.128.43]:46682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNQQj-0005xh-51 for 54100@debbugs.gnu.org; Thu, 24 Feb 2022 21:34:02 -0500 Original-Received: by mail-wm1-f43.google.com with SMTP id p184-20020a1c29c1000000b0037f76d8b484so856197wmp.5 for <54100@debbugs.gnu.org>; Thu, 24 Feb 2022 18:34:01 -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=wsn62+9Hme9nhjz/v6TaghctyRVLwE1pr68DfyRPmAY=; b=hkwxs2QJfWrCSujQg0TE+nEwYOmZlfuigMCxH+mYIcUo0ezmEUSfTvs9NQD1/uEACP 9wYLbBtaEditldO++2PfdyNemBbDG/+T0+ZZwgoj+PN3ADP9UCVMwXoc0Ct/zghbf7Mi MChQ+GAdXG3h1b4Kecd0bZ5kl1DaxBDXXF824IXe+33OpeI638ifXm9xc09qioOxLviY awTO8oApV4un+ZK0HjeyQLIMJLCk8gSbGUOzeZJCA7jasI0HN3rop/GpwJZ45hVcyw3Y gkSKdnPX3CBzFRcolu1on/mQId4PLztvyrAN7Vt0lVB9jL1KhMiMJPODxMPP1r4Rbqrb O88Q== 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=wsn62+9Hme9nhjz/v6TaghctyRVLwE1pr68DfyRPmAY=; b=HBY8UhsH0cHCzYs8xsOhmmKcehxHnomOgMr12dnOnL2VEYindgcrSDXt4sMleKwFWn XvwJAEk9r89M/X7i7W/iCv9f+9zLhKjMpNh6LsBs8i6mgIsgVL8ASEumRox8dEDvlNb/ /I6qTr69PVz9nBLRNR1yqmdUeKp2dr0IlD31K+Q9P797SsIGtuKYo3q/lLA4UPQpda2z nlENWN1OxHx0dmHbFFiDolP4oHlRnXFdyYJ9le/Ca/AfhC0o7TUphSo3f06rFZVeIPhG ds/xp9E8Z0wLU8s0e8snwG7wMw7a2Hxg0zHXsg3cLgrYM2ndGtwq/eNm6NdyI9LH71Nx wlhA== X-Gm-Message-State: AOAM530MHBzUyWmgd9ieZ9Y9Ve0GmGJCukCoSF7aBLao9SeoRxgUsTko ET7sgr38pegaScQiL81qZT0= X-Google-Smtp-Source: ABdhPJz/qleB9CUm4GeYLn209XvrmBT0XkLgrrnlPbWR57QlaaN/GVTxOKww/bl7tUavdk3HmNdQJg== X-Received: by 2002:a05:600c:5107:b0:37b:d944:b80a with SMTP id o7-20020a05600c510700b0037bd944b80amr704589wms.157.1645756435109; Thu, 24 Feb 2022 18:33:55 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j12-20020a05600c190c00b00380ead5bc65sm1105776wmq.29.2022.02.24.18.33.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 18:33:54 -0800 (PST) Content-Language: en-US In-Reply-To: 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:227609 Archived-At: On 24.02.2022 09:18, Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Find attached yet a better approach to avoid repetition. The patch looks good except for this part: (predicate - (lambda (buffer) - ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist. - (memq (cdr buffer) buffers)))) + (or predicate + (lambda (buffer) + ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist. + (memq (cdr buffer) buffers))))) 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? (I would also try to shorten the new defcustom's docstring by referring to the existing one, but I can make that change myself.) > Note that the above mention problem about multiple conditions remains, > though. Help appreciated. :) As described in the docstring: If any of these conditions are satisfied ... So when you use this value '(mu-project-buffer-p (not (derived-mode . comint-mode))) it means "either satisfies my-project-buffer-p or not derived from comint-mode". Whereas you probably wanted to combine them with "and": (setq-default project-switch-to-buffer-conditions '(and mu-project-buffer-p (not (derived-mode . comint-mode)))) And IDK, maybe the "and" top-level combination would work better for project-switch-to-buffer-conditions. It might trip up a user who's customizing both vars, though. 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.