From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Quit and Close Emacs Special Windows Date: Mon, 29 Jun 2020 22:44:07 -0400 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="30719"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Ergus , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 30 04:44:58 2020 Return-path: 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 ) id 1jq6GY-0007rX-Mz for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Jun 2020 04:44:58 +0200 Original-Received: from localhost ([::1]:32948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jq6GX-0002ly-P8 for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 22:44:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jq6Fq-00026P-Ln for emacs-devel@gnu.org; Mon, 29 Jun 2020 22:44:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jq6Fo-0001Nd-Ct for emacs-devel@gnu.org; Mon, 29 Jun 2020 22:44:13 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4F1C880A93; Mon, 29 Jun 2020 22:44:11 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 125EC805E6; Mon, 29 Jun 2020 22:44:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1593485049; bh=+LLuP0PLBHI+p78HyEOGgNIjkAS6Ue+0uholO2qCzG0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jx3NHas6jBhhZhxeD6FsmabtH4hJ/dUSVOT/+milq2ojQmohqW8K4tD5P2b3lBsIu x5sqM/pOzrKo/br9Ta9KVj6UJ+4rsbXwOmu1xYREw7hLMejZ/BsqWzZRif9KEMoJrb E2VJiRE3mLM08+Orr1TVGFvhrxKWHDTdt+n4PtK4S1Reh9o9j6Ql8Dpzpc2ptATgal xZxT9qDZQK9by+wBIBS+o6X1/3CNv6NaN8s98NCVQaXF3nhbL3kuJj77JLmDizR2x4 2ljCK9o4nN6Kws+7jC7FIbj02rlAWo3F+EgnfitwYizibd+PbM0NV2J8F3PZISVdMh 2uVGXyf088kPw== Original-Received: from alfajor (unknown [157.52.0.200]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BFE8A120848; Mon, 29 Jun 2020 22:44:08 -0400 (EDT) In-Reply-To: <3c578050-2a23-411e-bad0-c26a7c7ed5ee@default> (Drew Adams's message of "Mon, 29 Jun 2020 15:09:59 +0000 (UTC)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 22:35:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252577 Archived-At: Hi Drew, What does this have to do with Ergus's message? [ Except that they both mention windows and buffers. ] Stefan Drew Adams [2020-06-29 15:09:59] wrote: >> I have been reading this site: >> >> https://urldefense.com/v3/__https://christiantietze.de/posts/2019/10/emacs- >> quit-special- >> windows/__;!!GqivPVa7Brio!MYwcdeIdWpFMGgsvTIkt5Vbrg69dFCUgHqpfuyAyObkHKL7IAog >> HWMmQFaH3DjBy$ >> >> 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? >> >> 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. >> >> 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)