From 2e30c22798d4b3ecfc5056a3fde5b64ae0245da8 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 25 Apr 2025 18:10:30 -0700 Subject: [PATCH] tweaks and cleanups --- .gitignore | 4 ++++ deprecated.el | 25 +++++++++++++++++++++++++ init.el | 41 ++++++++++++++--------------------------- publish.el | 30 ++++++++++++++++++++++++++++-- 4 files changed, 71 insertions(+), 29 deletions(-) create mode 100644 deprecated.el diff --git a/.gitignore b/.gitignore index 26cd290..409b715 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ auto-save-list /projects /url/ /org-roam.db +/.org-id-locations +/eln-cache/ +/elpa/ +/tramp diff --git a/deprecated.el b/deprecated.el new file mode 100644 index 0000000..10dc41d --- /dev/null +++ b/deprecated.el @@ -0,0 +1,25 @@ +;;; -*- lexical-binding: t; -*- +;;; +;;; This file contains elisp that I used to use, but no longer +;;; do. It's mostly here as a reference. + + +(keychain-refresh-environment) + +(when window-system + (load-theme +DEFAULT-THEME+) + (set-frame-font (get-default-font))) + +(add-hook 'after-make-frame-functions + (lambda (frame) + (if (window-system) + (set-frame-font (get-default-font))))) + +;;; rust stuff --- no longer frens with rust +;; (add-hook 'rust-mode-hook #'racer-mode) +;; (add-hook 'racer-mode-hook #'eldoc-mode) +;; (add-hook 'racer-mode-hook #'company-mode) +;; +;; (require 'rust-mode) +;; (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common) +;; (setq company-tooltip-align-annotations t) diff --git a/init.el b/init.el index f21a6ff..9fb895b 100644 --- a/init.el +++ b/init.el @@ -137,7 +137,7 @@ present on disk." (when (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el")) (load (expand-file-name "~/quicklisp/slime-helper.el")) (ensure-package 'slime) - ;; Replace "sbcl" with the path to your implementation + (setq inferior-lisp-program "sbcl") (slime-setup '(slime-fancy slime-autodoc @@ -147,12 +147,8 @@ present on disk." slime-truncate-lines nil) (setq lisp-lambda-list-keyword-parameter-alignment t - lisp-lambda-list-keyword-alignment t) - - (when (executable-find "nyxt") - ;; load nyxt - ) -) + lisp-lambda-list-keyword-alignment t)) + ;(when (executable-find "nyxt")) (add-hook 'clojure-mode-hook #'enable-paredit-mode) (add-hook 'lisp-mode-hook #'enable-paredit-mode) @@ -160,7 +156,6 @@ present on disk." (add-hook 'scheme-mode-hook #'enable-paredit-mode) (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) -(message "loading %s" (emacs-path "scriba.el")) (let ((scriba-lisp (emacs-path "scriba.el"))) (when (and (file-exists-p scriba-lisp) (load scriba-lisp)) @@ -176,15 +171,6 @@ present on disk." (require 'rgbds-mode) (add-to-list 'auto-mode-alist '("\\.gbasm\\'" . rgbds-mode ))))) -;;; rust stuff --- no longer frens with rust -;; (add-hook 'rust-mode-hook #'racer-mode) -;; (add-hook 'racer-mode-hook #'eldoc-mode) -;; (add-hook 'racer-mode-hook #'company-mode) -;; -;; (require 'rust-mode) -;; (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common) -;; (setq company-tooltip-align-annotations t) - ;;; Project Interaction Library for Emacs (require 'projectile) (setq projectile-known-projects-file @@ -292,9 +278,8 @@ present on disk." (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) -(keychain-refresh-environment) - -(load (emacs-path "publish")) +;;;; org-mode publishing +(load (emacs-path "publish.el")) (defvar *host-font-size* #s(hash-table @@ -327,11 +312,13 @@ present on disk." *acceptable-font-sizes*)))) (format "%s %d" *default-font* font-size))) -(when (window-system) - (load-theme +DEFAULT-THEME+) - (set-frame-font (get-default-font))) +(defun reset-frame-font () (interactive) + (set-frame-font (get-default-font))) -(add-hook 'after-make-frame-functions - (lambda (frame) - (if (window-system) - (set-frame-font (get-default-font))))) +;; I always end up running emacs from a GUI, easier to add a function +;; to disable this later. +(load-theme +DEFAULT-THEME+) +(set-frame-font (get-default-font)) + +(unless (server-running-p) + (server-start)) diff --git a/publish.el b/publish.el index 6e0556d..a8e3508 100644 --- a/publish.el +++ b/publish.el @@ -8,7 +8,24 @@ :custom (org-roam-directory (file-truename "~/org/roam/")) (org-roam-db-autosync-enable) - + (org-roam-capture-templates + '(("d" "default" plain "%?" + :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" + "#+title: ${title}\n#+date: %U\n#+options: toc:nil num:nil\n#+filetags:\n\n") + :unnarrowed t) + ("a" "article" plain "- Source: [[%^{Url}][%^{Title}]]\n- Author: /%^{Author}/\n- Year: /%^{Year}/\n\n* Highlights / Notes\n" + :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" + "#+title: ${title}\n#+date: %U\n#+options: toc:nil num:nil\n#+filetags: article:\n\n") + :unnarrowed t) + ("p" "project" plain "- Repo: [[%^{Url}][%^{title}]]\n\nOne sentence summary.\n\n** Tasks [/]" + :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" + "#+title: ${title}\n#+date: %U\n#+options: toc:nil num:nil\n#+filetags: project\n\n") + :unnarrowed t))) + (org-roam-dailies-capture-templates + '(("d" "default" entry + "* %?" + :target (file+head "%<%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n")))) :bind (("C-c n l" . org-roam-buffer-toggle) ("C-c n f" . org-roam-node-find) ("C-c n g" . org-roam-graph) @@ -26,6 +43,14 @@ "${file}")) (require 'org-roam-protocol)) +(setq org-roam-dailies-directory (file-truename "~/org/roam/j/")) + +(setq org-roam-dailies-capture-templates + '(("d" "default" entry + "* Tasks [0/1]\n + [ ] %?\n\n* How did you improve your situation?" + :target (file+head "%<%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n\n")))) + (defvar *org-remote-site* "/ssh:web.metacircular.net:/srv/www/metacircular/" "Where should org-mode files be published?") @@ -129,7 +154,7 @@ ;;; is mostly the graph. ("org-site-roam-static" :base-directory "~/org/roam/" - :base-extension "svg\\|png\\|jpg\\|gif\\|pdf" + :base-extension "svg\\|png\\|jpg\\|gif\\|pdf\\|org" :publishing-directory "~/org/publish/n/" :recursive t :publishing-function org-publish-attachment) @@ -143,6 +168,7 @@ :html-doctype "html5" :html-head "" :html-head-include-scripts nil + :html-link-home "/" :html-html5-fancy t :html-link-up "../" :publishing-directory "~/org/publish/n/"