* set window size on init
@ 2009-11-10 19:57 Xah Lee
2009-11-10 20:39 ` despen
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Xah Lee @ 2009-11-10 19:57 UTC (permalink / raw)
To: help-gnu-emacs
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?
Thanks.
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: set window size on init
2009-11-10 19:57 set window size on init Xah Lee
@ 2009-11-10 20:39 ` despen
2009-11-11 8:32 ` Kiwon Um
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: despen @ 2009-11-10 20:39 UTC (permalink / raw)
To: help-gnu-emacs
Xah Lee <xahlee@gmail.com> writes:
> 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."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: set window size on init
2009-11-10 19:57 set window size on init Xah Lee
2009-11-10 20:39 ` despen
@ 2009-11-11 8:32 ` Kiwon Um
2009-11-11 21:01 ` Xah Lee
2009-11-11 18:31 ` Eli Zaretskii
[not found] ` <mailman.10516.1257964476.2239.help-gnu-emacs@gnu.org>
3 siblings, 1 reply; 7+ messages in thread
From: Kiwon Um @ 2009-11-11 8:32 UTC (permalink / raw)
To: help-gnu-emacs
On Nov 11, 4:57 am, Xah Lee <xah...@gmail.com> wrote:
> 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.
>
Check default-frame-alist and init-frame-alist, e.g.:
(setq default-frame-alist '((width . 80) (height . 65)))
(setq init-frame-alist '((width . 80) (height . 65)))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: set window size on init
2009-11-10 19:57 set window size on init Xah Lee
2009-11-10 20:39 ` despen
2009-11-11 8:32 ` Kiwon Um
@ 2009-11-11 18:31 ` Eli Zaretskii
[not found] ` <mailman.10516.1257964476.2239.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2009-11-11 18:31 UTC (permalink / raw)
To: help-gnu-emacs
> From: Xah Lee <xahlee@gmail.com>
> Date: Tue, 10 Nov 2009 11:57:14 -0800 (PST)
>
> 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.
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: set window size on init
[not found] ` <mailman.10516.1257964476.2239.help-gnu-emacs@gnu.org>
@ 2009-11-11 20:05 ` despen
2009-11-14 6:51 ` Jonathan Groll
0 siblings, 1 reply; 7+ messages in thread
From: despen @ 2009-11-11 20:05 UTC (permalink / raw)
To: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Xah Lee <xahlee@gmail.com>
>> Date: Tue, 10 Nov 2009 11:57:14 -0800 (PST)
>>
>> 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.
>
> 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.)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: set window size on init
2009-11-11 8:32 ` Kiwon Um
@ 2009-11-11 21:01 ` Xah Lee
0 siblings, 0 replies; 7+ messages in thread
From: Xah Lee @ 2009-11-11 21:01 UTC (permalink / raw)
To: help-gnu-emacs
On Nov 11, 12:32 am, Kiwon Um <um.ki...@gmail.com> wrote:
> On Nov 11, 4:57 am, Xah Lee <xah...@gmail.com> wrote:> 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.
>
> Check default-frame-alist and init-frame-alist, e.g.:
> (setq default-frame-alist '((width . 80) (height . 65)))
> (setq init-frame-alist '((width . 80) (height . 65)))
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/
☄
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: set window size on init
2009-11-11 20:05 ` despen
@ 2009-11-14 6:51 ` Jonathan Groll
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Groll @ 2009-11-14 6:51 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, Nov 11, 2009 at 03:05:06PM -0500, despen@verizon.net wrote:
>Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Xah Lee <xahlee@gmail.com>
>>> Date: Tue, 10 Nov 2009 11:57:14 -0800 (PST)
>>>
>>> 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.
>>
>> 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.)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-14 6:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-10 19:57 set window size on init Xah Lee
2009-11-10 20:39 ` despen
2009-11-11 8:32 ` Kiwon Um
2009-11-11 21:01 ` Xah Lee
2009-11-11 18:31 ` Eli Zaretskii
[not found] ` <mailman.10516.1257964476.2239.help-gnu-emacs@gnu.org>
2009-11-11 20:05 ` despen
2009-11-14 6:51 ` Jonathan Groll
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).