3

我正在使用带有 GTK 工具包的 emacs 23.2。我使用以下配置参数从源代码构建 emacs:

./configure --prefix=/usr --without-makeinfo --without-sound

它使用以下配置构建 emacs:

  构建过程应该在哪里找到源代码?/home/****/传入/emacs-23.2
  Emacs 应该使用哪些操作系统和机器描述文件?
        `s/gnu-linux.h' 和 `m/intel386.h'
  应该用什么编译器构建 emacs?gcc -g -O2 -Wdeclaration-after-statement -Wno-pointer-sign  
  Emacs 应该使用 GNU 版本的 malloc 吗?是的
      (使用 GNU C 库中 Doug Lea 的新 malloc。)
  Emacs 是否应该为缓冲区使用重定位分配器?是的
  Emacs 是否应该使用 mmap(2) 进行缓冲区分配?不
  Emacs 应该使用什么窗口系统?x11
  Emacs 应该使用什么工具包?GTK
  我们在哪里可以找到 X Windows 头文件?标准目录
  我们在哪里可以找到 X Windows 库?标准目录
  Emacs 使用 -lXaw3d 吗?不
  Emacs 使用 -lXpm 吗?是的
  Emacs 使用 -ljpeg 吗?是的
  Emacs 使用 -ltiff 吗?是的
  Emacs 是否使用 gif 库?是的-lgif
  Emacs 使用 -lpng 吗?是的
  Emacs 是否使用 -lrsvg-2?不
  Emacs 使用 -lgpm 吗?是的
  Emacs 使用 -ldbus 吗?是的
  Emacs 使用 -lgconf 吗?不
  Emacs 使用 -lfreetype 吗?是的
  Emacs 是否使用 -lm17n-flt?不
  Emacs 使用 -lotf 吗?是的
  Emacs 使用 -lxft 吗?是的
  Emacs 是否使用工具包滚动条?是的

我的操作系统是 OpenSuSE 11.1,GTK 版本是 2.14.4。当我在保持向上/向下键的普通大小(大约 1000 行)的文件中滚动时,emacs 几乎挂起并产生大约 50% 的 CPU 负载。我使用以下插件:

  • 我做
  • 亚麻布
  • 标签栏
  • 自动完成配置

启动 emacs 可以-q解决问题,但是我没有任何插件。我无法弄清楚,我.emacs的哪一部分对这种行为负责。.emacs这是我的-file的摘录:

(需要'ido)
(ido-mode 1)

(需要'linum)
(全局 linum 模式 1)

(需要'标签栏)
(标签栏模式 1)
(tabbar-local-mode 0)
(tabbar-mwheel-mode 0)
(setq tabbar-buffer-groups-function
      (拉姆达()
        (列表“全部”)))
(global-set-key [M-left] 'tabbar-backward)
(global-set-key [M-right] 'tabbar-forward)

;; 隐藏工具栏(gtk 等)
(工具栏模式-1)

;; 鼠标滚动增强
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-scroll-amount '(5 ((shift) . 5) ((control) . nil)))

;; 智能家居
(defun smart-beginning-of-line ()
  “按下 HOME 时强制光标跳转到当前行的第一个非空白字符”
  (交互的)
  (让((oldpos(点)))
    (回到缩进)
    (和(= oldpos(点))
         (行首))))
(put 'smart-beginning-of-line 'CUA'move)
(global-set-key [home] 'smart-beginning-of-line)

(自定义设置变量
  ;; custom-set-variables 是由 Custom 添加的。
  ;; 如果你手动编辑它,你可能会搞砸,所以要小心。
  ;; 您的 init 文件应该只包含一个这样的实例。
  ;; 如果有多个,它们将无法正常工作。
 '(列数模式 t)
 '(cua-mode t nil (cua-base))
 '(自定义缓冲区缩进 4)
 '(删除选择模式无)
 '(显示时间 24 小时格式 t)
 '(显示时间-日期1)
 '(显示时间模式 t)
 '(全局字体锁定模式 t nil(字体锁定))
 '(禁止启动缓冲区菜单 t)
 '(禁止启动屏幕 t)
 '(pc-select-meta-moves-sexps t)
 '(pc-select-selection-keys-only t)
 '(pc-selection-mode t nil (pc-select))
 '(滚动条模式(右引号))
 '(显示父母模式 t)
 '(标准缩进 4)
 '(uniquify-buffer-name-style (quote forward) nil (uniquify)))

(setq-default tab-width 4)
(setq-default indent-tabs-mode t)
(setq c-basic-offset 4)

;; 突出显示当前行
(global-hl-line-mode 1)
(set-face-background 'hl-line "#E8F2FE")

(defalias 'yes-or-no-p 'y-or-np)
(显示时间)
(设置语言环境“Latin-1”)

;; 根据模式更改光标颜色
(setq djcb-只读颜色“灰色”)
;; 有效值为 t、nil、box、hollow、bar、(bar . WIDTH)、hbar、
;; (hbar.高度); 请参阅 set-cursor-type 的文档
(setq djcb-read-only-cursor-type 'hbar)
(setq djcb-overwrite-color "red")
(setq djcb-overwrite-cursor-type '框)
(setq djcb-正常颜色“黑色”)
(setq djcb-normal-cursor-type 'bar)

(defun djcb-set-cursor-according-to-mode ()
  “根据一些次要模式更改光标颜色和类型。”
  (条件
    (缓冲区只读
      (设置光标颜色 djcb 只读颜色)
      (setq cursor-type djcb-read-only-cursor-type))
    (覆盖模式
      (设置光标颜色 djcb 覆盖颜色)
      (setq cursor-type djcb-overwrite-cursor-type))
    (吨
      (设置光标颜色 djcb 正常颜色)
      (setq cursor-type djcb-normal-cursor-type))))
(add-hook 'post-command-hook 'djcb-set-cursor-according-to-mode)

(define-key global-map '[C-right] 'forward-sexp)
(define-key global-map '[C-left] 'backward-sexp)
(define-key global-map '[s-left] 'windmove-left)
(define-key global-map '[s-right] 'windmove-right)
(define-key global-map '[s-up] 'windmove-up)
(define-key global-map '[s-down] 'windmove-down)
(define-key global-map '[S-down-mouse-1] 'mouse-stay-and-copy)
(define-key global-map '[CMS-down-mouse-1] 'mouse-stay-and-swap)
(define-key global-map '[S-mouse-2] 'mouse-yank-and-kill)
(define-key global-map '[CS-down-mouse-1] 'mouse-stay-and-kill)
(define-key global-map "\Ca" 'mark-whole-buffer)

(自定义设置面
  ;; custom-set-faces 是由 Custom 添加的。
  ;; 如果你手动编辑它,你可能会搞砸,所以要小心。
  ;; 您的 init 文件应该只包含一个这样的实例。
  ;; 如果有多个,它们将无法正常工作。
 '(默认 ((t (:inherit nil :stipple nil :background "#f7f9fa" :foreground "#191919" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
 '(font-lock-builtin-face ((((class color) (min-colors 88) (background light)) (:foreground "#642880" :weight bold))))
 '(font-lock-comment-face ((((class color) (min-colors 88) (background light)) (:foreground "#3f7f5f"))))
 '(font-lock-constant-face ((((class color) (min-colors 88) (background light)) (:weight bold))))
 '(font-lock-doc-face ((t (:inherit font-lock-string-face :foreground "#3f7f5f"))))
 '(font-lock-function-name-face ((((class color) (min-colors 88) (background light)) (:foreground "Black" :weight bold))))
 '(font-lock-keyword-face ((((class color) (min-colors 88) (background light)) (:foreground "#7f0055" :weight bold))))
 '(font-lock-preprocessor-face ((t (:inherit font-lock-builtin-face :foreground "#7f0055" :weight bold))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background light)) (:foreground "#0000c0"))))
 '(font-lock-type-face ((((class color) (min-colors 88) (background light)) (:foreground "#7f0055" :weight bold))))
 '(font-lock-variable-name-face ((((class color) (min-colors 88) (background light)) (:foreground "Black"))))
 '(minibuffer-prompt ((t (:foreground "medium blue"))))
 '(模式行 ((t (:background "#222222" :foreground "White"))))
 '(tabbar-button ((t (:inherit tabbar-default :foreground "dark red"))))
 '(tabbar-button-highlight ((t (:inherit tabbar-default :background "white" :box (:line-width 2 :color "white")))))
 '(tabbar-default ((t (:background "gray90" :foreground "gray50" :box (:line-width 3 :color "gray90") :height 100))))
 '(tabbar-highlight ((t (:underline t))))
 '(tabbar-selected ((t (:inherit tabbar-default :foreground "blue" :weight bold))))
 '(tabbar-separator ((t nil)))
 '(tabbar-unselected ((t (:inherit tabbar-default)))))

有什么建议么?亲切的问候,mefiX

4

3 回答 3

5

对我来说看起来不错。使用 emacs -q 可以正常运行的事实是关键,因为这意味着您可以解决问题。

现在,我希望有人根据您的文件为您提供简单的诊断,但如果没有(嘿,已经 7 小时了),您可以随时尝试标准的 .emacs-debugging 慢速教练。这不是特别有趣,但它会起作用。

选择你的乐趣:

(A) 分而治之

将你的 .emacs 精神分成 4 个部分。现在通过制作四个单独的试用 emacs 配置来找出是哪个季度导致您的问题:第一个带有 1/4 的 emacs,下一个带有一半,下一个带有四分之三,最后一个带有所有内容。

emacs --no-site-file    # see if the problem is in your site-wide emacs init
emacs -q -l config1     # is it in the first quarter
emacs -q -l config2     # is it in the first half (i.e. the second quarter)
emacs -q -l config3     # is it in the third quarter
emads -q -l config4     # gotta be here, but test again to be sure

如果你没有找到罪魁祸首,你可以进一步划分。如果你怀疑你有罪魁祸首,或者只是更喜欢这个方法的外观,试试这个:

(B) 检查每一步

加载一个空白的emacsemacs -q

在缓冲区中访问您的 .emacs

访问另一个缓冲区中的 1K 行文件。

使用 eval-last-sexp Cx Ce 或 eval-region 来尝试 .emacs 中的每个部分或行,或者从头开始系统地进行,或者从任何可疑的函数调用开始。

慢慢地但肯定地,你会把它吸出来。抱歉,我无法为您提供即时诊断。

于 2010-06-02T14:56:15.107 回答
2

根据我的经验,关闭 linum 模式可以解决滚动冻结的问题。

于 2011-12-06T18:21:36.580 回答
0

我在使用 emacs 24 时遇到了同样的问题。结果是选项卡模式减慢了它的速度。

于 2012-09-13T14:11:20.543 回答