diff --git a/content/configs/Console.md b/content/configs/Console.md index d0dc47e..672c7aa 100644 --- a/content/configs/Console.md +++ b/content/configs/Console.md @@ -937,7 +937,7 @@ fi ``` -### `autocommmit` {#autocommmit} +### `autocommit` {#autocommit} A script to autocommit files in a repository. I use it to sync my org directory and password store. I guess it's not how git is intended to be used, but it works for me. diff --git a/content/configs/Desktop.md~ b/content/configs/Desktop.md~ index 131c6bd..b062752 100644 --- a/content/configs/Desktop.md~ +++ b/content/configs/Desktop.md~ @@ -897,7 +897,7 @@ The script below allows me to: ```bash hostname=$(hostname) # Settings varying on the hostname -export WLAN_INTERFACE=$(nmcli -f DEVICE con show | grep -Ev "(.*docker.*|DEVICE|br.*|tun.*|--)" | xargs) +export WLAN_INTERFACE=$(nmcli -f DEVICE con show | grep -Ev "(.*docker.*|DEVICE|br.*|tun.*|veth.*|--)" | xargs) if [ "$hostname" = "azure" ]; then TRAY_MONITOR="eDP-1" # export WLAN_INTERFACE="wlp3s0" @@ -936,7 +936,7 @@ declare -A BLOCKS=( ) # Geolocation for some modules -export LOC="SPB" +export LOC="TMN" export IPSTACK_API_KEY=$(pass show My_Online/APIs/ipstack | head -n 1) @@ -2346,6 +2346,7 @@ This section generates manifests for various desktop software that I'm using. | dev | node | | dev | openjdk | | dev | go | +| dev | gcc-toolchain | ### Manifests {#manifests} diff --git a/content/configs/Emacs.md b/content/configs/Emacs.md index cb90cf5..62ce64a 100644 --- a/content/configs/Emacs.md +++ b/content/configs/Emacs.md @@ -124,6 +124,12 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept - [Productivity & Knowledge management](#productivity-and-knowledge-management) - [Capture templates & various settings](#capture-templates-and-various-settings) - [Custom agendas](#custom-agendas) + - [org-ql](#org-ql) + - [Review workflow](#review-workflow) + - [Data from git & org-roam](#data-from-git-and-org-roam) + - [Data from org-journal](#data-from-org-journal) + - [Data from org-agenda via org-ql](#data-from-org-agenda-via-org-ql) + - [Capture template](#capture-template) - [Org Journal](#org-journal) - [Org Roam](#org-roam) - [org-roam-ui](#org-roam-ui) @@ -234,7 +240,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept - [Notmuch](#notmuch) - [Elfeed](#elfeed) - [Some additions](#some-additions) - - [YouTube](#youtube) + - [YouTube & EMMS](#youtube-and-emms) - [EMMS](#emms) - [MPD](#mpd) - [MPV](#mpv) @@ -2966,6 +2972,262 @@ Log DONE time ``` +#### org-ql {#org-ql} + +[org-ql](https://github.com/alphapapa/org-ql) is a package to query the org files. I'm using it in my review workflow, perhaps later I'll find another usecases. + +```emacs-lisp +(use-package org-ql + :straight (:fetcher github + :repo "alphapapa/org-ql" + :files (:defaults (:exclude "helm-org-ql.el")))) +``` + + +#### Review workflow {#review-workflow} + +My take on a review workflow. As a baseline, I want to have a template that lists the important changes since the last review and other basic information. I'm doing reviews regularly, but the time intervals still may vary, hence this flexibility. + + +##### Data from git & org-roam {#data-from-git-and-org-roam} + +First, as I have [autocommit]({{< relref "Console" >}}) set up in my org directory, here is a handy function to get an alist of changed files of a form `(status . path)`. In principle, the `rev` parameter can be a commit, tag, etc but here I'm interested in a form like `@{2021-08-30}`. + +```emacs-lisp +(setq my/git-diff-status + '(("A" . added) + ("C" . copied) + ("D" . deleted) + ("M" . modified) + ("R" . renamed) + ("T" . type-changed) + ("U" . unmerged))) + +(defun my/get-files-status (rev) + (let ((files (shell-command-to-string (concat "git diff --name-status " rev)))) + (mapcar + (lambda (file) + (let ((elems (split-string file "\t"))) + (cons + (cdr (assoc (car elems) my/git-diff-status)) + (nth 1 elems)))) + (split-string files "\n" t)))) +``` + +I'll use it to get a list of added and changed Roam files since the last review. Date should have be in a format `YYYY-MM-DD`. + +```emacs-lisp +(defun my/org-changed-files-since-date (date) + (let ((default-directory org-directory)) + (my/get-files-status (format "@{%s}" date)))) +``` + +Now we are ready to format this list to insert it into the capture template. + +```emacs-lisp +(defun my/org-review-format-roam (rev) + (let* ((changes (my/org-changed-files-since-date rev)) + (new-roam + (seq-filter + (lambda (elem) + (and (eq (car elem) 'added) + (string-match-p (rx bos "roam") (cdr elem)))) + changes)) + (changed-roam + (seq-filter + (lambda (elem) + (and (eq (car elem) 'modified) + (string-match-p (rx bos "roam") (cdr elem)))) + changes))) + (concat + (unless (seq-empty-p new-roam) + (concat "** New Roam entries \n" + (mapconcat + (lambda (entry) + (format "- [[file:%s][%s]]" (cdr entry) (cdr entry))) + new-roam + "\n") + "\n")) + (unless (seq-empty-p changed-roam) + (concat "** Changed Roam entries \n" + (mapconcat + (lambda (entry) + (format "- [[file:%s][%s]]" (cdr entry) (cdr entry))) + changed-roam + "\n")))))) +``` + + +##### Data from org-journal {#data-from-org-journal} + +Second, I want to have a list of new jounal entries since the last review. + +```emacs-lisp +(defun my/org-journal-entries-since-date (rev-date) + (mapcar + (lambda (date) + (let ((time (encode-time (parse-time-string date)))) + `((file . ,(org-journal--get-entry-path time)) + (header . ,(format-time-string org-journal-date-format time))))) + (seq-filter + (lambda (date) (string-lessp rev-date date)) + (mapcar + (lambda (date) + (format "%04d-%02d-%02dT00:00:00+0300" (nth 2 date) (nth 0 date) (nth 1 date))) + (org-journal--list-dates))))) +``` + +Format the results: + +```emacs-lisp +(defun my/org-review-format-journal (rev-date) + (mapconcat + (lambda (item) + (format "- [[file:%s::*%s][%s]]" + (cdr (assoc 'file item)) + (cdr (assoc 'header item)) + (cdr (assoc 'header item)))) + (my/org-journal-entries-since-date rev-date) + "\n")) +``` + + +##### Data from org-agenda via org-ql {#data-from-org-agenda-via-org-ql} + +Third, I want to list some changes in my agenda. This section will change depending on what I'm currently working on. + +So, here is a list of queries results of which I want to see in the review template. The format is `(name date-field order-by-field query)`. + +```emacs-lisp +(setq my/org-ql-review-queries + `(("Waitlist" scheduled scheduled + (and + (done) + (tags-inherited "waitlist"))) + ("Personal tasks done" closed ,nil + (and + (tags-inherited "personal") + (todo "DONE"))) + ("Attended meetings" closed scheduled + (and + (tags "meeting") + (todo "PASSED"))) + ("Done project tasks" closed deadline + (and + (todo "DONE") + (ancestors + (heading "Tasks")))))) +``` + +The query will be executed like this: `(and (date-field :from rev-date) query)` + +```emacs-lisp +(defun my/org-review-exec-ql (saved rev-date) + (let ((query `(and + (,(nth 1 saved) :from ,rev-date) + ,(nth 3 saved)))) + (org-ql-query + :select #'element + :from (org-agenda-files) + :where query + :order-by (nth 2 saved)))) +``` + +Format one element of query result. + +```emacs-lisp +(defun my/org-review-format-element (elem) + (concat + (string-pad + (plist-get (cadr elem) :raw-value) + 40) + (when-let (scheduled (plist-get (cadr elem) :scheduled)) + (concat " [SCHEDULED: " (plist-get (cadr scheduled) :raw-value) "]")) + (when-let (deadline (plist-get (cadr elem) :deadline)) + (concat " [DEADLINE: " (plist-get (cadr deadline) :raw-value) "]")))) +``` + +Execute all the saved queries and format an Org list for the capture template. + +```emacs-lisp +(defun my/org-review-format-queries (rev-date) + (mapconcat + (lambda (results) + (concat "** " (car results) "\n" + (string-join + (mapcar (lambda (r) (concat "- " r)) (cdr results)) + "\n") + "\n")) + (seq-filter + (lambda (result) + (not (seq-empty-p (cdr result)))) + (mapcar + (lambda (saved) + (cons + (car saved) + (mapcar + #'my/org-review-format-element + (my/org-review-exec-ql saved rev-date)))) + my/org-ql-review-queries)) + "\n")) +``` + + +##### Capture template {#capture-template} + +Now, we have to put all this together and define a capture template for the review. + +I'll use a separate directory for the review files, just like for org-journal and org-roam. The filename will have a format `YYYY-MM-DD.org`, which will also free me from the effort of storing the last review date somewhere. + +If somehow there are no files in the folder, fallback to the current date minus one week. + +```emacs-lisp +(setq my/org-review-directory "review") + +(defun my/org-review-get-filename () + (concat my/org-review-directory "/" (format-time-string "%Y-%m-%d.org" (current-time)))) + +(defun my/get-last-review-date () + (substring + (or + (-max-by + 'string-greaterp + (-filter + (lambda (f) (not (or (string-equal f ".") (string-equal f "..")))) + (directory-files (f-join org-directory my/org-review-directory)))) + (format-time-string + "%Y-%m-%d" + (time-subtract + (current-time) + (seconds-to-time (* 60 60 24 7))))) + 0 10)) +``` + +A template looks like this: + +```emacs-lisp +(setq my/org-review-capture-template + `("r" "Review" plain (file ,(my/org-review-get-filename)) + ,(string-join + '("#+TITLE: Review %t" + "" + "Last review date: %(org-timestamp-translate (org-timestamp-from-string (format \"<%s>\" (my/get-last-review-date))))" + "" + "* Roam" + "%(my/org-review-format-roam (my/get-last-review-date))" + "* Journal" + "New journal entries:" + "%(my/org-review-format-journal (my/get-last-review-date))" + "* Agenda" + "%(my/org-review-format-queries (my/get-last-review-date))" + "* Thoughts :crypt:" + "%?") + "\n"))) + +(add-to-list 'org-capture-templates my/org-review-capture-template t) +``` + + #### Org Journal {#org-journal} [org-journal](https://github.com/bastibe/org-journal) is a plugin for maintaining a journal in org mode. I want to have its entries separate from my knowledge base. @@ -4101,8 +4363,7 @@ Trying this one out instead of vue-mode and svelte-mode, because this one seems :config (add-hook 'web-mode-hook 'smartparens-mode) (add-hook 'web-mode-hook 'hs-minor-mode) - (my/set-smartparens-indent 'web-mode) - (add-hook 'web-mode-hook )) + (my/set-smartparens-indent 'web-mode)) ``` Hooking this up with lsp. @@ -5338,7 +5599,7 @@ Open a URL with eww. ``` -##### YouTube {#youtube} +##### YouTube & EMMS {#youtube-and-emms} Previously this block was opening MPV with `start-process`, but now I've managed to hook up MPV with EMMS. So there is the EMMS+elfeed "integration". @@ -5364,12 +5625,13 @@ Now, a function to add YouTube link with metadata from elfeed to EMMS. (let ((track (emms-track 'url (my/get-youtube-url (elfeed-entry-link entry))))) (emms-track-set track 'info-title (elfeed-entry-title entry)) - (setq my/test track) (emms-playlist-insert-track track)))) (defun my/elfeed-add-emms-youtube () (interactive) - (emms-add-elfeed elfeed-show-entry)) + (emms-add-elfeed elfeed-show-entry) + (elfeed-tag elfeed-show-entry 'watched) + (elfeed-show-refresh)) (with-eval-after-load 'elfeed (general-define-key diff --git a/content/configs/Emacs.md~ b/content/configs/Emacs.md~ index 4e3af76..cb90cf5 100644 --- a/content/configs/Emacs.md~ +++ b/content/configs/Emacs.md~ @@ -1552,7 +1552,7 @@ Before I figure out how to package this for Guix: :straight (:host github :repo "SqrtMinusOne/wakatime-mode") :if (not my/is-termux) :config - <> + (setq wakatime-ignore-exit-codes '(0 1 102)) (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli"))) ;; (setq wakatime-cli-path (executable-find "wakatime")) (global-wakatime-mode)) @@ -4028,7 +4028,7 @@ My bit of config here: :straight t :init (my-leader-def - :keymaps '(js-mode-map typescript-mode-map vue-mode-map svelte-mode-map) + :keymaps '(js-mode-map web-mode-map typescript-mode-map vue-mode-map svelte-mode-map) "rr" #'prettier-prettify)) ``` @@ -4101,7 +4101,8 @@ Trying this one out instead of vue-mode and svelte-mode, because this one seems :config (add-hook 'web-mode-hook 'smartparens-mode) (add-hook 'web-mode-hook 'hs-minor-mode) - (my/set-smartparens-indent 'web-mode)) + (my/set-smartparens-indent 'web-mode) + (add-hook 'web-mode-hook )) ``` Hooking this up with lsp. @@ -4120,6 +4121,16 @@ Hooking this up with lsp. (add-hook 'web-mode-hook #'my/web-mode-lsp) ``` +Vue settings + +```emacs-lisp +(defun my/web-mode-vue-setup () + (when (string-match-p (rx ".vue" eos) (buffer-name)) + (setq-local web-mode-script-padding 0))) + +(add-hook 'web-mode-hook 'my/web-mode-vue-setup) +``` + #### OFF (OFF) Vue.js {#off--vue-dot-js} @@ -4763,7 +4774,7 @@ For some reason it doesn't use pipenv python executable, so here is a small work (if asc (cdr asc) (let ((python-executable - (string-trim (shell-command-to-string "PIPENV_IGNORE_VIRTUALENVS=1 pipenv run which python")))) + (string-trim (shell-command-to-string "PIPENV_IGNORE_VIRTUALENVS=1 pipenv run which python 2>/dev/null")))) (if (string-match-p ".*not found.*" python-executable) (message "Pipfile found, but not pipenv executable!") (message (format "Found pipenv python: %s" python-executable)) @@ -5469,7 +5480,7 @@ After all this is done, run `M-x emms-cache-set-from-mpd-all` to set cache from [mpv](https://mpv.io/) is a decent media player, which has found a place in this configuration because it integrates with youtube-dl. ```emacs-lisp -(add-to-list 'emms-player-list 'emms-player-mpv t) +(add-to-list 'emms-player-list 'emms-player-mpv) ``` Also a custom regex. My demands for MPV include running `youtube-dl`, so there is a regex that matches youtube.com or some of the video formats. diff --git a/content/configs/README.md~ b/content/configs/README.md~ index 720e0f1..dd4f10e 100644 --- a/content/configs/README.md~ +++ b/content/configs/README.md~ @@ -13,7 +13,7 @@ The majority of the software is configured with [literate configuration](https:/ The files themselves are managed and deployed via [yadm](https://yadm.io/), but I mostly use Org Mode rich noweb whenever I can instead of what yadm offers. -My current GNU/Linux distribution is [GNU Guix](https://guix.gnu.org/). In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Looks for Org tables with "Guix dependency" in the header. +My current GNU/Linux distribution is [GNU Guix](https://guix.gnu.org/). In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for the tables with "Guix dependency" in the header. Literate configuration files: @@ -70,7 +70,7 @@ Some of the notable programs are listed in the table below. ## Some statistics {#some-statistics} -Run the following to show the pictures with reasonable width: +If you are viewing the file in Emacs, eval the following to show the pictures with reasonable width: ```elisp (setq-local org-image-actual-width '(1024)) diff --git a/public/configs/console/index.html b/public/configs/console/index.html index bc6f76e..69739f4 100644 --- a/public/configs/console/index.html +++ b/public/configs/console/index.html @@ -793,7 +793,7 @@ bind -M insert \e else notify-send "Terminal" "Command execution complete" fi -

autocommmit

+

autocommit

A script to autocommit files in a repository. I use it to sync my org directory and password store. I guess it’s not how git is intended to be used, but it works for me.

Usage:

autocommit <repository> [-F]
diff --git a/public/configs/emacs/index.html b/public/configs/emacs/index.html
index eefdf38..96858b3 100644
--- a/public/configs/emacs/index.html
+++ b/public/configs/emacs/index.html
@@ -245,6 +245,15 @@
 

org-ql

+

org-ql is a package to query the org files. I’m using it in my review workflow, perhaps later I’ll find another usecases.

+
(use-package org-ql
+  :straight (:fetcher github
+		      :repo "alphapapa/org-ql"
+		      :files (:defaults (:exclude "helm-org-ql.el"))))
+

Review workflow

+

My take on a review workflow. As a baseline, I want to have a template that lists the important changes since the last review and other basic information. I’m doing reviews regularly, but the time intervals still may vary, hence this flexibility.

+
Data from git & org-roam
+

First, as I have autocommit set up in my org directory, here is a handy function to get an alist of changed files of a form (status . path). In principle, the rev parameter can be a commit, tag, etc but here I’m interested in a form like @{2021-08-30}.

+
(setq my/git-diff-status
+      '(("A" . added)
+	("C" . copied)
+	("D" . deleted)
+	("M" . modified)
+	("R" . renamed)
+	("T" . type-changed)
+	("U" . unmerged)))
+
+(defun my/get-files-status (rev)
+  (let ((files (shell-command-to-string (concat "git diff --name-status " rev))))
+    (mapcar
+     (lambda (file)
+       (let ((elems (split-string file "\t")))
+	 (cons
+	  (cdr (assoc (car elems) my/git-diff-status))
+	  (nth 1 elems))))
+     (split-string files "\n" t))))
+

I’ll use it to get a list of added and changed Roam files since the last review. Date should have be in a format YYYY-MM-DD.

+
(defun my/org-changed-files-since-date (date)
+  (let ((default-directory org-directory))
+    (my/get-files-status (format "@{%s}" date))))
+

Now we are ready to format this list to insert it into the capture template.

+
(defun my/org-review-format-roam (rev)
+  (let* ((changes (my/org-changed-files-since-date rev))
+	 (new-roam
+	  (seq-filter
+	   (lambda (elem)
+	     (and (eq (car elem) 'added)
+		  (string-match-p (rx bos "roam") (cdr elem))))
+	   changes))
+	 (changed-roam
+	  (seq-filter
+	   (lambda (elem)
+	     (and (eq (car elem) 'modified)
+		  (string-match-p (rx bos "roam") (cdr elem))))
+	   changes)))
+    (concat
+     (unless (seq-empty-p new-roam)
+       (concat "** New Roam entries \n"
+	       (mapconcat
+		(lambda (entry)
+		  (format "- [[file:%s][%s]]" (cdr entry) (cdr entry)))
+		new-roam
+		"\n")
+	       "\n"))
+     (unless (seq-empty-p changed-roam)
+       (concat "** Changed Roam entries \n"
+	       (mapconcat
+		(lambda (entry)
+		  (format "- [[file:%s][%s]]" (cdr entry) (cdr entry)))
+		changed-roam
+		"\n"))))))
+
Data from org-journal
+

Second, I want to have a list of new jounal entries since the last review.

+
(defun my/org-journal-entries-since-date (rev-date)
+  (mapcar
+   (lambda (date)
+     (let ((time (encode-time (parse-time-string date))))
+       `((file . ,(org-journal--get-entry-path time))
+	 (header . ,(format-time-string org-journal-date-format time)))))
+   (seq-filter
+    (lambda (date) (string-lessp rev-date date))
+    (mapcar
+     (lambda (date)
+       (format "%04d-%02d-%02dT00:00:00+0300" (nth 2 date) (nth 0 date) (nth 1 date)))
+     (org-journal--list-dates)))))
+

Format the results:

+
(defun my/org-review-format-journal (rev-date)
+  (mapconcat
+   (lambda (item)
+     (format "- [[file:%s::*%s][%s]]"
+	     (cdr (assoc 'file item))
+	     (cdr (assoc 'header item))
+	     (cdr (assoc 'header item))))
+   (my/org-journal-entries-since-date rev-date)
+   "\n"))
+
Data from org-agenda via org-ql
+

Third, I want to list some changes in my agenda. This section will change depending on what I’m currently working on.

+

So, here is a list of queries results of which I want to see in the review template. The format is (name date-field order-by-field query).

+
(setq my/org-ql-review-queries
+      `(("Waitlist" scheduled scheduled
+	 (and
+	  (done)
+	  (tags-inherited "waitlist")))
+	("Personal tasks done" closed ,nil
+	 (and
+	  (tags-inherited "personal")
+	  (todo "DONE")))
+	("Attended meetings" closed scheduled
+	 (and
+	  (tags "meeting")
+	  (todo "PASSED")))
+	("Done project tasks" closed deadline
+	 (and
+	  (todo "DONE")
+	  (ancestors
+	   (heading "Tasks"))))))
+

The query will be executed like this: (and (date-field :from rev-date) query)

+
(defun my/org-review-exec-ql (saved rev-date)
+  (let ((query `(and
+		 (,(nth 1 saved) :from ,rev-date)
+		 ,(nth 3 saved))))
+    (org-ql-query
+      :select #'element
+      :from (org-agenda-files)
+      :where query
+      :order-by (nth 2 saved))))
+

Format one element of query result.

+
(defun my/org-review-format-element (elem)
+  (concat
+   (string-pad
+    (plist-get (cadr elem) :raw-value)
+    40)
+   (when-let (scheduled (plist-get (cadr elem) :scheduled))
+     (concat " [SCHEDULED: " (plist-get (cadr scheduled) :raw-value) "]"))
+   (when-let (deadline (plist-get (cadr elem) :deadline))
+     (concat " [DEADLINE: " (plist-get (cadr deadline) :raw-value) "]"))))
+

Execute all the saved queries and format an Org list for the capture template.

+
(defun my/org-review-format-queries (rev-date)
+  (mapconcat
+   (lambda (results)
+     (concat "** " (car results) "\n"
+	     (string-join
+	      (mapcar (lambda (r) (concat "- " r)) (cdr results))
+	      "\n")
+	     "\n"))
+   (seq-filter
+    (lambda (result)
+      (not (seq-empty-p (cdr result))))
+    (mapcar
+     (lambda (saved)
+       (cons
+	(car saved)
+	(mapcar
+	 #'my/org-review-format-element
+	 (my/org-review-exec-ql saved rev-date))))
+     my/org-ql-review-queries))
+   "\n"))
+
Capture template
+

Now, we have to put all this together and define a capture template for the review.

+

I’ll use a separate directory for the review files, just like for org-journal and org-roam. The filename will have a format YYYY-MM-DD.org, which will also free me from the effort of storing the last review date somewhere.

+

If somehow there are no files in the folder, fallback to the current date minus one week.

+
(setq my/org-review-directory "review")
+
+(defun my/org-review-get-filename ()
+  (concat my/org-review-directory "/" (format-time-string "%Y-%m-%d.org" (current-time))))
+
+(defun my/get-last-review-date ()
+  (substring
+   (or
+    (-max-by
+     'string-greaterp
+     (-filter
+      (lambda (f) (not (or (string-equal f ".") (string-equal f ".."))))
+      (directory-files (f-join org-directory my/org-review-directory))))
+    (format-time-string
+     "%Y-%m-%d"
+     (time-subtract
+      (current-time)
+      (seconds-to-time (* 60 60 24 7)))))
+   0 10))
+

A template looks like this:

+
(setq my/org-review-capture-template
+      `("r" "Review" plain (file ,(my/org-review-get-filename))
+	,(string-join
+	  '("#+TITLE: Review %t"
+	    ""
+	    "Last review date: %(org-timestamp-translate (org-timestamp-from-string (format \"<%s>\" (my/get-last-review-date))))"
+	    ""
+	    "* Roam"
+	    "%(my/org-review-format-roam (my/get-last-review-date))"
+	    "* Journal"
+	    "New journal entries:"
+	    "%(my/org-review-format-journal (my/get-last-review-date))"
+	    "* Agenda"
+	    "%(my/org-review-format-queries (my/get-last-review-date))"
+	    "* Thoughts                                                            :crypt:"
+	    "%?")
+	  "\n")))
+
+(add-to-list 'org-capture-templates my/org-review-capture-template t)
 

Org Journal

org-journal is a plugin for maintaining a journal in org mode. I want to have its entries separate from my knowledge base.

(use-package org-journal
@@ -3265,8 +3466,7 @@ MimeType=x-scheme-handler/org-protocol
   :config
   (add-hook 'web-mode-hook 'smartparens-mode)
   (add-hook 'web-mode-hook 'hs-minor-mode)
-  (my/set-smartparens-indent 'web-mode)
-  (add-hook 'web-mode-hook ))
+  (my/set-smartparens-indent 'web-mode))
 

Hooking this up with lsp.

(setq my/web-mode-lsp-extensions
       `(,(rx ".svelte" eos)
@@ -4208,7 +4408,7 @@ MimeType=x-scheme-handler/org-protocol
   (let ((link (elfeed-entry-link elfeed-show-entry)))
     (when link
       (eww link))))
-
YouTube
+
YouTube & EMMS

Previously this block was opening MPV with start-process, but now I’ve managed to hook up MPV with EMMS. So there is the EMMS+elfeed “integration”.

The following function converts URLs from Invidious and the like to YouTube.

(defun my/get-youtube-url (link)
@@ -4226,12 +4426,13 @@ MimeType=x-scheme-handler/org-protocol
     (let ((track (emms-track
 		  'url (my/get-youtube-url (elfeed-entry-link entry)))))
       (emms-track-set track 'info-title (elfeed-entry-title entry))
-      (setq my/test track)
       (emms-playlist-insert-track track))))
 
 (defun my/elfeed-add-emms-youtube ()
   (interactive)
-  (emms-add-elfeed elfeed-show-entry))
+  (emms-add-elfeed elfeed-show-entry)
+  (elfeed-tag elfeed-show-entry 'watched)
+  (elfeed-show-refresh))
 
 (with-eval-after-load 'elfeed
   (general-define-key