[Top][All Lists]

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

Re: Problem with cl-letf in winner.el

From: Basil L. Contovounesios
Subject: Re: Problem with cl-letf in winner.el
Date: Thu, 06 May 2021 18:36:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Alan Mackenzie <acm@muc.de> writes:

> In connection with bug #48249, I'm looking at winner.el.  In function
> winner-set-conf, there is the following macro call:
>     (cl-letf (((window-buffer miniwin))
>               ((window-point  miniwin)))
>       (set-window-configuration winconf))
> ..  I'm having trouble understanding it.  When I expand and pretty print
> it, I get this:
>     (let*
>         ((v miniwin)
>          (v miniwin)
>          (old
>           (window-point v))
>          (old
>           (window-buffer v)))
>       (unwind-protect
>           (set-window-configuration winconf)
>         (set-window-point v old)
>         (let*
>             ((v old))
>           (progn
>             (set-window-buffer v v)
>             v))))
> This looks very strange indeed: under the let* there are two variables
> called v and two variables called old.  This looks like a bug to me, but
> alternatively, is there something I'm not understanding here?  (Just to
> be specific, I expanded the macro with lexical-binding both nil and t,
> and got the same results.)
> Help, please!

Enabling print-gensym and print-circle should make it clearer that the
seemingly duplicate vars are actually different uninterned symbols.

So my reading of that macro call is that it restores miniwin's buffer
and point after changing window configuration.



reply via email to

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