all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Devel" <emacs-devel@gnu.org>
Cc: rudalics@gmx.at
Subject: view-mode exit hook?
Date: Tue, 18 Dec 2007 11:03:23 -0800	[thread overview]
Message-ID: <DHEEKFAFJEFOJHLCFPFDKEOKCCAA.drew.adams@oracle.com> (raw)

What is the recommended way to run some code when view-mode exits? For
entering view-mode, `view-mode-hook' can be used (it is run by
`view-mode-enable'), but I don't see anything equivalent for exiting. Are
users supposed to advise view-mode code (e.g. `view-mode-exit'), or is there
a better, recommended course of action?

My use case: When view-mode is entered, my own code fits the frame (assuming
it's one-window-p) to the viewed buffer. My tweaked version of
`display-buffer' takes care of that. But when view-mode is exited, the frame
is not re-fit to the buffer that is now displayed there. I'm looking for a
way to call my function `fit-frame', preferably via a hook run after
view-mode has exited and the other buffer is displayed in the frame, that
is, at the very end of `view-mode-exit'.

Even better, perhaps, would be for view-mode to restore the frame config
after it exits. That way, the frame would return to its prior state for the
buffer that was shown there previously. That is preferable for two reasons:
(1) no need to explicitly re-fit the buffer and (2) if the user had manually
resized the frame for the prior buffer, returning to that buffer would not
override the user's frame size preference by fitting it.

             reply	other threads:[~2007-12-18 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 19:03 Drew Adams [this message]
2007-12-18 21:52 ` view-mode exit hook? martin rudalics
2007-12-18 22:47   ` Drew Adams
2007-12-19  6:39     ` martin rudalics
2007-12-19  7:24       ` Drew Adams
2008-01-06  0:33         ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2008-03-11 19:00 FW: " Drew Adams
2008-08-04 15:03 ` Drew Adams

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=DHEEKFAFJEFOJHLCFPFDKEOKCCAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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.