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

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

recentering another window (was: Re: Emacs as a translator's tool)


From: Emanuel Berg
Subject: recentering another window (was: Re: Emacs as a translator's tool)
Date: Wed, 10 Jun 2020 17:27:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

t wrote:

> Uh -- I see downtrhead you already got it.
> Sorry for chiming in late to the party.

Heh, no, that's what classy people do...

OT (on topic): I'm not getting `recenter' to work in
the other window. This, within
a `with-current-buffer' with an explicit buffer
argument

  (unless (pos-visible-in-window-p (point) (selected-window))
    (recenter) )

says

  ‘recenter’ing a window that does not display
  current-buffer

which seems to be what I want, but nothing happens.

BTW, I got the code from [1] where `or' is used.
That way of using or is cool in cases such as

  (or maybe-set-var-1 ... maybe-set-var-n default-hard-coded-value)

but in the stated `pos-visible-in-window-p'/recenter
case I think `unless' is better unless I'm ignorant
of something...


[1] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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