Emacs медленно запускается при смене темы и добавлении некоторых плагинов - PullRequest
1 голос
/ 10 января 2010

Это нормальная форма Emacs для задержки и мигания в течение 4 секунд после смены темы, добавления плагинов и конфигурации? (этого не случилось с Vim).

Вот мой .emacs:

;; set tab width

;; turn on tabs
(setq indent-tabs-mode t)
(setq-default indent-tabs-mode t)

;; bind the tab key 
(global-set-key (kbd "TAB") 'self-insert-command)

;; set the tab width
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-indent 4)

;; set open recent files

(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)

;; set yasnippet

(add-to-list 'load-path "D:/Program Files/emacs-23.1/site-lisp/plugins/yasnippet-0.6.1c")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "D:/Program Files/emacs-23.1/site-lisp/plugins/yasnippet-0.6.1c/snippets")

;; set yasnippet dropdown prompt

(setq yas/prompt-functions '(yas/dropdown-prompt))

;; set yasnippet no indent

(setq yas/indent-line 'none)

;; same syntax hightlight for all languages

(global-font-lock-mode 1)

;; remove bold

(mapc
    (lambda (face)
        (when (eq (face-attribute face :weight) 'bold)
        (set-face-attribute face nil :weight 'normal)))
(face-list)) 

;; set color theme

(require 'color-theme)
(color-theme-initialize)
(color-theme-charcoal-black)

;; set line number

(global-linum-mode 1)

;; set the highlight current line minor mode

;; in every buffer, the line which contains the cursor will be fully
;; highlighted

(global-hl-line-mode 1)

;; prevent emacs from making backup files

(setq make-backup-files nil) 

;; default 

  (custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(tool-bar-mode nil))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "SystemWindow" :foreground "SystemWindowText" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "outline" :family "Monaco")))))

Могу ли я улучшить это?

1 Ответ

3 голосов
/ 10 января 2010

Мигает нормально. Скорость может быть улучшена путем байт-компиляции вашего кода elisp. Для этого выполните M-x byte-compile-file и укажите путь к вашему .emacs, затем выполните C-u 0 M-x byte-recompile-directory для каждого каталога elisp, который еще не скомпилирован байтово (возможно, в вашем случае - yasnippet).

Перезапустите Emacs и посмотрите, увеличилась ли скорость. Если он все еще медленный, после запуска Emacs переключитесь в буфер сообщений и найдите сообщения в виде

Загрузка C: \ foo \ bar.el (источник) ... сделано

Если часть "(source)" находится здесь, то также можно скомпилировать каталог C: \ foo.

Также помните, что вам нужно перекомпилировать .emacs после каждого изменения в нем.

...