在this pdf document之后,我在~/.emacs文件中添加了以下内容:
(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-PDF-mode t) ;; .pdf statt .dvi per default:
;;Zeilenumbruch
;;(add-hook ’LaTeX-mode-hook ’turn-on-auto-fill)
;;Syntax Higlight
(add-hook ’LaTeX-mode-hook ’turn-on-font-lock)
;; Mathe Modus
(add-hook ’LaTeX-mode-hook ’LaTeX-math-mode)
;; Reftex einflechten und laden
(setq reftex-plug-into-AUCTeX t)
(add-hook ’LaTeX-mode-hook ’turn-on-reftex)
;; Satzende ". " statt ". ". " fuer M-k: loeschen bis Satzende usw.
;;(setq sentence-end "[.?!][]\"’)}]*\\($\\| \\| \\)[
;;]*") ;; Da ist ein "Newline in der Zeile!"
;;(setq sentence-end-double-space nil)
;;direkte Rechtschreib Korrektur:
;;(add-hook ’LaTeX-mode-hook ’flyspell-mode)
;; Nur benutzen falls Auctex > 11.81 mit preview-latex:
(load "preview-latex.el" nil t t)
;; aspell ist besser als ispell.
;; Zeile kommentieren, falls nicht installiert:
(setq-default ispell-program-name "aspell")
;; Deutsche Rechtschreibung falls \usepackage{ngerman}
;; oder german benutzt wird
(add-hook ’TeX-language-de-hook
(function (lambda () (ispell-change-dictionary "german8"))))不幸的是,emacs现在不能启动,相反,它会给出错误
Warning (initialization): An error occurred while loading `/home/../.emacs':
Symbol's value as variable is void: ’LaTeX-mode-hook
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.开始使用--debug-init时,它会提供以下信息
Debugger entered--Lisp error: (void-variable ’LaTeX-mode-hook)
(add-hook ’LaTeX-mode-hook ’turn-on-font-lock)
eval-buffer(#<buffer *load*> nil "/home/../.emacs" nil t) ; Reading at buffer position 812
load-with-code-conversion("/home/../.emacs" "/home/../.emacs" t t)
load("~/.emacs" t t)
...我试着改用latex-mode-hook。我在寻找解决方案,但我似乎是唯一一个有这个问题的人。
我使用的是带有最新Emacs和Auctex的Ubuntu 12.04。如果需要,我会发布版本信息,但我认为必须将某些内容添加到配置中,或者必须安装任何软件包。
如何让emacs与该配置一起工作?
发布于 2012-06-07 13:01:31
您是否使用了错误的单引号字符?它似乎是某种反引号,而不是简单的单引号。试一试
'LaTeX-mode-hook而不是
’LaTeX-mode-hook(对于该字符的所有其他出现情况也是如此)。
https://stackoverflow.com/questions/10919398
复制相似问题