2017-11-29 13 views
0

갑자기 무언가가 발생했을 때, 저는 .emacs 파일로 엉망이었습니다. .emacs 파일을 편집 할 수 없습니다. 나는 이맥스는 파일 자체를 삭제하는 것을 시도했다하지만 다시 내가 다시 이맥스를 시작할 때마다 앞으로 계속.emacs 파일을 편집하고 저장할 수 없습니다. 오류; 심볼의 함수 정의가 무효입니다 : auto-update-file-header

Symbol’s function definition is void: auto-update-file-header.

: 나는 시도하고 파일을 저장 한 후 수정할 때마다, 그것은 나에게 오류를 제공합니다. 여기

내 이맥스 파일에 포함 된 내용입니다 :

(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 
    ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#e090d7" "#8cc4ff" "#eeeeec"]) 
'(custom-enabled-themes (quote (manoj-dark))) 
'(package-selected-packages (quote (color-identifiers-mode flycheck)))) 
(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. 
) 
(require 'package) 

(add-to-list 'package-archives 
      '("MELPA Stable" . "https://stable.melpa.org/packages/") t) 
(package-initialize) 
(add-to-list 'package-archives 
      '("melpa" . "http://melpa.milkbox.net/packages/") t) 
(package-refresh-contents) 
(add-hook 'after-init-hook #'global-flycheck-mode) 
(add-hook 'after-init-hook 'global-color-identifiers-mode) 
(add-to-list 'custom-theme-load-path "/Users/kjr132/.emacs.d/themes") 
(set-cursor-color "#0a9dff") 
(provide 'init-themes) 
(add-to-list 'load-path' "~/.emacs.d/") 
(package-install 'color-identifiers-mode) 
(autoload 'auto-make-header "header2")  
(add-hook 'write-file-hooks 'auto-update-file-header)  
(add-hook 'emacs-lisp-mode-hook 'auto-make-header)  
(add-hook 'c-mode-common-hook 'auto-make-header)  
(add-hook 'tex-mode-hook 'auto-make-header) 
(add-to-list 'load-path "~/.emacs.d") 
(defun my-compilation-hook() 
    (when (not (get-buffer-window "*compilation*")) 
    (save-selected-window 
     (save-excursion 
     (let* ((w (split-window-vertically)) 
       (h (window-height w))) 
      (select-window w) 
      (switch-to-buffer "*compilation*") 
      (shrink-window (- h compilation-window-height))))))) 
(add-hook 'compilation-mode-hook 'my-compilation-hook) 
+0

파일은 emacs에서 필요하지만, 그 자체로는 다시 생성되지 않습니다. 나는 당신이 운명이라고 생각한다; D –

답변

0

실제 버그는 분명히 write-file-hooks에서 실행되는 auto-update-file-header을 정의되지 않은 것입니다. 그래서 디스크에 무언가를 쓰려고 할 때마다 Emacs는 오류를 던질 것입니다.

.emacs 파일의 write-file-hooks 행을 다른 편집기에서 삭제하거나 emacs -Q을 사용하여 삭제할 수 있습니다. 또는 용감한 사람이라면, 실행중인 Emacs에서

(remove-hook 'write-file-hooks 'auto-update-file-header) 

을 시도해보고 복구 할 수 있는지보십시오.

+0

나는이 이름의 기능을 위해 구글을 시도했지만 공백으로 나왔다. – tripleee

+0

나를 미치게 부르지 만, 나는'나노 '보다'vi'를 더 좋아한다. 현대'vi '에서, 화살표 키가 작동해야하고'd d'로 줄을 제거 할 수 있습니다. (''q! ') – tripleee

+0

다른 편집기를 사용하여 그 행을 지우려고했으나 (예 : 잘못된 것을 제거하면 취소 할 수 없습니다!) 그러나 다시, 그것은 되돌아 온다, 내가 그것을하는 어떤 것도 그것이 바뀌게한다. –

0

메시지는 실례입니다. 그들 4 개 개별 구성 요소 또는 셀을 가지고 here 바와 같이

Symbol’s function definition is void: auto-update-file-header 

이러한 메시지는 이맥스 LISP의 심볼의 특성을 나타낸다.

이 코드는 문제가 아니지만이 기호에 대해 람다 식을 확인할 수 없습니다. Emacs에서 심볼 함수 간접 연산이 작동하는 방법은 this을 참조하십시오.

기호를 통해 액세스 할 수있는 기능이있는 경우 고리를 추가하는 것이 좋으며 그렇지 않은 경우에는 아무 효과가 없습니다.

(if (symbol-function 'auto-update-file-header) 
    (add-hook 'write-file-hooks 'auto-update-file-header) 
(message "Symbol 'auto-update-file-header has void function definition. 
Maybe define one?"))