From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#16661: 24.3.50; standalone minibuffer frame gets renamed with name of aother frame Date: Fri, 21 Feb 2014 20:23:47 -0800 (PST) Message-ID: <16fff663-6320-4d96-a575-e3c368472a0a@default> References: <<97c44b41-de36-472b-833d-3b0d1ac4c912@default>> <> <<831tzgypbp.fsf@gnu.org>> <> <<83zjm3xuu8.fsf@gnu.org>> <> <> <<83vbwhblkp.fsf@gnu.org>> <<3febc9ab-b7b2-443c-8ec8-eaaf28ace468@default>> <> <<8338jd693l.fsf@gnu.org>> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1393043056 18843 80.91.229.3 (22 Feb 2014 04:24:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Feb 2014 04:24:16 +0000 (UTC) Cc: 16661@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 22 05:24:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WH48V-0003jb-0A for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Feb 2014 05:24:23 +0100 Original-Received: from localhost ([::1]:48349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH48T-0004Q2-U5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Feb 2014 23:24:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH48I-0004Pp-Qc for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 23:24:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WH48A-0002Bq-6u for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 23:24:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH48A-0002Bj-3X for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 23:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WH489-0004Ev-Lk for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 23:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Feb 2014 04:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16661 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 16661-submit@debbugs.gnu.org id=B16661.139304304016286 (code B ref 16661); Sat, 22 Feb 2014 04:24:01 +0000 Original-Received: (at 16661) by debbugs.gnu.org; 22 Feb 2014 04:24:00 +0000 Original-Received: from localhost ([127.0.0.1]:35303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WH487-0004Eb-2b for submit@debbugs.gnu.org; Fri, 21 Feb 2014 23:23:59 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:27120) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WH484-0004EN-Gh for 16661@debbugs.gnu.org; Fri, 21 Feb 2014 23:23:57 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s1M4Nobp025792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 22 Feb 2014 04:23:50 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s1M4NmRZ015543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Feb 2014 04:23:49 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s1M4Nlqh027627; Sat, 22 Feb 2014 04:23:47 GMT In-Reply-To: <<8338jd693l.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86006 Archived-At: > How about adding a Lisp backtrace to the info you already put there? OK, I have some more info about this. This is the backtrace: 000 this-cmd: nil, last-cmd: nil =09(name . "drews-lisp-20") backtrace() ad-Advice-modify-frame-parameters(# # ((name . "drews-lisp-20"))) apply(ad-Advice-modify-frame-parameters # (= # ((name . "drews-lisp-20")))) modify-frame-parameters(# ((name . "drews-lisp-20"))= ) rename-frame() run-hooks(window-setup-hook) I do this in my init file: (when (and (if (fboundp 'display-graphic-p) (display-graphic-p) window-syst= em) (eq system-type 'windows-nt) (fboundp 'rename-frame)) (add-hook 'window-setup-hook 'rename-frame)) This is `rename-frame': (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 =3D 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. (let ((fr (get-a-frame old-name))) ; Convert to frame if string. (if all-named (while fr (modify-frame-parameters fr (list (cons 'name new-name))) (setq fr (get-a-frame old-name))) ; Get another. (when (string=3D (get-frame-name fr) (get-frame-name)) (setq fr (selected-frame))) (modify-frame-parameters fr (list (cons 'name new-name)))))) What's odd is that I never saw the minibuffer get renamed to another buffer name before now. And even now it happens only occasionally. I will switch to using my function `rename-non-minibuffer-frame', which I hope will take care of the problem I see. But I wonder whether this might not indicate an Emacs bug. Either a new bug: Why should the `buffer-name' of the minibuffer frame be different from the frame name, for the minibuffer frame? Apparently Emacs thinks that the current buffer in the minibuffer frame is the buffer of another frame (in this case, Dired). And I believe that I have seen this renaming bug happen only when there is only one other frame, besides the minibuffer frame. How is it possible that (buffer-name) is the name of a Dired buffer when `window-setup-hook' is called for the minibuffer frame? Or perhaps some old bug was fixed, which causes me to see this for the first time (across all Emacs versions from Emacs 20-24)? But even in that case I have the same questions: why would `buffer-name' be wrong when `window-setup-hook' is run? Anyone have insight into this? I believe I first started seeing this in early January, but it might have been a little before or after that.