emacs的daemon

Emacs是慢,我承认,这也是为什么我在term下使用VIM.

不过今天看到个让Emacs飞起来的办法.真好!!

1.emacs --daemon

我用awesome,所以添加在.xinitrc里面了

eamcs --daemon &

2. emacsclient

         emacsclient -c 对应的GUI

         emacsclient -t 对应的是term,考虑term下面也换成emacs,那多爽阿.

为了方便 win+enter 直接启动emacsclient -c ,awesome的键绑.

在.bashrc中定义了  alias et='emacsclient -t "$@" -a "vim"'

要是daemon没启动的话就用vim替代.

3.Stopping the Emacs Daemon

The simplest way to stop the emacs daemon from within emacs is to use the kill-emacs or save-buffers-kill-emacs commands.

From outside of emacs this can be achieved using emacsclient:

    emacsclient -e '(kill-emacs)'

This will shutdown the daemon immediately with out prompting or saving files.

If you would like emacs to prompt if there are unsaved buffers or existing clients/frames, you can add the following functions to your .emacs file then use the command:

    emacsclient -e '(client-save-kill-emacs)'

问题:

1. 关于字体的设置

在client中的是没法用.emacs中定义的字体的,两个解决的方法.

使用利用 emacs 的一个 hook 函数 after-make-frame-functions

;;daemon时的字体
(defun frame-setting ()
  (interactive)
  ;; Setting English Font
  (set-face-attribute
   'default nil :font "Monaco 12")
  ;; Chinese Font
  (dolist (charset '(kana han symbol cjk-misc bopomofo))
    (set-fontset-font (frame-parameter nil 'font)
                      charset
                      (font-spec :family "文泉驿等宽微米黑" :size 18))))

;; 使用daemon启动的时候,添加字体,启动tabbar和光标闪烁
(if (and (fboundp 'daemonp) (daemonp))
    (add-hook 'after-make-frame-functions
              (lambda (frame)
                (with-selected-frame frame
                  (frame-setting)
                  (tabbar-mode t)
          (blink-cursor-mode t))))
  (frame-setting)
  (tabbar-mode t))

设置window-system-default-frame-alist,直接设置参数的默认值

(setq window-system-default-frame-alist
      '(
        ;; if frame created on x display
        (x
	 (menu-bar-lines . 1)
	 (tool-bar-lines . nil)
	 ;; mouse
	 (mouse-wheel-mode . 1)
	 (mouse-wheel-follow-mouse . t)
	 (mouse-avoidance-mode . 'exile)
	 ;; face
	 (font . "文泉驿等宽微米黑 8")
	 )
        ;; if on term
        (nil
	 (menu-bar-lines . 0) (tool-bar-lines . 0)
	 ;; (background-color . "black")
	 ;; (foreground-color . "white")
	 )
	)
      )

我用的是第一个方法,第二个方法没看懂怎么用的.

第一个方法我添加了tabbar和光标闪烁.

2.desktop 的问题

emacs的desktop,公司的电脑有问题,家里的就没有 ,还要在看看.

转载于:https://www.cnblogs.com/darwin/archive/2011/05/26/2059282.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值