; set window size to 100x58 chars.
(set-frame-size (selected-frame) 100 58)
however, it doesn't work.
But eval-region the code itself would work.
Anyone know why's that?
Thanks.
Xah
∑ http://xahlee.org/
☄
> i have, at the end of my .emacs this code:
>
> ; set window size to 100x58 chars.
> (set-frame-size (selected-frame) 100 58)
>
> however, it doesn't work.
> But eval-region the code itself would work.
>
> Anyone know why's that?
I don't think you have a "selected-frame" while
.emacs is being read.
I don't see that in the documentation but under
.emacs processing, it says it reads terminal specific
stuff after it reads the .emacs:
"Emacs runs the hook term-setup-hook at the end of initialization, after
both your `.emacs' file and any terminal-specific library have been read
in."
Does it help to run this from term-setup-hook or window-setup-hook?
The reason for the inconsistency is that Emacs initializes the GUI
display at some specific point during startup, and any customizations
of the display before that point will generally be overridden.
It might but this page suggests some solutions:
http://emacsblog.org/2007/01/29/maximize-on-startup-part-1/
(The one with the initial-frame-alist seems most useful.)
Thanks all for help. The following works as it should.
(setq default-frame-alist
'((menu-bar-lines . 1)
(left-fringe)
(right-fringe)
(tool-bar-lines . 0)
(width . 75)
(height . 50)
))
(setq initial-frame-alist '((width . 100) (height . 50)))
for future reference of later readers, type Ctrl+h v then initial-
frame-alist will give you good doc.
Xah
∑ http://xahlee.org/
☄
The same Ryan McGeary who wrote the above blog entry also wrote
maxframe.el:
http://files.emacsblog.org/ryan/elisp/maxframe.el
I find it works perfectly well for me with GNU emacs under Linux if it
is one of the last things invoked in .emacs.
Under OS X I manually set frame-size as maxframe makes the frame too
big. This is the function I use to set frame-size manually for my
specific display:
;;maximize frame function for darwin - by Nurullah Akkaya on help-gnu-emacs
(defun na-resize-frame-big ()
"Set size"
(interactive)
(set-frame-width (selected-frame) 178)
(set-frame-height (selected-frame) 50 )
(set-frame-position (selected-frame) 0 1))
Regards,
Jonathan