From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action' Date: Mon, 3 Jan 2022 19:21:51 +0100 Message-ID: References: <164073060906.21430.4993248796177370312@vcs2.savannah.gnu.org> <20211228223009.6D0BAC002EE@vcs2.savannah.gnu.org> <871r1v8nhf.fsf@gnus.org> <83ilv7jqm7.fsf@gnu.org> <6a9cd581-1630-4a95-62c4-419603561072@gmx.at> <3499cedf-b170-3045-873d-d45d2972ae13@gmx.at> <0f492ac4-4167-5448-2c74-a5f67950eae4@yandex.ru> <2de2323b-6d34-9263-776b-dbeff036f8f4@gmx.at> <87zgog68ni.fsf@gnus.org> <8dfc6f22-d331-e7c1-b536-2d374197528f@gmx.at> <86v8z26o15.fsf@mail.linkov.net> <9d5f512f-dd10-fb6b-2fe7-db24ed92f7c8@gmx.at> <86y23xuv8g.fsf@mail.linkov.net> 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="10525"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org, Eli Zaretskii , sdsg@amazon.com To: Juri Linkov , Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 03 19:22:43 2022 Return-path: Envelope-to: ged-emacs-devel@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 1n4Ryk-0002ax-8Y for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Jan 2022 19:22:42 +0100 Original-Received: from localhost ([::1]:46770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4Ryj-0002iz-2I for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Jan 2022 13:22:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4Ry7-0001oy-7P for emacs-devel@gnu.org; Mon, 03 Jan 2022 13:22:03 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:55669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4Ry1-0003VN-VF; Mon, 03 Jan 2022 13:22:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1641234112; bh=Rk11Rlcy5htmYfAZ6xTH998pZ6hnPXtgBX3CcPsxb5s=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Kb2AeUpb45R+SMHLiwgLOiGqZ/lOz0rFUh7wUY/Py5kJs6q/L+nEV/NYtRKcxq2LV s+Gj6W8xDotofTLylMrjakmSlDTq5s1q0M3GIJaT886BJUwMoP+CfDfrrqDpbH6OiT UCUSK33hnKV/b+PUiCSJhORggX2Np3w03T1DJ0Qs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.102] ([213.142.97.198]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbAcs-1mXa3c0f3g-00bfbc; Mon, 03 Jan 2022 19:21:52 +0100 In-Reply-To: <86y23xuv8g.fsf@mail.linkov.net> Content-Language: en-US X-Provags-ID: V03:K1:KKBrTWgiolUQh47BZx5euslq09/TllbEJX61jr28tSdKcyZSZ+C z/om0VxQ4mW8XqanxBLFKX1a5/kDXqinuHE3RVrz2zRljvsTynwSkGQXAyS8L5pR9Q+1Nak gOYU5ZKR9sEc5V/2567VGn90xghTK6zLea8zimeMZ7Y9tWzgpZ2rtSyYb/bgFQn+9Fgf/GF m8SkM/wV1zLLKZmIEn4Iw== X-UI-Out-Filterresults: notjunk:1;V03:K0:uBb1ZZKYbgE=:WqCxDQi7ueojQJZpCRPQCl re0hwhDr5wPhykpkJEk3iMmWgFDHaeBLv959ARd2xGOudcqke7nGYsISqaWmZ0mlYzz7tIqLp D0GXbwc0Q70PJNv5LBtz6JqcCmGYqvKik6wIbLHDK98OPSqXN9i5477bvcqQZy5X9CesagcEa +k47CVF8TQwIJilVpxzaGAqfJdgeycNx4BHQe2mq5eGAtkFlT/enRgA+/vPVWk0VIU1/SDCW4 e9y1v+iZxMkBGpkmDD7eY7u668NoVpGqy3PP6bZSXRmErY/lZkl2cGYmH0t8HTCR9EaDmdbh1 CDI5OPYiwk43lkdKHSeeSP72Cb8e20TjZs5Jrv1IQM4hGIOHeIRexjMbEQ8vqCL0ss+yoNBkN wIXdls9mCfrP3/V8U+yOu17dJvGqLsCTLBpNoZkGnGR4ryuaJCCSiXEERC/SaNJCydG3I1N6H nhTLBXdIhcZTnlVglsOK/0dA01h6loJ+J7WyyGYFoz5QhPIW6cmFWxKqRrDJ+opP6Lqr6vLav hEp3QJxEuVRTUQx19sGYKjO3FsO3fuimVpSAm+COA8/gbR2jZXcS+X+c0eqsySC4cNgNCoKN0 bJxxuMtG83ACWLZKYbXlygg7g2u7Y5bOma1O6PFnqVI8Nk4kaiIhZ4Oo5snlS4G9UD2Owxphq l+Nw8dVJydAei7X3y8rmxWgblv4dHkNwNdfd29DLFhLas97snrs0+lOJZpOEDPuUay9wXDj7g 57k7ZuP8rP2z67b6YfijKgp8x4w0lSXNwPiLnSZWeMQNflCFm7fz2t4QR3E8xLj3wdISSNBf Received-SPF: pass client-ip=212.227.15.19; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284083 Archived-At: >> Perhaps the customized value structure should simply refer to major mode(s)? >> >> Then there won't be a need to create a predefined list with mappings. > > Indeed, this is what I use for the outbound buffer: It's not sufficiently general. For example, 'shell' first pops up the buffer and then sets its major mode with an explanation that goes as ;; The buffer's window must be correctly set when we call comint ;; (so that comint sets the COLUMNS env var properly). (pop-to-buffer buffer) Using the tools we have on board we could do something in the spirit of (defun display-buffer-match-comint (_buffer action) (cadr (assq 'comint (cdr action)))) (customize-set-variable 'display-buffer-alist '((display-buffer-match-comint display-buffer-same-window (nil)))) (pop-to-buffer "*shell*" '(nil . ((comint t)))) which means that customizing 'display-buffer-alist' with that value on Emacs 28 will report a mismatch but that's the only mishap that should happen. We also could have 'display-buffer-assq-regexp' do (when (or (and (stringp key) (string-match-p key buffer-name)) (and (functionp key) (funcall key buffer-name action)) (and (symbolp key) (cadr (assq key (cdr action))))) so we could do away with 'display-buffer-match-comint' but then we would have to change the custom type of 'display-buffer-alist' - no great deal either. WDYT? martin