I want to have line number at buffer, but when I use Emacs server, the Message buffer display the following error:
Invalid face reference: font-lock-comment-delimiter-face [2 times]
Invalid face reference: linum
Invalid face reference: font-lock-comment-face
Invalid face reference: font-lock-comment-delimiter-face
Invalid face reference: font-lock-comment-face
Invalid face reference: font-lock-comment-delimiter-face
Invalid face reference: font-lock-comment-face
So I found out linum is designed to use after frame is created. So I add such hook in my .emacs
file
(defun my-turn-on-linum-mode (frame)
"My function to turn on linum mode."
(with-selected-frame frame
(linum-mode 1)))
(if (daemonp)
(progn
(add-hook 'after-make-frame-functions 'my-turn-on-linum-mode))
(global-linum-mode 1)) ;;; if not daemon, just do it
Then if I start with emacs --daemon
and open clients, it works fine for the first client I open, either graphic or terminal mode. It also works good no matter how many times when I open graphic frames. However, if I open client in terminal mode for the second time, the same error emergences. The error continues to show up if I open client in terminal mode further.
I'm really frustrated after 10 hours' digging. Maybe I should learn Lisp seriously? Any suggestions are appreciated!