help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about display-buffer-overriding-action


From: Eduardo Ochs
Subject: Question about display-buffer-overriding-action
Date: Tue, 15 Mar 2022 22:34:19 -0300

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]