CodeKingPlusPlus
CodeKingPlusPlus

Reputation: 16081

Emacs not loading package at startup

Emacs will not load the package window-number I have the following in my .emacs file:

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

However, once emacs is started if I type: M-x load-file RETURN .emacs Then window-number-mode will be loaded.

What is going on here and why won't window-number load on startup? Note that I downloaded window-number from elpa

EDIT window-number-mode works, but it won't start when emacs starts. I have to type M-x window-number-mode. I tried inserting (window-number-mode) into my .emacs file but this did not fix my problem.

Upvotes: 3

Views: 1478

Answers (2)

Joseph Helfert
Joseph Helfert

Reputation: 421

In .el file have you seen this?

;; 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.

Upvotes: 1

juanleon
juanleon

Reputation: 9380

If you loaded the package from elpa, make sure you have (package-initialize) before you use the package. That function (among other things) updates the load-path to include the directories of downloaded packages.

The "require" might be unnecessary, as elpa packages typically have autoloads, but it makes no harm.

Upvotes: 2

Related Questions