From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Question about display-buffer-overriding-action Date: Tue, 15 Mar 2022 22:34:19 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17801"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 16 02:35:09 2022 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 1nUIZ9-0004OU-1U for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Mar 2022 02:35:07 +0100 Original-Received: from localhost ([::1]:43954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUIZ7-0001MW-NR for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 21:35:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUIYe-0001M8-OF for help-gnu-emacs@gnu.org; Tue, 15 Mar 2022 21:34:37 -0400 Original-Received: from [2a00:1450:4864:20::232] (port=41690 helo=mail-lj1-x232.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUIYb-0002mF-Md for help-gnu-emacs@gnu.org; Tue, 15 Mar 2022 21:34:36 -0400 Original-Received: by mail-lj1-x232.google.com with SMTP id z26so1224547lji.8 for ; Tue, 15 Mar 2022 18:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=67F69QMypKOhXVtaVR5owu3iwktjGvFhC4dH0yraDE8=; b=KSiEwmJozlkCNQAEVMVHSpAafUzs00POQZLv8vJlDBtJmKKb3Uz0Gf/uV2s5QRyhL8 cc9VOf6H+rvNmVYvZwhvOqpg4yhVs/Sqvw60lExc7OOo2t60uU5nsA5AbqqUYLoUahzs FACNPH/mVOlxQGVsAsCpv+wsyt6ZmTCVA8nCVy2aKaTG8/nPnAFvNGMvEZW3fJ16nuKB yvDqNrqJ/C1NDsxJkkoAh4hIBv7LntegYHcPZmZqMLO12pWR3Wmer2RLTYbhZ6lUXLyz HaPsoS9pk/OIzCmTlTCpkaqj5iYlgtd8c6a4GIbmz3stlGEMK4dyvKciS/Ow/ostrrST j8Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=67F69QMypKOhXVtaVR5owu3iwktjGvFhC4dH0yraDE8=; b=nTnu6TtKHxNsmYSz/DAvK43LH367IYDF2qwtkJeua87NCrooZmw3cFHiv9VaBxJsnZ z3zTHJCjl1+FLjcs/sermEv8pEwNMZlgvVJNcCb9e/LtXw5tO9uEjOvXe8IRyVwo2SaM YaujQn+jwxPOt3chsrom0YEZmpgn2zvdJHFS37M+vicXZ02f5bTKNIhBb/KmoG4vHNCv v9+/e0nt+hE9aK/gaJicPuaapNgpuhJKW6uWlvMF79A1fPsIE632G5nEF/m85eVfaxAV YlD9QYYNsZC/xJ7IoTVnG9gFrCqPdyK6ZT6L74t1F663aSPyZUydTiedpILFHbFU8Z07 qkJQ== X-Gm-Message-State: AOAM532Nv3emEzmdodSSxdDSc1IU0MCvjcc0A//uvth2wcvDnS0K1uF1 XD3k5ZYYedN2kKdtOc6ZldRqoVkcZ4VV6BwNvZ252bNPTpg= X-Google-Smtp-Source: ABdhPJzF9ZygYS3YfQuksmxFMLzvotdRxv2jEMG4bhBIAVez+MP9+5ZszhkZ+5rEnITt350M/lJpe7hjsjqmORoxRKs= X-Received: by 2002:a2e:b890:0:b0:249:1c55:741c with SMTP id r16-20020a2eb890000000b002491c55741cmr15451290ljp.193.1647394471252; Tue, 15 Mar 2022 18:34:31 -0700 (PDT) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::232 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=eduardoochs@gmail.com; helo=mail-lj1-x232.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:136601 Archived-At: Hi all, how do I set `display-buffer-overriding-action' in a let to make `pop-to-buffer' use the current window? The docs are here, (info "(elisp)Choosing Window") (info "(elisp)The Zen of Buffer Display") but I'm probably misreading something over and over, because I've done lots of tests and I can't get it right... Here's a concrete example. The package "osm" is new in ELPA, and is an OpenStreetMap viewer for Emacs. Suppose that we define this: (setq USETHISWINDOW nil) (defun find-osm (lat lon zoom &rest comments) "Open a map. LAT, LON and ZOOM are the latitude, longitude, and zoom factor. The COMMENTS are ignored. You need to have osm.el - OpenStreetMap viewer - installed for this to work." (let ((display-buffer-overriding-action USETHISWINDOW)) (osm-goto lat lon zoom))) ;; Test: (find-osm -22.5 -41.9 15 "Near home") The function `osm-goto' calls `osm--goto', that calls `pop-to-buffer', and apparently one of the variables that controls the behavior of `pop-to-buffer' is `display-buffer-overriding-action'. If we have two windows open and USETHISWINDOW is nil, then - at least in my setting - this test ;; Test: (find-osm -22.5 -41.9 15 "Near home") opens the map in the other window. What is the value of USETHISWINDOW that would mean "always open in the current window"? Thanks in advance! Eduardo Ochs http://angg.twu.net/#eev