GNU bug report logs - #16661
24.3.50; standalone minibuffer frame gets renamed with name of aother frame

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 5 Feb 2014 23:34:02 UTC

Severity: normal

Tags: moreinfo

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #68 received at 16661 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 16661 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#16661: 24.3.50;
 standalone minibuffer frame gets renamed with name of aother frame
Date: Mon, 24 Feb 2014 15:14:44 -0500
>   rename-frame()
>   run-hooks(window-setup-hook)

[...]

> (defun rename-frame (&optional old-name new-name all-named)
>   "Rename a frame named OLD-NAME to NEW-NAME.
> Prefix arg non-nil means rename all frames named OLD-NAME to NEWNAME.
> OLD-NAME may be a frame, its name, or nil.  Default is `selected-frame'.
> NEW-NAME is a string or nil.  Default NEW-NAME is current `buffer-name'."
>   (interactive
>    (list (read-frame
>            (concat "Rename " (and current-prefix-arg  "all ")
>                    "frame" (and current-prefix-arg  "s named") ": ")
>            nil t)             ; Default = selected.  Must exist.
>          (read-from-minibuffer "Rename to (new name): "
>                                (cons (buffer-name) 1))
>          current-prefix-arg))
>   (setq old-name  (or old-name  (get-frame-name)) ; Batch default: current.
>         new-name  (or new-name  (buffer-name))) ; Batch default: buf name.

When called from window-setup-hook, you have no guarantee about what is
the current buffer.  It may be a buffer that's not even displayed.
So you want to use (window-buffer (frame-selected-window)) rather than
current-buffer, here.

Not sure if it's related to your actual bug, tho, since
window-setup-hook is only run once at startup and your problem seems to
happen later.


        Stefan




This bug report was last modified 9 years and 149 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.