diff --git a/README.org b/README.org index d570fe19..5db1ba5c 100644 --- a/README.org +++ b/README.org @@ -811,6 +811,9 @@ I think I like this interface to controlling bluetooth the most #+end_src ** Org Mode +:PROPERTIES: +:ID: 20240827T103448.834367 +:END: Org-Mode needs to be loaded pretty high in the file so that we are ensuring things get picked up in the correct order. This has been a problem for me in the past so I prefer it right after setting some keybindings and then much later loading things like =roam= =super-agenda= and others. Let's start by creating a self contained function of what I'd like started on every org buffer. @@ -959,6 +962,7 @@ Part of this config includes some special capture templates for my work as a you org-directory "~/docs/notes") (add-hook 'org-mode-hook 'chris/org-mode-setup) + (setq org-refile-targets '((org-agenda-files :maxlevel . 6) ("/home/chris/docs/todo/archive.org" :maxlevel . 6))) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) @@ -1235,7 +1239,7 @@ We need to create a lesson capture function to find our lesson files differently "Function to return the lesson file that is needed for TFC plan capture and move to correct position for plan insertion" (interactive) ;; (unless org-roam-mode (org-roam-mode +1)) - (let* ((files (denote-all-files)) + (let* ((files (denote-directory-files)) (lessons (remove nil (cl-loop for file in files collect (if (string-match "lessons/" file) file)))) @@ -1477,7 +1481,7 @@ I might try switching to and using denote instead of Org Roam. Denote doesn't us :config (require 'denote-org-extras) (setq denote-directory "/home/chris/docs/notes" - denote-dired-directories '("/home/chris/docs/notes") + denote-dired-directories '("/home/chris/docs/notes" "/home/chris/docs/notes/lessons") denote-dired-directories-include-subdirectories t denote-modules '(project xref ffap) denote-known-keywords '("emacs" "bible" "jesus" "tfc" "lesson" "it" "dev")) @@ -1515,7 +1519,8 @@ I might try switching to and using denote instead of Org Roam. Denote doesn't us :keymaps 'override "nf" 'denote-open-or-create "nb" 'denote-backlinks - "nk" 'denote-keywords-add)) + "nk" 'denote-keywords-add + "nl" 'denote-link-or-create)) #+end_src *** Org-Superstar @@ -5444,8 +5449,13 @@ I am going to try and use LanguageTool to fix grammatical issues. Org Bible is going to be set of functions for creating and using a bible app within Emacs. Let's see if we can't make it work. #+begin_src emacs-lisp (load (concat user-emacs-directory "bible.el")) +(add-to-list 'warning-suppress-types '(org-element)) +(add-to-list 'warning-suppress-log-types '(org-element)) #+end_src ** Emacs as RPG +:PROPERTIES: +:ID: 20240828T061621.839280 +:END: Using emacs to run rpg things #+begin_src emacs-lisp (add-to-list 'load-path "/home/chris/dev/emacs-rpgdm/") @@ -5454,8 +5464,24 @@ Using emacs to run rpg things (defun chris/dnd-skill-check (&optional skill) "Roll for a skill check using skill or prompting for one." (interactive) - (let* ((skills (org-table-get-remote-range "20240826T061454.312500:skills" "$I..II")) - (skill (if skill skill (completing-read "Which skill: " )))))) + (let* ((skills (with-current-buffer + (find-file-noselect "~/docs/notes/20240804T132141--dungeons-and-dragons__area_fun_personal.org") + (org-table-get-remote-range + "skills" "@I$1..@II$2"))) + (skill (completing-read "Which skill: " + (seq-filter + 'stringp + (cl-loop for e in skills + collect + (if (= 0 (string-to-number + (substring-no-properties e))) + (substring-no-properties e)))))) + (value (substring-no-properties + (nth (+ 1 (cl-position + skill skills + :test 'string=)) + skills)))) + (message value))) :general (chris/leader-keys diff --git a/init.el b/init.el index dec8a2be..579aaa33 100644 --- a/init.el +++ b/init.el @@ -671,6 +671,7 @@ much faster. The hope is to also make this a faster version of imenu." org-directory "~/docs/notes") (add-hook 'org-mode-hook 'chris/org-mode-setup) + (setq org-refile-targets '((org-agenda-files :maxlevel . 6) ("/home/chris/docs/todo/archive.org" :maxlevel . 6))) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) @@ -944,7 +945,7 @@ much faster. The hope is to also make this a faster version of imenu." "Function to return the lesson file that is needed for TFC plan capture and move to correct position for plan insertion" (interactive) ;; (unless org-roam-mode (org-roam-mode +1)) - (let* ((files (denote-all-files)) + (let* ((files (denote-directory-files)) (lessons (remove nil (cl-loop for file in files collect (if (string-match "lessons/" file) file)))) @@ -1020,7 +1021,7 @@ much faster. The hope is to also make this a faster version of imenu." :config (require 'denote-org-extras) (setq denote-directory "/home/chris/docs/notes" - denote-dired-directories '("/home/chris/docs/notes") + denote-dired-directories '("/home/chris/docs/notes" "/home/chris/docs/notes/lessons") denote-dired-directories-include-subdirectories t denote-modules '(project xref ffap) denote-known-keywords '("emacs" "bible" "jesus" "tfc" "lesson" "it" "dev")) @@ -1058,7 +1059,8 @@ much faster. The hope is to also make this a faster version of imenu." :keymaps 'override "nf" 'denote-open-or-create "nb" 'denote-backlinks - "nk" 'denote-keywords-add)) + "nk" 'denote-keywords-add + "nl" 'denote-link-or-create)) (use-package org-present :commands org-present @@ -4012,6 +4014,8 @@ interfere with the default `bongo-playlist-buffer'." "N" 'mastodon-notifications--timeline)) (load (concat user-emacs-directory "bible.el")) +(add-to-list 'warning-suppress-types '(org-element)) +(add-to-list 'warning-suppress-log-types '(org-element)) (add-to-list 'load-path "/home/chris/dev/emacs-rpgdm/") (use-package rpgdm @@ -4019,8 +4023,24 @@ interfere with the default `bongo-playlist-buffer'." (defun chris/dnd-skill-check (&optional skill) "Roll for a skill check using skill or prompting for one." (interactive) - (let* ((skills (org-table-get-remote-range "20240826T061454.312500:skills" "$I..II")) - (skill (if skill skill (completing-read "Which skill: " )))))) + (let* ((skills (with-current-buffer + (find-file-noselect "~/docs/notes/20240804T132141--dungeons-and-dragons__area_fun_personal.org") + (org-table-get-remote-range + "skills" "@I$1..@II$2"))) + (skill (completing-read "Which skill: " + (seq-filter + 'stringp + (cl-loop for e in skills + collect + (if (= 0 (string-to-number + (substring-no-properties e))) + (substring-no-properties e)))))) + (value (substring-no-properties + (nth (+ 1 (cl-position + skill skills + :test 'string=)) + skills)))) + (message value))) :general (chris/leader-keys