I'm using emacs23 snapshot, now it has a fancy function "emacs
--daemon" to run emacs in background. But when I use "emacsclient -c"
to connect to the daemon, I found that my ~/.emacs is not
loaded. That's so bad, is there anyone experienced in emacs daemon?
Thanks.
best
lars
using CVS emacs, I use "emacs -daemon" and it executes the .emacs or
init fine. "--" or "-" both seem to work from a bash shell btw.
Are you sure there is no error in your .emacs? Did you run emacs -daemon
from the command line where you can see any error output?
Just to be sure - you dont expect emacs -c to run the .emacs?
^^^^^^^^^^^^^^^^^^^^^
I meant : "emacsclient -c"
And if Debian based Linux : And did you be sure to run "sudo update-alternatives --config" for emacs
and emacsclient?
Hi!
> I'm using emacs23 snapshot, now it has a fancy function "emacs
> --daemon" to run emacs in background. But when I use "emacsclient -c"
> to connect to the daemon, I found that my ~/.emacs is not
> loaded. That's so bad, is there anyone experienced in emacs daemon?
Yes, I had a problem where my .emacs was only loaded partially till a
specific line and everything after that line was omitted. The problem
was that the expression in that line required a file which tried to
retrieve informations from the current frame at load time, but with
emacs --daemon there is no frame then.
So I'd try to check if your .emacs isn't loaded at all or if it's loaded
partially. If it's the latter, try to find the offending code.
Bye,
Tassilo
--
"Emacs is not a development tool but a way of life."
- David Kastrup in alt.religion.emacs -
Yeah, when I run "emacs --daemon" in console it shows this error
message:
error: Fontset `tty' does not exist
But if run "emacs" there is no such message. Note that my emacs is
emacs-gtk.
The font setting script in my .emacs is:
;; font setting
(set-default-font "Bitstream Vera Sans Mono-10")
(set-fontset-font (frame-parameter nil 'font)
'chinese-gbk '("Microsfot Yahei-10" . "unicode-bmp"))
Is there anything wrong?
Best
Lars
Hi!
> Yeah, when I run "emacs --daemon" in console it shows this error
> message:
>
> error: Fontset `tty' does not exist
>
> But if run "emacs" there is no such message. Note that my emacs is
> emacs-gtk.
>
> The font setting script in my .emacs is:
>
> ;; font setting
> (set-default-font "Bitstream Vera Sans Mono-10")
> (set-fontset-font (frame-parameter nil 'font)
> 'chinese-gbk '("Microsfot Yahei-10" . "unicode-bmp"))
>
> Is there anything wrong?
As I've said in <87od03j...@thinkpad.tsdh.de> there's no initial
frame when starting emacs as daemon, so you cannot get frame parameters.
Maybe adding the code to `window-setup-hook' will work. Or simply use
`M-x customize-face' for font settings.
Bye,
Tassilo
--
Richard Stallman doesn't need it, since he already read the internet.
> ;; font setting
> (set-default-font "Bitstream Vera Sans Mono-10")
> (set-fontset-font (frame-parameter nil 'font)
> 'chinese-gbk '("Microsfot Yahei-10" . "unicode-
> bmp"))
>
> Is there anything wrong?
At least the second statement is only applicable when GNU Emacs runs
in windowing environment. You should execute it, and maybe more, only
when the window-system is not nil.
My init file is organised like this – and I can launch GNU Emacs
23.0.60 as daemon.
--
Greetings
Pete
Never be led astray onto the path of virtue
(add-hook 'window-setup-hook
(lambda nil
;; font setting
(set-default-font "Bitstream Vera Sans Mono-10")
(set-fontset-font (frame-parameter nil 'font)
'chinese-gbk '("Microsfot Yahei-10" . "unicode-bmp"))
;; window positioning
(setq default-frame-alist '((top . 0) (left . 0) (width . 100) (height . 40)))
))
Now emacs-daemon can startup without any error message:
loading.....
loading.....
loading.....
starting emacs daemon....
But then I found emacsclient -c can not connect to emacs daemon, and "ps ax|grep emacs" returns nothing. That means emacs daemon failed to startup... It's so wierd, and I don't know why...