unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: emacs-devel <emacs-devel@gnu.org>
Subject: delete-other-frames
Date: Tue, 23 Aug 2016 10:19:59 +0200	[thread overview]
Message-ID: <57BC072F.9070704@gmx.at> (raw)

I'd like to fix two issues with ‘delete-other-frames’ but am yet
undecided on how to do that.

(1) With emacs -Q step by step evaluate the following forms:

(setq less (make-frame '((minibuffer . nil))))
(setq normal (make-frame))
(delete-other-frames normal)

This gets me:

Debugger entered--Lisp error: (error "Attempt to delete a surrogate minibuffer frame")
   delete-frame(#<frame *scratch* 01bb1090>)
   delete-other-frames(#<frame *scratch* 050f4a30>)
   eval((delete-other-frames normal) nil)
   elisp--eval-last-sexp(nil)
   eval-last-sexp(nil)
   funcall-interactively(eval-last-sexp nil)
   call-interactively(eval-last-sexp nil nil)
   command-execute(eval-last-sexp)

The problematic code in ‘delete-other-frames’ is this:

     ;; Delete mon-minibuffer-only frames first, because `delete-frame'
     ;; signals an error when trying to delete a mini-frame that's
     ;; still in use by another frame.
     (dolist (frame frames)
       (unless (eq (frame-parameter frame 'minibuffer) 'only)
	(delete-frame frame)))

Here we try to delete all frames whose `minibuffer' parameter is not
`only'.  However, the minibuffer window of a minibuffer-less frame might
be on a _normal_ frame as in our example: The minibuffer window of the
frame ‘less’ is owned by the initial frame and ‘delete-other-frames’
tries to delete that frame before ‘less’, resulting in the error cited
above.

Should we document the current behavior in the doc-string or should we
amend the code?

(2) The doc-string says "Delete all frames on the current terminal,
except FRAME."  IIUC this doesn't make much sense when FRAME is not on
the current terminal.  In that case, ‘delete-other-frames’ will delete
all frames on the current terminal and leave the frames on FRAME's
terminal alone.  In order to delete all other frames on FRAME's terminal
one has to make that terminal current first.  If that is the desired
behavior, we should mention it in the doc-string.  Otherwise, we should
delete all other frames on FRAME's terminal.

Thanks for suggestions, martin




             reply	other threads:[~2016-08-23  8:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23  8:19 martin rudalics [this message]
2016-08-23 14:09 ` delete-other-frames Eli Zaretskii
2016-08-23 17:56   ` delete-other-frames Richard Copley
2016-08-23 18:31     ` delete-other-frames Eli Zaretskii
2016-08-23 19:55       ` delete-other-frames Richard Copley
2016-08-24  9:07     ` delete-other-frames martin rudalics
2016-08-24  9:06   ` delete-other-frames martin rudalics
2016-08-25  9:16     ` delete-other-frames martin rudalics
2016-08-25 14:46       ` delete-other-frames Eli Zaretskii
2016-08-27  1:32         ` delete-other-frames Richard Stallman
2016-08-27  7:40           ` delete-other-frames Eli Zaretskii
     [not found]         ` <<E1bdSUT-00059T-8W@fencepost.gnu.org>
2016-08-27  6:31           ` delete-other-frames Drew Adams
2016-08-27  7:45             ` delete-other-frames Eli Zaretskii
2016-08-27 21:45             ` delete-other-frames Richard Stallman
     [not found]           ` <<49a2a9c7-8573-4f07-897f-3eb444679d8a@default>
     [not found]             ` <<E1bdlPn-0005Ch-I4@fencepost.gnu.org>
2016-08-28  0:41               ` delete-other-frames Drew Adams
     [not found] <<<57BC072F.9070704@gmx.at>
     [not found] <<57BC072F.9070704@gmx.at>

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=57BC072F.9070704@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).