Emacs가 이 Lisp 디버거 보고서를 해석하는 방법

Emacs가 이 Lisp 디버거 보고서를 해석하는 방법

..emacsemacs -debug-init &​오류가 무엇인지 말해 보세요.

   Debugger entered--Lisp error: (file-error "Cannot open load file" "browse-kill-ring")
      require(browse-kill-ring)
      eval-buffer(#<buffer  *load*> nil "/home/Harry/.emacs" nil t)  ; Reading at buffer position 2772
      load-with-code-conversion("/home/Harry/.emacs" "/home/Harry/.emacs" t t)
      load("~/.emacs" t t)
      command-line()
      normal-top-level()

이것은 내 .init 파일입니다.

;; Uncomment next line to give response to check .emacs loaded
(warn "Loading .emacs")
;; -----------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Set up colors 
;

(defun good-colors ()
  (progn
     (set-background-color "DimGray")
     (set-foreground-color "LightGray")
     (set-cursor-color "DarkSlateBlue")
     (set-border-color "DimGray")
     (set-mouse-color "DarkSlateBlue")

     (set-face-background 'default "DimGray")
     (set-face-background 'region "DarkSlateGray")
     (set-face-background 'highlight "DarkSlateBlue")
     (set-face-background 'modeline "DarkSlateBlue") ;;; CornflowerBlue")

     (set-face-foreground 'default "LightGray")
     (set-face-foreground 'region "Ivory")
     (set-face-foreground 'highlight "LightGray")  ;;; DimGray")
     (set-face-foreground 'modeline "LightGray")
     ))

;; (good-colors)  ;; calls the previously-defined function

;; ====================
;; insert date and time

(defvar current-date-time-format "%a %b %d %H:%M:%S %Z %Y"
  "Format of date to insert with `insert-current-date-time' func
See help of `format-time-string' for possible replacements")

(defvar current-time-format "%a %H:%M:%S"
  "Format of date to insert with `insert-current-time' func.
Note the weekly scope of the command's precision.")

(defun insert-current-date-time ()
  "insert the current date and time into current buffer.
Uses `current-date-time-format' for the formatting the date/time."
       (interactive)
       (insert "==========\n")
;       (insert (let () (comment-start)))
       (insert (format-time-string current-date-time-format (current-time)))
       (insert "\n")
       )

(defun insert-current-time ()
  "insert the current time (1-week scope) into the current buffer."
       (interactive)
       (insert (format-time-string current-time-format (current-time)))
       (insert "\n")
       )

(global-set-key "\C-c\C-d" 'insert-current-date-time)
(global-set-key "\C-c\C-t" 'insert-current-time)

;; Set current line as title in my Hints file, e.g. "TITLE" becomes ..
;;             -------- TITLE --------

(fset 'title
   (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([1 45 45 45 45 45 45 45 45 32 5 32 45 45 45 45 45 45 45 45 1 escape 120 99 101 110 116 tab 108 105 tab return] 0 "%d")) arg)))

(global-set-key "\C-c\C-T" 'title)

;; * Customization defaults in this file
;; From: http://mwolson.org/notes/PlugEmacsConfPresentation.html
;;
;; Uncomment this to cause the Tab key to insert spaces instead of
;; tabs.  The default is to insert tabs.
;;
 (setq-default indent-tabs-mode nil)
;;
;; Enable browsing of kill ring (that is, recently-killed/cut text)
;; when you hit M-y
(require 'browse-kill-ring)
(defadvice yank-pop (around kill-ring-browse-maybe (arg))
  "If last action was not a yank, run `browse-kill-ring' instead."
  (if (not (eq last-command 'yank))
      (browse-kill-ring)
    ad-do-it))
(ad-activate 'yank-pop)
;;
;;  - Put backup data into the ~/.emacs.d/backup directory, instead of
;;    putting backup files in the current directory.  I find this to
;;    be much cleaner.
;;

(custom-set-variables
  '(backup-directory-alist (quote (("." . "~/.emacs.d/backup"))))
)

(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.
 '(inhibit-startup-buffer-menu t)
 '(inhibit-startup-screen t))
(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.
 )

해결됨:

@sds 및 @Drew의 답변을 따르고 다음 정보를 사용하여 browse-kill-ring.el내 디렉터리에 패키지를 설치했습니다..emacs.dhttp://ergoemacs.org/emacs/emacs_installing_packages.html.init내 파일 에 다음을 넣으십시오.

;; Tell emacs where is your personal elisp lib dir
;; this is default dir for extra packages
(add-to-list 'load-path "~/.emacs.d/")

;; load the packaged named xyz.
(load "browse-kill-ring") ;; best not to include the ending “.el” or “.elc”

@sds 및 @Drew 덕분에 모든 것이 정확해졌습니다. 불행히도 두 답변을 모두 받아들일 수는 없습니다.

답변1

보고서의 의미는 처음 두 줄에 있습니다.

Debugger entered--Lisp error: (file-error "Cannot open load file" "browse-kill-ring")
  require(browse-kill-ring)

을(를) 로드하려고 시도 중이지만 browse-kill-ringemacs가 작업을 수행할 수 없습니다.

당신은해야합니다이 패키지를 설치하세요사용하기 전에.

답변2

browse-kill-ring.el변수에 라이브러리 위치를 추가해야 합니다 load-path. 예를 들어 browse-kill-ring.el위치에 있는 경우 /some/directory/browse-kill-ring.el초기화 파일( ~/.emacs)에 다음을 추가합니다.

(add-to-list 'load-path "some/directory/browse-kill-ring.el")

관련 정보