all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* frames and reading of .emacs?
@ 2004-01-07 15:00 Jan Even Nilsen
  2004-01-07 20:50 ` Martin Stemplinger
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Even Nilsen @ 2004-01-07 15:00 UTC (permalink / raw)


Hi, fellow emacs users.
I have changed my system from Linux red hat 9 to mandrake Linux, running
GNU Emacs 21.3.1 (i386-mandrake-linux-gnu, X toolkit, Xaw3d scroll bars) 
of 2003-08-27 on ke.mandrakesoft.com, modified by Mandrake

Now on this system the initial frame does not position correctly 
according to my setting

(setq default-frame-alist      '((top . -00) (left . 300) (width . 89) 
(height . 51)  (cursor-color . "red") (background-color . "khaki")))

However, M-x new-frame gives a frame in the right position.

Possibly (un)connected to this is the fact that I have to run
load-file "~/.emacs"
to get all the settings in my .emacs working. Particularly annoying is 
the ugly blue and white region-face, while i prefer only the backround 
to be discretely darker, keeping the other font-lock colours by having
(custom-set-faces
'(region ((t (:background "lightgoldenrod3"))))
)
in .emacs

The two problems may be unconnected, but whats puzzling is that when
M-x new-frame follows the instructions in .emacs regarding frames
and load-file "~/.emacs" works nicely, why does it not work at initial 
startup?

Regards,
Even

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

* Re: frames and reading of .emacs?
  2004-01-07 15:00 frames and reading of .emacs? Jan Even Nilsen
@ 2004-01-07 20:50 ` Martin Stemplinger
  2004-01-08  9:01   ` Jan Even Nilsen
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Stemplinger @ 2004-01-07 20:50 UTC (permalink / raw)


On Mit Jan 07 2004 at 16:00, Jan Even Nilsen <evenREMOVE@THISgfi.uib.no> wrote:

> Now on this system the initial frame does not position correctly according to my setting
>
> (setq default-frame-alist      '((top . -00) (left . 300) (width . 89) (height . 51)
> (cursor-color . "red") (background-color . "khaki")))
>
AFAIK the settings are controlled by the variable
initial-frame-alist. Its documentation says

You can specify geometry-related options for just the initial frame
by setting this variable in your `.emacs' file; however, they won't
take effect until Emacs reads `.emacs', which happens after first creating
the frame.  If you want the frame to have the proper geometry as soon
as it appears, you need to use this three-step process:
* Specify X resources to give the geometry you want.
* Set `default-frame-alist' to override these options so that they
  don't affect subsequent frames.
* Set `initial-frame-alist' in a way that matches the X resources,
  to override what you put in `default-frame-alist'.

HTH
Martin
-- 
Remove NOSPAM to reply by mail

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

* Re: frames and reading of .emacs?
  2004-01-07 20:50 ` Martin Stemplinger
@ 2004-01-08  9:01   ` Jan Even Nilsen
  2004-01-08 16:36     ` Greg Fenton
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Even Nilsen @ 2004-01-08  9:01 UTC (permalink / raw)


Martin Stemplinger wrote:
> AFAIK the settings are controlled by the variable
> initial-frame-alist. Its documentation says
> 
> You can specify geometry-related options for just the initial frame
> by setting this variable in your `.emacs' file; however, they won't
> take effect until Emacs reads `.emacs', which happens after first creating
> the frame.  If you want the frame to have the proper geometry as soon
> as it appears, you need to use this three-step process:
> * Specify X resources to give the geometry you want.
> * Set `default-frame-alist' to override these options so that they
>   don't affect subsequent frames.
> * Set `initial-frame-alist' in a way that matches the X resources,
>   to override what you put in `default-frame-alist'.

I tried this, and it works like before in some respects, the frame 
appears in position (given by X or whatever) and then pops into its 
assigned place, but not the right size.

My .emacs now looks like this after some stripping:
------------------------------------------------------------------
(setq default-frame-alist  '((top . -00) (left . 300) (width . 89) 
(height . 51) (cursor-color . "red")))
(setq initial-frame-alist  '((top . -00) (left . 300) (width . 89) 
(height . 51)))

(custom-set-faces
  '(default ((t (:stipple nil :background "khaki" :foreground "black" 
:inverse-video nil :box nil :strike-through nil :overline nil :underline 
nil :slant normal :weight normal :height 125 :width semi-condensed 
:family "misc-fixed"))))
  '(region ((t (:background "lightgoldenrod3"))))
)
-----------------------------------------------------------------

On startup the following happen:
1) The frame is moved to the right position, i.e. top and left is read 
from the first line, but the width and height is wrong, its 80x25 
(wherever that came from). M-x new-frame gets right size.

Questions: Is width and height not read? But initial-frame-alist's value 
is ((top . 0) (left . 300) (width . 89) (height . 51)) when i check, so 
it must be read. Why does not emacs use these last two sizes on startup, 
while it uses the first two? Are they overridden by some other mechanism 
(afterwards? No visible size change though)?

2) The first line of custom-set-faces, the '(default ... is set OK, but 
the '(region ... is not right. Regions gets marked with white on blue. 
There is nothing wrong with the syntax here because when using
(load-file "~/.emacs") it is read and used OK.

Question: Again, is there some other mechanism overriding this setting 
upon startup?
BTW: The region is not set righ by M-x new-frame, I need to (load-file 
"~/.emacs") in every new frame :-(

I have now stripped down the .emacs, and I am still puzzled, so I hope 
someone can give me a hint as to what my new emacs is doing.
I know that an existing default.el would be read last, but there is no 
such file on my system, as far as I can see.

Sincerely, Even
on
GNU Emacs 21.3.1 (i386-mandrake-linux-gnu, X toolkit, Xaw3d scroll bars) 
of 2003-08-27 on ke.mandrakesoft.com, modified by Mandrake

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

* Re: frames and reading of .emacs?
  2004-01-08  9:01   ` Jan Even Nilsen
@ 2004-01-08 16:36     ` Greg Fenton
  2004-01-09  8:41       ` Jan Even Nilsen
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Fenton @ 2004-01-08 16:36 UTC (permalink / raw)


Jan Even Nilsen wrote:
> 
> I have now stripped down the .emacs, and I am still puzzled, so I hope 
> someone can give me a hint as to what my new emacs is doing.
> I know that an existing default.el would be read last, but there is no 
> such file on my system, as far as I can see.
> 

What about ~/.Xresources ?

Can you post your "stripped down" .emacs ?

greg.fenton
-- 
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/

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

* Re: frames and reading of .emacs?
  2004-01-08 16:36     ` Greg Fenton
@ 2004-01-09  8:41       ` Jan Even Nilsen
  2004-01-09  9:41         ` Martin Rydstr|m
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Even Nilsen @ 2004-01-09  8:41 UTC (permalink / raw)


Greg Fenton wrote:
> Jan Even Nilsen wrote:
>> ...
>> I have now stripped down the .emacs, and I am still puzzled, so I hope 
>> someone can give me a hint as to what my new emacs is doing.
>> I know that an existing default.el would be read last, but there is no 
>> such file on my system, as far as I can see.
> 
> What about ~/.Xresources ?

No such file on my system, but I'll look into the system's Xresources files.

> Can you post your "stripped down" .emacs ?

It's contents is only the text posted between the --- lines, that's how 
stripped it is, to make sure this strange behaviour is not my own doing.

Xresources:
The system Xresources file(s all) contain the line
emacs.geometry: 80x25
This is the size the frame gets initially.
Then, when .emacs is read, the line
(setq initial-frame-alist  '((top . -00) (left . 300) (width . 89) 
(height . 51)))
makes the frame move, but does not manage to resize it.

I do not understand? Is it wrong syntax for setq of height and width 
(works for default-frame-alist though)?

A Q&D way, since new-frames are like I want them, is to set
(delete-frame)
(new-frame)
in the end of .emacs

BTW: The inclusion of the emacs related entry into a ~/.Xresources and 
edit of these, did not help.


2) The changing of the face for the marked region is somewhat of a 
puzzle, but I can live with it. It nags me that some function overrides 
my settings, though.

Even

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

* Re: frames and reading of .emacs?
  2004-01-09  8:41       ` Jan Even Nilsen
@ 2004-01-09  9:41         ` Martin Rydstr|m
  2004-01-13  8:56           ` Jan Even Nilsen
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Rydstr|m @ 2004-01-09  9:41 UTC (permalink / raw)


Jan Even Nilsen <evenREMOVE@THISgfi.uib.no> writes:
> Greg Fenton wrote:
> > Jan Even Nilsen wrote:
> >> ...
> >> I have now stripped down the .emacs, and I am still puzzled, so I
> >> hope someone can give me a hint as to what my new emacs is doing.
> >> I know that an existing default.el would be read last, but there is
> >> no such file on my system, as far as I can see.
> > What about ~/.Xresources ?
> 
> No such file on my system, but I'll look into the system's Xresources files.
> 
> > Can you post your "stripped down" .emacs ?
> 
> It's contents is only the text posted between the --- lines, that's
> how stripped it is, to make sure this strange behaviour is not my own
> doing.
> 
> Xresources:
> The system Xresources file(s all) contain the line
> emacs.geometry: 80x25
> This is the size the frame gets initially.
> Then, when .emacs is read, the line
> (setq initial-frame-alist  '((top . -00) (left . 300) (width . 89)
> (height . 51)))
> makes the frame move, but does not manage to resize it.

My guess, without researching, is that X-resources take precedence
over initial-frame-alist, which takes precedence over app-defaults.

> I do not understand? Is it wrong syntax for setq of height and width
> (works for default-frame-alist though)?
> 
> A Q&D way, since new-frames are like I want them, is to set
> (delete-frame)
> (new-frame)
> in the end of .emacs
> 
> BTW: The inclusion of the emacs related entry into a ~/.Xresources and
> edit of these, did not help.

Resources in ".Xresources" aren't automatically activated (except on
some weird systems which confuse user-level app-defaults (which are
normally in .Xdefaults-`hostname`, or something like that)), but are
only loaded into the resource database when logging in via Xdm (or
similar). You probably need to do something along the lines of
"xrdb -merge .Xresources" to get any changes within a session.

> 2) The changing of the face for the marked region is somewhat of a
> puzzle, but I can live with it. It nags me that some function
> overrides my settings, though.

Yes, that's weird. One possibility is to explicitly set the back-
ground color of the face. (set-face-background 'region "goldenrod").

Regards,

'mr

-- 
[Emacs] is written in Lisp, which is the only computer language that is
beautiful.  -- Neal Stephenson, _In the Beginning was the Command Line_

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

* Re: frames and reading of .emacs?
  2004-01-09  9:41         ` Martin Rydstr|m
@ 2004-01-13  8:56           ` Jan Even Nilsen
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Even Nilsen @ 2004-01-13  8:56 UTC (permalink / raw)


Martin Rydstr|m wrote:
>>>Jan Even Nilsen wrote:
>>BTW: The inclusion of the emacs related entry into a ~/.Xresources and
>>edit of these, did not help.
> 
> Resources in ".Xresources" aren't automatically activated (except on
> some weird systems which confuse user-level app-defaults (which are
> normally in .Xdefaults-`hostname`, or something like that)), but are
> only loaded into the resource database when logging in via Xdm (or
> similar). You probably need to do something along the lines of
> "xrdb -merge .Xresources" to get any changes within a session.

Sorry, my fault. Did work after new login (or was it reboot?).

> >>2) The changing of the face for the marked region is somewhat of a
>>puzzle, but I can live with it. It nags me that some function
>>overrides my settings, though.
> 
> 
> Yes, that's weird. One possibility is to explicitly set the back-
> ground color of the face. (set-face-background 'region "goldenrod").

Thanks, but unfortunately this did not help. At least now we can assume 
that it is a case of overriding and probably not failing to read the 
custom-set variable)

Even

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

end of thread, other threads:[~2004-01-13  8:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-07 15:00 frames and reading of .emacs? Jan Even Nilsen
2004-01-07 20:50 ` Martin Stemplinger
2004-01-08  9:01   ` Jan Even Nilsen
2004-01-08 16:36     ` Greg Fenton
2004-01-09  8:41       ` Jan Even Nilsen
2004-01-09  9:41         ` Martin Rydstr|m
2004-01-13  8:56           ` Jan Even Nilsen

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.