Browse Source

Emacs: Make solution for removal of (elpaca nil) semantics

master
Riyyi 6 months ago
parent
commit
cf156ca80b
  1. 2
      .config/emacs/site-lisp/core/dot-core-config.el
  2. 2
      .config/emacs/site-lisp/core/dot-core-packages.el
  3. 16
      .config/emacs/site-lisp/dot-development.el
  4. 18
      .config/emacs/site-lisp/dot-elpaca.el
  5. 2
      .config/emacs/site-lisp/dot-evil.el
  6. 70
      .config/emacs/site-lisp/dot-keybinds.el
  7. 8
      .config/emacs/site-lisp/dot-mail.el
  8. 20
      .config/emacs/site-lisp/dot-org-mode.el
  9. 2
      .config/emacs/site-lisp/dot-selection.el

2
.config/emacs/site-lisp/core/dot-core-config.el

@ -169,7 +169,7 @@
;; -----------------------------------------
;; Recentf
(elpaca nil (setup recentf ; built-in
(elpaca-nil (setup recentf ; built-in
(:require recentf)
(:when-loaded
(setq recentf-auto-cleanup 'never)

2
.config/emacs/site-lisp/core/dot-core-packages.el

@ -60,7 +60,7 @@
(super-save-mode)))
(elpaca nil (setup desktop ; built-in
(elpaca-nil (setup desktop ; built-in
(:require desktop)
(:when-loaded
(setq desktop-base-file-name "state")

16
.config/emacs/site-lisp/dot-development.el

@ -105,7 +105,7 @@
;; Adding to project.el project directory detection
;; https://michael.stapelberg.ch/posts/2021-04-02-emacs-project-override/
(elpaca nil (setup project ; built-in
(elpaca-nil (setup project ; built-in
(setq project-list-file (expand-file-name "projects" dot-cache-dir))
(:when-loaded
@ -159,12 +159,12 @@
;; Enable color escape codes.
(elpaca nil (setup ansi-color ; built-in
(elpaca-nil (setup ansi-color ; built-in
(:with-mode compilation-filter (:hook ansi-color-compilation-filter))
;; :hook (compilation-filter . ansi-color-compilation-filter)
(:when-loaded (setq ansi-color-bold-is-bright t))))
(elpaca nil (setup compile ; built-in
(elpaca-nil (setup compile ; built-in
(defun dot/compile-disable-underline () ""
(face-remap-add-relative 'underline :underline nil))
(:with-mode comint-mode (:hook dot/compile-disable-underline))
@ -307,7 +307,7 @@
;;; C/C++
(elpaca nil (setup c-mode ; built-in
(elpaca-nil (setup c-mode ; built-in
;; C++ // line comment style in c-mode
(defun dot/c-mode-comment-style () ""
(c-toggle-comment-style -1))
@ -323,7 +323,7 @@
;; - omnisharp-roslyn-bin
;; - netcoredbg (edit PKGBUILD to detect dotnet -6.0 dependencies)
(elpaca nil (setup csharp-mode)) ; built-in
(elpaca-nil (setup csharp-mode)) ; built-in
;;; CMake
@ -333,7 +333,7 @@
;;; Emacs Lisp
(elpaca nil (setup emacs-lisp ; built-in
(elpaca-nil (setup emacs-lisp ; built-in
(defun dot/elisp-init () ""
(setq-local indent-tabs-mode nil))
(:hook dot/elisp-init)))
@ -366,7 +366,7 @@
;;; Python
(elpaca nil (setup python-mode ; built-in
(elpaca-nil (setup python-mode ; built-in
(defun dot/python-mode-init () ""
(setq-local indent-tabs-mode t)
(setq-local tab-width (default-value 'tab-width))
@ -424,7 +424,7 @@
;;; Flyspell
(elpaca nil (setup ispell ; built-in
(elpaca-nil (setup ispell ; built-in
(:when-loaded
(setq ispell-program-name "/usr/bin/hunspell")
(ispell-set-spellchecker-params)

18
.config/emacs/site-lisp/dot-elpaca.el

@ -9,12 +9,12 @@
;; -----------------------------------------
;; Elpaca bootstrap
(defvar elpaca-installer-version 0.6)
(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
: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))
@ -27,8 +27,10 @@
(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 (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))
@ -46,8 +48,14 @@
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;;;###autoload
(defmacro elpaca-nil (body)
"Defer execution until all Elpaca queues have been processed."
(declare (indent 1))
`(add-hook 'elpaca-after-init-hook (lambda () (,@body))))
;; Stop coping with startup time, its done loading when its done loading
(add-hook 'elpaca-after-init-hook (lambda () (setq after-init-time (current-time))))
(elpaca-nil (setq after-init-time (current-time)))
(provide 'dot-elpaca)

2
.config/emacs/site-lisp/dot-evil.el

@ -81,7 +81,7 @@ Vim equivalence: >gv"
;; Evil command aliases.
(elpaca nil (setup evil-ex ; evil-ex.el is part of evil
(elpaca-nil (setup evil-ex ; evil-ex.el is part of evil
(:when-loaded
(evil-ex-define-cmd "W" "w")
(evil-ex-define-cmd "Q" "q")

70
.config/emacs/site-lisp/dot-keybinds.el

@ -35,7 +35,7 @@
;; Disable keybinds of native modes that clash with other custom keybinds.
(elpaca nil (setup emacs
(elpaca-nil (setup emacs
(:global
"M-h" nil
"M-j" nil
@ -43,18 +43,18 @@
"M-l" nil
)))
(elpaca nil (setup org
(elpaca-nil (setup org
(:bind "M-h" nil
"C-M-h" nil
)))
(elpaca nil (setup cc-mode
(elpaca-nil (setup cc-mode
(:bind-into c-mode-base-map
"M-j" nil
"C-M-h" nil
)))
(elpaca nil (setup nxml-mode
(elpaca-nil (setup nxml-mode
(:bind "M-h" nil
)))
@ -63,16 +63,16 @@
;; Disable keybinds of installed packages that clash with other custom keybinds.
(elpaca nil (setup evil-states
(elpaca-nil (setup evil-states
(:bind-into evil-motion-state-map dot/leader-key nil
)))
(elpaca nil (setup magit
(elpaca-nil (setup magit
(:evil-bind normal
;; Do not close magit when pressing escape
"<escape>" nil)))
(elpaca nil (setup php-mode
(elpaca-nil (setup php-mode
(:bind "M-j" nil
"C-M-h" nil
)))
@ -84,7 +84,7 @@
;;; Set Native Global Keybinds
(elpaca nil (setup emacs
(elpaca-nil (setup emacs
(:global
;; Buffers
"C-x C-b" ibuffer
@ -111,21 +111,21 @@
;;; Set Native Mode Keybinds
;; Dired
(elpaca nil (setup dired
(elpaca-nil (setup dired
(:bind
[remap dired-find-file] dot/dired-find-file
[remap dired-up-directory] dot/dired-up-directory
)))
;; Org
(elpaca nil (setup org
(elpaca-nil (setup org
(:bind "M-c" org-edit-special
)))
(elpaca nil (setup org-src
(elpaca-nil (setup org-src
(:bind "M-c" org-edit-src-exit
"M-k" org-edit-src-abort
)))
(elpaca nil (setup org-capture
(elpaca-nil (setup org-capture
(:bind "M-c" org-capture-finalize
"M-w" org-capture-refile
"M-k" org-capture-kill
@ -136,7 +136,7 @@
;; Set keybinds to functionality of installed packages.
(elpaca nil (setup emacs
(elpaca-nil (setup emacs
(:global
;; Buffers
"M-h" centaur-tabs-backward-tab
@ -151,7 +151,7 @@
"M-x" dot/M-x
)))
(elpaca nil (setup company
(elpaca-nil (setup company
(:bind-into company-active-map
;; Company completion selection
"M-n" nil
@ -163,7 +163,7 @@
"<escape>" company-abort
)))
(elpaca nil (setup evil-ex
(elpaca-nil (setup evil-ex
(:bind-into evil-ex-completion-map
;; Evil command history selection
"M-h" abort-recursive-edit
@ -172,7 +172,7 @@
"M-l" exit-minibuffer
)))
(elpaca nil (setup emacs
(elpaca-nil (setup emacs
(:global
;; flyspell-correct
[remap ispell-word] flyspell-correct-at-point ; z=
@ -189,26 +189,26 @@
(which-key-add-key-based-replacements "C-h o" "describe-symbol-at-point")))))
;; LSP
(elpaca nil (setup lsp-mode
(elpaca-nil (setup lsp-mode
(:bind-into lsp-signature-mode-map
"M-j" lsp-signature-next
"M-k" lsp-signature-previous
)))
;; Magit
(elpaca nil (setup magit
(elpaca-nil (setup magit
(:bind-into magit-log-select-mode-map
"M-c" magit-log-select-pick
"M-k" magit-log-select-quit
)))
;; Org-roam
(elpaca nil (setup org-roam
(elpaca-nil (setup org-roam
(:bind [down-mouse-1] org-roam-visit-thing
)))
;; Minibuffer completion selection
(elpaca nil (setup minibuffer
(elpaca-nil (setup minibuffer
(:bind-into minibuffer-local-map
"M-J" next-history-element
"M-K" previous-history-element
@ -223,7 +223,7 @@
)))
;; with-editor
(elpaca nil (setup with-editor
(elpaca-nil (setup with-editor
(:bind
"M-c" with-editor-finish
"M-k" with-editor-cancel
@ -231,7 +231,7 @@
;;; Global evil keymap
(elpaca nil (setup evil
(elpaca-nil (setup evil
(:bind-into evil-normal-state-map
"C-n" neotree-toggle-in-project-root
"C-S-p" evil-paste-pop-next
@ -256,13 +256,13 @@
;;; Other evil state-related keybinds
;; Custom (M-x customize)
(elpaca nil (setup cus-edit
(elpaca-nil (setup cus-edit
(:evil-bind-into normal custom-mode-map
[down-mouse-1] widget-button-click
)))
;; Dashboard
(elpaca nil (setup dashboard
(elpaca-nil (setup dashboard
(:evil-bind normal
[down-mouse-1] widget-button-click
"g" dashboard-refresh-buffer
@ -272,13 +272,13 @@
)))
;; Dap
(elpaca nil (setup dap-ui
(elpaca-nil (setup dap-ui
(:evil-bind-into normal dap-ui-session-mode-map
"D" dap-ui-delete-session
)))
;; Deft
(elpaca nil (setup deft
(elpaca-nil (setup deft
(:evil-bind normal
[down-mouse-1] widget-button-click
"+" deft-new-file-named
@ -296,7 +296,7 @@
)))
;; Elfeed
(elpaca nil (setup elfeed
(elpaca-nil (setup elfeed
(:evil-bind-into normal elfeed-search-mode-map
"b" elfeed-search-browse-url
"c" elfeed-search-clear-filter
@ -316,14 +316,14 @@
)))
;; Magit
(elpaca nil (setup magit
(elpaca-nil (setup magit
(:evil-bind (normal visual)
"{" magit-section-backward-sibling
"}" magit-section-forward-sibling
)))
;; Minibuffer
(elpaca nil (setup minibuffer
(elpaca-nil (setup minibuffer
(:evil-bind-into normal minibuffer-local-map
"TAB" vertico-insert
"j" vertico-next
@ -336,7 +336,7 @@
)))
;; Mu4e
(elpaca nil (setup mu4e
(elpaca-nil (setup mu4e
(:evil-bind-into normal mu4e-compose-mode-map
"q" mu4e-message-kill-buffer
"M-c" message-send-and-exit
@ -344,7 +344,7 @@
)))
;; Neotree
(elpaca nil (setup neotree
(elpaca-nil (setup neotree
(:evil-bind normal
"RET" neotree-enter
"<backtab>" neotree-collapse-all ; <S-tab>
@ -362,7 +362,7 @@
)))
;; Org
(elpaca nil (setup org
(elpaca-nil (setup org
(:evil-bind normal
"RET" dot/org-ret-at-point
)
@ -374,7 +374,7 @@
)))
;; Wdired
(elpaca nil (setup wdired
(elpaca-nil (setup wdired
(:evil-bind (normal insert)
"M-c" wdired-finish-edit
"M-k" wdired-abort-changes
@ -387,7 +387,7 @@
;;; Global Leader
(elpaca nil (setup general
(elpaca-nil (setup general
(:when-loaded
(general-create-definer space-leader
:prefix dot/leader-key
@ -593,7 +593,7 @@
;;; Local Leader
(elpaca nil (setup general
(elpaca-nil (setup general
(:when-loaded
(general-create-definer local-leader
:prefix dot/localleader-key

8
.config/emacs/site-lisp/dot-mail.el

@ -24,7 +24,7 @@
;; Key bindings
;; [https://www.djcbsoftware.nl/code/mu/mu4e/MSGV-Keybindings.html#MSGV-Keybindings]
(elpaca nil (setup mu4e ; loaded from AUR package
(elpaca-nil (setup mu4e ; loaded from AUR package
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
(:autoload mu4e mu4e-update-index)
(:when-loaded
@ -114,7 +114,7 @@
;; Sending mail.
(elpaca nil (setup smtpmail ; built-in
(elpaca-nil (setup smtpmail ; built-in
(setq smtpmail-default-smtp-server "mail.riyyi.com")
(:load-after mu4e)
(:when-loaded
@ -124,11 +124,11 @@
(setq smtpmail-stream-type 'starttls)
(setq smtpmail-queue-mail nil))))
(elpaca nil (setup sendmail ; built-in
(elpaca-nil (setup sendmail ; built-in
(:load-after mu4e)
(:when-loaded (setq send-mail-function 'smtpmail-send-it))))
(elpaca nil (setup message ; built-in
(elpaca-nil (setup message ; built-in
(:load-after mu4e)
(:when-loaded
(setq message-kill-buffer-on-exit t)

20
.config/emacs/site-lisp/dot-org-mode.el

@ -9,7 +9,7 @@
;; -----------------------------------------
;; LaTeX Configuration
(elpaca nil (setup tex-mode ; built-in
(elpaca-nil (setup tex-mode ; built-in
(:when-loaded
(defun dot/tex-mode-init () ""
(setq indent-tabs-mode t)
@ -30,7 +30,7 @@
;; Base Org.
(elpaca nil (setup org ; built-in
(elpaca-nil (setup org ; built-in
(setq org-directory (expand-file-name "documents/org" (getenv "HOME")))
(setq org-default-notes-file (expand-file-name "notes.org" org-directory))
(:with-mode before-save
@ -97,7 +97,7 @@ When ANYWHERE is non-nil, search beyond the preamble."
;; Org agenda.
(elpaca nil (setup org-agenda ; built-in
(elpaca-nil (setup org-agenda ; built-in
(:load-after evil org)
(:when-loaded
(setq org-agenda-files `(,org-directory ,user-emacs-directory))
@ -107,26 +107,26 @@ When ANYWHERE is non-nil, search beyond the preamble."
;; Org capture.
(elpaca nil (setup org-capture ; built-in
(elpaca-nil (setup org-capture ; built-in
;; Org-capture in new tab, rather than split window
(:hook delete-other-windows)))
;; Org keys.
(elpaca nil (setup org-keys ; built-in
(elpaca-nil (setup org-keys ; built-in
(:when-loaded
(setq org-return-follows-link t))))
;; Org links.
(elpaca nil (setup ol ; built-in
(elpaca-nil (setup ol ; built-in
(:when-loaded
;; Do not open links to .org files in a split window
(add-to-list 'org-link-frame-setup '(file . find-file)))))
;; Org source code blocks.
(elpaca nil (setup org-src ; built-in
(elpaca-nil (setup org-src ; built-in
(:when-loaded
(setq org-edit-src-content-indentation 0)
(setq org-src-fontify-natively t)
@ -136,13 +136,13 @@ When ANYWHERE is non-nil, search beyond the preamble."
;; Org exporter.
(elpaca nil (setup ox ; built-in
(elpaca-nil (setup ox ; built-in
(:when-loaded
(setq org-export-coding-system 'utf-8-unix))))
;; Org latex exporter.
(elpaca nil (setup ox-latex ; built-in
(elpaca-nil (setup ox-latex ; built-in
(:when-loaded
;; Define how minted (highlighted src code) is added to src code blocks
(setq org-latex-listings 'minted)
@ -233,7 +233,7 @@ When ANYWHERE is non-nil, search beyond the preamble."
;; Enable https://www.orgroam.com/manual.html#org_002droam_002dprotocol, needed to process org-protocol:// links
(elpaca nil (setup org-roam-protocol ; org-roam-protocol.el is part of org-roam
(elpaca-nil (setup org-roam-protocol ; org-roam-protocol.el is part of org-roam
(:load-after org-roam)
(:when-loaded

2
.config/emacs/site-lisp/dot-selection.el

@ -41,7 +41,7 @@
(setq vertico-previous-directory nil)))
(advice-add 'vertico--update-candidates :after #'dot/vertico-dired-goto-last-visited))
(elpaca nil (setup vertico-mouse ; vertico-mouse.el is part of vertico
(elpaca-nil (setup vertico-mouse ; vertico-mouse.el is part of vertico
(:load-after vertico)
(:when-loaded (vertico-mouse-mode))))

Loading…
Cancel
Save