From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.bugs Subject: bug#20848: 24.5; window-state-put fails when strongly dedicated windows are involved Date: Fri, 19 Jun 2015 14:20:51 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c38a2270562a0518ddf414 X-Trace: ger.gmane.org 1434716553 28142 80.91.229.3 (19 Jun 2015 12:22:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Jun 2015 12:22:33 +0000 (UTC) To: 20848@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 19 14:22:23 2015 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 1Z5vJB-0002gN-U8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jun 2015 14:22:10 +0200 Original-Received: from localhost ([::1]:57769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vJA-0006ud-S6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jun 2015 08:22:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vJ6-0006uY-Hg for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5vJ4-0007Mo-Gn for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:22:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vJ4-0007Mg-D7 for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z5vJ4-0003bX-3V for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jun 2015 12:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20848 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.143471647213787 (code B ref -1); Fri, 19 Jun 2015 12:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jun 2015 12:21:12 +0000 Original-Received: from localhost ([127.0.0.1]:51680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5vID-0003aH-VW for submit@debbugs.gnu.org; Fri, 19 Jun 2015 08:21:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51563) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5vI9-0003ZY-Lp for submit@debbugs.gnu.org; Fri, 19 Jun 2015 08:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5vI1-000715-W8 for submit@debbugs.gnu.org; Fri, 19 Jun 2015 08:20:59 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vI1-00070z-T6 for submit@debbugs.gnu.org; Fri, 19 Jun 2015 08:20:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vI0-0006iF-2X for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:20:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5vHx-0006zV-DF for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:20:55 -0400 Original-Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:34458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vHx-0006zG-2M for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 08:20:53 -0400 Original-Received: by wicnd19 with SMTP id nd19so17427171wic.1 for ; Fri, 19 Jun 2015 05:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=3tzXxUUrpmO8366+EXtLhqEOwld0V6Ku5We4TQjwgUA=; b=bDfZsYlTZLMvSyI8hTlE7XSiIEVUaiEfdXo6GdpqfBgbYHIKscq6sMrYZlizkKxOm9 PY+1MXh91pmUWvZedk6f6na8xgv+ei4M93ZkbdGJKAQhYjDNsvAp7KqQ1dsRyxYtCz/x VlcqOu9G+tNxJNBsiZZGCvMhZWNfYmwEibJ9pD4Nw+MEsDqy4njMxMYRknO/nFa0PWrf WOo5y6ADP4WrTkh4tT+2zXaaSpZTPHXKeK35mr8+Ai13vpwlEkh2R2/Z8NIBBN3y+v65 H48F4uWiBINH0cCjZtDnQX5HbDzdFaPYsMbAQ2437hhsqPPFQQm3WlvlwHafbLbDQrxT eSAA== X-Received: by 10.180.206.229 with SMTP id lr5mr6208736wic.86.1434716451393; Fri, 19 Jun 2015 05:20:51 -0700 (PDT) Original-Received: by 10.28.225.66 with HTTP; Fri, 19 Jun 2015 05:20:51 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:104118 Archived-At: --001a11c38a2270562a0518ddf414 Content-Type: text/plain; charset=UTF-8 I've written a package for managing window configurations and switched from using `current-window-configuration' and `set-window-configuration' for their storage to `window-state-get' and `window-state-put' as recommended by the Emacs Lisp manual to have serializable state and the possibility of transforming it in a more elegant manner. Today an user reported to me that the package doesn't work when strongly dedicated buffers are involved. I've refined their reproduction recipe to the following piece of code which can be evaluated from `emacs -Q` in the scratch buffer: (progn (switch-to-buffer "*Messages*") (let ((old-window-config (window-state-get))) (set-window-dedicated-p nil t) (switch-to-buffer-other-window "*scratch*") (window-state-put old-window-config (frame-root-window)))) To get out of this, it's sufficient to use M-: (set-window-dedicated-p nil nil) afterwards. Compare with the following version that doesn't error out: (progn (switch-to-buffer "*Messages*") (let ((old-window-config (current-window-configuration))) (set-window-dedicated-p nil t) (switch-to-buffer-other-window "*scratch*") (set-window-configuration old-window-config))) Is this a bug? If not, is there a way of working around this in a sane fashion (like, not removing the dedication status of the window)? In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2) of 2015-04-20 on bitzer.hoetzel.info Windowing system distributor `The X.Org Foundation', version 11.0.11701000 System Description: Arch Linux Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-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 line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils 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 dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 70995 6884) (symbols 48 17559 0) (miscs 40 35 138) (strings 32 9046 4656) (string-bytes 1 248445) (vectors 16 8907) (vector-slots 8 383084 18361) (floats 8 63 89) (intervals 56 177 6) (buffers 960 11) (heap 1024 48846 939)) --001a11c38a2270562a0518ddf414 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've written a package for managing window configurati= ons and switched
from using `current-window-configuration' and `set-= window-configuration'
for their storage to `window-state-get' an= d `window-state-put' as
recommended by the Emacs Lisp manual to have= serializable state and the
possibility of transforming it in a more ele= gant manner.

Today an user reported to me that the package doesn'= ;t work when strongly
dedicated buffers are involved.=C2=A0 I've ref= ined their reproduction recipe
to the following piece of code which can = be evaluated from `emacs -Q` in
the scratch buffer:

(progn
=C2= =A0 (switch-to-buffer "*Messages*")
=C2=A0 (let ((old-window-c= onfig (window-state-get)))
=C2=A0 =C2=A0 (set-window-dedicated-p nil t)<= br>=C2=A0 =C2=A0 (switch-to-buffer-other-window "*scratch*")
= =C2=A0 =C2=A0 (window-state-put old-window-config (frame-root-window))))
To get out of this, it's sufficient to use M-: (set-window-dedicat= ed-p
nil nil) afterwards.

Compare with the following version that= doesn't error out:

(progn
=C2=A0 (switch-to-buffer "*Me= ssages*")
=C2=A0 (let ((old-window-config (current-window-configura= tion)))
=C2=A0 =C2=A0 (set-window-dedicated-p nil t)
=C2=A0 =C2=A0 (s= witch-to-buffer-other-window "*scratch*")
=C2=A0 =C2=A0 (set-w= indow-configuration old-window-config)))

Is this a bug? If not, is t= here a way of working around this in a sane
fashion (like, not removing = the dedication status of the window)?



In GNU Emacs 24.5.1 (x= 86_64-unknown-linux-gnu, GTK+ Version 3.16.2)
=C2=A0of 2015-04-20 on bitzer.hoetzel.info
Windowing sy= stem distributor `The X.Org Foundation', version 11.0.11701000
Syste= m Description: Arch Linux

Configured using:
=C2=A0`configure --pr= efix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib
=C2=A0--localsta= tedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft
=C2=A0'CFLAGS=3D-mar= ch=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fstack-protector-strong
=C2=A0--= param=3Dssp-buffer-size=3D4' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2
=C2=A0= LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important = settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-sys= tem: utf-8-unix

Major mode: Lisp Interaction

Minor modes in e= ffect:
=C2=A0 tooltip-mode: t
=C2=A0 electric-indent-mode: t
=C2= =A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode:= t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-com= position-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compressi= on-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t
Recent messages:
For information about GNU Emacs and the GNU syste= m, type C-h C-a.

Load-path shadows:
None found.

Features:<= br>(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml=
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
ma= ilabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-uti= l help-fns mail-prsvr mail-utils time-date tooltip electric
uniquify edi= ff-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 r= egister 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-tab= le epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs= button faces cus-face macroexp files
text-properties overlay sha1 md5 b= ase64 format env code-pages mule
custom widget hashtable-print-readable = backquote make-network-process
dbusbind gfilenotify dynamic-setting syst= em-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-t= ty emacs)

Memory information:
((conses 16 70995 6884)
=C2=A0(s= ymbols 48 17559 0)
=C2=A0(miscs 40 35 138)
=C2=A0(strings 32 9046 465= 6)
=C2=A0(string-bytes 1 248445)
=C2=A0(vectors 16 8907)
=C2=A0(ve= ctor-slots 8 383084 18361)
=C2=A0(floats 8 63 89)
=C2=A0(intervals 56= 177 6)
=C2=A0(buffers 960 11)
=C2=A0(heap 1024 48846 939))
--001a11c38a2270562a0518ddf414--