commit 4825f7d0a04e21146b3151d376028a6828291389
parent 985227c70b60beb3a644ba12a8f0b296dc8239ea
Author: Cem Keylan <cem@ckyln.com>
Date: Thu, 23 Jul 2020 15:23:30 +0300
emacs: re-revert to straight.el
Diffstat:
M | init.org | | | 131 | ++++++++++++++++++++++++++++++++++++++++++------------------------------------- |
1 file changed, 69 insertions(+), 62 deletions(-)
diff --git a/init.org b/init.org
@@ -169,17 +169,28 @@ them to 0.
** Package management
-I have recently reverted to package.el for package management. Even though
-=straight.el= is overall the better solution, I have had some issues significant
-enough to switch back. This might be re-reverted if my issues persist.
+I have switched to straight.el for package management. It is overall faster than
+package.el, way more reproducible, and doesn't auto-load packages that you have
+installed only for the purpose of trying out. The following is the bootstrapping
+script that straight.el uses to install itself.
#+BEGIN_SRC emacs-lisp
- (require 'package)
- (setq package-archives
- '(
- ("elpa" . "https://elpa.gnu.org/packages/")
- ("melpa" . "https://melpa.org/packages/")))
- (package-initialize)
+ (defvar bootstrap-version)
+ (let ((bootstrap-file
+ (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
+ (bootstrap-version 5))
+ (unless (file-exists-p bootstrap-file)
+ (with-current-buffer
+ (url-retrieve-synchronously
+ "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
+ 'silent 'inhibit-cookies)
+ (goto-char (point-max))
+ (eval-print-last-sexp)))
+ (load bootstrap-file nil 'nomessage))
+
+ (eval-when-compile
+ (add-to-list 'load-path (expand-file-name "straight/repos/straight.el" user-emacs-directory)))
+ (require 'straight)
#+END_SRC
*** use-package
@@ -189,11 +200,8 @@ for configuring and loading packages in a clean, fast, lazy, and a tidy way. It
is not a package manager, but it can interface with other package managers.
#+BEGIN_SRC emacs-lisp
- (unless (package-installed-p 'use-package)
- (package-refresh-contents)
- (package-install 'use-package))
-
- (require 'use-package)
+ (straight-use-package 'use-package)
+ (require 'bind-key)
#+END_SRC
** Custom-file
@@ -236,7 +244,7 @@ be loaded as one of the first packages.
#+BEGIN_SRC emacs-lisp
(use-package cheatsheet
- :ensure t
+ :straight t
:bind ("C-c s c" . cheatsheet-show)
:config
(cheatsheet-add-group 'Common
@@ -261,7 +269,7 @@ am using Emacs. Let's begin with the evil-mode itself.
#+BEGIN_SRC emacs-lisp
(use-package evil
- :ensure t
+ :straight t
:custom
(evil-want-C-u-scroll nil)
(evil-want-keybinding nil)
@@ -277,7 +285,7 @@ We didn't ask for the keybindings yet, because we are going to get the
(use-package evil-collection
:requires evil
:after evil
- :ensure t
+ :straight t
:config
(evil-collection-init))
#+END_SRC
@@ -291,7 +299,7 @@ for me.
(use-package evil-surround
:requires evil
:after evil
- :ensure t
+ :straight t
:config
(global-evil-surround-mode 1))
#+END_SRC
@@ -305,7 +313,7 @@ section.
#+BEGIN_SRC emacs-lisp
(use-package org
- :ensure t
+ :straight org-plus-contrib
:functions org-babel-tangle
:after evil
:bind (("C-c l" . org-store-link) ;; See the cheatsheet configuration
@@ -371,7 +379,7 @@ I am quite serious on this vim stuff now. I want it everywhere.
#+BEGIN_SRC emacs-lisp
(use-package evil-org
- :ensure t
+ :straight t
:after (evil org)
:functions evil-org-agenda-set-keys
:hook (org-mode . evil-org-mode)
@@ -389,7 +397,7 @@ to manually edit hunks for specific commits. I use evil-magit along with it.
#+BEGIN_SRC emacs-lisp
(use-package magit
- :ensure t
+ :straight t
:bind ("C-x g" . magit-status)
:config
(cheatsheet-add-group 'Magit
@@ -408,7 +416,7 @@ to manually edit hunks for specific commits. I use evil-magit along with it.
#+BEGIN_SRC emacs-lisp
(use-package evil-magit
- :ensure t
+ :straight t
:after (evil magit)
:config (evil-magit-init))
#+END_SRC
@@ -419,7 +427,7 @@ I like being able to interact with PR's and issues on Github from the comfort of
Emacs. Forge is a good one on that. Less web browsing, the better.
#+BEGIN_SRC emacs-lisp
- (use-package forge :ensure t :after magit)
+ (use-package forge :straight t :after magit)
#+END_SRC
** Flycheck
@@ -430,7 +438,7 @@ and buggy on Vim.
#+BEGIN_SRC emacs-lisp
(use-package flycheck
- :ensure t
+ :straight t
:config
(global-flycheck-mode)
(cheatsheet-add-group '"Syntax Checking"
@@ -439,7 +447,7 @@ and buggy on Vim.
'(:key "C-c ! l" :description "list flycheck errors"))
)
(use-package flycheck-pos-tip
- :ensure t
+ :straight t
:hook (flycheck-mode . flycheck-pos-tip-mode))
#+END_SRC
@@ -451,7 +459,7 @@ much yet. Pretty simple config.
#+BEGIN_SRC emacs-lisp
(use-package company
- :ensure t
+ :straight t
:custom
(company-idle-delay 1)
(company-minimum-prefix-length 1)
@@ -467,7 +475,7 @@ keybindings that executes commands on a project level.
#+BEGIN_SRC emacs-lisp
(use-package projectile
- :ensure t
+ :straight t
:bind-keymap ("C-c p" . projectile-command-map)
:config (projectile-mode +1)
(cheatsheet-add-group 'Projectile
@@ -487,7 +495,7 @@ information when I startup Emacs.
#+BEGIN_SRC emacs-lisp
(use-package dashboard
- :ensure t
+ :straight t
:custom
(dashboard-center-content t)
(show-week-agenda-p nil)
@@ -504,14 +512,13 @@ file with elfeed-org.
#+BEGIN_SRC emacs-lisp
(use-package elfeed
- :ensure t
- :after org
+ :straight t
:hook (after-init . elfeed-update)
:bind ("C-x w" . elfeed))
(use-package elfeed-org
- :ensure t
- :after (elfeed org)
+ :straight t
+ :after (elfeed org-plus-contrib)
:custom (rmh-elfeed-org-files (list (concat user-emacs-directory "feed.org")))
:config
(elfeed-org)
@@ -536,7 +543,7 @@ somewhat wonky.
("C-c m u" . mu4e)))
(use-package mu4e-alert
- :ensure t
+ :straight t
:after mu4e
:config
(mu4e-alert-enable-mode-line-display))
@@ -554,7 +561,7 @@ and many more.
#+BEGIN_SRC emacs-lisp
(use-package helm
- :ensure t
+ :straight t
:commands (helm-find-files helm-buffers-list)
:config
(bind-key "M-x" 'helm-M-x)
@@ -570,11 +577,11 @@ and many more.
'(:key "C-x i" :description "helm-imenu")
'(:key "C-x b" :description "helm-buffers-list")))
(use-package helm-descbinds
- :ensure t
+ :straight t
:config
(bind-key "C-x C-d" 'helm-descbinds)
(cheatsheet-add :group "Helm" :key "C-x C-d" :description "helm-descbinds"))
- (use-package helm-swoop :ensure t)
+ (use-package helm-swoop :straight t)
#+END_SRC
** Academics
@@ -589,14 +596,14 @@ I find them extremely useful.
#+BEGIN_SRC emacs-lisp
(use-package org-noter
:after org
- :ensure t)
+ :straight t)
#+END_SRC
*** Bibliography stuff
I am using helm-bibtex, which is extremely useful navigating bibliography files.
#+BEGIN_SRC emacs-lisp
(use-package helm-bibtex
- :ensure t)
+ :straight t)
#+END_SRC
*** PDF Tools
@@ -624,7 +631,7 @@ that is as follows.
#+BEGIN_SRC emacs-lisp
(use-package pdf-tools
- :ensure t
+ :straight t
:config
(pdf-loader-install))
#+END_SRC
@@ -638,7 +645,7 @@ These don't really deserve their own sections, but I prefer to use them.
This is a package for re-initiating a file as root.
#+BEGIN_SRC emacs-lisp
- (use-package sudo-edit :ensure t)
+ (use-package sudo-edit :straight t)
#+END_SRC
*** linum-relative
@@ -647,7 +654,7 @@ the other lines.
#+BEGIN_SRC emacs-lisp
(use-package linum-relative
- :ensure t
+ :straight t
:bind ("C-c r" . display-line-numbers-mode)
:custom
(linum-relative-current-symbol "")
@@ -663,7 +670,7 @@ that I write.
#+BEGIN_SRC emacs-lisp
(use-package markdown-mode
- :ensure t
+ :straight t
:config (setq markdown-command "/usr/bin/markdown"))
#+END_SRC
@@ -673,7 +680,7 @@ I sometimes output html from org-mode as it comes handy. We use htmlize for
that.
#+BEGIN_SRC emacs-lisp
- (use-package htmlize :ensure t)
+ (use-package htmlize :straight t)
#+END_SRC
*** toc-org
@@ -684,7 +691,7 @@ Github README.
#+BEGIN_SRC emacs-lisp
(use-package toc-org
- :ensure t
+ :straight t
:hook (org-mode . toc-org-mode))
#+END_SRC
@@ -694,7 +701,7 @@ which-key-mode shows key completions when the user is stuck in a prefix key.
#+BEGIN_SRC emacs-lisp
(use-package which-key
- :ensure t
+ :straight t
:custom
(which-key-popup-type 'side-window)
:config
@@ -748,7 +755,7 @@ For markdown, I want to have 4 spaces as an indentation.
#+BEGIN_SRC emacs-lisp
(use-package markdown-mode
- :ensure t
+ :straight t
:custom
(md-indent-tabs-mode nil)
(md-tab-width 4))
@@ -775,7 +782,7 @@ is the use-package
#+BEGIN_SRC emacs-lisp
(use-package company-jedi
- :ensure t
+ :straight t
:after company
:init
(add-to-list 'company-backends 'company-jedi))
@@ -809,16 +816,16 @@ This installs =irony=, =company-irony=, and =flycheck-irony=.
#+BEGIN_SRC emacs-lisp
(use-package irony
- :ensure t
+ :straight t
:hook (c-mode . irony-mode))
(use-package flycheck-irony
- :ensure t
+ :straight t
:after (flycheck irony)
:hook (flycheck-mode . flycheck-irony-setup))
(use-package company-irony
- :ensure t
+ :straight t
:after (company irony)
:config
(add-to-list 'company-backends 'company-irony))
@@ -830,16 +837,16 @@ For Go, we are installing =go-mode= and =company-go=. =go-mode= is a rewrite of
the built-in major mode for go. =company-go= is the company backend for go.
#+BEGIN_SRC emacs-lisp
- (use-package go-mode :ensure t)
+ (use-package go-mode :straight t)
(use-package company-go
- :ensure t
+ :straight t
:after company
)
#+END_SRC
** Makefile
#+BEGIN_SRC emacs-lisp
- (use-package helm-make :ensure t)
+ (use-package helm-make :straight t)
#+END_SRC
** LaTeX
@@ -849,7 +856,7 @@ configuration on it.
#+BEGIN_SRC emacs-lisp :tangle no
(use-package auctex
- :ensure t)
+ :straight t)
#+END_SRC
* Themes and Buffer Customization
@@ -866,7 +873,7 @@ The 'if' statement makes sure we have
#+BEGIN_SRC emacs-lisp
(use-package doom-themes
:after all-the-icons
- :ensure t
+ :straight t
:functions doom-themes-org-config doom-themes-treemacs-config
:custom
(doom-themes-enable-bold t)
@@ -885,10 +892,10 @@ guess. Pretty straightforward.
#+BEGIN_SRC emacs-lisp
(use-package all-the-icons
- :ensure t)
+ :straight t)
(use-package all-the-icons-dired
- :ensure t
+ :straight t
:after all-the-icons
:hook (dired-mode . all-the-icons-dired-mode))
#+END_SRC
@@ -897,7 +904,7 @@ guess. Pretty straightforward.
*** Modeline
#+BEGIN_SRC emacs-lisp
(use-package doom-modeline
- :ensure t
+ :straight t
:config (doom-modeline-mode 1))
#+END_SRC
@@ -910,7 +917,7 @@ that you appreciate having when its time comes.
#+BEGIN_SRC emacs-lisp
(use-package undo-tree
- :ensure t
+ :straight t
:config
(cheatsheet-add :group "Common" :key "C-x u" :description "undo-tree"))
#+END_SRC
@@ -921,7 +928,7 @@ way. :)
#+BEGIN_SRC emacs-lisp
(use-package hl-todo
- :ensure t
+ :straight t
:hook (prog-mode . hl-todo-mode))
#+END_SRC
@@ -1013,7 +1020,7 @@ inconsistency of switching between terminal and the graphical Emacs.
:if (executable-find "xclip")
:if (getenv "DISPLAY")
:unless (eq system-type 'windows-nt)
- :ensure t
+ :straight t
:config (xclip-mode))
#+END_SRC
@@ -1034,7 +1041,7 @@ not have a =--dired= option. Let's disable it.
#+BEGIN_SRC emacs-lisp
(use-package dired-explorer
- :ensure t
+ :straight t
:custom (dired-use-ls-dired nil))
#+END_SRC