all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: 34749@debbugs.gnu.org
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)	[thread overview]
Message-ID: <6aae54ec-85bf-4447-bec0-7c916caeb2f8@default> (raw)
In-Reply-To: <<83o96lacf8.fsf@gnu.org>>

> > 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).
> 
> 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.
 
> > 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.
> 
> 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.





       reply	other threads:[~2019-03-08 16:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<b375da42-2b65-4579-902c-85e9fdcaeac7@default>
     [not found] ` <<83o96lacf8.fsf@gnu.org>
2019-03-08 16:34   ` Drew Adams [this message]
2019-03-08 17:00     ` bug#34749: 26.1; `delete-windows-on': (1) doc, (2) bug, (3) bug, (4) candidates Eli Zaretskii
     [not found] ` <<5C7E4BAB.3050508@gmx.at>
     [not found]   ` <<83mum5accd.fsf@gnu.org>
     [not found]     ` <<5C824BAC.4090907@gmx.at>
     [not found]       ` <<83lg1pa4oa.fsf@gnu.org>
     [not found]         ` <<5C82B9E1.1080302@gmx.at>
     [not found]           ` <<83zhq587g6.fsf@gnu.org>
     [not found]             ` <<5C837BD6.9010200@gmx.at>
     [not found]               ` <<83ef7g8gbc.fsf@gnu.org>
     [not found]                 ` <<5C83BC9B.5020803@gmx.at>
     [not found]                   ` <<e0b90f9b-2d1f-4877-b83a-aeca5425dbea@default>
     [not found]                     ` <<8336nw807g.fsf@gnu.org>
2019-03-09 17:35                       ` Drew Adams
2019-03-09 18:12                         ` Eli Zaretskii
     [not found] <<<<b375da42-2b65-4579-902c-85e9fdcaeac7@default>
     [not found] ` <<<<83o96lacf8.fsf@gnu.org>
     [not found]   ` <<<6aae54ec-85bf-4447-bec0-7c916caeb2f8@default>
     [not found]     ` <<<83a7i59u85.fsf@gnu.org>
     [not found]       ` <<a1314708-0feb-4092-8b60-37d7282a328f@default>
     [not found]         ` <<834l8d9orm.fsf@gnu.org>
2019-03-08 19:48           ` Drew Adams
2019-03-08 20:14             ` Eli Zaretskii
     [not found] <<<b375da42-2b65-4579-902c-85e9fdcaeac7@default>
     [not found] ` <<<83o96lacf8.fsf@gnu.org>
     [not found]   ` <<6aae54ec-85bf-4447-bec0-7c916caeb2f8@default>
     [not found]     ` <<83a7i59u85.fsf@gnu.org>
2019-03-08 17:14       ` Drew Adams
2019-03-08 18:58         ` Eli Zaretskii
     [not found] ` <<<5C7E4BAB.3050508@gmx.at>
     [not found]   ` <<<83mum5accd.fsf@gnu.org>
     [not found]     ` <<<5C824BAC.4090907@gmx.at>
     [not found]       ` <<<83lg1pa4oa.fsf@gnu.org>
     [not found]         ` <<<5C82B9E1.1080302@gmx.at>
     [not found]           ` <<<83zhq587g6.fsf@gnu.org>
     [not found]             ` <<<5C837BD6.9010200@gmx.at>
     [not found]               ` <<<83ef7g8gbc.fsf@gnu.org>
     [not found]                 ` <<<5C83BC9B.5020803@gmx.at>
     [not found]                   ` <<<e0b90f9b-2d1f-4877-b83a-aeca5425dbea@default>
     [not found]                     ` <<<8336nw807g.fsf@gnu.org>
     [not found]                       ` <<dd8e2b24-ab4a-4a4c-b9b8-9249f9ec035b@default>
     [not found]                         ` <<83sgvv7w99.fsf@gnu.org>
2019-03-09 22:32                           ` Drew Adams
2019-03-04 16:25 Drew Adams
2019-03-05 10:12 ` martin rudalics
2019-03-08 10:29   ` Eli Zaretskii
2019-03-08 11:02     ` martin rudalics
2019-03-08 13:15       ` Eli Zaretskii
2019-03-08 18:52         ` martin rudalics
2019-03-08 19:45           ` Drew Adams
2019-03-09  8:39             ` martin rudalics
2019-03-09 16:37               ` Drew Adams
2019-03-08 19:58           ` Eli Zaretskii
2019-03-09  8:39             ` martin rudalics
2019-03-09 10:58               ` Eli Zaretskii
2019-03-09 13:16                 ` martin rudalics
2019-03-09 16:33                   ` Drew Adams
2019-03-09 16:46                     ` Eli Zaretskii
2019-03-10  8:46                     ` martin rudalics
2019-03-10  8:48                 ` martin rudalics
2019-03-08 10:27 ` Eli Zaretskii
2022-04-26 12:32 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6aae54ec-85bf-4447-bec0-7c916caeb2f8@default \
    --to=drew.adams@oracle.com \
    --cc=34749@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.