|
|
@ -143,127 +143,73 @@ https://blog.d46.us/advanced-emacs-startup/ |
|
|
|
** Elpaca |
|
|
|
Boilerplate for Elpaca |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(defvar elpaca-installer-version 0.6) |
|
|
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) |
|
|
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) |
|
|
|
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) |
|
|
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" |
|
|
|
:ref nil |
|
|
|
:files (:defaults "elpaca-test.el" (:exclude "extensions")) |
|
|
|
:build (:not elpaca--activate-package))) |
|
|
|
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) |
|
|
|
(build (expand-file-name "elpaca/" elpaca-builds-directory)) |
|
|
|
(order (cdr elpaca-order)) |
|
|
|
(default-directory repo)) |
|
|
|
(add-to-list 'load-path (if (file-exists-p build) build repo)) |
|
|
|
(unless (file-exists-p repo) |
|
|
|
(make-directory repo t) |
|
|
|
(when (< emacs-major-version 28) (require 'subr-x)) |
|
|
|
(condition-case-unless-debug err |
|
|
|
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) |
|
|
|
((zerop (call-process "git" nil buffer t "clone" |
|
|
|
(plist-get order :repo) repo))) |
|
|
|
((zerop (call-process "git" nil buffer t "checkout" |
|
|
|
(or (plist-get order :ref) "--")))) |
|
|
|
(emacs (concat invocation-directory invocation-name)) |
|
|
|
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" |
|
|
|
"--eval" "(byte-recompile-directory \".\" 0 'force)"))) |
|
|
|
((require 'elpaca)) |
|
|
|
((elpaca-generate-autoloads "elpaca" repo))) |
|
|
|
(progn (message "%s" (buffer-string)) (kill-buffer buffer)) |
|
|
|
(error "%s" (with-current-buffer buffer (buffer-string)))) |
|
|
|
((error) (warn "%s" err) (delete-directory repo 'recursive)))) |
|
|
|
(unless (require 'elpaca-autoloads nil t) |
|
|
|
(require 'elpaca) |
|
|
|
(elpaca-generate-autoloads "elpaca" repo) |
|
|
|
(load "./elpaca-autoloads"))) |
|
|
|
(add-hook 'after-init-hook #'elpaca-process-queues) |
|
|
|
(elpaca `(,@elpaca-order)) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
For Windows it might be necessary to disable symlink creations |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(when *work_remote* |
|
|
|
(elpaca-no-symlink-mode)) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
use-package integration |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(defvar elpaca-installer-version 0.7) |
|
|
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) |
|
|
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) |
|
|
|
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) |
|
|
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" |
|
|
|
:ref nil :depth 1 |
|
|
|
:files (:defaults "elpaca-test.el" (:exclude "extensions")) |
|
|
|
:build (:not elpaca--activate-package))) |
|
|
|
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) |
|
|
|
(build (expand-file-name "elpaca/" elpaca-builds-directory)) |
|
|
|
(order (cdr elpaca-order)) |
|
|
|
(default-directory repo)) |
|
|
|
(add-to-list 'load-path (if (file-exists-p build) build repo)) |
|
|
|
(unless (file-exists-p repo) |
|
|
|
(make-directory repo t) |
|
|
|
(when (< emacs-major-version 28) (require 'subr-x)) |
|
|
|
(condition-case-unless-debug err |
|
|
|
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) |
|
|
|
((zerop (apply #'call-process `("git" nil ,buffer t "clone" |
|
|
|
,@(when-let ((depth (plist-get order :depth))) |
|
|
|
(list (format "--depth=%d" depth) "--no-single-branch")) |
|
|
|
,(plist-get order :repo) ,repo)))) |
|
|
|
((zerop (call-process "git" nil buffer t "checkout" |
|
|
|
(or (plist-get order :ref) "--")))) |
|
|
|
(emacs (concat invocation-directory invocation-name)) |
|
|
|
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" |
|
|
|
"--eval" "(byte-recompile-directory \".\" 0 'force)"))) |
|
|
|
((require 'elpaca)) |
|
|
|
((elpaca-generate-autoloads "elpaca" repo))) |
|
|
|
(progn (message "%s" (buffer-string)) (kill-buffer buffer)) |
|
|
|
(error "%s" (with-current-buffer buffer (buffer-string)))) |
|
|
|
((error) (warn "%s" err) (delete-directory repo 'recursive)))) |
|
|
|
(unless (require 'elpaca-autoloads nil t) |
|
|
|
(require 'elpaca) |
|
|
|
(elpaca-generate-autoloads "elpaca" repo) |
|
|
|
(load "./elpaca-autoloads"))) |
|
|
|
(add-hook 'after-init-hook #'elpaca-process-queues) |
|
|
|
(elpaca `(,@elpaca-order)) |
|
|
|
|
|
|
|
;(setq use-package-always-ensure t) |
|
|
|
(elpaca elpaca-use-package |
|
|
|
;; enable :elpaca use-package keyword |
|
|
|
(elpaca-use-package-mode) |
|
|
|
;; assume :elpaca t unless otherwise specified |
|
|
|
(setq elpaca-use-package-by-default t)) |
|
|
|
;; enable use-package :ensure support for elpaca |
|
|
|
(elpaca-use-package-mode)) |
|
|
|
|
|
|
|
;; block until current queue processed. |
|
|
|
(elpaca-wait) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
For Windows it might be necessary to disable symlink creations |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(defun +elpaca-unload-seq (e) |
|
|
|
(and (featurep 'seq) (unload-feature 'seq t)) |
|
|
|
(elpaca--continue-build e)) |
|
|
|
|
|
|
|
;; You could embed this code directly in the reicpe, I just abstracted it into a function. |
|
|
|
(defun +elpaca-seq-build-steps () |
|
|
|
(append (butlast (if (file-exists-p (expand-file-name "seq" elpaca-builds-directory)) |
|
|
|
elpaca--pre-built-steps elpaca-build-steps)) |
|
|
|
(list '+elpaca-unload-seq 'elpaca--activate-package))) |
|
|
|
|
|
|
|
;;(elpaca `(seq :build ,(+elpaca-seq-build-steps))) |
|
|
|
(use-package seq :elpaca `(seq :build ,(+elpaca-seq-build-steps))) |
|
|
|
(when *work_remote* |
|
|
|
(elpaca-no-symlink-mode)) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
** COMMENT Rest of the stuff |
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(require 'package) |
|
|
|
|
|
|
|
(add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/") t) |
|
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) |
|
|
|
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) |
|
|
|
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t) |
|
|
|
|
|
|
|
; fix for bug 34341 |
|
|
|
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") |
|
|
|
|
|
|
|
(when (< emacs-major-version 27) |
|
|
|
(package-initialize)) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(unless (package-installed-p 'use-package) |
|
|
|
(package-refresh-contents) |
|
|
|
(package-install 'use-package)) |
|
|
|
|
|
|
|
(eval-when-compile |
|
|
|
(setq use-package-enable-imenu-support t) |
|
|
|
(require 'use-package)) |
|
|
|
(require 'bind-key) |
|
|
|
|
|
|
|
(setq use-package-verbose t) |
|
|
|
|
|
|
|
(use-package diminish |
|
|
|
:ensure t) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
cl is deprecated in favor for cl-lib, some packages like emmet still depend on cl. |
|
|
|
Shut off the compiler warning about it. |
|
|
|
Maybe turn it on again at some point before the next major emacs upgrade |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(setq byte-compile-warnings '(cl-functions)) |
|
|
|
#+end_src |
|
|
|
* use-package keywords general / diminish |
|
|
|
Needs to be loaded before any other package which uses the :general keyword |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(use-package general |
|
|
|
:ensure t |
|
|
|
:demand t) |
|
|
|
(use-package diminish |
|
|
|
:ensure t |
|
|
|
:demand t) |
|
|
|
(use-package general |
|
|
|
:ensure t |
|
|
|
:demand t) |
|
|
|
|
|
|
|
(use-package diminish |
|
|
|
:ensure t |
|
|
|
:demand t) |
|
|
|
|
|
|
|
(elpaca-wait) |
|
|
|
;;wait for elpaca any time a use-package keyword is added |
|
|
|
(elpaca-wait) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
* sane defaults |
|
|
@ -274,7 +220,7 @@ Needs to be loaded before any other package which uses the :general keyword |
|
|
|
(setq sentence-end-double-space nil) ;; don't coun two spaces after a period as the end of a sentence. |
|
|
|
(delete-selection-mode t) ;; delete selected region when typing |
|
|
|
(use-package saveplace |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:config |
|
|
|
(save-place-mode 1) ;; saves position in file when it's closed |
|
|
|
:custom |
|
|
@ -332,6 +278,7 @@ Restore it to reasonable value after init. Also stop garbage collection during m |
|
|
|
;; Resizing the emacs frame can be a terriblu expensive part of changing the font. |
|
|
|
;; By inhibiting this, we easily hale startup times with fonts that are larger |
|
|
|
;; than the system default. |
|
|
|
(setq package-enable-at-startup nil) |
|
|
|
(setq frame-inhibit-implied-resize t) |
|
|
|
#+end_src |
|
|
|
|
|
|
@ -421,7 +368,7 @@ Windows Theme: |
|
|
|
** line numbers |
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(use-package display-line-numbers |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:init |
|
|
|
:hook |
|
|
|
((prog-mode |
|
|
@ -471,7 +418,7 @@ Edit bookmarks (while in bookmark file): |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package bookmark |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:custom |
|
|
|
(bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks"))) |
|
|
|
#+end_src |
|
|
@ -496,7 +443,7 @@ Some windows specific stuff |
|
|
|
Exclude some dirs from spamming recentf |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package recentf |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
; :defer 1 |
|
|
|
:config |
|
|
|
(recentf-mode) |
|
|
@ -512,7 +459,7 @@ Exclude some dirs from spamming recentf |
|
|
|
* savehist |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package savehist |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:config |
|
|
|
(savehist-mode) |
|
|
|
:custom |
|
|
@ -558,7 +505,7 @@ Exclude some dirs from spamming recentf |
|
|
|
* abbrev |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package abbrev |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:diminish abbrev-mode |
|
|
|
:hook |
|
|
|
((text-mode org-mode) . abbrev-mode) |
|
|
@ -619,7 +566,7 @@ in case evil is messing something up. |
|
|
|
use builtin version |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package eldoc |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:diminish eldoc-mode |
|
|
|
:defer t) |
|
|
|
#+end_src |
|
|
@ -794,7 +741,7 @@ Completion ui, replaces company. |
|
|
|
;; "C-d" 'corfu-info-documentation) |
|
|
|
|
|
|
|
(use-package emacs |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:init |
|
|
|
;; hide commands in M-x which do not apply to current mode |
|
|
|
(setq read-extended-command-predicate #'command-completion-default-include-p) |
|
|
@ -1192,7 +1139,7 @@ If the property is already set, replace its value." |
|
|
|
|
|
|
|
(use-package org |
|
|
|
:ensure t |
|
|
|
:pin gnu |
|
|
|
; :pin gnu |
|
|
|
:mode (("\.org$" . org-mode)) |
|
|
|
:diminish org-indent-mode |
|
|
|
:defer 1 |
|
|
@ -1284,7 +1231,7 @@ Elpaca cant find it, though it's built in org |
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
|
|
|
(use-package ob-python |
|
|
|
; :elpaca nil |
|
|
|
; :ensure nil |
|
|
|
:defer t |
|
|
|
:after org |
|
|
|
; :ensure org-contrib |
|
|
@ -1667,7 +1614,7 @@ For useful snippet either install yasnippet-snippets or get them from here |
|
|
|
With hippie expand I am able to use yasnippet and emmet at the same time with the same key. |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package hippie-exp |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:defer t |
|
|
|
:bind |
|
|
|
("C-<return>" . hippie-expand) |
|
|
@ -1721,7 +1668,7 @@ With hippie expand I am able to use yasnippet and emmet at the same time with th |
|
|
|
** lisp |
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(use-package elisp-mode |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:defer t) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
@ -1908,7 +1855,7 @@ deactivate |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package beancount |
|
|
|
:elpaca nil |
|
|
|
:ensure nil |
|
|
|
:if *sys/linux* |
|
|
|
:load-path "user-global/elisp/" |
|
|
|
; :ensure t |
|
|
|