[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : window-other.el / ref-lines.el
From: |
Drew Adams |
Subject: |
RE: [External] : window-other.el / ref-lines.el |
Date: |
Tue, 17 Jan 2023 17:04:41 +0000 |
> (defun next-window-buffer ()
> (window-buffer (next-window)) )
>
> (defmacro with-other-window (&rest body)
> (declare (indent 1) (debug t))
> `(let ((buf (next-window-buffer)))
> (when (bufferp buf)
> (with-current-buffer buf
> ,@body) )))
Your macro _name_ is misleading (and so would
be `in-other-window'). You're doing BODY with
the next-window's _buffer current_. But you're
not _selecting_ the next-window while doing it.
IOW, that window isn't selected when you do BODY.
`with-selected-window' does its BODY with
its WINDOW selected. You could (if that were
what you wanted) define a `with-other-window'
which did the equivalent for the `next-window':
(defmacro with-other-window (&rest body)
`(with-selected-window (next-window) ,@body))