bloated emacs configuration
git clone git://git.ckyln.com/~cem/emacs.d.git
Log | Files | Refs | README

commit 3ca74e62b3672cc858fd62102d1cc6ab6c79dc04
parent f6626949ef1d24785c53ee8d4b2cef44e5238857
Author: Cem Keylan <cem@ckyln.com>
Date:   Tue, 31 Mar 2020 01:29:22 +0300

add an explanation for reverting to package.el

Minit.org | 50++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+), 0 deletions(-)

diff --git a/init.org b/init.org @@ -41,6 +41,8 @@ - [[Docker][Docker]] - [[Backup Options][Backup Options]] - [[Set Browser][Set Browser]] +- [[Notes][Notes]] + - [[Reverting to package.el][Reverting to package.el]] * Intro This is my emacs configuration file, I used to have a big @@ -158,6 +160,8 @@ to install itself. (load bootstrap-file nil 'nomessage)) #+END_SRC +*** use-package + We need use-package for maintaining other packages. #+BEGIN_SRC emacs-lisp @@ -726,3 +730,49 @@ so that I don't have to keep track of it in case I ever change my browser. browse-url-browser-function 'browse-url-generic ) #+END_SRC +* Notes +** Reverting to package.el +You can always revert back to =package.el= by replacing the [[Package Management]] +section with the following configuration steps. This can be for many reasons. +For example I have reverted to package.el on my old laptop where I don't want +deal with compilation, and I don't want to keep git repositories of every package +that I use. However, I believe that I can deal with those problems as I learn more +about the internals of straight. + +*** Replacing the bootstrap command + +You need to replace the =straight.el= package manager bootstrapper. This is +the first code block in the section. Replace it with the following code block. + +Keep in mind that you shouldn't add =:tangle no=. + +#+BEGIN_SRC emacs-lisp :tangle no + (require 'package) + (setq package-archives '( + ("elpa" . "https://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/") + )) + (package-initialize) +#+END_SRC + +This code block will initialize =package.el=. Now we need to replace use-package +as it works with package.el + +*** Making use-package work with package.el + +Now, replace the second code-block in the section with the following +commands. + +#+BEGIN_SRC emacs-lisp :tangle no + (unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) +#+END_SRC + +There is also the final step, which is the most important one. Replacing the use-package =:straight= +calls with =:ensure=. Keep in mind that doing so will also replace the line below as well. In your shell, +run the following command. + +#+BEGIN_SRC sh :tangle no +sed -i 's/\:straight /\:ensure /g' init.org +#+END_SRC