6

I'd like to have the following code in my library:

(when (not (buffer-visible-p es-results-buffer))
  (delete-other-windows)
  (view-buffer-other-window es-results-buffer))

However, I haven't been able to find a function for buffer-visible-p. Is there such a function?

Drew
  • 75,699
  • 9
  • 109
  • 225
Lee H
  • 2,697
  • 1
  • 16
  • 31

1 Answers1

5

You are looking for get-buffer-window, or you can iterate over the list of all visible windows yourself.

sds
  • 5,928
  • 20
  • 39