Compare commits

..

5 commits

Author SHA1 Message Date
ff740ce08e feat: Add org-download 2025-04-30 09:40:43 +02:00
1a21781fba fix: switch back to company from corfu to avoid random crash
It seems like a known issue (don't have the link anymore..) but
company is doing fine for now so just switch back to it.
2025-04-30 09:39:47 +02:00
d3dc9465dd fix: load init.el of notes repo when org-roam is properly loaded
This avoids all kinds of issues about variables not being declared,
etc. in the project-notes init.el
2025-04-30 09:38:32 +02:00
f5ef8d68c5 fix: Update visit/reload-config docs 2025-04-30 09:37:32 +02:00
0b57fa79b5 feat: Update elpaca
This avoids the warning at startup about not being able to determine
elpaca core date.
2025-04-30 09:36:55 +02:00
2 changed files with 32 additions and 24 deletions

View file

@ -7,13 +7,13 @@
** Core ** Core
#+begin_src emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar elpaca-installer-version 0.7) (defvar elpaca-installer-version 0.11)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) (defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil :depth 1 :ref nil :depth 1 :inherit ignore
:files (:defaults "elpaca-test.el" (:exclude "extensions")) :files (:defaults "elpaca-test.el" (:exclude "extensions"))
:build (:not elpaca--activate-package))) :build (:not elpaca--activate-package)))
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) (let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
@ -23,11 +23,11 @@
(add-to-list 'load-path (if (file-exists-p build) build repo)) (add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo) (unless (file-exists-p repo)
(make-directory repo t) (make-directory repo t)
(when (< emacs-major-version 28) (require 'subr-x)) (when (<= emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err (condition-case-unless-debug err
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone" ((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let ((depth (plist-get order :depth))) ,@(when-let* ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch")) (list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo)))) ,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout" ((zerop (call-process "git" nil buffer t "checkout"
@ -43,10 +43,10 @@
(unless (require 'elpaca-autoloads nil t) (unless (require 'elpaca-autoloads nil t)
(require 'elpaca) (require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo) (elpaca-generate-autoloads "elpaca" repo)
(load "./elpaca-autoloads"))) (let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
(add-hook 'after-init-hook #'elpaca-process-queues) (add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order)) (elpaca `(,@elpaca-order))
#+end_src #+END_SRC
** Use-package integration ** Use-package integration
@ -471,7 +471,7 @@ C-c C-c to apply."
*** Corfu *** Corfu
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC
(use-package corfu (use-package corfu
;; Optional customizations ;; Optional customizations
:bind (:map corfu-map ("<tab>" . corfu-complete)) :bind (:map corfu-map ("<tab>" . corfu-complete))
@ -502,7 +502,7 @@ C-c C-c to apply."
*** Company-mode *** Company-mode
#+BEGIN_SRC #+BEGIN_SRC emacs-lisp
(use-package company (use-package company
:config :config
(define-key prog-mode-map (define-key prog-mode-map
@ -964,6 +964,7 @@ Preserve indentation in SRC blocks
(org-roam-db-autosync-mode) (org-roam-db-autosync-mode)
;; Add todo lists to org-agenda ;; Add todo lists to org-agenda
(custom-set-variables '(org-agenda-files (directory-files-recursively org-roam-directory "todo\\.org$"))) (custom-set-variables '(org-agenda-files (directory-files-recursively org-roam-directory "todo\\.org$")))
(load (expand-file-name "init.el" org-roam-directory) :no-error-if-file-is-missing)
) )
#+END_SRC #+END_SRC
@ -1024,6 +1025,15 @@ Preserve indentation in SRC blocks
) )
#+END_SRC #+END_SRC
** Org Download
#+BEGIN_SRC emacs-lisp
(use-package org-download
:config
(add-hook 'dired-mode-hook 'org-download-enable)
)
#+END_SRC
* Elisp * Elisp
** Add demos to describe-function ** Add demos to describe-function
@ -1179,12 +1189,12 @@ This should normally be done by the init.el to load this configuration.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun myrmi/visit-config () (defun myrmi/visit-config ()
"Reloads ~/.emacs.d/config.org at runtime" "Visit emacs config"
(interactive) (interactive)
(find-file my-config-file)) (find-file my-config-file))
(defun myrmi/reload-config () (defun myrmi/reload-config ()
"Reloads ~/.emacs.d/config.org at runtime" "Reload emacs config at runtime"
(interactive) (interactive)
(org-babel-load-file my-config-file)) (org-babel-load-file my-config-file))
#+END_SRC #+END_SRC

View file

@ -7,11 +7,9 @@
(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;; This is the actual config file. It is omitted if it doesn't exist so emacs won't refuse to launch. ;; This is the actual config file. It is omitted if it doesn't exist so emacs won't refuse to launch.
(defvar my-config-file (expand-file-name "config.org" user-emacs-directory)) (defvar my-config-file (expand-file-name "config.org" user-emacs-directory))
(defvar notes-config-file (expand-file-name "init.el" "~/projects/notes/"))
(when (file-readable-p my-config-file) (when (file-readable-p my-config-file)
(org-babel-load-file (expand-file-name my-config-file))) (org-babel-load-file (expand-file-name my-config-file)))
(load notes-config-file :no-error-if-file-is-missing)
(load custom-file :no-error-if-file-is-missing) (load custom-file :no-error-if-file-is-missing)
) )