Subject: Re: bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer)))

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 17 Oct 2019 05:03:25 +0200

Eduardo Ochs <[email-masked]> writes:

> In many versions of Emacs the sexp below
>
>   (save-window-excursion (shell) (buffer-name (current-buffer)))
>
> returns "*shell*", but in some recent versions it returns the name of
> the current buffer instead.

This seems to be introduced by 

commit 59191cd0cbe8463f9095a71cb4048bb138d6e446
Author: Michael Albinus <[email-masked]>
Date:   Sun Apr 2 11:02:54 2017 +0200

    Apply connecion-local variables for shells
    
if I read the log right.

It wraps the `pop-to-buffer' in a `(with-current-buffer buffer', so
current-buffer doesn't change like it used to.

Michael?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no