From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: =?utf-8?Q?Re=3A_Customize_=E2=80=98window-state-get/put=E2=80=99?= Date: Sun, 13 Oct 2019 23:39:06 -0400 Message-ID: <0037B8CB-A95F-4720-BCFA-CED72AB94107@gmail.com> References: <87sgo4kyfp.fsf@mail.linkov.net> <87lfttbo70.fsf@mail.linkov.net> <874l0gqna8.fsf@mail.linkov.net> <877e59bs04.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="20469"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 14 05:40:08 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iJrDM-0005Em-9X for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2019 05:40:08 +0200 Original-Received: from localhost ([::1]:44240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJrDK-0003Hw-P8 for ged-emacs-devel@m.gmane.org; Sun, 13 Oct 2019 23:40:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49018) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJrCU-0002ys-F7 for emacs-devel@gnu.org; Sun, 13 Oct 2019 23:39:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJrCT-0005vL-Ex for emacs-devel@gnu.org; Sun, 13 Oct 2019 23:39:14 -0400 Original-Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:38425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJrCS-0005pv-BH for emacs-devel@gnu.org; Sun, 13 Oct 2019 23:39:13 -0400 Original-Received: by mail-qt1-x830.google.com with SMTP id j31so23508896qta.5 for ; Sun, 13 Oct 2019 20:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b66B2NF93/TsBSBEj1HmKKcfWxG82tGWX8N67rHhk/I=; b=mFfr0jpckbfN9463ey/e0uC8xxnVq1Q1eYzi/QIezTcr40y9TOC2eePc0XyuwAgiVp qHnG7KhXJHUBt6IASm3BEm07C+FkGhHnH0wIFDjKTUHy0DmA+kSQL2C+J7OIAqpX/mJV SMsjIg+9WL5L6rRWhQ+fm5YGCgTcA0VVzmfXxJnfloNi97PxOjJdiY+14wmrVqXKiRAd z+nnh1gfzn5J5WalsoBeeoD43U/g3j6fI6KQqBTQx5t7QU6DtHN4AVggfra6eqWXbqo2 8Y0IlZkPYZ89/MB1UXiZVp1jIzLDIhzyJbYrvplCaHJICYXpnPBeliAxp4P/+hV764ob qgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b66B2NF93/TsBSBEj1HmKKcfWxG82tGWX8N67rHhk/I=; b=Uo8NyvAwxTBRFxRdeB9qU6e+VnS1tg4lGA4VLvOr+tIk9bwr3H25skriiC+ULma/gF UfSwOuhYYv2UuloU5iXL91rjcHemBuIkNkJbzHo1ES3odlE7hODlxrCrHm0w9oE/bHnk jpcULpSR3zs+Dp+sKU8KjgJ2mZlEXAqGWURBzed3WqH/EqBeGUVIfJSTtvhk/5f4ZtUF Khzct6x2HPOiCGm+lFBHxoKM7s2mi2dJ1HYtQbTx6eMvvg9miErHwpZ+IhKWucXbW8Pn fYH7rnJ8BiGfpuzD4tmDMruZ5l7xm+ljsVrMemw7k0Gd1912yENy7rMI/VuZsJm5XkKo RHRQ== X-Gm-Message-State: APjAAAWAegR6E3NL52zrKJJYxARPe3EmcyUONeWl+5Z/tZyZr0AqfWVI kgYx4XenIbL3xdjTn2v4wrue5vJKcd3KdA== X-Google-Smtp-Source: APXvYqzpOmWIK+MUBm6p/QDe7fpI6YFznpWNjLL2kyZ0Olh9I57xUCO0s2A1s1daPFe0JytyCoVD3A== X-Received: by 2002:ac8:290f:: with SMTP id y15mr31390656qty.181.1571024351188; Sun, 13 Oct 2019 20:39:11 -0700 (PDT) Original-Received: from [192.168.1.5] (c-71-207-8-160.hsd1.pa.comcast.net. [71.207.8.160]) by smtp.gmail.com with ESMTPSA id w131sm8013082qka.85.2019.10.13.20.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Oct 2019 20:39:10 -0700 (PDT) In-Reply-To: <877e59bs04.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3594.4.19) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::830 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240996 Archived-At: > 2. before calling window-state-put create these buffers with the > saved buffer names, so window-state-put will restore windows with = the > same buffer names. What I did is restore these buffer /after/ window-state-put. Because the = information I needed is stored in window parameters. >=20 >> I go through each window and replace the buffers in them with >> placeholder buffers and store the buffer type (breakpoint, register, >> etc) in a window parameter. >=20 > By placeholder do you mean some default text contents to show when > tmp buffer is not restored? Something like =E2=80=9Ctmp buffer was = here=E2=80=9D. I mean a dummy buffer for window-state-get to save. This buffer is not = visible to the user in theory: I create it and put it in every window = and call window-state-get, then swap back buffers and remove this = placeholder. Then before window-state-put create this buffer, and = window-state-put will put it in every window. Once I restored every = windows=E2=80=99 buffer from their window parameter, I can kill the = placeholder. The sole purpose of the placeholder is for = window-state-get/put to have /something/ to save/display. Yuan=