From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jonathan Marten Newsgroups: gmane.emacs.bugs Subject: bug#25062: 24.5; Frame title (with "%b" format) changes when going to minibuffer Date: Tue, 29 Nov 2016 15:55:30 +0000 Organization: JJM @ Home Message-ID: <6551952.t1DPFT6gTp@keelhaul> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: blaine.gmane.org 1480436628 10853 195.159.176.226 (29 Nov 2016 16:23:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 16:23:48 +0000 (UTC) User-Agent: KMail/4.14.10 (Linux/4.4.26-gentoo; KDE/4.14.14; x86_64; git-721a351; 2016-05-06) To: 25062@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 29 17:23:41 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBlC0-0001ii-TQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Nov 2016 17:23:41 +0100 Original-Received: from localhost ([::1]:37921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBlC4-0004gp-L3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Nov 2016 11:23:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBklK-00076C-SI for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBklG-0008Pr-Uz for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:56:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBklG-0008Pl-Qj for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cBklG-0007Qw-HO for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jonathan Marten Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2016 15:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25062 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148043495028551 (code B ref -1); Tue, 29 Nov 2016 15:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Nov 2016 15:55:50 +0000 Original-Received: from localhost ([127.0.0.1]:46293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBkl4-0007QR-37 for submit@debbugs.gnu.org; Tue, 29 Nov 2016 10:55:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBkl1-0007QD-QU for submit@debbugs.gnu.org; Tue, 29 Nov 2016 10:55:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBkkv-0008Gb-18 for submit@debbugs.gnu.org; Tue, 29 Nov 2016 10:55:42 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBkku-0008GX-R4 for submit@debbugs.gnu.org; Tue, 29 Nov 2016 10:55:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBkkt-0006ho-4Z for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:55:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBkko-0008FW-2R for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:55:39 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.134]:62030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBkkn-0008F0-Oh for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 10:55:33 -0500 Original-Received: from keelhaul.localnet ([81.158.216.180]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.163]) with ESMTPSA (Nemesis) id 0MWKgT-1cDjre1K4v-00XO5h for ; Tue, 29 Nov 2016 16:55:31 +0100 X-Provags-ID: V03:K0:1Nu7cvNl2sc/xp/gwOvItHPDsCAKvoi2dNjz5XchuibRele/ZLp t3I+aJxljEIWIKNx4z050RQbqqFwYs9AZcMQ86DIxPOBD6JPh69PNHS0CtTCSa3X6608aQv E80zxUjrFtHaDSpBquO+ijg3KICGyvc+b+t1PxZs+Mf5FfgnWvlg56VgDGa4gDrbMZVFGGb I0SlVWqketzwDUek8wp8Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:xKyihv6zIUs=:R9XpsdQHt7n+G8q5SP2RWl TsXHRPYllW4hLLRBMWrk89AhBu9k2qxjxlRS+u/lVzz4R74gusKjuG330foZZYX1lwFMqDxG1 kTEgdaa0r2fIiuCB6si0Og4lrav+dSR45y/5jkuCGe/QDhXuE1Oh9AQ3aHUV44UvpaNXDSrf1 m8oPcwPhyAdZrKNy/FFbS6UNhnUDFhOBcUNM9yLDJfSwdDJcYjCn/BVgKPIRTgy2NEOrVIpY0 /LKQ6PNRLwhZLiThmw0ZPn3AHeawqRqa32nJ1CLZT5gx34bdRCjc4JhMhOBBMBToEGMZRyCmP hGEaPw0Uw3ttTmYQ1cDPuq2RZCapzYUpCA/NCEH1AizVjyAXdD1JqiAnfc/rn16Re/u9nTs7N we9h6eIV0M3jSx9Kx4pCUzOyRAZT1VIM13UYaM/2ZWtzYQWXauQAaQOGdVJAnT8WyOVsCzv1P Xh1UMbjTRh5u7YyjOzvs1aS0DKyCeU7qrwisLhmCImiljWvKbcYCgHJdZ5W+pMx+yl6yyyswc jwWc3qRiijaWC/w6LibDQV9lFE2gNLAHsSt4I1Pve6dAFEsjvou5jFc/5FaZ5gKEoIecszAPo LY+9YqEkoHKv0xQE0mFEOJ4PcoLbElthSjLJvHNHjs67qbLaDMqKJY4HoKDfINkStXflNUA9x wYgZ4xtpXiZsIbvqlLiIh0IQ4WbliyL6w1cMwMnu+kBijHehvaHllXRUzGkhDUPS8iyLXn7hs TBkTyB7R10ElI1+Q X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:126246 Archived-At: When using the "%b" substitution in frame-title-format (the default value includes this when there are multiple frames), the user would expect the name of the buffer that they are editing to be shown. This happens, but when going to the minibuffer for any sort of prompt the title changes to the buffer name of the minibuffer - "*Minibuf-0*" or similar. This may be what is happening internally, but it is an implementation detail which does not need to be revealed. The user might wonder why the window title is changing just because they are being prompted for some information. Applying the following patch corrects this. If the selected window is a minibuffer window, it evaluates the format string in the buffer of the minibuffer-selected-window instead of the buffer of the minibuffer. With this patch, the frame title stays the same as before when being prompted in the minibuffer. --- emacs-24.5/src/xdisp.c.orig 2015-04-02 08:23:06.000000000 +0100 +++ emacs-24.5/src/xdisp.c 2016-11-22 11:29:13.978385207 +0000 @@ -11612,6 +11612,7 @@ { /* Do we have more than one visible frame on this X display? */ Lisp_Object tail, other_frame, fmt; + Lisp_Object this_window; ptrdiff_t title_start; char *title; ptrdiff_t len; @@ -11640,9 +11641,17 @@ format_mode_line_unwind_data (f, current_buffer, selected_window, 0)); - Fselect_window (f->selected_window, Qt); + this_window = f->selected_window; + if ( MINI_WINDOW_P (XWINDOW (this_window))) + { + Lisp_Object original_window = Fminibuffer_selected_window (); + if (!NILP (original_window)) + this_window = original_window; + } + Fselect_window (this_window, Qt); + set_buffer_internal_1 - (XBUFFER (XWINDOW (f->selected_window)->contents)); + (XBUFFER (XWINDOW (this_window)->contents)); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; mode_line_target = MODE_LINE_TITLE; In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.31) of 2016-11-22 on keelhaul Windowing system distributor `The X.Org Foundation', version 11.0.11804000 Configured using: `configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/emacs-24.5-r3 --htmldir=/usr/share/doc/emacs-24.5-r3/html --libdir=/usr/lib64 --program-suffix=-emacs-24 --infodir=/usr/share/info/emacs-24 --localstatedir=/var --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp --with-gameuser=:gamestat --without-compress-install --with-file-notification=inotify --enable-acl --without-dbus --without-gpm --without-hesiod --without-kerberos --without-kerberos5 --with-xml2 --without-selinux --with-gnutls --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns --without-gconf --without-gsettings --with-toolkit-scroll-bars --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm --with-imagemagick --with-xft --without-libotf --without-m17n-flt --with-x-toolkit=gtk2 GENTOO_PACKAGE=app-editors/emacs-24.5-r3 'CFLAGS=-O2 -march=native -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed'' Important settings: value of $EMACSLOADPATH: /usr/local/lib/xemacs/local: value of $LC_COLLATE: C value of $LC_MONETARY: en_GB.UTF-8 value of $LC_TIME: C value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: asi-indent-mode: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t transient-mark-mode: t Recent messages: byte-code: End of buffer [2 times] byte-code: Beginning of buffer [2 times] Saving /home/jjm/.newsrc... Saving file /home/jjm/.newsrc... Wrote /home/jjm/.newsrc Saving /home/jjm/.newsrc...done Saving /home/jjm/.newsrc.eld... Saving file /home/jjm/.newsrc.eld... Wrote /home/jjm/.newsrc.eld Saving /home/jjm/.newsrc.eld...done End of buffer [2 times] Load-path shadows: /usr/local/lib/xemacs/local/site-start hides /etc/emacs/site-start Features: (shadow sort mail-extr warnings emacsbug sendmail gnus-topic utf-7 nndraft nnmh nnimap parse-time utf7 nnfolder gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig gnus-cache gnus-sum netrc gnutls network-stream starttls tls nntp gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader mail-utils wid-edit pp server sunkbd redo+ paren browse-url paren-xe blink-paren buffer-frame frame-select auto-set-indent sourcepair url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra cl-loaddefs cl-lib cconv eieio-core gnus-util mm-util mail-prsvr password-cache url-vars mailcap compile comint ansi-color ring sgml-mode psgml easymenu datetrack edj site-gentoo gnu-compat advice help-fns time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process inotify dynamic-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 173555 13977) (symbols 48 28250 0) (miscs 40 110 146) (strings 32 39827 6642) (string-bytes 1 1298501) (vectors 16 20550) (vector-slots 8 511832 8105) (floats 8 233 332) (intervals 56 295 0) (buffers 960 19) (heap 1024 40082 5871))