From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#34749: 26.1; `delete-windows-on': (1) doc, (2) bug, (3) bug, (4) candidates Date: Fri, 8 Mar 2019 08:34:05 -0800 (PST) Message-ID: <6aae54ec-85bf-4447-bec0-7c916caeb2f8@default> References: <> <<83o96lacf8.fsf@gnu.org>> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="115215"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34749@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 08 17:35:24 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2ISx-000Tlw-On for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2019 17:35:24 +0100 Original-Received: from localhost ([127.0.0.1]:46588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2ISw-0005zS-MS for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2019 11:35:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2ISf-0005vg-V3 for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 11:35:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2ISd-00050K-Dc for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 11:35:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2ISc-0004zn-Pr for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 11:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h2ISc-0005Jh-Ge for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 11:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2019 16:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34749 X-GNU-PR-Package: emacs Original-Received: via spool by 34749-submit@debbugs.gnu.org id=B34749.155206285820351 (code B ref 34749); Fri, 08 Mar 2019 16:35:02 +0000 Original-Received: (at 34749) by debbugs.gnu.org; 8 Mar 2019 16:34:18 +0000 Original-Received: from localhost ([127.0.0.1]:36587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2IRt-0005I8-1Q for submit@debbugs.gnu.org; Fri, 08 Mar 2019 11:34:18 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:37786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2IRq-0005Hp-D1 for 34749@debbugs.gnu.org; Fri, 08 Mar 2019 11:34:15 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x28GXTUI114677; Fri, 8 Mar 2019 16:34:08 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-2018-07-02; bh=Tm+KyWTZLASV3o6rw78x0VuJ/xbhZs/+Va3wZ2MeqIo=; b=EmpUbSuympRbt1W0XaJ93xiqk4DGHDv8RdccUkpWTu6V2p/h6KHxRyZjZskdd8ZK/Vm4 LxNq46FIDCBzMjpELkh5vdtwbYlO+MoQhY+MyvM5b/rNvnwnMT8TKLenFo23D+uRKe70 e/BwBHfcJz2F6npNBuipXmOzf9KMu50qNiGZqmhZDCbKIquc2V3ljxRH6P/Jr7t7K+e6 kqb8iOich9tRIKOeurXtPcjhtjqbqu7ntvys6tYdMBfB47mb51hEPm+j714FcoLob+EU 7AjruIqCeAOKmFH79V48FR5NfuZ+5dO/KW5mWuXAGgVX368RXVtPblAlbw/07riXs1cg qQ== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2qyh8us88t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Mar 2019 16:34:08 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x28GY7NU001000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Mar 2019 16:34:07 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x28GY6ZA028590; Fri, 8 Mar 2019 16:34:06 GMT In-Reply-To: <<83o96lacf8.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9189 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903080115 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:156149 Archived-At: > > 1. The doc string should first of all completely describe the > > interactive behavior and only secondarily describe the Lisp behavior > > (completely). > > > > In particular, this doc string should say explicitly what happens with = a > > prefix arg, including what happens with different kinds of raw prefix > > arg (including, but not limited to, 0). >=20 > I fixed this, although not regarding the order. the doc string is not > too long, so interspersing the description of interactive behavior > with non-interactive is not a catastrophe. Thank you. Agreed. By "first of all" and "only secondarily" I meant importance more than order. I meant that for a command the interactive use is more important to document (but both are important). (And yes, it is typically presented first, but that's not imperative, and yes, sometimes it makes more sense to intersperse interactive and non.) > Btw, it is a pity that only the prefix arg of zero is useful in > interactive usage, which doesn't let the user select the other > behaviors regarding the optional FRAME argument. I think this > could/should be improved by relatively straightforward changes that > use values of prefix arg other than zero. Both you and Martin have now opened a discussion about possible improvements to the command/function behavior. I agree that it could be improved. And I agree with you that discussion of that should probably happen outside this bug thread. _____ Nevertheless and FWIW (toward that discussion): I've long (since 1996) had my own version of `delete-windows-on', which differs in the following ways. My version is not completely up-to-date wrt the latest vanilla implementation, but the changes I've made are still relevant, I think. Here is the code comment that summarizes my changes: ;; REPLACES ORIGINAL in `window.el' (built-in prior to Emacs 24.5): ;; ;; 1) Use `read-buffer' in interactive spec. ;; 2) Do not raise an error if BUFFER is a string that ;; does not name a buffer. ;; 3) Call `delete-window', so if you use the advised ;; `delete-window' here then this also deletes frames ;; where window showing the BUFFER is the only window. #3 refers to my advised version of `delete-window', which does just `delete-frame' if WINDOW is the only one in its frame. My code is in `frame-cmds.el': https://www.emacswiki.org/emacs/download/frame-cmds.el I also have this related command there, FWIW (since 2006), which, for my personal use, I bind to the keys that are normally bound to `delete-window': (defun delete-windows-for (&optional buffer) "`delete-window' or prompt for buffer and delete its windows. With no prefix arg, delete the selected window. With a prefix arg, prompt for a buffer and delete all windows, on any frame, that show that buffer." (interactive (list (and current-prefix-arg (frcmds-read-buffer-for-delete-windows)))) (if buffer (delete-windows-on buffer) (delete-window))) Function `frcmds-read-buffer-for-delete-windows' is used by both `delete-windows-on' and `delete-windows-for'. It offers only displayed buffers as completion candidates. =20 > > The doc string should also say that a prefix arg is ignored when the > > condition of the last paragraph applies (dedicated window alone in > > frame, with other frames existing), if that's true. >=20 > I didn't understand what this alludes to. It refers to this behavior described in the current doc string: When a window showing BUFFER-OR-NAME is dedicated and the only window of its frame, that frame is deleted when there are other frames left. I was saying that the doc string should also mention that in this case any prefix arg you provide is ignored.