在“emacs -deamon”之后,我看不到emacsclient框架中的新主题。它从'emacs M-x server-start' [英] After 'emacs --deamon' I can not see new theme in emacsclient frame. It works from 'emacs M-x server-start'

查看:259
本文介绍了在“emacs -deamon”之后,我看不到emacsclient框架中的新主题。它从'emacs M-x server-start'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最小配置 https://www.refheap.com/18816

情景1。


  • 从终端运行emacs。


  • 从终端运行'emacsclient -c'

  • 效果:应用主题

  • Run 'emacs' from terminal.
  • M-x server-start
  • Run 'emacsclient -c' from terminal.
  • Effect: Theme applied.

场景2。


  • 从终端运行'emacs --daemon' li>
  • 运行'emacsclient -c'

  • 效果:主题不适用

为什么是这样?

.emacs.d / init.d config:

.emacs.d/init.d config:

(require 'package)
(package-initialize)

(defun install-pack (p)
"A utility function to help in installing emacs package."
(unless (package-installed-p p) (package-install p)))

(defun install-packs (packs)
"A utility function to help in installing emacs packages."
(unless package-archive-contents
        (package-refresh-contents))
(dolist (p packs) (install-pack p)))

;(load-theme 'tronesque)
(load-theme 'tronesque t)

;(load-theme 'tronesque)
;;(load-theme 'tronesque t)
(custom-set-variables
;; custom-set-variables was added by Custom.
'(custom-enabled-themes (quote (tronesque)))
'(custom-safe-themes (quote    ("b8f561a188a77e450ab8a060128244c81dea206f15c1152a6899423dd607b327" default))))
 (custom-set-faces
 ;; custom-set-faces was added by Custom.
 )


推荐答案

对于Emacs 24,

For Emacs 24,

(if (daemonp)
    (add-hook 'after-make-frame-functions
        (lambda (frame)
            (select-frame frame)
            (load-theme 'tronesque t)))
    (load-theme 'tronesque t))

(if (daemonp)
    (add-hook 'after-make-frame-functions
        (lambda (frame)
            (with-selected-frame frame
                (load-theme 'tronesque t))))
    (load-theme 'tronesque t))

应该做。

这篇关于在“emacs -deamon”之后,我看不到emacsclient框架中的新主题。它从'emacs M-x server-start'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆