Move config files to XDG-compatible path
Move config files to XDG-compatible path: `$HOME/.config/emacs`.
This commit is contained in:
parent
05ad81c631
commit
7df5b0e507
19 changed files with 3 additions and 3 deletions
100
.config/emacs/init.el
Normal file
100
.config/emacs/init.el
Normal file
|
@ -0,0 +1,100 @@
|
|||
;;;;
|
||||
;;;;;; -*- Mode: Emacs-Lisp -*-
|
||||
;;;;
|
||||
;; package config
|
||||
;; We want certificate verification for the repositories, see
|
||||
;; <https://glyph.twistedmatrix.com/2015/11/editor-malware.html> for
|
||||
;; the issues involved. Note that on Debian, `gnutls-trustfiles' has
|
||||
;; reasonable settings, so we don't need to customize that.
|
||||
(setq tls-checktrust t)
|
||||
(setq gnutls-verify-error t)
|
||||
|
||||
(setq tls-program
|
||||
'("gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p %p %h"))
|
||||
|
||||
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
||||
|
||||
;; Do package initialization now, so we can require packages from config snippets
|
||||
(setq package-enable-at-startup nil)
|
||||
(require 'package)
|
||||
(setq package-archives
|
||||
'(("gnu" . "https://elpa.gnu.org/packages/")
|
||||
("melpa" . "https://melpa.org/packages/")))
|
||||
|
||||
;; package list to install
|
||||
(setq package-list '(use-package))
|
||||
|
||||
;; activate packages
|
||||
(package-initialize)
|
||||
|
||||
;; fetch list of available packages
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
|
||||
;; install missing packages
|
||||
(dolist (package package-list)
|
||||
(unless (package-installed-p package)
|
||||
(package-install package)))
|
||||
|
||||
;; configure packages (taken from https://r0tty.org/git/dotfiles/emacs)
|
||||
(require 'use-package)
|
||||
|
||||
;; file used for storing customization information
|
||||
(setq custom-file "~/.config/emacs/custom.el")
|
||||
(load custom-file)
|
||||
|
||||
;; set auth-sources
|
||||
(setq auth-sources '("~/.authinfo.gpg"))
|
||||
|
||||
;; Config snippets loading; this provides an easy way to define
|
||||
;; 'configuration snippets' for use with a specific package (that may
|
||||
;; be not installed), and enable loading that snippet when its
|
||||
;; basename (specified as a symbol) is part of the variable
|
||||
;; config-snippets.
|
||||
(defgroup config-snippets nil
|
||||
"Configuration snippets -- elisp files that are loaded at startup.")
|
||||
|
||||
(defcustom config-snippets '()
|
||||
"Specifies the config snippets to be loaded at startup.
|
||||
Elements may be strings (interpreted as literal filenames) or
|
||||
symbols, which are converted to strings, and suffixed with \".el\"."
|
||||
:group 'config-snippets
|
||||
:type '(repeat (choice symbol string)))
|
||||
|
||||
(defcustom config-snippet-path '("~/.config/emacs/config/")
|
||||
"Specifies the path in which config snippets are searched"
|
||||
:group 'config-snippets
|
||||
:type '(repeat directory))
|
||||
|
||||
(setq config-snippets '(base
|
||||
backups
|
||||
c
|
||||
calendar
|
||||
dev
|
||||
ediff
|
||||
functions
|
||||
git
|
||||
gpg
|
||||
man
|
||||
multiple-cursors
|
||||
org
|
||||
pass
|
||||
python
|
||||
ripgrep
|
||||
rust
|
||||
tramp
|
||||
wl
|
||||
yaml))
|
||||
|
||||
(message "Loading\nconfig-snippets: %s\nconfig-snippets-path: %s" config-snippets config-snippet-path)
|
||||
(dolist (snippet config-snippets)
|
||||
(message "snippet: %s" snippet)
|
||||
(dolist (dir config-snippet-path)
|
||||
(message "dir: %s" dir)
|
||||
(let ((file-name (expand-file-name (concat dir (if (symbolp snippet)
|
||||
(concat (symbol-name snippet) ".el")
|
||||
snippet)))))
|
||||
(message "loading file")
|
||||
(if (file-readable-p file-name)
|
||||
(load-file file-name)
|
||||
(message "Config snippet not found: %s" snippet)))))
|
Loading…
Add table
Add a link
Reference in a new issue