mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-14 08:01:35 +09:00
Emacs : straight -> use-package
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
#+title: Emacs Configuration
|
#+title: Emacs Configuration
|
||||||
#+AUTHOR: JaeYoo-Im, (cpu3792@gmail.com)
|
#+author: JaeYoo-Im
|
||||||
#+latex_header: \usepackage{kotex}
|
#+email: (cpu3792@gmail.com)
|
||||||
|
|
||||||
* Basic Configuration
|
* Basic Configuration
|
||||||
Emacs Configuration for emacs 29.50
|
Emacs Configuration for emacs 29.50
|
||||||
@ -45,29 +45,68 @@ Emacs Configuration for emacs 29.50
|
|||||||
(emacs-init-time))))
|
(emacs-init-time))))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Package Function
|
*** Package Function
|
||||||
|
**** Use-package
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
(defvar bootstrap-version)
|
(require 'package)
|
||||||
(defvar comp-deferred-compilation-deny-list ()) ; workaround, otherwise straight shits itself
|
(when (version< emacs-version "28")
|
||||||
(let ((bootstrap-file
|
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/")))
|
||||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
|
||||||
(bootstrap-version 5))
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
||||||
(unless (file-exists-p bootstrap-file)
|
|
||||||
(with-current-buffer
|
(customize-set-variable 'package-archive-priorities
|
||||||
(url-retrieve-synchronously
|
'(("gnu" . 99) ; prefer GNU packages
|
||||||
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
("nongnu" . 80) ; use non-gnu packages if
|
||||||
'silent 'inhibit-cookies)
|
; not found in GNU elpa
|
||||||
(goto-char (point-max))
|
("stable" . 70) ; prefer "released" versions
|
||||||
(eval-print-last-sexp)))
|
; from melpa
|
||||||
(load bootstrap-file nil 'nomessage))
|
("melpa" . 0))) ; if all else fails, get it
|
||||||
(package-initialize)
|
; from melpa
|
||||||
|
(customize-set-variable 'package-user-dir
|
||||||
|
(expand-file-name "elpa/" user-emacs-directory))
|
||||||
|
|
||||||
|
;;(package-initialize)
|
||||||
(unless package-archive-contents
|
(unless package-archive-contents
|
||||||
(package-refresh-contents))
|
(package-refresh-contents))
|
||||||
(straight-use-package '(use-package :build t))
|
(unless (package-installed-p 'use-package)
|
||||||
|
(package-install 'use-package))
|
||||||
|
|
||||||
|
(require 'use-package)
|
||||||
(setq use-package-always-ensure t)
|
(setq use-package-always-ensure t)
|
||||||
|
|
||||||
(unless (file-exists-p package-user-dir)
|
(use-package auto-package-update
|
||||||
(mkdir package-user-dir t))
|
:custom
|
||||||
;;; init.el ends here
|
(auto-package-update-interval 7)
|
||||||
|
(auto-package-update-prompt-before-update t)
|
||||||
|
(auto-package-update-hide-results t)
|
||||||
|
:config
|
||||||
|
(auto-package-update-maybe)
|
||||||
|
(auto-package-update-at-time "09:00"))
|
||||||
|
#+end_src
|
||||||
|
**** Straight
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;;##+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(defvar comp-deferred-compilation-deny-list ()) ; workaround, otherwise straight shits itself
|
||||||
|
(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))
|
||||||
|
(package-initialize)
|
||||||
|
(unless package-archive-contents
|
||||||
|
(package-refresh-contents))
|
||||||
|
(straight-use-package '(use-package :build t))
|
||||||
|
(setq use-package-always-ensure t)
|
||||||
|
|
||||||
|
(unless (file-exists-p package-user-dir)
|
||||||
|
(mkdir package-user-dir t))
|
||||||
|
;;; init.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Add other modules
|
*** Add other modules
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
@ -106,16 +145,19 @@ Emacs Configuration for emacs 29.50
|
|||||||
|
|
||||||
*** Backup options
|
*** Backup options
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
(setq backup-directory-alist `(("." . ,(expand-file-name "backups/" user-emacs-directory))))
|
(setq backup-directory-alist `(("." . ,(expand-file-name "backups/" user-emacs-directory))))
|
||||||
(setq-default custom-file (expand-file-name ".custom.el" user-emacs-directory))
|
(setq-default custom-file (expand-file-name ".custom.el" user-emacs-directory))
|
||||||
(when (file-exists-p custom-file)
|
(when (file-exists-p custom-file)
|
||||||
(load custom-file))
|
(load custom-file))
|
||||||
(setq delete-by-moving-to-trash t
|
(setq delete-by-moving-to-trash t
|
||||||
trash-directory "~/.local/share/Trash/files/")
|
trash-directory "~/.local/share/Trash/files/")
|
||||||
(setq undo-limit 100000000
|
(setq undo-limit 100000000
|
||||||
auto-save-default t)
|
auto-save-default t)
|
||||||
|
(setq auto-save-file-name-transforms
|
||||||
|
`((".*" ,(expand-file-name "backups/" user-emacs-directory) t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
*** Other options
|
*** Other options
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
(set-default-coding-systems 'utf-8)
|
(set-default-coding-systems 'utf-8)
|
||||||
@ -165,16 +207,17 @@ Emacs Configuration for emacs 29.50
|
|||||||
`(fixed-pitch-serif ((t (:inherit (default)))))
|
`(fixed-pitch-serif ((t (:inherit (default)))))
|
||||||
`(variable-pitch ((t (:font "Ubuntu 11")))))))
|
`(variable-pitch ((t (:font "Ubuntu 11")))))))
|
||||||
|
|
||||||
(require 'custom-ui)
|
;;(require 'custom-ui)
|
||||||
(require 'custom-keybindings)
|
;;(require 'custom-keybindings)
|
||||||
(require 'custom-default)
|
;;(require 'custom-default)
|
||||||
(require 'custom-completion)
|
;;(require 'custom-completion)
|
||||||
(require 'custom-projects)
|
;;(require 'custom-projects)
|
||||||
(require 'custom-latex)
|
;;(require 'custom-latex)
|
||||||
(require 'custom-org)
|
;;(require 'custom-org)
|
||||||
|
;;(require 'custom-languages)
|
||||||
|
;;(require 'custom-extra)
|
||||||
|
|
||||||
;;(require 'custom-workspaces)
|
;;(require 'custom-workspaces)
|
||||||
(require 'custom-languages)
|
|
||||||
(require 'custom-extra)
|
|
||||||
|
|
||||||
;;; config.el ends here
|
;;; config.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
Reference in New Issue
Block a user