From e2d1dae4573e759980fd017ab492c6ec711b1535 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 27 Dec 2022 18:33:42 +0000 Subject: Update zettelkasten, elfeed and emacs 28 config --- init.el | 129 ++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 76 insertions(+), 53 deletions(-) diff --git a/init.el b/init.el index 4bd6913..6349a8d 100644 --- a/init.el +++ b/init.el @@ -26,7 +26,6 @@ (define-key ymh-map (kbd "C-l") #'org-agenda-open-link) (define-key ymh-map (kbd "C-p") #'org-previous-link) (define-key ymh-map (kbd "C-n") #'org-next-link) -;;(define-key y-map (kbd "C-g") #'org-zettelkasten-goto-id) (set-register ?l (cons 'file "~/.emacs.d/loader.org")) (set-register ?m (cons 'file "~/Dropbox/org/meetings.org")) @@ -34,17 +33,24 @@ (set-register ?p (cons 'file "~/Dropbox/org/projects.org")) (set-register ?c (cons 'file (format-time-string "~/Dropbox/org/%Y-%m.org"))) +(defvar emacs-29-p) +(setq emacs-29-p (version<= "29" emacs-version)) + (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize) +;; For emacs 28 and below install use-package +(unless (package-installed-p 'use-package) + (package-install 'use-package)) + (use-package ymh-common :load-path "ymh-emacs") (use-package emacs :init (setq gnus-init-file (expand-file-name "gnus.el" user-emacs-directory)) - + (setq-default fill-column 80) (setq completion-cycle-threshold 3) @@ -86,6 +92,16 @@ (setq vc-follow-symlinks t) + (setq add-log-full-name "Yann Herklotz") + (setq add-log-mailing-address "git@yannherklotz.com") + (setq change-log-default-name "CHANGELOG") + (add-hook 'change-log-mode-hook + (lambda () + (make-local-variable 'tab-width) + (make-local-variable 'left-margin) + (setq tab-width 2 + left-margin 2))) + (setq-default indent-tabs-mode nil) (setq-default tab-width 4) (setq-default python-indent-offset 4) @@ -112,7 +128,8 @@ (dolist (c '(overwrite-mode narrow-to-region narrow-to-page upcase-region downcase-region)) (put c 'disabled nil)) - (set-face-attribute 'default nil :font "Iosevka YMHG Medium-12") + ;; (set-face-attribute 'default nil :font "Iosevka YMHG Medium-12") + (set-face-attribute 'default nil :font "IBM Plex Mono SmBld-9") (setq auto-mode-alist (append @@ -273,13 +290,13 @@ https://yannherklotz.com")) (use-package ef-themes :ensure t :config - (load-theme 'ef-dark t)) + ;;(load-theme 'ef-dark t) + ) (use-package modus-themes :ensure t :config - ;;(load-theme 'modus-vivendi t) - ) + (load-theme 'modus-vivendi t)) (use-package pass :ensure t @@ -450,44 +467,24 @@ https://yannherklotz.com")) :config (setq org-transclusion-exclude-elements nil)) -;;(use-package org-zettelkasten -;; :after org -;; :init -;; (setq org-zettelkasten-directory "~/Dropbox/zk") -;; :config -;; (defun org-zettelkasten-abs-file (file) (expand-file-name file org-zettelkasten-directory)) -;; -;; (defun org-zettelkasten-goto-id (id) -;; "Go to an ID." -;; (interactive "sID: #") -;; (let (abs-link org-zettelkasten-abs-file) -;; (cond ((string-prefix-p "1" id) -;; (org-link-open-from-string -;; (concat "[[file:" (abs-link "hls.org") "::#" id "]]"))) -;; ((string-prefix-p "2" id) -;; (org-link-open-from-string -;; (concat "[[file:" (abs-link "computing.org") "::#" id "]]"))) -;; ((string-prefix-p "3" id) -;; (org-link-open-from-string -;; (concat "[[file:" (abs-link "verification.org") "::#" id "]]"))) -;; ((string-prefix-p "4" id) -;; (org-link-open-from-string -;; (concat "[[file:" (abs-link "mathematics.org") "::#" id "]]"))) -;; ((string-prefix-p "5" id) -;; (org-link-open-from-string -;; (concat "[[file:" (abs-link "hardware.org") "::#" id "]]")))))) -;; (define-key ymh-map (kbd "C-g") #'org-zettelkasten-goto-id) -;; -;; (define-key ymh-map (kbd "s") -;; (lambda () (interactive) -;; (let ((org-agenda-files -;; (mapcar #'org-zettelkasten-abs-file -;; '("hls.org" -;; "computing.org" -;; "verification.org" -;; "mathematics.org" -;; "hardware.org")))) (org-search-view)))) -;; (add-hook 'org-mode-hook #'org-zettelkasten-mode)) +(use-package org-zettelkasten + :after org + :init + (unless (package-installed-p 'org-zettelkasten) + (if emacs-29-p + (package-vc-install + '(org-zettelkasten + . (:url "https://git.sr.ht/~ymherklotz/org-zettelkasten"))) + (packag-install 'org-zettelkasten))) + (setq org-zettelkasten-directory "~/Dropbox/zk") + (setq org-zettelkasten-mapping + '((1 . "hls.org") + (2 . "computing.org") + (3 . "verification.org") + (4 . "mathematics.org") + (5 . "hardware.org"))) + :config + (org-zettelkasten-setup)) (use-package pdf-tools :ensure t @@ -598,14 +595,14 @@ https://yannherklotz.com")) (global-set-key (kbd "C-c o m") #'ymhg/notmuch) (setq notmuch-saved-searches - '((:name "inbox" :query "date:last_month..this_month and tag:inbox not tag:deleted" :key "n") + `((:name "inbox" :query "date:last_month..this_month and tag:inbox not tag:deleted and tag:unread" :key "n") (:name "flagged" :query "tag:flagged" :key "f") (:name "sent" :query "tag:sent" :key "s") (:name "drafts" :query "tag:draft" :key "d") - (:name "mailbox" :query "date:last_month..this_month and (tag:mailbox and tag:inbox) and not tag:deleted and not tag:sent" :key "m") - (:name "imperial" :query "date:last_month..this_month and (tag:imperial and tag:inbox) and not tag:deleted and not tag:sent" :key "i") - (:name "mailbox-archive" :query "date:last_month..this_month and (tag:mailbox and tag:archive) and not tag:deleted and not tag:sent" :key "a") - (:name "imperial-archive" :query "date:last_month..this_month and (tag:imperial and tag:archive) and not tag:deleted and not tag:sent" :key "b") + (:name "mailbox" :query "date:last_month..this_month and (tag:mailbox and tag:inbox) and not tag:deleted and not tag:sent and tag:unread" :key ,(kbd "m i")) + (:name "imperial" :query "date:last_month..this_month and (tag:imperial and tag:inbox) and not tag:deleted and not tag:sent and tag:unread" :key ,(kbd "i i")) + (:name "mailbox-archive" :query "date:last_month..this_month and (tag:mailbox and tag:archive) and not tag:deleted and not tag:sent" :key ,(kbd "m a")) + (:name "imperial-archive" :query "date:last_month..this_month and (tag:imperial and tag:archive) and not tag:deleted and not tag:sent" :key ,(kbd "i a")) (:name "all recent" :query "date:last_month..this_month" :key "r"))) (setq notmuch-fcc-dirs @@ -755,7 +752,8 @@ https://yannherklotz.com")) (add-hook 'TeX-mode-hook #'reftex-mode) (add-hook 'TeX-mode-hook #'outline-minor-mode) (add-hook 'LaTeX-mode-hook - (lambda () (setq reftex-ref-style-default-list '("Default" "Cleveref")))) + (lambda () + (setq reftex-ref-style-default-list '("Default" "Cleveref")))) (with-eval-after-load 'latex (define-key LaTeX-mode-map " " @@ -781,11 +779,16 @@ https://yannherklotz.com")) :config (global-hungry-delete-mode)) +(use-package eglot + :if (not emacs-29-p) + :ensure t) + (use-package eglot :config - (add-to-list 'eglot-server-programs '(prolog-mode . ("swipl" "-g" "use_module(library(lsp_server))." "-g" - "lsp_server:main" "-t" "halt" "--" - "stdio")))) + (add-to-list 'eglot-server-programs + '(prolog-mode + . ("swipl" "-g" "use_module(library(lsp_server))." "-g" + "lsp_server:main" "-t" "halt" "--" "stdio")))) (use-package elec-pair :config @@ -797,7 +800,27 @@ https://yannherklotz.com")) (use-package yaml-mode :ensure t) +(use-package ox-texinfo + :after org) + +(use-package visual-fill-column + :ensure t) + +(use-package elfeed + :ensure t + :init + (setq-default elfeed-search-filter "@1-month-ago +unread ")) + +(use-package elfeed-org + :ensure t + :init + (setq rmh-elfeed-org-files '("~/Dropbox/org/elfeed.org")) + :config + (elfeed-org)) + (setq gc-cons-threshold (* 1024 1024 10)) (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) +(unless (file-exists-p custom-file) + (with-temp-buffer (write-file custom-file))) (load custom-file) -- cgit