unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* quit-window
@ 2011-10-22 20:43 Christoph Scholtes
  2011-10-23  7:23 ` quit-window Chong Yidong
  2011-10-23  9:20 ` quit-window martin rudalics
  0 siblings, 2 replies; 23+ messages in thread
From: Christoph Scholtes @ 2011-10-22 20:43 UTC (permalink / raw)
  To: emacs-devel

quit-window bound to `q' in a keymap provides a nice, consistent UI for
getting rid of the window and killing/burying its buffer.

However, some modes are inhibiting consistency by wrapping quit-window
in a function, which in most cases performs some kind of cleanup. This
creates inconsistency in the interface since, for example, `C-u q' to
kill the buffer is not available anymore unless the wrapper passes on
the argument to quit-window.

Take for example `info-emacs-manual', which provides `Info-exit' bound
to `q' in its map. `q' will quit the window and bury the buffer, but
`C-u q' will *not* kill the buffer.

I have identified at least 18 modes that do something similar. Maybe
some special case even needs to, but most of the time it could be
cleaned up, IMO.

Also, some of these exit wrappers explicitely restore a previous
window configuration. Doesn't quit-window handle that already?

Finally, if there is mode-specific cleanup to be done, could we provide
a quit-window-hook to connect to so we can eliminate the need for
wrappers?

This would allow a more consistent behavior between the modes. Maybe
it's just me, but often I am surprised as a user by the difference in
behavior of certain commands, especially when it comes to window
manipulation (quit, kill, bury etc.).

Christoph



^ permalink raw reply	[flat|nested] 23+ messages in thread
* quit-window
@ 2007-10-19  9:00 martin rudalics
  0 siblings, 0 replies; 23+ messages in thread
From: martin rudalics @ 2007-10-19  9:00 UTC (permalink / raw)
  To: emacs-devel

The doc-string of `quit-window' says

(defun quit-window (&optional kill window)
   "Quit the current buffer.  Bury it, and maybe delete the selected frame.
\(The frame is deleted if it contains a dedicated window for the buffer.)
With a prefix argument, kill the buffer instead.

Noninteractively, if KILL is non-nil, then kill the current buffer,
otherwise bury it.

If WINDOW is non-nil, it specifies a window; we delete that window,
and the buffer that is killed or buried is the one in that window."

The following parts seem dubious:

- "Quit the current buffer."

   The function is called `quit-window' its doc-string says "quit the
   current buffer".  Since the current buffer is not necessarily the
   buffer displayed in the selected window this sentence is both
   misleading and wrong.

- "Bury it, and maybe delete the selected frame."

   KILL non-nil will kill the buffer, not bury it.  WINDOW non-nil will
   affect WINDOW's frame, not the selected frame.

- "\(The frame is deleted if it contains a dedicated window for the buffer.)"

   Only if there are no other windows on that frame.

- "Noninteractively, if KILL is non-nil, then kill the current buffer,
   otherwise bury it."

   "current buffer" and "bury" are misleading again.

Could someone with a good sense of what's going on in this function
improve that?  Also

       (and (or (window-minibuffer-p) (window-dedicated-p window))

should probably become

       (and (or (window-minibuffer-p window) (window-dedicated-p window))

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2011-10-25 18:55 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-22 20:43 quit-window Christoph Scholtes
2011-10-23  7:23 ` quit-window Chong Yidong
2011-10-23 15:02   ` quit-window Christoph Scholtes
2011-10-23 23:49     ` quit-window Chong Yidong
2011-10-24 16:39     ` quit-window Richard Stallman
2011-10-24 17:18       ` quit-window Eli Zaretskii
2011-10-24 17:40         ` quit-window martin rudalics
2011-10-25 12:19         ` quit-window Richard Stallman
2011-10-25  1:24       ` quit-window Christoph Scholtes
2011-10-25 13:01         ` quit-window martin rudalics
2011-10-25 18:55         ` quit-window Richard Stallman
2011-10-23  9:20 ` quit-window martin rudalics
2011-10-23 13:27   ` quit-window Juri Linkov
2011-10-23 16:04     ` quit-window Christoph Scholtes
2011-10-23 18:58     ` quit-window martin rudalics
2011-10-24  5:12       ` quit-window Juri Linkov
2011-10-25  3:59         ` quit-window Chong Yidong
2011-10-25  4:28           ` quit-window Juri Linkov
2011-10-23 16:01   ` quit-window Christoph Scholtes
2011-10-23 19:00     ` quit-window martin rudalics
2011-10-25  1:00       ` quit-window Christoph Scholtes
2011-10-25 10:04         ` quit-window martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2007-10-19  9:00 quit-window martin rudalics

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