Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix Emacs警告加载“…/.Emacs.el”时出错:_Unix_Emacs_Elisp - Fatal编程技术网

Unix Emacs警告加载“…/.Emacs.el”时出错:

Unix Emacs警告加载“…/.Emacs.el”时出错:,unix,emacs,elisp,Unix,Emacs,Elisp,在emacs中编辑.emacs.el时,我运行了Alt+X eval buffer命令。 我的操作系统是windows。 当我重新启动emacs时,它会显示以下警告: 警告初始化:加载时出错 `…/.emacs.el': 错误:用于Unicode转义的非十六进制数字 为确保正常运行,您应调查并移除 初始化文件中错误的原因。使用 `-“调试初始化”选项以查看完整的错误回溯 .emacs.el是: ;;Open all fine in one running instance ;;Ref:http:

在emacs中编辑.emacs.el时,我运行了Alt+X eval buffer命令。 我的操作系统是windows。 当我重新启动emacs时,它会显示以下警告:

警告初始化:加载时出错 `…/.emacs.el':

错误:用于Unicode转义的非十六进制数字

为确保正常运行,您应调查并移除 初始化文件中错误的原因。使用 `-“调试初始化”选项以查看完整的错误回溯

.emacs.el是:

;;Open all fine in one running instance
;;Ref:http://www.johndcook.com/blog/2010/07/28/miscellaneous-emacs-adventures/
;;(server-start)

;;TEST
(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.
 `(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 `(custom-enabled-themes (quote (wheatgrass))))
(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.
 )

;;Set auto save backup location, failed with following warning
(setq backup-directory-alist
    `((".*" . ,"D:\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Unix-Tmp" t)))

(require 'recentf)
(recentf-mode 1)

(setq inhibit-startup-screen t)

(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)

;;Aspell install failed
;;(setq-default ispell-program-name "C:/bin/Aspell/bin/aspell.exe")
;;(setq text-mode-hook '(lambda() (flyspell-mode t) ))

如何解决它?

问题在于以下几行:

(setq backup-directory-alist
    `((".*" . ,"D:\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Unix-Tmp" t)))
\U引入了unicode转义。。。并且后面必须跟十六进制数字

实际上,您似乎想要的是一个文本反斜杠字符,因此您需要对其进行转义;i、 e

(setq backup-directory-alist
    `((".*" . ,"D:\\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\\Unix-Tmp" t)))
参考:

更新


然而,这似乎导致了另一个问题。更好的解决办法是按照@Stefan的建议去做。使用/而不是\作为路径名分隔符。它甚至可以在Windows上工作…

问题在于以下几行:

(setq backup-directory-alist
    `((".*" . ,"D:\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Unix-Tmp" t)))
\U引入了unicode转义。。。并且后面必须跟十六进制数字

实际上,您似乎想要的是一个文本反斜杠字符,因此您需要对其进行转义;i、 e

(setq backup-directory-alist
    `((".*" . ,"D:\\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\\Unix-Tmp" t)))
参考:

更新


然而,这似乎导致了另一个问题。更好的解决办法是按照@Stefan的建议去做。使用/而不是\作为路径名分隔符。它甚至可以在Windows上运行…

错误是由D:\Unix Tmp引起的,正如Stephen所说,您引入了unicode转义

但当我换成:

(setq backup-directory-alist
    `((".*" . ,"D:\\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\\Unix-Tmp" t)))
它将抛出另一个:

正在加载d:/git\u root\u tfs/WorkStation/Unix Home/.recentf…已完成清理 更新recentf列表…已完成删除0以获取有关GNU Emacs的信息 和GNU系统,C-h C-a型。使自动保存文件名:无效 在替换文本中使用“\”

最后,我将路径更改为D:\Tmp Unix,它就可以工作了

(setq backup-directory-alist
    `((".*" . ,"D:\Tmp-Unix")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Tmp-Unix" t)))
总计。eamcs.el为

;;Open all fine in one running instance
;;Ref:http://www.johndcook.com/blog/2010/07/28/miscellaneous-emacs-adventures/
;;(server-start)

;;TEST
(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.
 `(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 `(custom-enabled-themes (quote (wheatgrass))))
(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.
 )

;;Set auto save backup location, failed with following warning
(setq backup-directory-alist
    `((".*" . ,"D:\Tmp-Unix")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Tmp-Unix" t)))

(require 'recentf)
(recentf-mode 1)

(setq inhibit-startup-screen t)

(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)

;;Aspell install failed
;;(setq-default ispell-program-name "C:/bin/Aspell/bin/aspell.exe")
;;(setq text-mode-hook '(lambda() (flyspell-mode t) ))

错误是由D:\Unix Tmp\U引入unicode转义引起的,如Stephen所述

但当我换成:

(setq backup-directory-alist
    `((".*" . ,"D:\\Unix-Tmp")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\\Unix-Tmp" t)))
它将抛出另一个:

正在加载d:/git\u root\u tfs/WorkStation/Unix Home/.recentf…已完成清理 更新recentf列表…已完成删除0以获取有关GNU Emacs的信息 和GNU系统,C-h C-a型。使自动保存文件名:无效 在替换文本中使用“\”

最后,我将路径更改为D:\Tmp Unix,它就可以工作了

(setq backup-directory-alist
    `((".*" . ,"D:\Tmp-Unix")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Tmp-Unix" t)))
总计。eamcs.el为

;;Open all fine in one running instance
;;Ref:http://www.johndcook.com/blog/2010/07/28/miscellaneous-emacs-adventures/
;;(server-start)

;;TEST
(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.
 `(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 `(custom-enabled-themes (quote (wheatgrass))))
(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.
 )

;;Set auto save backup location, failed with following warning
(setq backup-directory-alist
    `((".*" . ,"D:\Tmp-Unix")))
(setq auto-save-file-name-transforms
    `((".*" ,"D:\Tmp-Unix" t)))

(require 'recentf)
(recentf-mode 1)

(setq inhibit-startup-screen t)

(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)

;;Aspell install failed
;;(setq-default ispell-program-name "C:/bin/Aspell/bin/aspell.exe")
;;(setq text-mode-hook '(lambda() (flyspell-mode t) ))

在Emacs中,文件名始终使用正向斜杠而不是反向斜杠。Windows通常更喜欢向后斜杠,但除了少数例外,Windows实际上也接受向前斜杠。

在Emacs中,文件名总是使用向前斜杠而不是向后斜杠。Windows通常更喜欢向后斜杠,但除了少数例外,Windows实际上也接受向前斜杠。

Windows中的Emacs将向前斜杠/视为反斜杠\。指定任何类型的路径时,应始终使用正斜杠。Emacs将正确解释它们。这允许您将转义序列的使用控制到达到预期效果的时间


C:/Users/username/AppData/Roaming/.emacs在emacs中是完全有效的路径/文件名。

Windows中的emacs将前斜杠/视为反斜杠\。指定任何类型的路径时,应始终使用正斜杠。Emacs将正确解释它们。这允许您将转义序列的使用控制到达到预期效果的时间


C:/Users/username/AppData/Roaming/.emacs在emacs中是完全有效的路径/文件名。

谢谢Stephen。我试过你的解决办法。但它抛出以下错误:加载d:/git\u root\u tfs/WorkStation/Unix Home/.recentf…完成清理recentf列表…完成0删除有关GNU Emacs和GNU系统的信息,键入C-h C-a。自动保存文件名:在替换文本中使用“\”无效我已将路径更改为D:\Tmp Unix。它起作用了。非常感谢汉克斯·斯蒂芬。我试过你的解决办法。但它抛出以下错误:加载d:/git\u root\u tfs/WorkStation/Unix Home/.recentf…完成清理recentf列表…完成0删除有关GNU Emacs和GNU系统的信息,键入C-h C-a。自动保存文件名:在替换文本中使用“\”无效我已将路径更改为D:\Tmp Unix。它起作用了。谢谢