all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* after-init-hook not executed under Linux?
@ 2002-09-08  1:32 Marc Levoy
  2002-09-09 19:15 ` after-init-hook not executed under GNU/Linux? Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Levoy @ 2002-09-08  1:32 UTC (permalink / 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

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

* Re: after-init-hook not executed under GNU/Linux?
  2002-09-08  1:32 after-init-hook not executed under Linux? Marc Levoy
@ 2002-09-09 19:15 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2002-09-09 19:15 UTC (permalink / raw)
  Cc: bug-gnu-emacs

I tested after-init-hook by setting it in my init file thus

  (add-hook 'after-init-hook '(lambda () (message "Here I am!")))

and the message was output.  I tried this in the code that will become
the 21.3 release, on GNU/Linux, and the message did appear in
*Messages*.  I do not know why your test, inserting text, did not
work.

The right way to solve your problem is to specify with an X resource
that you don't want a tool bar.  See the X Resources appendix in the
Emacs manual.


Please don't call the whole system "Linux"--the system is more GNU
than Linux, and we started its development.  Please give us a share of
the credit, and call the system "GNU/Linux".

See http://www.gnu.org/gnu/linux-and-gnu.html for more explanation.

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

end of thread, other threads:[~2002-09-09 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-08  1:32 after-init-hook not executed under Linux? Marc Levoy
2002-09-09 19:15 ` after-init-hook not executed under GNU/Linux? Richard Stallman

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.