Emacs打开最近的文件缓慢! [英] Emacs is slow opening recent files!

查看:114
本文介绍了Emacs打开最近的文件缓慢!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当直接打开文件时,我打开一个最近被激活的文件,在我的 .emacs中添加以下行。

 (require'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(全局设置键\Cx\ \Cr'recentf-open-files)

需要大约2秒钟才能打开。



这是一个正常的行为吗?

我用于打开最近的文件的命令:



我的整个.emacs:

 (custom-set-variables 
;; custom-set-variables已被Custom添加
;;如果您手动编辑,
;;你的init文件应该只包含一个这样的实例
;;如果有不止一个,他们将无法正常工作
;;
;; (tool-bar-mode nil))
(custom-set-faces
;; custom-set-faces被Custom添加
;;如果你编辑i你可以把它搞砸,所以要小心。
;;您的init文件应该只包含一个这样的实例。
;;如果有不止一个,就不行。
'(default((t(:inherit nil:stipple nil:backgroundGrey15:foregroundGray:reverse-video nil:box nil:strike-through nil:overline nil:underline nil:体重正常:高度92:宽度正常:铸造轮廓:家庭摩纳哥))))))

;; colot主题插件
(加载到列表'加载路径〜/ .emacs.d /)
(require'color-theme)
(eval-after-loadcolor-theme
'(progn
(color- theme-initialize)
(color-theme-charcoal-black))

;; YASnippets
(add-to-list'load-path〜/ .emacs。 d / plugins / yasnippet-0.6.1c)
(require'yasnippet);;不是yasnippet-bundle
(yas / initialize)
(yas / load-directory〜/ .emacs.d / plugins / yasnippet-0.6.1c / snippets)

;;禁用启动屏幕和启动消息
(setq inhibit-startup-message t)

;; set yasnippet no indent
(setq yas / indent-line'none)

;;设置选项卡宽度
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-indent 4)

; ;设置打开最近的文件

(require'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(全局集-key\Cx\ \Cr'recentf-open-files)

;;设定行号
(global-linum-mode 1)

;;防止emacs备份文件
(setq make-backup-files nil)

;;所有语言的相同语法hightlight
(全局字体锁模式1)

;;删除粗体和下划线
(mapc
(lambda(face)
(set-face-attribute face nil:weight'normal:underline nil))
(face-list))


解决方案

当远程文件主持人已经走了。

 (setq recentf-keep'(file-remote-p file-readable-p))

可以解决您的问题(远程文件将保留,如果仍然存在则不进行测试)。


When opening a file directly its fast, but when I open a recent file which is activated adding the following lines in my .emacs.:

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

it takes around 2 seconds to open.

Is this a normal behavior can I do something about it?

The command I use to open recent files:

My whole .emacs:

(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 "Grey15" :foreground "Grey" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 92 :width normal :foundry "outline" :family "Monaco")))))

  ;;colot theme plugin
(add-to-list 'load-path "~/.emacs.d/")
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-charcoal-black)))

  ;;YASnippets
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
    (require 'yasnippet) ;; not yasnippet-bundle
    (yas/initialize)
    (yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/snippets")

;; disable splash screen and startup message
(setq inhibit-startup-message t)

;; set yasnippet no indent
(setq yas/indent-line 'none)

;; 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 line number
(global-linum-mode 1)

;; prevent emacs from making backup files
(setq make-backup-files nil) 

;; same syntax hightlight for all languages
(global-font-lock-mode 1)

;; remove bold and underline
 (mapc
  (lambda (face)
    (set-face-attribute face nil :weight 'normal :underline nil))
  (face-list))

解决方案

I had problem with recentf and remote file when the remote host was gone.

(setq recentf-keep '(file-remote-p file-readable-p))

May solve your problem (remote file will be kept without testing if they still exists).

这篇关于Emacs打开最近的文件缓慢!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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