all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Marc Levoy" <levoy@cs.stanford.edu>
Subject: after-init-hook not executed under Linux?
Date: 7 Sep 2002 18:32:20 -0700	[thread overview]
Message-ID: <15738.43172.702755.65468@electrolux.Stanford.EDU> (raw)


Dear Emacs maintainers,

I just upgraded from Emacs 20.7 to 21.2, and under version 21, I am having
unexpected trouble setting my initial screen height in my .emacs init file.  In
trying to work around this problem, I discovered (I believe) that
after-init-hook is not being executed in Linux Emacs, although it *is* being
executed in Windows Emacs.


Some details:

I set the initial frame height using a command line option, "-geometry 80x60".
Then, when Emacs encounters the following code in my init file:

	(if (fboundp 'tool-bar-mode)
		(tool-bar-mode -1))

it shortens the window by 2 lines.  The obvious way to compensate for this
shortening is to change my command line option to "-geometry 80x62".
Unfortunately, this doesn't work, perhaps because Emacs checks my proposed
frame height against the actual height of my screen (or my Exceed window),
which is only 60 lines.

As a workaround, I tried resetting the frame height at the end of my init file,
using "set-frame-height".  This doesn't work either; Emacs ignores the command,
perhaps because of the order in which it applies such requests relative to
checking against the maximum allowing frame height.

As a last-ditch workaround, I tried resetting the frame height by using
"after-init-hook".  Specifically, I placed the following code in my init file:

	(add-hook 'after-init-hook 'mem-after-init-hook)
	(defun mem-after-init-hook ()
		(set-frame-height (selected-frame) 60)
	)

This works in Emacs 21.2 under Windows 2000, but not in Emacs 21.2 under Linux.
In fact, under Linux, this hook appears never to get executed at all.  (I
verified this by asking the hook to insert text in a buffer, which I could look
at later.  It inserted the text correctly under Windows, but not under Linux.)


More details:

On Linux, I am running "GNU Emacs 21.2.1 (i386-redhat-linux-gnu, X toolkit,
Xaw3d scroll bars) of 2002-04-08 on porky.devel.redhat.com" on a Linux 7.3
system, displaying either on my Linux desktop or through Exceed 7.0 to a
Windows 2000 system.  On Windows, I am running "GNU Emacs 21.2.1
(i386-msvc-nt5.0.2195) of 2002-03-19 on buffy".


Any wisdom on why after-init-hook doesn't seem to be getting executed?
Or any wisdom on forcing my frame height to be what I want?

-Marc Levoy
 Associate Professor
 Computer Science Department
 Stanford University

             reply	other threads:[~2002-09-08  1:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-08  1:32 Marc Levoy [this message]
2002-09-09 19:15 ` after-init-hook not executed under GNU/Linux? Richard Stallman

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=15738.43172.702755.65468@electrolux.Stanford.EDU \
    --to=levoy@cs.stanford.edu \
    /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.