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 15:09:59 +0000 (UTC)
Message-ID: <3c578050-2a23-411e-bad0-c26a7c7ed5ee@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>
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="66668"; mail-complaints-to="usenet@ciao.gmane.io"
To: Ergus <spacibba@aol.com>, emacs-devel@gnu.org
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 29 17:11:30 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 1jpvRR-000HE7-Av
	for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 17:11:29 +0200
Original-Received: from localhost ([::1]:37574 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 1jpvRQ-0007R7-CO
	for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 11:11:28 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57172)
 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 1jpvQ9-0006et-L8
 for emacs-devel@gnu.org; Mon, 29 Jun 2020 11:10:09 -0400
Original-Received: from aserp2120.oracle.com ([141.146.126.78]:49432)
 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 1jpvQ7-0006ia-8r
 for emacs-devel@gnu.org; Mon, 29 Jun 2020 11:10:09 -0400
Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05TF8At9107674;
 Mon, 29 Jun 2020 15:10:01 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29;
 bh=Zqtrmj2t0M4lHW8XQQc2DZF9ATrSNTKSVUeKKYizmeI=;
 b=nN3yAMjWIrOu+9R33jFcafQWpTKrIW2mXynBiZHqQk6yS/TQ0dmSbsN1j0PWh3C2eyZE
 XPzxda7B7DUjYvrP1B3d9newg0dVu53B/oOt41dZELSy18gmVEp6phPQV4e67F0UgzJY
 k7ou/ZS50JWc8z6++dte8eI3ROv5SjonBWZgi327WAMyRkURkweeE13DuhLc3D4kDn98
 cekwCfTL9plsh/JWvflXCTtOZithHgKPExkx6y4btWIsLt1iqNDtzYSMRNfHExRYy6r8
 kqV6VP+cR7IF9LX/fkBZng5lvqlyJdkW2SR6DVPmlomaBjdzTV/FiIPWHtMOqr+maD2Z QQ== 
Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70])
 by aserp2120.oracle.com with ESMTP id 31xx1dkwcg-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL);
 Mon, 29 Jun 2020 15:10:01 +0000
Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1])
 by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05TF8emx006606;
 Mon, 29 Jun 2020 15:10:00 GMT
Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by aserp3020.oracle.com with ESMTP id 31xg10m0sy-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 29 Jun 2020 15:10:00 +0000
Original-Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26])
 by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 05TF9xrN005360;
 Mon, 29 Jun 2020 15:10:00 GMT
In-Reply-To: <87ftaej5pp.fsf@ergus.i-did-not-set--mail-host-address--so-tickle-me>
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 spamscore=0
 malwarescore=0
 mlxlogscore=999 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0
 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2004280000 definitions=main-2006290103
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9667
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 clxscore=1015 adultscore=0
 suspectscore=0 mlxlogscore=999 cotscore=-2147483648 lowpriorityscore=0
 malwarescore=0 phishscore=0 impostorscore=0 mlxscore=0 spamscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2004280000 definitions=main-2006290103
Received-SPF: pass client-ip=141.146.126.78;
 envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 11:10:03
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, URIBL_BLOCKED=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:252567
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/252567>

> I have been reading this site:
>=20
> https://urldefense.com/v3/__https://christiantietze.de/posts/2019/10/emac=
s-
> quit-special-
> windows/__;!!GqivPVa7Brio!MYwcdeIdWpFMGgsvTIkt5Vbrg69dFCUgHqpfuyAyObkHKL7=
IAog
> HWMmQFaH3DjBy$
>=20
> and I am wondering why we don't provide an option to enable this
> behaviour by default in some cases without needing the "hack" in the
> link. It doesn't seems to be too complex to implement right?
>=20
> I know it is just a detail, but in some cases (like when using man or
> compile mode, or reading a function documentation, or after executing
> magit commands) it doesn't make sense to keep the buffer in the buffer
> list after pressing q in 90% of the times.
>=20
> Could we consider to add this as (for example) an option to enable it by
> default OR add a customisable list with the modes where the user could
> desire to have this behaviour?

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)