From 1adf46af4ad072cad5ab8697a5fc0b1ba1f901fe Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 9 Nov 2023 07:41:26 +0000 Subject: [PATCH] Update project, feeds and social configs to use-package --- home/emacs/init.el | 61 +++++++++++++++++-------------- home/emacs/init.org | 87 +++++++++++++++++++++++++-------------------- 2 files changed, 84 insertions(+), 64 deletions(-) diff --git a/home/emacs/init.el b/home/emacs/init.el index 48b5a69f..210bd3ca 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -383,18 +383,17 @@ manually with something like this: ;; Shutdown server when last managed buffer is killed (customize-set-variable 'eglot-autoshutdown t) -(let ((elfeed-base-directory "~/.elfeed")) - (setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory) - elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory) - rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory)))) +(setq project-switch-use-entire-map t + project-switch-commands + '((project-dired "Browse directory") + (project-find-file "Find file") + (project-find-regexp "Find regexp") + (project-find-dir "Find directory") + (project-eshell "Eshell"))) -(when (require 'elfeed nil :noerror) - (keymap-global-set "C-c f f" #'elfeed) - (add-hook 'elfeed-search-mode-hook #'elfeed-update) - (when (require 'elfeed-org nil :noerror) - (elfeed-org)) - (when (require 'elfeed-tube nil :noerror) - (elfeed-tube-setup))) +(setq magit-clone-default-directory "~/Projects/") +(use-package magit + :ensure t) (when (require 'emms-setup nil :noerror) (setq emms-player-list '(emms-player-mpv) @@ -418,21 +417,6 @@ manually with something like this: ("p" emms-previous) ("P" emms-pause)))) -(setq project-switch-use-entire-map t - project-switch-commands - '((project-dired "Browse directory") - (project-find-file "Find file") - (project-find-regexp "Find regexp") - (project-find-dir "Find directory") - (project-eshell "Eshell"))) - -(setq magit-clone-default-directory "~/Projects/") -(require 'magit nil :noerror) - -(setq mastodon-instance-url "https://tech.lgbt" - mastodon-active-user "Tux922") -(require 'mastodon nil :noerror) - ;;; Vertico (when (require 'vertico nil :noerror) (require 'vertico-directory) @@ -840,3 +824,28 @@ Depends on having `pdf-tools'." (mu4e-alert-set-default-style 'libnotify) (mu4e-alert-enable-notifications) (mu4e-alert-enable-mode-line-display)) + +(let ((elfeed-base-directory "~/.elfeed")) + (setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory) + elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory) + rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory)))) + +(use-package elfeed + :bind (("C-c f f" . elfeed) + ("C-c f u" . elfeed-update)) + :hook (elfeed-search-mode . elfeed-update) + :config + (use-package elfeed-org + :ensure t + :config (elfeed-org)) + (use-package elfeed-tube + :ensure t + :config (elfeed-tube-setup))) + +(setq mastodon-instance-url "https://tech.lgbt" + mastodon-active-user "Tux922") +(use-package mastodon + :commands mastodon) + +(use-package ement + :commands ement-connect) diff --git a/home/emacs/init.org b/home/emacs/init.org index 188acf8a..ed89d117 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -444,26 +444,26 @@ For reference information, see [[https://orgmode.com][Org-mode website]] ;; Shutdown server when last managed buffer is killed (customize-set-variable 'eglot-autoshutdown t) #+END_SRC +** Project +#+BEGIN_SRC emacs-lisp + (setq project-switch-use-entire-map t + project-switch-commands + '((project-dired "Browse directory") + (project-find-file "Find file") + (project-find-regexp "Find regexp") + (project-find-dir "Find directory") + (project-eshell "Eshell"))) +#+END_SRC +** Version control +#+begin_src emacs-lisp + (setq magit-clone-default-directory "~/Projects/") + (use-package magit + :ensure t) +#+end_src * Copy (to sort) For now I'll just copy all config into this file, to confirm that it works properly. Will reorganise into separate sections later -** TODO Feeds -#+BEGIN_SRC emacs-lisp - (let ((elfeed-base-directory "~/.elfeed")) - (setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory) - elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory) - rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory)))) - - (when (require 'elfeed nil :noerror) - (keymap-global-set "C-c f f" #'elfeed) - (add-hook 'elfeed-search-mode-hook #'elfeed-update) - (when (require 'elfeed-org nil :noerror) - (elfeed-org)) - (when (require 'elfeed-tube nil :noerror) - (elfeed-tube-setup))) -#+END_SRC - ** TODO Media #+BEGIN_SRC emacs-lisp (when (require 'emms-setup nil :noerror) @@ -489,27 +489,6 @@ Will reorganise into separate sections later ("P" emms-pause)))) #+END_SRC -** TODO Project -#+BEGIN_SRC emacs-lisp - (setq project-switch-use-entire-map t - project-switch-commands - '((project-dired "Browse directory") - (project-find-file "Find file") - (project-find-regexp "Find regexp") - (project-find-dir "Find directory") - (project-eshell "Eshell"))) - - (setq magit-clone-default-directory "~/Projects/") - (require 'magit nil :noerror) -#+END_SRC - -** TODO Social -#+BEGIN_SRC emacs-lisp - (setq mastodon-instance-url "https://tech.lgbt" - mastodon-active-user "Tux922") - (require 'mastodon nil :noerror) -#+END_SRC - ** TODO Completion (Crafted) #+BEGIN_SRC emacs-lisp ;;; Vertico @@ -839,7 +818,8 @@ Will reorganise into separate sections later (setq-default pdf-view-display-size 'fit-width))) #+END_SRC -* Email +* Internet +** Email #+BEGIN_SRC emacs-lisp (setq sendmail-program (executable-find "msmtp") send-mail-function #'smtpmail-send-it @@ -934,3 +914,34 @@ Will reorganise into separate sections later #+END_SRC +** Feeds +#+BEGIN_SRC emacs-lisp + (let ((elfeed-base-directory "~/.elfeed")) + (setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory) + elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory) + rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory)))) + + (use-package elfeed + :bind (("C-c f f" . elfeed) + ("C-c f u" . elfeed-update)) + :hook (elfeed-search-mode . elfeed-update) + :config + (use-package elfeed-org + :ensure t + :config (elfeed-org)) + (use-package elfeed-tube + :ensure t + :config (elfeed-tube-setup))) +#+END_SRC + +** Social +#+BEGIN_SRC emacs-lisp + (setq mastodon-instance-url "https://tech.lgbt" + mastodon-active-user "Tux922") + (use-package mastodon + :commands mastodon) + + (use-package ement + :commands ement-connect) +#+END_SRC +