From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: display-buffer-alist actions Date: Wed, 24 Feb 2021 20:52:03 +0100 Message-ID: <87k0qxtekt.fsf@fastmail.fm> References: <87sg5lgy2z.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26494"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.8; emacs 27.1.91 Cc: help-gnu-emacs@gnu.org To: Eric S Fraga Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 24 21:08:18 2021 Return-path: Envelope-to: geh-help-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 1lF0SI-0006mp-L1 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 21:08:18 +0100 Original-Received: from localhost ([::1]:52718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lF0SH-0003eu-K6 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 15:08:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lF0RQ-0003eV-Vn for help-gnu-emacs@gnu.org; Wed, 24 Feb 2021 15:07:25 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:35463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lF0RP-0008VX-55 for help-gnu-emacs@gnu.org; Wed, 24 Feb 2021 15:07:24 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1BA915C01A6; Wed, 24 Feb 2021 15:07:21 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 24 Feb 2021 15:07:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type; s=fm2; bh=bkvHXGu0KUY+2mwYTqWyh5pAe4 gb5cjrEgQxQlFG9Zk=; b=kmPa8O8SbADK+hLw7RVgs4LoRizcTumJUZldgoR5Qx 7mhY2fc7ORt3CIQMmOQjI4vjluuYXHH0hPIFkes9PMNIv0p4oRq88wxk8gKc8uDh yEEEEIE1prJnePbk4bA6Yxm46Afz/tJ+EDPMDKzvQjwkL+VpypYlsQT7qXlGsZZe 5djhM23bUGp0/atQi9viby/TisavrVQIrXHHJoNYzr7H6c8ChP/uy6I4VmzYJ1+2 sPzFCluY62/D3ioFzLlLkQSAm9T/7FTq8hhvfrXavqqCqfqVcYIyzPMSs+gxEVFE rGXlgMdNl+GTilzoWxlQXh4xsYOpVpnUAR5quCi4Ffgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=bkvHXG u0KUY+2mwYTqWyh5pAe4gb5cjrEgQxQlFG9Zk=; b=Op5TQyPXbL98dLJYQ3FWCW DEOC1pst4TcA7u3QcbIHMdOpmmhMi8AYFdSq1VZUMreusZPGWP31p9OZuqdtMhsq r2soQu+/L8zUfTtUDriZsoRZHmXXpWzI0q5NxnRDkCnBOIXXqvIJZAJ6OOzuRy8C OpQg3GoF57f5G6iByleUNz22VmlUd49h1Wq11rGsk8gy/u1mY/fwGSmJh3Oi0SrK qvGMK6VU7LdQF5Ktwm66nlXf32TKEGa923bBO5a9qGRS5qmRin79veQe9R9/I83X lVzukcPhxjEiStfHX8sN7HcsmVEt/1vb2R0b5MDNaRqZ07Aqv9QoqCHGWGkwCLJw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeejgddufeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpeflohhoshht ucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqe enucggtffrrghtthgvrhhnpefhteeivdejheehuedtgfeuieeflefghfejuedttedtffdu ieelfffgvdefteekhfenucffohhmrghinhepphhrohhtvghsihhlrghoshdrtghomhenuc fkphepleehrdeluddrudeljedrheejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfh hm X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5bc539.dynamic.kabel-deutschland.de [95.91.197.57]) by mail.messagingengine.com (Postfix) with ESMTPA id D5DB81080054; Wed, 24 Feb 2021 15:07:19 -0500 (EST) In-reply-to: <87sg5lgy2z.fsf@ucl.ac.uk> Received-SPF: pass client-ip=66.111.4.29; envelope-from=joostkremers@fastmail.fm; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-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_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128232 Archived-At: On Wed, Feb 24 2021, Eric S Fraga wrote: > Hello all, > > I've read and re-read the documentation for display-buffer-alist and I > cannot quite understand it. Yes, it's the easiest thing to grok. I've found Protesilaos Stavrou's comments and Youtube video on the topic helpful: https://protesilaos.com/dotemacs/#h:12591f89-eeea-4b12-93e8-9293504e5a12 > I have the following, which works: > > #+begin_src emacs-lisp > (setq display-buffer-alist > '(("^\\*Async Shell Command*" . (display-buffer-no-window)) > ("some regexp that works fine" > (display-buffer-in-side-window) > (window-width . 0.28) > (side . left) > (slot . 0)))) > #+end_src > > I have two monitors, one in landscape for which the above is ideal, > although I do not quite understand it. I got it from somewhere on the > Interweb... Watch Protesilaos' video and I think you'll understand better. > In any case, my other monitor is portrait and I would rather set the > width and the side to be bottom for windows on that monitor. Is it > possible to have a conditional of some sort in the list of conses, one > where I would look at the frame width and height? IIUC no, the actions (the conses you mention) don't have conditionals. What you could do, however, is write your own display-buffer function, which checks the frame dimensions and calls `display-buffer-side-window` with either `(side . left)` or `(side . bottom)`. -- Joost Kremers Life has its moments