all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Setting initial frame's parameters before its creation
@ 2013-03-01  2:26 Leo Liu
  2013-03-01  3:47 ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Liu @ 2013-03-01  2:26 UTC (permalink / raw)
  To: emacs-devel

Hi there,

I am now working with a setup with two screens of different resolutions.
I would like a way in elisp to change the initial frame's parameters
before its creation.

Setting them using x resources seems to be the only way but it could
only provide good defaults for a fixed resolution and thus breaks down
with two resolutions as in my case.

Any suggestions?

Thanks,
Leo




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

* Re: Setting initial frame's parameters before its creation
  2013-03-01  2:26 Setting initial frame's parameters before its creation Leo Liu
@ 2013-03-01  3:47 ` Stefan Monnier
  2013-03-01  5:14   ` Leo Liu
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2013-03-01  3:47 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> I am now working with a setup with two screens of different resolutions.
> I would like a way in elisp to change the initial frame's parameters
> before its creation.
> Setting them using x resources seems to be the only way but it could
> only provide good defaults for a fixed resolution and thus breaks down
> with two resolutions as in my case.
> Any suggestions?

I have a local patch which causes Emacs (in GUI sessions) to read the
.emacs because creating the "initial" frame.  You could use something
like that, but it requires recompiling Emacs.

Another option might be to use an emacs daemon, since in this case as
well the .emacs file is read before setting up any GUI frame.


        Stefan



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

* Re: Setting initial frame's parameters before its creation
  2013-03-01  3:47 ` Stefan Monnier
@ 2013-03-01  5:14   ` Leo Liu
  2013-03-01 14:24     ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Liu @ 2013-03-01  5:14 UTC (permalink / raw)
  To: emacs-devel

On 2013-03-01 11:47 +0800, Stefan Monnier wrote:
> I have a local patch which causes Emacs (in GUI sessions) to read the
> .emacs because creating the "initial" frame.  You could use something
> like that, but it requires recompiling Emacs.

Yes I am interested. BTW, do you plan to add it to trunk at some point?

> Another option might be to use an emacs daemon, since in this case as
> well the .emacs file is read before setting up any GUI frame.

OK, I'll think about this as well. Thank you.

Leo




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

* Re: Setting initial frame's parameters before its creation
  2013-03-01  5:14   ` Leo Liu
@ 2013-03-01 14:24     ` Stefan Monnier
  2013-03-01 16:34       ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2013-03-01 14:24 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>> I have a local patch which causes Emacs (in GUI sessions) to read the
>> .emacs because creating the "initial" frame.  You could use something
>> like that, but it requires recompiling Emacs.
> Yes I am interested. BTW, do you plan to add it to trunk at some point?

I wrote it more as an experiment than anything else.  If there's enough
demand I can try and clean it up, but the main problem is that to use
it, you'd need to provide a command-line argument (since just flat out
changing the Emacs behavior would break many users's .emacs).

>> Another option might be to use an emacs daemon, since in this case as
>> well the .emacs file is read before setting up any GUI frame.
> OK, I'll think about this as well. Thank you.


        Stefan



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

* Re: Setting initial frame's parameters before its creation
  2013-03-01 14:24     ` Stefan Monnier
@ 2013-03-01 16:34       ` Stefan Monnier
  2013-03-01 22:14         ` Xue Fuqiao
                           ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stefan Monnier @ 2013-03-01 16:34 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> I wrote it more as an experiment than anything else.  If there's enough
> demand I can try and clean it up, but the main problem is that to use
> it, you'd need to provide a command-line argument (since just flat out
> changing the Emacs behavior would break many users's .emacs).

Tho I guess we could introduce a new startup file ~/.emacs.d/early-init.el


        Stefan



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

* Re: Setting initial frame's parameters before its creation
  2013-03-01 16:34       ` Stefan Monnier
@ 2013-03-01 22:14         ` Xue Fuqiao
  2013-03-02  2:55         ` Leo Liu
  2013-03-02 12:55         ` Tomasz Gajewski
  2 siblings, 0 replies; 11+ messages in thread
From: Xue Fuqiao @ 2013-03-01 22:14 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Leo Liu, emacs-devel

On Fri, 01 Mar 2013 11:34:42 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > I wrote it more as an experiment than anything else.  If there's enough
> > demand I can try and clean it up, but the main problem is that to use
> > it, you'd need to provide a command-line argument (since just flat out
> > changing the Emacs behavior would break many users's .emacs).
> 
> Tho I guess we could introduce a new startup file ~/.emacs.d/early-init.el

Looks good.

>         Stefan

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

* Re: Setting initial frame's parameters before its creation
  2013-03-01 16:34       ` Stefan Monnier
  2013-03-01 22:14         ` Xue Fuqiao
@ 2013-03-02  2:55         ` Leo Liu
  2013-03-02 12:55         ` Tomasz Gajewski
  2 siblings, 0 replies; 11+ messages in thread
From: Leo Liu @ 2013-03-02  2:55 UTC (permalink / raw)
  To: emacs-devel

On 2013-03-02 00:34 +0800, Stefan Monnier wrote:
> Tho I guess we could introduce a new startup file ~/.emacs.d/early-init.el
>
>
>         Stefan

That would be nice. A few people are annoyed that we cannot program
initial-frame nicely in elisp and before-init-hook is beyond useless for
users.

How about naming the file before-init or before-init-hook?

Thanks,
Leo




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

* Re: Setting initial frame's parameters before its creation
  2013-03-01 16:34       ` Stefan Monnier
  2013-03-01 22:14         ` Xue Fuqiao
  2013-03-02  2:55         ` Leo Liu
@ 2013-03-02 12:55         ` Tomasz Gajewski
  2013-03-03 10:39           ` Didier Verna
  2 siblings, 1 reply; 11+ messages in thread
From: Tomasz Gajewski @ 2013-03-02 12:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Leo Liu, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I wrote it more as an experiment than anything else.  If there's
>> enough demand I can try and clean it up, but the main problem is that
>> to use it, you'd need to provide a command-line argument (since just
>> flat out changing the Emacs behavior would break many users's
>> .emacs).
>
> Tho I guess we could introduce a new startup file
> ~/.emacs.d/early-init.el

It would be nice if it could also solve (maybe not so common) problem of
loading custom user code before executing site init files. I had to
uninstall doxymacs on debian to be able to load development version of
cedet because doxymacs loaded wrong version of eieio before evaluating
my .emacs. I couldn't find any other clean way of doing it.

Or maybe there is some other solution to this that I'm not aware of?

Regards
Tomasz Gajewski



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

* Re: Setting initial frame's parameters before its creation
  2013-03-02 12:55         ` Tomasz Gajewski
@ 2013-03-03 10:39           ` Didier Verna
  2013-03-03 18:49             ` Tomasz Gajewski
  0 siblings, 1 reply; 11+ messages in thread
From: Didier Verna @ 2013-03-03 10:39 UTC (permalink / raw)
  To: Tomasz Gajewski; +Cc: emacs-devel, Stefan Monnier, Leo Liu

Tomasz Gajewski <tomga@wp.pl> wrote:

> Or maybe there is some other solution to this that I'm not aware of?

  Why don't you just

;; Put Custom settings elsewhere and load them now:
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)

  in your init file ?

-- 
ELS 2013, June 3/4, Madrid, Spain:  http://els2013.european-lisp-symposium.org

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com



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

* Re: Setting initial frame's parameters before its creation
  2013-03-03 10:39           ` Didier Verna
@ 2013-03-03 18:49             ` Tomasz Gajewski
  2013-03-03 19:47               ` Didier Verna
  0 siblings, 1 reply; 11+ messages in thread
From: Tomasz Gajewski @ 2013-03-03 18:49 UTC (permalink / raw)
  To: emacs-devel; +Cc: Stefan Monnier, Leo Liu

Didier Verna <didier@didierverna.net> writes:

> Tomasz Gajewski <tomga@wp.pl> wrote:
>
>> Or maybe there is some other solution to this that I'm not aware of?
>
>   Why don't you just
>
> ;; Put Custom settings elsewhere and load them now:
> (setq custom-file "~/.emacs.d/custom.el")
> (load custom-file)
>
>   in your init file ?

How would it help me to avoid evaluating elisp site init file before
evaluating my .emacs. Anything I could write in .emacs was just too
late. Doxymacs package in debian caused loading eieio before my code in
.emacs was evaluated.

Maybe I could run emacs with -no-site-file and later load it somehow but
I do not consider this a clean solution.

Regards
Tomasz Gajewski



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

* Re: Setting initial frame's parameters before its creation
  2013-03-03 18:49             ` Tomasz Gajewski
@ 2013-03-03 19:47               ` Didier Verna
  0 siblings, 0 replies; 11+ messages in thread
From: Didier Verna @ 2013-03-03 19:47 UTC (permalink / raw)
  To: Tomasz Gajewski; +Cc: Leo Liu, Stefan Monnier, emacs-devel

Tomasz Gajewski <tomga@wp.pl> wrote:

> How would it help me to avoid evaluating elisp site init file before
> evaluating my .emacs.

  Oh, sorry. I misread your message and didn't notice you were talking
  about /site/ init files.

-- 
ELS 2013, June 3/4, Madrid, Spain:  http://els2013.european-lisp-symposium.org

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com



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

end of thread, other threads:[~2013-03-03 19:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01  2:26 Setting initial frame's parameters before its creation Leo Liu
2013-03-01  3:47 ` Stefan Monnier
2013-03-01  5:14   ` Leo Liu
2013-03-01 14:24     ` Stefan Monnier
2013-03-01 16:34       ` Stefan Monnier
2013-03-01 22:14         ` Xue Fuqiao
2013-03-02  2:55         ` Leo Liu
2013-03-02 12:55         ` Tomasz Gajewski
2013-03-03 10:39           ` Didier Verna
2013-03-03 18:49             ` Tomasz Gajewski
2013-03-03 19:47               ` Didier Verna

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.