From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail
From: Drew Adams <drew.adams@oracle.com>
Newsgroups: gmane.emacs.devel
Subject: RE: Quit and Close Emacs Special Windows
Date: Mon, 29 Jun 2020 17:00:01 +0000 (UTC)
Message-ID: <f9f1c135-5cc7-4e45-9c4c-8f332f8db4f3@default>
References: <87ftaej5pp.fsf.ref@ergus.i-did-not-set--mail-host-address--so-tickle-me>
 <87ftaej5pp.fsf@ergus.i-did-not-set--mail-host-address--so-tickle-me>
 <3c578050-2a23-411e-bad0-c26a7c7ed5ee@default>
 <20200629164524.y74lx5xgdomfj25b@ergus>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202";
	logging-data="27106"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: emacs-devel@gnu.org
To: Ergus <spacibba@aol.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 29 19:01:03 2020
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1jpx9S-0006zr-TK
	for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 19:01:03 +0200
Original-Received: from localhost ([::1]:49398 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1jpx9R-000096-N1
	for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 13:01:01 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60556)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <drew.adams@oracle.com>)
 id 1jpx8c-0007m6-H9
 for emacs-devel@gnu.org; Mon, 29 Jun 2020 13:00:10 -0400
Original-Received: from userp2120.oracle.com ([156.151.31.85]:34818)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <drew.adams@oracle.com>)
 id 1jpx8a-0002FV-4K
 for emacs-devel@gnu.org; Mon, 29 Jun 2020 13:00:09 -0400
Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
 by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05TGw63D088363;
 Mon, 29 Jun 2020 17:00:04 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29;
 bh=If7J9g8fyzLH7kMPZ2b4YoFpEKW8qO0pfSxcvijv/+s=;
 b=QsJIdXOYrSd87YJbKAu4tmmd1TNq7uu8B+G00JucPuBNDFTQKpiUo5anEWuOwgh8keDU
 tps2HN8kAufI7GBCtPLLlWId7eWZh72wrida8lJ1G2eyNbM6bGhHPv2Q0uqvVraRuHl1
 6kt9ZYHiHvUneReTjcxOG+ULF/wSttXstoITNamhAS3LL/An1zF8tbaIWPl2yS0KtAD5
 01ASVCuhT5vGCgteRXOs1K2XuEHxn4QiV1oaEB7I/c1Q5B2BBqS8j77mdK9he4PRa/HO
 QSnm4tvRKhKC3/2rosXg39SrnZ6aDHLQPYHA6EWBDZbliFBHEM+wYTPeKEDJmhxrc3X+ EQ== 
Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79])
 by userp2120.oracle.com with ESMTP id 31wxrmymhv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL);
 Mon, 29 Jun 2020 17:00:03 +0000
Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1])
 by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05TGwUFb009041;
 Mon, 29 Jun 2020 17:00:03 GMT
Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by userp3020.oracle.com with ESMTP id 31xfvr1q33-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 29 Jun 2020 17:00:03 +0000
Original-Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 05TH02wp016116;
 Mon, 29 Jun 2020 17:00:02 GMT
In-Reply-To: <20200629164524.y74lx5xgdomfj25b@ergus>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.5017.0 (x86)]
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9667
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 spamscore=0
 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000
 definitions=main-2006290109
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9667
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0
 mlxlogscore=999
 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015
 malwarescore=0 phishscore=0 adultscore=0 cotscore=-2147483648
 lowpriorityscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0
 reason=mlx scancount=1 engine=8.12.0-2004280000
 definitions=main-2006290109
Received-SPF: pass client-ip=156.151.31.85; envelope-from=drew.adams@oracle.com;
 helo=userp2120.oracle.com
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 13:00:06
X-ACL-Warn: Detected OS   = Linux 3.1-3.10 [fuzzy]
X-Spam_score_int: -63
X-Spam_score: -6.4
X-Spam_bar: ------
X-Spam_report: (-6.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:252570
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/252570>

Hi Ergus

> >FWIW, I do this:
> >
> >(defun quit-window-delete (&optional kill window)
> >  "Quit WINDOW, deleting it, and bury its buffer.
> >WINDOW must be a live window and defaults to the selected one.
> >With prefix argument KILL non-nil, kill the buffer instead of
> >burying it.
> >
> >This is similar to the version of `quit-window' that Emacs had before
> >the introduction of `quit-restore-window'.  It ignores the information
> >stored in WINDOW's `quit-restore' window parameter.
> >
> >It deletes the WINDOW more often, rather than switching to another
> >buffer in it.  If WINDOW is alone in its frame then the frame is
> >deleted or iconified, according to option `frame-auto-hide-function'."
> >  (interactive "P")
> >  (set-window-parameter
> >    window 'quit-restore `(frame frame nil ,(current-buffer)))
> >  (quit-restore-window window (if kill 'kill 'bury)))
> >
> >(global-set-key [remap quit-window] 'quit-window-delete)
> >
> >I also use dedicated windows for buffers with names `*...*',
> >and I make frame "hiding" delete frames rather than iconify.
> >
> >(setq special-display-regexps '("[ ]?[*][^*]+[*]"))
> >(setq frame-auto-hide-function 'delete-frame)
>
>
> 1) Should we provide a custom variable to conditionally enable the
> set-window-parameter part of your code within quit-window?
>=20
> 2) I am not very trained in lisp, so I must ask if you think that
> this changes is general enough for all the buffers like: Help,
> man, Compile, magit etc?? and won't conflict with others?
>=20
> if 1 && 2): as this is your code, could you please add the
> changes if nobody has any concern about it?

No idea; sorry.  I'm just saying what I do.

The definition of `quit-window-delete' that I use
has this comment:

 ;; Candidate as a replacement for `quit-window',
 ;; at least when used interactively.  For example:
 ;; (define-key global-map [remap quit-window] 'quit-window-delete)
 ;;
 ;; Thanks to Martin Rudalics for suggestions.

Someone else will need to make changes to Emacs, if
such is decided.

The things I mentioned don't necessarily belong
together for others.  For me they make sense together.

For example, making buffers `*...*' special-display
is unrelated to quitting help buffers with `q'.

But for me it makes sense.  I show all such buffers
in their own dedicated window (frame, in fact), and
when I use `q' to quit the buffer I want to delete
the frame.  I imagine that at least some others won't
want such behavior.

Do I think that it would be good to have a simple way
to get `q' to delete the window?  Yes.  Do I think it
would be good to have a simple way for `q' to delete
a one-window frame?  Yes.  But someone else will need
to think about and decide whether that's helpful in
general and, if so, what's the best way to offer it.