From a9769e991905f52dae2100e0e89b9efc4dbf82ef Mon Sep 17 00:00:00 2001 From: William Moore Date: Thu, 11 Jul 2024 10:05:04 -0500 Subject: [PATCH] Updates on my side for THWAP change tests --- .gitignore | 6 +++ init.el | 19 ++++++--- thwap/thwap-defaults.el | 12 +++--- thwap/thwap-development.el | 25 ----------- thwap/thwap-helpers.el | 8 ++-- thwap/thwap-interface.el | 26 +++++++----- thwap/thwap-orgmode.el | 85 ++++++++++++++++++++------------------ 7 files changed, 90 insertions(+), 91 deletions(-) diff --git a/.gitignore b/.gitignore index 5277758..9b042f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ *~ *.elc +elpa/ +melpa/ +*.lock +.org-id-locations +org-roam.db scratch +.emacs.desktop recentf .cache* .lsp* diff --git a/init.el b/init.el index a385715..996d938 100644 --- a/init.el +++ b/init.el @@ -4,21 +4,22 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. + '(desktop-save-mode t) '(mouse-autoselect-window t) '(mouse-drag-and-drop-region t) '(mouse-drag-and-drop-region-cross-program t) - '(terraform-format-on-save t) - '(terraform-indent-level 2) + '(thwap-development '(magitmode projectilemode pythonmode elpymode yamlmode)) + '(thwap-orgmode '(orgmode orgdownload orgroam orgpublish)) + '(thwap-ui-theme nil) '(tool-bar-mode nil) - '(visible-bell 1) - '(xterm-mouse-mode t)) + '(visible-bell 1)) -(custom-set-faces +;;(custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(default ((t (:family "Noto Sans Mono" :foundry "GOOG" :slant normal :weight regular :height 90 :width normal))))) +;; '(default ((t (:family "Noto Sans Mono" :foundry "GOOG" :slant normal :weight regular :height 90 :width normal))))) ;; thwap helpers (require 'thwap-helpers) @@ -43,3 +44,9 @@ (let ((user-config (thwap/list-files-with-extension "~/.emacs.d/thwap.d" "el"))) (dolist (config user-config) (load-file config))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/thwap/thwap-defaults.el b/thwap/thwap-defaults.el index de72327..1224c92 100644 --- a/thwap/thwap-defaults.el +++ b/thwap/thwap-defaults.el @@ -4,9 +4,9 @@ ;; ;; automatically revert buffers when they change on disk -(global-auto-revert-mode t) +;; (global-auto-revert-mode f) ;; display line numbers, TODO make this a config option for line number style -(global-display-line-numbers-mode 1) +;; (global-display-line-numbers-mode 1) ;; set our default warning level to error (setq warning-minimum-level :error) ;; set the default tab width to 2 spaces @@ -25,10 +25,10 @@ ;; ;; golden-ratio -(straight-use-package 'golden-ratio) -(golden-ratio-mode 1) -(setq golden-ratio-auto-scale t) -(message "Golden Ratio Mode Enabled") +;; (straight-use-package 'golden-ratio) +;; (golden-ratio-mode 1) +;; (setq golden-ratio-auto-scale t) +;; (message "Golden Ratio Mode Enabled") ;; ;; Set up the T.H.W.A.P. keybindings diff --git a/thwap/thwap-development.el b/thwap/thwap-development.el index 8457dba..bce2119 100644 --- a/thwap/thwap-development.el +++ b/thwap/thwap-development.el @@ -10,11 +10,9 @@ (const :tag "lsp" lspmode) ;; generally required for other modes (const :tag "magit" magitmode) ;; git integration (const :tag "projectile" projectilemode) ;; project management - (const :tag "copilot" copilotmode) ;; code completion (const :tag "go" gomode) ;; go language support (const :tag "python" pythonmode) ;; python language support (const :tag "elpy" elpymode) ;; python language support (elpy) - (const :tag "terraform" terraformmode) ;; terraform language support (const :tag "yaml" yamlmode)) ;; yaml language support :group 'thwap-config) @@ -49,19 +47,6 @@ (thwap/add-key-binding "p" 'projectile-command-map "Projectile commands") (message "projectile loaded")) -;; co-pilot -(when (memq 'copilotmode thwap-development) - (straight-use-package 'dash) - (straight-use-package 'editorconfig) - (use-package copilot - :straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el")) - :ensure t) - ;; you can utilize :map :hook and :config to customize copilot - (add-hook 'prog-mode-hook 'copilot-mode) - (define-key copilot-completion-map (kbd "") 'copilot-accept-completion) - (define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion) - (message "copilot loaded")) - ;; go-mode (when (memq 'gomode thwap-development) (straight-use-package 'go-mode) @@ -96,16 +81,6 @@ :hook (python-mode . python-black-on-save-mode)) (message "python-mode loaded")) -;; terraform-mode -(when (memq 'terraformmode thwap-development) - (straight-use-package 'terraform-mode) - (when (eq 'company thwap-completion) - (straight-use-package 'company-terraform) - (add-hook 'terraform-mode-hook #'company-terraform-init)) - (add-hook 'terraform-mode-hook #'terraform-format-on-save-mode) - (add-hook 'terraform-mode-hook #'terraform-format-on-save-mode) - (message "terraform-mode loaded")) - ;; yaml-mode (when (memq 'yamlmode thwap-development) (straight-use-package 'yaml-mode) diff --git a/thwap/thwap-helpers.el b/thwap/thwap-helpers.el index bc935c5..36f3362 100644 --- a/thwap/thwap-helpers.el +++ b/thwap/thwap-helpers.el @@ -60,10 +60,10 @@ LST is reversed and concatenated into a single string with line breaks." "Update the `org-agenda-files` variable. This function sets `org-agenda-files` and `org-timeblock-files` to the list of all `.org` files in the `~/.org-agenda` directory, and sets -`org-timeblock-inbox-file` to `~/.org-agenda/tasks.org`." - (setq org-agenda-files (thwap/list-files-with-extension "~/.org-agenda" "org")) - (setq org-timeblock-files (thwap/list-files-with-extension "~/.org-agenda" "org")) - (setq org-timeblock-inbox-file "~/.org-agenda/tasks.org")) +`org-timeblock-inbox-file` to `~/org/agenda/index.org`." + (setq org-agenda-files (thwap/list-files-with-extension "~/org/agenda" "org")) + (setq org-timeblock-files (thwap/list-files-with-extension "~/org/agenda" "org")) + (setq org-timeblock-inbox-file "~/org/agenda/index.org")) (message "T.H.W.A.P. Loaded helper function library.") diff --git a/thwap/thwap-interface.el b/thwap/thwap-interface.el index 3a943aa..e661716 100644 --- a/thwap/thwap-interface.el +++ b/thwap/thwap-interface.el @@ -10,14 +10,15 @@ (const :tag "Doom themes" doomthemes) (const :tag "Sublime themes" sublimethemes) (const :tag "Kaolin themes" kaolinthemes) - (const :tag "Alect themes" alectthemes)) + (const :tag "Alect themes" alectthemes) + (const :tag "Wombat themes" wombat)) :group 'thwap-config) ;; theme to load -(defcustom thwap-ui-theme 'wombat ;; 'modus-vivendi-tinted - "Name of the theme to load." - :type 'string - :group 'thwap-config) +(defcustom thwap-ui-theme nil + "Name of the theme to load." + :type 'string + :group 'thwap-config) ;; all-the-icons toggle (defcustom thwap-ui-icons nil @@ -28,7 +29,7 @@ :group 'thwap-config) -;; theme bits + ; theme bits (when (memq 'modusthemes thwap-ui-themes) (straight-use-package 'modus-themes) @@ -50,16 +51,21 @@ (require 'kaolin-themes) (message "Kaolin themes loaded.")) -(when (memq 'alectthems thwap-ui-themes) +(when (memq 'alectthemes thwap-ui-themes) (straight-use-package 'alect-themes) (require 'alect-themes) (message "Alect themes loaded.")) -;; load the theme specified in the config +(when (memq 'wombat thwap-ui-themes) + '(thwap-ui-theme 'wombat) + (message "Wombat themes loaded.")) + +;; load the theme specified in the config if it is set ;; if things look wonky, you probably either need to install the ;; theme or you need to check your spelling. -(load-theme thwap-ui-theme :no-confirm) -(message "Theme loaded: %s" thwap-ui-theme) +(if thwap-ui-theme + (load-theme thwap-ui-theme :no-confirm) + (message "Theme loaded: %s" thwap-ui-theme)) ;; icon bits diff --git a/thwap/thwap-orgmode.el b/thwap/thwap-orgmode.el index be2afa2..3f30b73 100644 --- a/thwap/thwap-orgmode.el +++ b/thwap/thwap-orgmode.el @@ -11,7 +11,9 @@ (const :tag "Org-Modern" orgmodern) (const :tag "Org-TimeBlock" orgtimeblock) (const :tag "Org-Download" orgdownload) - (const :tag "Org-Transclusion" orgtransclusion)) + (const :tag "Org-Transclusion" orgtransclusion) + (const :tag "Org-Roam" orgroam) + (const :tag "Org-Publish" orgpublish)) :group 'thwap-config) ;; org-babel extras @@ -21,11 +23,6 @@ (const :tag "ob-napkin" obnapkin)) :group 'thwap-config) -(defcustom thwap-org-openai-api-token nil - "OpenAI API Token for use in org-ai. (Setting this enables the org-ai support.)" - :type 'string - :group 'thwap-config) - ;; ;; Ensure Org mode is installed and loaded ;; @@ -33,15 +30,15 @@ ;; base (when (memq 'orgmode thwap-orgmode) (straight-use-package 'org) - (thwap/ensure-directory-exists "~/.org-agenda") + (thwap/ensure-directory-exists "~/org") (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "firefox-esr" org-log-done 'time org-startup-indented t org-hide-leading-stars t org-support-shift-select t - org-directory "~/.org-agenda" - org-default-notes-file "~/.org-agenda/notes.org" + org-directory "~/org" + org-default-notes-file "~/org/index.org" org-export-with-sub-superscripts t org-export-with-toc t) (thwap/org-agenda-files-update) @@ -49,19 +46,19 @@ '((sequence "TODO(t)" "WAITING(w)" "BLOCKED(b)" "|" "IN-PROGRESS(i)") (sequence "WONTDO(o)" "DEPRECATED(e)" "STUPID(s)" "|" "DONE(d)"))) (setq org-capture-templates - `(("t" "TODO" entry (file+headline "~/.org-agenda/tasks.org" "Tasks") + `(("t" "TODO" entry (file+headline "~/org/agenda/index.org" "Tasks") "* TODO %?\n %a") - ("l" "TODO" entry (file+headline "~/.org-agenda/tasks.org" "LIFE Tasks") + ("l" "TODO" entry (file+headline "~/org/agenda/index.org" "LIFE Tasks") "* TODO %?\n %i\n %a") - ("a" "Appointment" entry (file+headline "~/.org-agenda/events.org" "Appointments") + ("a" "Appointment" entry (file+headline "~/org/agenda/events.org" "Appointments") "* %?\n %i\n %a" :clock-in t :clock-resume t) - ("e" "Schedule Event" entry (file+headline "~/.org-agenda/events.org" "Events") + ("e" "Schedule Event" entry (file+headline "~/org/agenda/events.org" "Events") "* %?\n %i\n %a" :clock-in t :clock-resume t) - ("m" "Schedule Meeting" entry (file+headline "~/.org-agenda/events.org" "Meetings") + ("m" "Schedule Meeting" entry (file+headline "~/org/agenda/events.org" "Meetings") "* %?\n %i\n %a" :clock-in t :clock-resume t) - ("n" "Note" entry (file "~/.org-agenda/notes.org") + ("n" "Note" entry (file "~/org/index.org") "* %?\n %i\n %a" :clock-in t :clock-resume t) - ("i" "Idea" entry (file "~/.org-agenda/ideas.org") + ("i" "Idea" entry (file "~/org/agenda/ideas.org") "* %? :IDEA: \n%t" :clock-in t :clock-resume t))) (org-babel-do-load-languages 'org-babel-load-languages @@ -113,17 +110,38 @@ (message "org-download loaded")) ;; org-roam -;; (when (and thwap-org-enable-org thwap-org-enable-org-roam) -;; (setq org-roam-directory "~/.org-agenda") -;; (setq org-roam-db-location "~/.org-agenda/org-roam.db") -;; (setq org-roam-completion-everywhere t) -;; (setq org-roam-capture-templates -;; '(("d" "default" plain "%?" -;; :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") -;; :unnarrowed t))) -;; (add-hook 'after-init-hook 'org-roam-mode) -;; (add-hook 'org-mode-hook 'org-roam-mode) -;; (add-hook 'org-mode-hook 'org-roam-ui-mode)) +(when (and (memq 'orgmode thwap-orgmode) (memq 'orgroam thwap-orgmode)) + (straight-use-package 'org-roam) + (org-roam-db-autosync-mode) + (setq org-roam-v2-ack t) + (setq org-roam-directory "~/org-roam") + (setq org-roam-db-location "~/org-roam/org-roam.db") + (setq org-roam-completion-everywhere t) + (setq org-roam-capture-templates + '(("d" "default" plain "%?" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") + :unnarrowed t))) + ;; (add-hook 'after-init-hook 'org-roam) + ;; (add-hook 'org-mode-hook 'org-roam) + ;;(add-hook 'org-mode-hook 'org-roam-ui-mode) + + ) + +(when (and (memq 'orgmode thwap-orgmode) (memq 'orgpublish thwap-orgmode)) + (require 'ox-publish) + (setq org-publish-project-alist + '( + ("org-notes" + :base-directory "~/org/" + :base-extension "org" + :publishing-directory "~/www/html/org/" + :recursive t + :publishing-function org-html-publish-to-html + :headline-levels 4 ; Just the default for this project. + :auto-preamble t + ) + )) +) ;; ;; org-roam-ui ;; (when (and thwap-org-enable-org thwap-org-enable-org-roam thwap-org-enable-org-roam-ui) @@ -144,19 +162,6 @@ (add-to-list 'org-babel-load-languages '(mermaid . t)) (message "ob-mermaid loaded")) -;; org-ai -(when (and (memq 'orgmode thwap-orgmode) thwap-org-openai-api-token) - (straight-use-package - '(org-ai :type git :host github :repo "rksm/org-ai" - :local-repo "org-ai" - :files ("*.el" "README.md" "snippets"))) - (setq org-ai-default-chat-model "gpt-3.5-turbo") - (setq org-ai-openai-api-token thwap-org-openai-api-token) - (org-ai-global-mode) - (org-ai-install-yasnippets) - (message "org-ai loaded")) - - (message "T.H.W.A.P. Org-Mode settings loaded") (provide 'thwap-orgmode) ;; thwap-orgmode.el ends here