unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer)))
@ 2019-10-14  7:55 Eduardo Ochs
  2019-10-17  3:03 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Eduardo Ochs @ 2019-10-14  7:55 UTC (permalink / raw)
  To: 37745

[-- Attachment #1: Type: text/plain, Size: 908 bytes --]

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.

Let me be more precise. I ran the sexp below in the versions of Emacs
that I have in my machine,

  (list emacs-version
    (save-window-excursion (shell) (buffer-name (current-buffer)))
    )

and collected the outputs, and got:

  ("24.5.1" "*shell*")
  ("25.1.1" "*shell*")
  ("26.3" "*shell*")
  ("27.0.50" "TODO")

Here's the exact version of my "27.0.50". The output of

  PAGER=cat git log -1 --format=format:"%H%n%cd%n"

was:

  01ea96b5548a80e6aabc69428439113ce0a8c17e
  Mon Oct 14 08:47:02 2019 +0200

I don't know (yet) how to bisect versions to find exactly when the
behavior changed, sorry... btw, this is a Debian box (on amd64).

  Cheers,
    Eduardo Ochs
    http://angg.twu.net/#eev

[-- Attachment #2: Type: text/html, Size: 1229 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer)))
  2019-10-14  7:55 bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer))) Eduardo Ochs
@ 2019-10-17  3:03 ` Lars Ingebrigtsen
  2019-10-17  8:26   ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-17  3:03 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: 37745, Michael Albinus

Eduardo Ochs <eduardoochs@gmail.com> 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 <michael.albinus@gmx.de>
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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer)))
  2019-10-17  3:03 ` Lars Ingebrigtsen
@ 2019-10-17  8:26   ` martin rudalics
  2019-10-17 16:50     ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2019-10-17  8:26 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Eduardo Ochs; +Cc: 37745, Michael Albinus

 >> 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 <michael.albinus@gmx.de>
 > 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.

Why can't you simply use (buffer-name (shell)) instead?

martin





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer)))
  2019-10-17  8:26   ` martin rudalics
@ 2019-10-17 16:50     ` Michael Albinus
  2019-10-27  8:42       ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2019-10-17 16:50 UTC (permalink / raw)
  To: martin rudalics; +Cc: Lars Ingebrigtsen, 37745, Eduardo Ochs

martin rudalics <rudalics@gmx.at> 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 <michael.albinus@gmx.de>
>> 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.
>
> Why can't you simply use (buffer-name (shell)) instead?

That's possible, of course.

However, `shell' has always made the shell buffer current. It was an
oversight by me to change this.

I've added this behavior to the docstring of `shell', and fixed
this. Committed to master.

> martin

Best regards, Michael.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer)))
  2019-10-17 16:50     ` Michael Albinus
@ 2019-10-27  8:42       ` Michael Albinus
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2019-10-27  8:42 UTC (permalink / raw)
  To: martin rudalics; +Cc: Lars Ingebrigtsen, 37745, Eduardo Ochs

Version: 27.1

Michael Albinus <michael.albinus@gmx.de> writes:

> I've added this behavior to the docstring of `shell', and fixed
> this. Committed to master.

No further complaints, so I'm closing this bug.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-27  8:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-14  7:55 bug#37745: (save-window-excursion (shell) (buffer-name (current-buffer))) Eduardo Ochs
2019-10-17  3:03 ` Lars Ingebrigtsen
2019-10-17  8:26   ` martin rudalics
2019-10-17 16:50     ` Michael Albinus
2019-10-27  8:42       ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).