3

Emacs は、ファイルwindow-numberに次のようなパッケージをロードしません。.emacs

;;;windows                                                                  
(require 'window-number)                                                    
(window-number-mode) 

ただし、次のように入力するとemacsが開始されるとM-x load-file RETURN .emacswindow-number-modeロードされます。

ここで何が起こっていて、window-number起動時に読み込まれないのはなぜですか? window-numberelpaからダウンロードしたことに注意してください

EDIT window-number-mode は機能しますが、emacs の起動時に起動しません。入力する必要がありM-x window-number-modeます。ファイルに挿入しようと(window-number-mode)しまし.emacsたが、問題は解決しませんでした。

4

2 に答える 2

2

elpa からパッケージを読み込んだ場合は(package-initialize)、パッケージを使用する前に確認してください。この関数は (特に) ダウンロードしたパッケージのディレクトリを含むように load-path を更新します。

elpa パッケージには通常 autoload があるため、「require」は不要かもしれませんが、害はありません。

于 2013-07-17T14:11:29.173 に答える
1

.el ファイルでこれを見たことがありますか?

;; Installation
;; ============

;; Drop this file into your load path.  C-h v load-path RET or F1 v
;; load-path RET will help.  Then place the following lines into your
;; .emacs or ~/.xemacs/init.el and uncomment them.

;; ----------------------------------------------------------------------------

;; (autoload 'window-number-mode "window-number"
;;   "A global minor mode that enables selection of windows according to
;; numbers with the C-x C-j prefix.  Another mode,
;; `window-number-meta-mode' enables the use of the M- prefix."
;;   t)

;; (autoload 'window-number-meta-mode "window-number"
;;   "A global minor mode that enables use of the M- prefix to select
;; windows, use `window-number-mode' to display the window numbers in
;; the mode-line."
;;   t)

;; ----------------------------------------------------------------------------

;; Then you can use M-x window-number-mode RET to turn the mode on, or
;; place (window-number-mode 1) and (window-number-meta-mode 1) into
;; your .emacs or ~/.xemacs/init.el.
于 2013-07-17T13:57:36.023 に答える