Emacs package installs script in initialization file

I reorganized my init Emacs files to install them under version control. The layout of the file system is as follows:

/home/axel/.user_config/emacs
├── development.el
├── general.el
├── init.el
├── packages.el
└── writing.el

packages.elcontains a list of packages that Emacs should install at startup, if they are not already installed. This works without problems after execution rm -rf ~/.emacs.d/*. When I start Emacs after this, all the packages listed in packages.elare installed. However, when I manually add a package (for example markdown-mode+) to the list pfl-packagesin packages.el, the new package does not install when I restart Emacs. Removing the content ~/.emacs.d/solves this problem again, but I would like to be able to add the package names to the list that Emacs automatically installs at startup. Did I miss something important during Emacs initialization?

Please view the contents of the relevant files below.

The file ~/.emacscontains the following:

(add-to-list 'load-path "~/.user_config/emacs/")
(load-library "init")

The file ~/.user_config/emacs/init.elcontains:

;;;; loads the different libraries to set up Emacs accordingly

;; load the library that sets up package repositories and syncing
(load-library "packages")

;; load the library that sets up the general behavior of Emacs
(load-library "general")
(load-library "writing")
(load-library "development")

The file packages.elcontains the following:

;;;; this library sets up package repositories and allows for syncing    packages
;;;; between different machines
;;;; to add packages to the syncing, add their repository names to the   list `pfl-packages'

;;; set up package repositories from which additional packages can be installed

;; set up ELPA and MELPA repositories
(package-initialize)
(add-to-list 'package-archives
                     '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives
                     '("org" . "http://orgmode.org/elpa/"))


;;; set up package syncing to allow for syncing between different machines

;; list of packages to sync
(setq pfl-packages
        '(
            color-theme-sanityinc-solarized
            company
            company-auctex
            company-c-headers
            company-irony
            company-quickhelp
            elpy
            ess
            flycheck-irony
            irony
            magit
            markdown-mode
            markdown-mode+
            rainbow-delimiters
            smart-tabs-mode
            yasnippet
            ))

;; refresh package list if it is not already available
(when (not package-archive-contents) (package-refresh-contents))

;; install packages from the list that are not yet installed
(dolist (pkg pfl-packages)
    (when (and (not (package-installed-p pkg)) (assoc pkg package-archive-contents))
        (package-install pkg)))
+4
source
1

~/.emacs.d init.el :

(load "~/.emacs.d/init-packages")

init-packages.el , : emacs , , , . , .

, package-initialize , .

init-packages.el:

(require 'package)

(add-to-list 'package-archives
             '("elpy" . "http://jorgenschaefer.imtqy.com/packages/"))

(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))

(add-to-list 'package-archives
             '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t)

(add-to-list 'load-path "~/.emacs.d/site-lisp/")


; list the packages you want
(setq package-list
    '(python-environment deferred epc 
        flycheck ctable jedi concurrent company cyberpunk-theme elpy 
        yasnippet pyvenv highlight-indentation find-file-in-project 
        sql-indent sql exec-path-from-shell iedit
        auto-complete popup let-alist magit git-rebase-mode 
        git-commit-mode minimap popup))


; activate all the packages
(package-initialize)

; fetch the list of packages available 
(unless package-archive-contents
  (package-refresh-contents))

; install the missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

, , !

+9

All Articles