all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to debug problem with emacsclient and init file
@ 2010-04-15  9:03 Jim Burton
  2010-04-15 15:58 ` Harry Putnam
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Burton @ 2010-04-15  9:03 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

Hi, I an running Emacs 23.1.1 on arch linux. I start the emacs daemon
in my ~/.xinit file (emacs --daemon &) and can open new emacsclients
in the terminal with no problems, but when I try

$ emacslient -c

the line "Waiting for Emacs..." is printed and nothing else. If I add
the -n option:

$ emacsclient -nc
*ERROR*: Undefined color: "unspecified-bg"

So I tried starting the emacs daemon without my init file and
everything is fine -- I can open graphical emacsclients. This seems
weird because I can open a new (X or terminal) emacs without getting
any complaints about the init file. I thought about adding my init
stuff back in gradually but there's rather a lot of it, and I wondered
if there is a better way to debug this problem?

Thanks, 

[-- Attachment #2: Type: text/plain, Size: 12 bytes --]

-- 
J Burton

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

* Re: How to debug problem with emacsclient and init file
  2010-04-15  9:03 How to debug problem with emacsclient and init file Jim Burton
@ 2010-04-15 15:58 ` Harry Putnam
  2010-04-16  9:17   ` Jim Burton
  0 siblings, 1 reply; 9+ messages in thread
From: Harry Putnam @ 2010-04-15 15:58 UTC (permalink / raw)
  To: help-gnu-emacs

Jim Burton <jim@sdf-eu.org> writes:

> So I tried starting the emacs daemon without my init file and
> everything is fine -- I can open graphical emacsclients. This seems
> weird because I can open a new (X or terminal) emacs without getting
> any complaints about the init file. I thought about adding my init
> stuff back in gradually but there's rather a lot of it, and I wondered
> if there is a better way to debug this problem?

I'm not sure this even works when going thru emacsclient but does
turning on  debug-on-error show you any more userfull info:

Put:
 (setq eval-expression-debug-on-error t) 

Into ~/.emacs to find out.





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

* Re: How to debug problem with emacsclient and init file
  2010-04-15 15:58 ` Harry Putnam
@ 2010-04-16  9:17   ` Jim Burton
  2010-04-16 14:52     ` Suvayu Ali
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Burton @ 2010-04-16  9:17 UTC (permalink / raw)
  To: Harry Putnam; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

At Thu, 15 Apr 2010 10:58:43 -0500,
Harry Putnam wrote:
> 
> Jim Burton <jim@sdf-eu.org> writes:
> 
> > So I tried starting the emacs daemon without my init file and
> > everything is fine -- I can open graphical emacsclients. This seems
> > weird because I can open a new (X or terminal) emacs without getting
> > any complaints about the init file. I thought about adding my init
> > stuff back in gradually but there's rather a lot of it, and I wondered
> > if there is a better way to debug this problem?
> 
> I'm not sure this even works when going thru emacsclient but does
> turning on  debug-on-error show you any more userfull info:
> 
> Put:
>  (setq eval-expression-debug-on-error t) 
>

Hi Harry. This has no effect -- the daemon starts without any errors
and the graphical client won't start. Commenting stuff out of .emacs
I've found I can start the graphical client without a color theme, or
if I do this:

(defmacro Xlaunch (&rest x)
  (list 'if (eq window-system 'x) (cons 'progn x)))
(require 'color-theme)
(color-theme-initialize)
(if (Xlaunch)
    (color-theme-gray30))

Which works but I get no color theme -- of course when the daemon
starts Xlaunch is false. Is there some way to say "do this if the
current client uses X"?
 
Jim
> Into ~/.emacs to find out.
> 
> 

[-- Attachment #2: Type: text/plain, Size: 12 bytes --]

-- 
J Burton

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

* Re: How to debug problem with emacsclient and init file
  2010-04-16  9:17   ` Jim Burton
@ 2010-04-16 14:52     ` Suvayu Ali
  2010-04-16 17:12       ` Jim Burton
  0 siblings, 1 reply; 9+ messages in thread
From: Suvayu Ali @ 2010-04-16 14:52 UTC (permalink / raw)
  To: help-gnu-emacs

On Friday 16 April 2010 02:17 AM, Jim Burton wrote:
> At Thu, 15 Apr 2010 10:58:43 -0500,
> Harry Putnam wrote:
>>
>> Jim Burton<jim@sdf-eu.org>  writes:
>>
>>> So I tried starting the emacs daemon without my init file and
>>> everything is fine -- I can open graphical emacsclients. This seems
>>> weird because I can open a new (X or terminal) emacs without getting
>>> any complaints about the init file. I thought about adding my init
>>> stuff back in gradually but there's rather a lot of it, and I wondered
>>> if there is a better way to debug this problem?
>>
>> I'm not sure this even works when going thru emacsclient but does
>> turning on  debug-on-error show you any more userfull info:
>>
>> Put:
>>   (setq eval-expression-debug-on-error t)
>>
>
> Hi Harry. This has no effect -- the daemon starts without any errors
> and the graphical client won't start. Commenting stuff out of .emacs
> I've found I can start the graphical client without a color theme, or
> if I do this:
>
> (defmacro Xlaunch (&rest x)
>    (list 'if (eq window-system 'x) (cons 'progn x)))
> (require 'color-theme)
> (color-theme-initialize)
> (if (Xlaunch)
>      (color-theme-gray30))
>
> Which works but I get no color theme -- of course when the daemon
> starts Xlaunch is false. Is there some way to say "do this if the
> current client uses X"?
>

I was trying to get something like this working. To follow the 
discussion look at the thread "conditional font faces" from the 27th of 
February to 5th of March.

The only solution was to use a theme which uses similar colour schemes 
as no window to present a consistent environment in either and X window 
or the terminal.

GL and plz do post back if you find something that can actually switch 
between to themes without resorting to the above compromise.

> Jim
>> Into ~/.emacs to find out.
>>
>>


-- 
Suvayu

Open source is the future. It sets us free.




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

* Re: How to debug problem with emacsclient and init file
  2010-04-16 14:52     ` Suvayu Ali
@ 2010-04-16 17:12       ` Jim Burton
  2010-04-17  0:11         ` suvayu ali
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Burton @ 2010-04-16 17:12 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2093 bytes --]

At Fri, 16 Apr 2010 07:52:54 -0700,
Suvayu Ali wrote:
> 
[snip]
> 
> I was trying to get something like this working. To follow the 
> discussion look at the thread "conditional font faces" from the 27th of 
> February to 5th of March.
> 
> The only solution was to use a theme which uses similar colour schemes 
> as no window to present a consistent environment in either and X window 
> or the terminal.
> 
> GL and plz do post back if you find something that can actually switch 
> between to themes without resorting to the above compromise.
> 

Thanks to malsyned on #emacs I have the following that works like a charm:                                                                                   
                                                                                                                                                             
(add-hook 'after-make-frame-functions                                                                                                                        
          '(lambda (f)                                                                                                                                       
             (with-selected-frame f                                                                                                                          
               (if (window-system f)                                                                                                                 
                   (color-theme-gray30)                                                                                                                      
                 (color-theme-emacs-nw)))))                                                                                                                  
                                                                                                                                                             
Jim

> > Jim
> >> Into ~/.emacs to find out.
> >>
> >>
> 
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.
> 

[-- Attachment #2: Type: text/plain, Size: 12 bytes --]

-- 
J Burton

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

* Re: How to debug problem with emacsclient and init file
  2010-04-16 17:12       ` Jim Burton
@ 2010-04-17  0:11         ` suvayu ali
  2010-04-17  8:22           ` Jim Burton
  2010-04-17 18:54           ` Jim Burton
  0 siblings, 2 replies; 9+ messages in thread
From: suvayu ali @ 2010-04-17  0:11 UTC (permalink / raw)
  To: Jim Burton; +Cc: help-gnu-emacs

On 16 April 2010 10:12, Jim Burton <jim@sdf-eu.org> wrote:
> At Fri, 16 Apr 2010 07:52:54 -0700,
> Suvayu Ali wrote:
>>
> [snip]
>>
>> I was trying to get something like this working. To follow the
>> discussion look at the thread "conditional font faces" from the 27th of
>> February to 5th of March.
>>
>> The only solution was to use a theme which uses similar colour schemes
>> as no window to present a consistent environment in either and X window
>> or the terminal.
>>
>> GL and plz do post back if you find something that can actually switch
>> between to themes without resorting to the above compromise.
>>
>
> Thanks to malsyned on #emacs I have the following that works like a charm:
>
> (add-hook 'after-make-frame-functions
>          '(lambda (f)
>             (with-selected-frame f
>               (if (window-system f)
>                   (color-theme-gray30)
>                 (color-theme-emacs-nw)))))
>

I have tried something like that before, the problem with this is it
changes the theme for all the existing frames. So if I make an X
window frame, I get the proper theme. Then if I start a client in the
xterm, I get the proper theme for the no-window frame but my X window
frame also changes theme to that theme. It doesn't change back to the
desired X window theme even when I select the X window frame with the
mouse or Alt+Tab. It would be good if themes could be selected for
specific frames and not the entire emacs session itself.

If this is unrealisable for the current emacs release, could this be a
feature enhancement request for future releases?

> Jim
>

-- 
Suvayu

Open source is the future. It sets us free.




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

* Re: How to debug problem with emacsclient and init file
  2010-04-17  0:11         ` suvayu ali
@ 2010-04-17  8:22           ` Jim Burton
  2010-04-17 18:54           ` Jim Burton
  1 sibling, 0 replies; 9+ messages in thread
From: Jim Burton @ 2010-04-17  8:22 UTC (permalink / raw)
  To: suvayu ali; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]

At Fri, 16 Apr 2010 17:11:30 -0700,
suvayu ali wrote:
> 
> On 16 April 2010 10:12, Jim Burton <jim@sdf-eu.org> wrote:
> > At Fri, 16 Apr 2010 07:52:54 -0700,
> > Suvayu Ali wrote:
> >>
> > [snip]
> >>
> >> I was trying to get something like this working. To follow the
> >> discussion look at the thread "conditional font faces" from the 27th of
> >> February to 5th of March.
> >>
> >> The only solution was to use a theme which uses similar colour schemes
> >> as no window to present a consistent environment in either and X window
> >> or the terminal.
> >>
> >> GL and plz do post back if you find something that can actually switch
> >> between to themes without resorting to the above compromise.
> >>
> >
> > Thanks to malsyned on #emacs I have the following that works like a charm:
> >
> > (add-hook 'after-make-frame-functions
> >          '(lambda (f)
> >             (with-selected-frame f
> >               (if (window-system f)
> >                   (color-theme-gray30)
> >                 (color-theme-emacs-nw)))))
> >
> 
> I have tried something like that before, the problem with this is it
> changes the theme for all the existing frames. 

Try using the code I posted. Do you think I would have said it worked like a
charm if it worked the way you describe?


> So if I make an X
> window frame, I get the proper theme. Then if I start a client in the
> xterm, I get the proper theme for the no-window frame but my X window
> frame also changes theme to that theme. It doesn't change back to the
> desired X window theme even when I select the X window frame with the
> mouse or Alt+Tab. It would be good if themes could be selected for
> specific frames and not the entire emacs session itself.
> 
> If this is unrealisable for the current emacs release, could this be a
> feature enhancement request for future releases?
> 
> > Jim
> >
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.

[-- Attachment #2: Type: text/plain, Size: 12 bytes --]

-- 
J Burton

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

* Re: How to debug problem with emacsclient and init file
  2010-04-17  0:11         ` suvayu ali
  2010-04-17  8:22           ` Jim Burton
@ 2010-04-17 18:54           ` Jim Burton
  2010-04-17 19:50             ` Suvayu Ali
  1 sibling, 1 reply; 9+ messages in thread
From: Jim Burton @ 2010-04-17 18:54 UTC (permalink / raw)
  To: suvayu ali; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]

At Fri, 16 Apr 2010 17:11:30 -0700,
suvayu ali wrote:
> 
> On 16 April 2010 10:12, Jim Burton <jim@sdf-eu.org> wrote:
> > At Fri, 16 Apr 2010 07:52:54 -0700,
> > Suvayu Ali wrote:
> >>
> > [snip]
> >>
> >> I was trying to get something like this working. To follow the
> >> discussion look at the thread "conditional font faces" from the 27th of
> >> February to 5th of March.
> >>
> >> The only solution was to use a theme which uses similar colour schemes
> >> as no window to present a consistent environment in either and X window
> >> or the terminal.
> >>
> >> GL and plz do post back if you find something that can actually switch
> >> between to themes without resorting to the above compromise.
> >>
> >
> > Thanks to malsyned on #emacs I have the following that works like a charm:
> >
> > (add-hook 'after-make-frame-functions
> >          '(lambda (f)
> >             (with-selected-frame f
> >               (if (window-system f)
> >                   (color-theme-gray30)
> >                 (color-theme-emacs-nw)))))
> >
> 
> I have tried something like that before, the problem with this is it
> changes the theme for all the existing frames. So if I make an X
> window frame, I get the proper theme. Then if I start a client in the
> xterm, I get the proper theme for the no-window frame but my X window
> frame also changes theme to that theme. It doesn't change back to the
> desired X window theme even when I select the X window frame with the
> mouse or Alt+Tab. It would be good if themes could be selected for
> specific frames and not the entire emacs session itself.
>

I should have said, in addition to the hook you need

(setq color-theme-is-global nil)

Apologies,

Jim 
> If this is unrealisable for the current emacs release, could this be a
> feature enhancement request for future releases?
> 
> > Jim
> >
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.

[-- Attachment #2: Type: text/plain, Size: 12 bytes --]

-- 
J Burton

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

* Re: How to debug problem with emacsclient and init file
  2010-04-17 18:54           ` Jim Burton
@ 2010-04-17 19:50             ` Suvayu Ali
  0 siblings, 0 replies; 9+ messages in thread
From: Suvayu Ali @ 2010-04-17 19:50 UTC (permalink / raw)
  To: Jim Burton; +Cc: help-gnu-emacs

On Saturday 17 April 2010 11:54 AM, Jim Burton wrote:
> At Fri, 16 Apr 2010 17:11:30 -0700,
> suvayu ali wrote:
>>
>> On 16 April 2010 10:12, Jim Burton<jim@sdf-eu.org>  wrote:
>>> At Fri, 16 Apr 2010 07:52:54 -0700,
>>> Suvayu Ali wrote:
>>>>
>>> [snip]
>>>>
>>>> I was trying to get something like this working. To follow the
>>>> discussion look at the thread "conditional font faces" from the 27th of
>>>> February to 5th of March.
>>>>
>>>> The only solution was to use a theme which uses similar colour schemes
>>>> as no window to present a consistent environment in either and X window
>>>> or the terminal.
>>>>
>>>> GL and plz do post back if you find something that can actually switch
>>>> between to themes without resorting to the above compromise.
>>>>
>>>
>>> Thanks to malsyned on #emacs I have the following that works like a charm:
>>>
>>> (add-hook 'after-make-frame-functions
>>>           '(lambda (f)
>>>              (with-selected-frame f
>>>                (if (window-system f)
>>>                    (color-theme-gray30)
>>>                  (color-theme-emacs-nw)))))
>>>
>>
>> I have tried something like that before, the problem with this is it
>> changes the theme for all the existing frames. So if I make an X
>> window frame, I get the proper theme. Then if I start a client in the
>> xterm, I get the proper theme for the no-window frame but my X window
>> frame also changes theme to that theme. It doesn't change back to the
>> desired X window theme even when I select the X window frame with the
>> mouse or Alt+Tab. It would be good if themes could be selected for
>> specific frames and not the entire emacs session itself.
>>
>
> I should have said, in addition to the hook you need
>
> (setq color-theme-is-global nil)
>

Thank you thank you thank you! I have been scratching my head since I 
can obviously see it didn't work whereas you mentioned it did. With 
that, everything "Just Works".

> Apologies,
>

Appreciate your help. :)
-- 
Suvayu

Open source is the future. It sets us free.




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

end of thread, other threads:[~2010-04-17 19:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15  9:03 How to debug problem with emacsclient and init file Jim Burton
2010-04-15 15:58 ` Harry Putnam
2010-04-16  9:17   ` Jim Burton
2010-04-16 14:52     ` Suvayu Ali
2010-04-16 17:12       ` Jim Burton
2010-04-17  0:11         ` suvayu ali
2010-04-17  8:22           ` Jim Burton
2010-04-17 18:54           ` Jim Burton
2010-04-17 19:50             ` Suvayu Ali

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.