首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >init中的Emacs Lisp错误(文件错误“无法打开加载文件"/home/user/a-m")

init中的Emacs Lisp错误(文件错误“无法打开加载文件"/home/user/a-m")
EN

Stack Overflow用户
提问于 2016-06-20 10:41:14
回答 1查看 3.1K关注 0票数 1

最近,我对init文件做了一些修改,我注意到--调试--init中似乎缺少一些加载文件。以下是调试器的输出

代码语言:javascript
复制
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 "\205\262

command-line()

normal-top-level()

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

最佳安德烈

编辑:这是init文件。我刚刚更改了jabber (电子邮件)的一些信息,但除此之外,文件没有改变

代码语言:javascript
复制
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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-c\C-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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-20 16:17:57

谢谢你的帮助。我没有正确地阅读新的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_INSTALLDIR\site-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抑止-默认-init t),或者删除`default.el’,否则您的设置可能会被覆盖!

因此,我只是将(setq inhibit-default-init t)添加到init文件中。

再次感谢!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37920437

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档