diff --git a/README.org b/README.org index aff9dd97..f342d696 100644 --- a/README.org +++ b/README.org @@ -739,9 +739,9 @@ This evil-collection package includes a lot of other evil based things. "tt" '(consult-theme :which-key "choose theme") "tl" '(toggle-truncate-lines :which-key "truncate lines") "ts" '(ispell :which-key "spell check") + "tb" '(org-bible-select :which-key "Select bible version") "ff" '(find-file :which-key "find file") "fv" '(chris/find-videos :which-key "find file") - "fb" '(chris/open-bible :which-key "find bible book") "fr" '(consult-recent-file :which-key "recent file") "fs" '(save-buffer :which-key "save") "ft" '(chris/find-todo :which-key "open todo file") @@ -757,7 +757,7 @@ This evil-collection package includes a lot of other evil based things. "ss" '(consult-line :which-key "consult search") "sr" '(consult-ripgrep :which-key "consult ripgrep") "sd" '(dictionary-search :which-key "search the dictionary") - "sv" '(org-bible-jump :which-key "imenu") + "sv" '(org-bible-jump :which-key "Find Bible verse") "oP" '(proced :which-key "proced") "ov" '(vterm :which-key "vterm") "wo" '(other-window :which-key "other window") @@ -2403,15 +2403,6 @@ Jinx is an enchanted spell checker for emacs. I think I'll just turn it on globa "C-S-f" 'jinx-correct)) #+end_src -#+begin_src emacs-lisp -(add-to-list 'eglot-server-programs - '(text-mode . ("harper-ls" "--stdio"))) -(add-to-list 'eglot-server-programs - '(org-mode . ("harper-ls" "--stdio"))) -(add-to-list 'eglot-server-programs - '((english-prose-mode :language-id "plaintext") . ("harper-ls" "--stdio"))) -#+end_src - ** Emoji In order to render color emojis I'll use =unicode-fonts=. #+begin_src emacs-lisp :tangle no @@ -3992,6 +3983,12 @@ Let's give eglot a try. (add-to-list 'eglot-server-programs '(wgsl-mode "wgsl-analyzer")) (add-to-list 'eglot-server-programs '(qml-mode "qmlls")) +(add-to-list 'eglot-server-programs + '(text-mode . ("harper-ls" "--stdio"))) +(add-to-list 'eglot-server-programs + '(org-mode . ("harper-ls" "--stdio"))) +(add-to-list 'eglot-server-programs + '((english-prose-mode :language-id "plaintext") . ("harper-ls" "--stdio"))) :general (general-def 'normal eglot-mode-map "ga" 'eglot-code-actions diff --git a/bible.el b/bible.el index 4ea3afd2..cec68b6c 100644 --- a/bible.el +++ b/bible.el @@ -75,9 +75,18 @@ (pulsar-recenter-top)))) (defun org-bible-select () - "Pick a different bible that is formatted in org-mode" + "Pick a different bible that is formatted in org-mode +If in a bible switch to the other version whilst keeping that position" (interactive) - (let ((bible (completing-read "Pick a bible version: " '("ESV" "CSB" "NASB")))))) + (let ((bible (completing-read "Pick a bible version: " '("ESV" "CSB" "NLT")))) + (cond ((string= bible "ESV") (setq org-bible-selected "~/docs/bibles/esv.org")) + ((string= bible "CSB") (setq org-bible-selected "~/docs/bibles/csb.org")) + ((string= bible "NLT") (setq org-bible-selected "~/docs/bibles/nlt.org"))) + (if (or (string= (buffer-name) "csb.org") + (string= (buffer-name) "esv.org") + (string= (buffer-name) "nlt.org")) + (let* ((verse (search-backward "Verse" (beginning-of-line))))) + (find-file org-bible-selected)))) ;; (define-minor-mode org-bible-mode ;; "Toggles the org bible minor mode" @@ -85,11 +94,91 @@ ;; :global t ;; :lighter " bible") -(defun org-bible-from-xml () +;;; A helper function for creating org bibles from xml data +(defun org-bible-from-xml (&optional file) "Get the bible from xml and render as org buffer" (interactive) - (let ((bible (xml-parse-file "~/docs/bibles/engwebu_usfx.xml"))) - (with-current-buffer (get-buffer-create "*web-bible*") - (insert (string bible)) - (insert "hello") - (save-buffer)))) + (with-current-buffer (get-buffer-create "*nlt-bible*") + (insert-file "~/docs/bibles/Bible_English_NLT.xml") + (let ((bible (cddr (libxml-parse-xml-region)))) + (erase-buffer) + (insert "#+title: NLT - New Living Translation Bible +#+description: The New Living Translation Bible formatted in Org syntax: Copyright © 2015 by Tyndale House. +#+STARTUP: hidedrawers +#+OPTIONS: ^:{} + +") + (cl-loop for book in bible + do (progn (insert "* " + (cond + ((string= (alist-get 'bnumber (cadr book)) "1") "Genesis") + ((string= (alist-get 'bnumber (cadr book)) "2") "Exodus") + ((string= (alist-get 'bnumber (cadr book)) "3") "Leviticus") + ((string= (alist-get 'bnumber (cadr book)) "4") "Numbers") + ((string= (alist-get 'bnumber (cadr book)) "5") "Dueteronomy") + ((string= (alist-get 'bnumber (cadr book)) "6") "Joshua") + ((string= (alist-get 'bnumber (cadr book)) "7") "Judges") + ((string= (alist-get 'bnumber (cadr book)) "8") "Ruth") + ((string= (alist-get 'bnumber (cadr book)) "9") "1 Samuel") + ((string= (alist-get 'bnumber (cadr book)) "10") "2 Samuel") + ((string= (alist-get 'bnumber (cadr book)) "11") "1 Kings") + ((string= (alist-get 'bnumber (cadr book)) "12") "2 Kings") + ((string= (alist-get 'bnumber (cadr book)) "13") "1 Chronicles") + ((string= (alist-get 'bnumber (cadr book)) "14") "2 Chronicles") + ((string= (alist-get 'bnumber (cadr book)) "15") "Ezra") + ((string= (alist-get 'bnumber (cadr book)) "16") "Nehemiah") + ((string= (alist-get 'bnumber (cadr book)) "17") "Esther") + ((string= (alist-get 'bnumber (cadr book)) "18") "Job") + ((string= (alist-get 'bnumber (cadr book)) "19") "Psalms") + ((string= (alist-get 'bnumber (cadr book)) "20") "Proverbs") + ((string= (alist-get 'bnumber (cadr book)) "21") "Ecclesiastes") + ((string= (alist-get 'bnumber (cadr book)) "22") "Song of Solomon") + ((string= (alist-get 'bnumber (cadr book)) "23") "Isaiah") + ((string= (alist-get 'bnumber (cadr book)) "24") "Jeremiah") + ((string= (alist-get 'bnumber (cadr book)) "25") "Lamentations") + ((string= (alist-get 'bnumber (cadr book)) "26") "Ezekiel") + ((string= (alist-get 'bnumber (cadr book)) "27") "Daniel") + ((string= (alist-get 'bnumber (cadr book)) "28") "Hosea") + ((string= (alist-get 'bnumber (cadr book)) "29") "Joel") + ((string= (alist-get 'bnumber (cadr book)) "30") "Amos") + ((string= (alist-get 'bnumber (cadr book)) "31") "Obadiah") + ((string= (alist-get 'bnumber (cadr book)) "32") "Jonah") + ((string= (alist-get 'bnumber (cadr book)) "33") "Micah") + ((string= (alist-get 'bnumber (cadr book)) "34") "Nahum") + ((string= (alist-get 'bnumber (cadr book)) "35") "Habakkuk") + ((string= (alist-get 'bnumber (cadr book)) "36") "Zephaniah") + ((string= (alist-get 'bnumber (cadr book)) "37") "Haggai") + ((string= (alist-get 'bnumber (cadr book)) "38") "Zechariah") + ((string= (alist-get 'bnumber (cadr book)) "39") "Malachi") + ((string= (alist-get 'bnumber (cadr book)) "40") "Matthew") + ((string= (alist-get 'bnumber (cadr book)) "41") "Mark") + ((string= (alist-get 'bnumber (cadr book)) "42") "Luke") + ((string= (alist-get 'bnumber (cadr book)) "43") "John") + ((string= (alist-get 'bnumber (cadr book)) "44") "Acts") + ((string= (alist-get 'bnumber (cadr book)) "45") "Romans") + ((string= (alist-get 'bnumber (cadr book)) "46") "1 Corinthians") + ((string= (alist-get 'bnumber (cadr book)) "47") "2 Corinthians") + ((string= (alist-get 'bnumber (cadr book)) "48") "Galatians") + ((string= (alist-get 'bnumber (cadr book)) "49") "Ephesians") + ((string= (alist-get 'bnumber (cadr book)) "50") "Phillipians") + ((string= (alist-get 'bnumber (cadr book)) "51") "Colossians") + ((string= (alist-get 'bnumber (cadr book)) "52") "1 Thessalonians") + ((string= (alist-get 'bnumber (cadr book)) "53") "2 Thessalonians") + ((string= (alist-get 'bnumber (cadr book)) "54") "1 Timothy") + ((string= (alist-get 'bnumber (cadr book)) "55") "2 Timothy") + ((string= (alist-get 'bnumber (cadr book)) "56") "Titus") + ((string= (alist-get 'bnumber (cadr book)) "57") "Philemon") + ((string= (alist-get 'bnumber (cadr book)) "58") "Hebrews") + ((string= (alist-get 'bnumber (cadr book)) "59") "James") + ((string= (alist-get 'bnumber (cadr book)) "60") "1 Peter") + ((string= (alist-get 'bnumber (cadr book)) "61") "2 Peter") + ((string= (alist-get 'bnumber (cadr book)) "62") "1 John") + ((string= (alist-get 'bnumber (cadr book)) "63") "2 John") + ((string= (alist-get 'bnumber (cadr book)) "64") "3 John") + ((string= (alist-get 'bnumber (cadr book)) "65") "Jude") + ((string= (alist-get 'bnumber (cadr book)) "66") "Revelation")) + "\n") + (cl-loop for chapter in (cddr book) + do (progn (insert "** Chapter " (alist-get 'cnumber (cadr chapter)) "\n") + (cl-loop for verse in (cddr chapter) + do (insert "*** Verse " (alist-get 'vnumber (cadr verse)) "\n" (caddr verse) "\n"))))))))) diff --git a/init.el b/init.el index cc0dce3f..3540cef4 100644 --- a/init.el +++ b/init.el @@ -461,9 +461,9 @@ "tt" '(consult-theme :which-key "choose theme") "tl" '(toggle-truncate-lines :which-key "truncate lines") "ts" '(ispell :which-key "spell check") + "tb" '(org-bible-select :which-key "Select bible version") "ff" '(find-file :which-key "find file") "fv" '(chris/find-videos :which-key "find file") - "fb" '(chris/open-bible :which-key "find bible book") "fr" '(consult-recent-file :which-key "recent file") "fs" '(save-buffer :which-key "save") "ft" '(chris/find-todo :which-key "open todo file") @@ -479,7 +479,7 @@ "ss" '(consult-line :which-key "consult search") "sr" '(consult-ripgrep :which-key "consult ripgrep") "sd" '(dictionary-search :which-key "search the dictionary") - "sv" '(org-bible-jump :which-key "imenu") + "sv" '(org-bible-jump :which-key "Find Bible verse") "oP" '(proced :which-key "proced") "ov" '(vterm :which-key "vterm") "wo" '(other-window :which-key "other window") @@ -1728,11 +1728,11 @@ Optional BACKEND must be `re-reveal' or a backend derived from it." (use-package ox-hugo) -;; (use-package ox-zola -;; :load-path "ox-zola/" -;; :config -;; (setq org-hugo-base-dir "/home/chris/dev/cochrun.xyz" -;; org-hugo-section "blog")) +(use-package ox-zola + :load-path "ox-zola/" + :config + (setq org-hugo-base-dir "/home/chris/dev/cochrun.xyz" + org-hugo-section "blog")) (defun chris/window-delete-popup-frame (&rest _) "Kill selected selected frame if it has parameter `chris/window-popup-frame'. @@ -2900,13 +2900,6 @@ current buffer's, reload dir-locals." (rust-ts-mode . eglot-ensure) :config - (add-to-list 'eglot-server-programs - '(text-mode . ("harper-ls" "--stdio"))) - (add-to-list 'eglot-server-programs - '(org-mode . ("harper-ls" "--stdio"))) - (add-to-list 'eglot-server-programs - '((english-prose-mode :language-id "plaintext") . ("harper-ls" "--stdio"))) - (setq eglot-autoshutdown t) (defun chris/eglot-capf () @@ -2920,6 +2913,12 @@ current buffer's, reload dir-locals." (add-to-list 'eglot-server-programs '(wgsl-mode "wgsl-analyzer")) (add-to-list 'eglot-server-programs '(qml-mode "qmlls")) +(add-to-list 'eglot-server-programs + '(text-mode . ("harper-ls" "--stdio"))) +(add-to-list 'eglot-server-programs + '(org-mode . ("harper-ls" "--stdio"))) +(add-to-list 'eglot-server-programs + '((english-prose-mode :language-id "plaintext") . ("harper-ls" "--stdio"))) :general (general-def 'normal eglot-mode-map "ga" 'eglot-code-actions