Emacs Lisp error at init (file-error "Cannot open load file" "/home/user/a-m" )



我最近在我的init emacs文件中做了一些更改,我注意到--debug-init似乎缺少一些加载文件。这是调试器的输出

Debugger entered--Lisp error: (file-error "Cannot open load file" "/home/andre/a-m")
load("/home/andre/a-m" nil nil t)
load-file("a-m")
eval-buffer(#<buffer  *load*> nil "/usr/local/share/emacs/site-lisp/default.el" nil t)  ; Reading at buffer position 269
load-with-code-conversion("/usr/local/share/emacs/site-lisp/default.el" "/usr/local/share/emacs/site-lisp/default.el" t t)
load("default" t t)
#[0 "205262
command-line()
normal-top-level()

我已经在网上搜索了a-m文件代表什么,以及如何纠正这些错误,但没有成功。感谢您的任何帮助!

最好 安德烈

编辑:这是初始化文件。我刚刚更改了有关jabber(电子邮件)的一些信息,但除此之外,文件保持不变

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; File name: ` ~/.emacs '
;; ---------------------
;; If you need your own personal ~/.emacs
;; please make a copy of this file
;; an placein your changes and/or extension.
;; Copyright (c) 1997-2002 SuSE Gmbh Nuernberg, Germany.
;; Author: Werner Fink, <feedback@suse.de> 1997,98,99,2002
;; Test of Emacs derivates
;; -----------------------
(load-library "url-handlers")
;; Always use PDFLaTeX
(setq TeX-PDF-mode t)
;; TeXcount setup for AUCTeX
(require 'tex)
(add-to-list 'TeX-command-list
(list "TeXcount" "texcount %s.tex" 'TeX-run-command nil t))
(load "auctex.el" nil t t)`
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
;; MELPA
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
'("melpa" . "http://melpa.org/packages/")
t)
(package-initialize))
;; YASNIPPETS
(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
(setq yas-snippet-dirs
'("~/.emacs.d/snippets"               ;; personal snippets
"~/.emacs.d/plugins/yasnippet/snippets/"    ;; the default collection
))
(yas-global-mode 1) ;; or M-x yas-reload-all if you've started YASnippet already.
;; Timestamp controls
(add-hook 'before-save-hook 'time-stamp)
(setq time-stamp-pattern nil)
;; Controls for calendar
(setq european-calendar-style t)
(set-default 'truncate-lines t)
;; Controls for jabber
(require 'jabber)
;;;;;;;;;;;;;;;
;; TRAMP mode
;;;;;;;;;;;;;;;
(setq tramp-default-method "ssh")
;;;;;;;;;;;
;;ORG mode
;;;;;;;;;;;
(define-key global-map "C-cl" 'org-store-link)
(define-key global-map "C-ca" 'org-agenda)
(setq org-log-done t)
(setq org-agenda-files (list "~/org/NOTES.org"))
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox")
(setq org-support-shift-select 't)
(setq org-agenda-include-diary t)
(setq org-src-fontify-natively t)
;;;;;;;;;;;
;;G-CODE
;;;;;;;;;;;
(require 'generic-x)
(define-generic-mode gcode-generic-mode
'(("(" . ")"))
(apply 'append 
(mapcar #'(lambda (s) (list (upcase s) (downcase s) (capitalize s)))
'("sub" "endsub" "if" "do" "while" "endwhile" "call" "endif" 
"sqrt" "return" "mod" "eq" "ne" "gt" "ge" "lt" "le" "and" 
"or" "xor" "atan" "abs" "acos" "asin" "cos" "exp" 
"fix" "fup" "round" "ln" "sin" "tan" "repeat" "endrepeat")))
'(("\(#<_?[A-Za-z0-9_]+>\)" (1 font-lock-type-face))
("\([NnGgMmFfSsTtOo]\)" (1 font-lock-function-name-face))
("\([XxYyZzAaBbCcUuVvWwIiJjKkPpQqRr]\)" (1 font-lock-string-face))
("\([-+]?[0-9]*\.[0-9]+\)" (1 font-lock-constant-face))
("\(#[0-9]+\)" (1 font-lock-type-face))
("\([0-9]+\)" (1 font-lock-constant-face)))
'("\.gcode\'")
nil
"Generic mode for g-code files.")
;;;;;;;;;;;
;;OpenSCAD
;;;;;;;;;;;
(add-to-list 'load-path
"/usr/local/share/emacs/site-lisp/")
(autoload 'scad-mode "scad-mode" "Activate OpenSCAD mode." 'interactive)
(add-to-list 'auto-mode-alist '("\.scad\'" . scad-mode))
;;;;;;;;
;;ANSYS
;;;;;;;;
(add-to-list 'load-path
"/usr/local/share/emacs/site-lisp/")
(autoload 'ansys-mode "ansys-mode" "Activate Ansys mode." 'interactive)
(add-to-list 'auto-mode-alist '("\.txt\'" . ansys-mode))
(add-to-list 'auto-mode-alist '("\.db\'" . ansys-mode))
;    (add-to-list 'auto-mode-alist '("\.dat\'" . ansys-mode))
;    (add-to-list 'auto-mode-alist '("\.inp\'" . ansys-mode))
;;;;;;;;;;;
;;LS-DYNA
;;;;;;;;;;;
(add-to-list 'load-path
"/usr/local/share/emacs/site-lisp/")
(autoload 'lsdyna-mode "lsdyna" "Enter ls-dyna mode." t)
(setq auto-mode-alist (cons '("\.k\'" . lsdyna-mode) auto-mode-alist))
;;;;;;;;;;;
;;ABAQUS
;;;;;;;;;;;
;; ;; setup files ending in “.inp” to open in python-mode
;; (add-to-list 'auto-mode-alist '("\.inp\'" . python-mode))
(add-to-list 'load-path
"/usr/local/share/emacs/site-lisp/")
(autoload 'abaqus-mode "abaqus" "Enter abaqus mode." t)
(setq auto-mode-alist (cons '("\.inp\'" . abaqus-mode) auto-mode-alist))
;;;;;;;;;;;;;;;;;;;;;;
;; PDF-LATEX+INKSCAPE
;;;;;;;;;;;;;;;;;;;;;;
(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.
'(LaTeX-command-style (quote (("" "%(PDF)%(latex) -shell-escape %S%(PDFout)"))))
'(ansys-current-ansys-version "140")
'(jabber-account-list (quote (("myemail.com"))))
'(org-agenda-files (quote ("~/org/NOTES.org")))
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server "smtp.googlemail.com")
'(smtpmail-smtp-service 587))
(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.
)
;; ;;;;;;;;;;;
;; ;;GNUPLOT
;; ;;;;;;;;;;;
;; (add-to-list 'Info-default-directory-list "/usr/info")
;; ;; load the file
;; (require 'gnuplot)
;; ;; specify the gnuplot executable (if other than /usr/bin/gnuplot)
;; (setq gnuplot-program "/usr/bin/gnuplot")
;; ;; automatically open files ending with .gp or .gnuplot in gnuplot mode
;; (setq auto-mode-alist 
;; (append '(("\.\(gp\|gnuplot\|p\)$" . gnuplot-mode)) auto-mode-alist))
; GIT controls
(add-to-list 'load-path ".../git/contrib/emacs")
(require 'git)
(require 'git-blame)
(require 'vc-git)
;; OCTAVE
(autoload 'run-octave "octave-inf" nil t)
(put 'upcase-region 'disabled nil)
;; PHP
(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
(add-to-list 'auto-mode-alist '("\.php$" . php-mode))
(add-to-list 'auto-mode-alist '("\.inc$" . php-mode))
;; Command for automatic alignment of comments
(defun align-comment (beg end)
(interactive "r")
(align-regexp beg end (concat "\(\s-*\)" comment-start))
)
(global-set-key "C-cC-a" 'align-comment )
;; Flyspell mode binding to F6 key
(global-set-key [f6] 'flyspell-mode)        ; F6
;; Command for automatic auto-fill
(add-hook 'text-mode-hook 'turn-on-auto-fill)

感谢您的帮助。我没有正确阅读新的ansys模式 https://github.com/dieter-wilhelm/ansys-mode 文档。这是问题所在:

请查看随附的default.el’ customisation example. It can be used as a configuration file (after moving it e. g. to/usr/share/emacs/site-lisp' 或c:EMACS_INSTALLDIRsite-lisp’, hint: The directory site-lisp/ in the Emacs installation tree is in its default load-path). Yetdefault.el' 在您的个人 Emacs 配置文件(如果有的话)~/.emacs’ (or~/.emacs.d/init.el')之后加载!如果您打算使用 Emacs 的自定义系统更改以下设置或直接在您的个人配置文件中更改它们,您必须在个人配置文件中设置变量inhibit-default-init’ tot' "(setq inhibit-default-init t)" 或删除 'default.el',否则您的设置可能会被覆盖!

所以我只是在 init 文件中添加了(setq inhibit-default-init t)

再次感谢!

请注意,在 Git 2.18(2018 年第 2 季度)中,contrib/emacs/中的脚本已经过时了,并且已被错误并告诉用户有替换的存根替换。

因此,init错误消息在2018年可能不再适用。

参见 提交 6d5ed48 (2018 年 4 月 11 日) 由 Ævar Arnfjörð Bjarmason (avar)。
(由Junio C Hamano --gitster-- 在提交 7d7d051 中合并,2018 年 5 月 8 日)

git{,-blame}.el:删除旧的 Emacs 代码

git-blame.el模式已被Emacs自己的模式所取代。vc-annotate
(由C-xvg调用)。
git.el模式的用户现在最好使用 Magit 或 Git 后端来实现 Emacs 自己的 VC 模式。

这些模式是在 10 多年前添加的,当时 Emacs 自己的 Git 支持 成熟度要低得多,野外也没有其他成熟模式 或者随 Emacs 本身一起提供。

如今,这些模式几乎没有用户,而 git 的用户也不是 我们运送这些服务很好(一些操作系统将它们与 git 一起安装) 默认情况下,这令人困惑并导致用户误入歧途)。

[...]而不是在升级时收到神秘的加载错误, 现有用户将收到将他们定向到README文件的错误,或者 只是停止需要这些模式

详见"git/contrib/emacs/README"。

相关内容

最新更新