From 35b8a04810e64c827af72afd3c5143781d5ae8b7 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 31 Mar 2026 09:49:05 -0500 Subject: [PATCH] idk --- README.org | 3 ++- init.el | 3 ++- org-publish.el | 59 ++++++++++++++++++++++++++------------------------ 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/README.org b/README.org index 89ed7a02..026cc5e7 100644 --- a/README.org +++ b/README.org @@ -4044,7 +4044,8 @@ Let's give eglot a try. #+begin_src emacs-lisp (use-package eldoc-box :config - (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)) + (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t) + (remove-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode)) #+end_src *** CMAKE diff --git a/init.el b/init.el index fa35fa57..130e3a29 100644 --- a/init.el +++ b/init.el @@ -2961,7 +2961,8 @@ current buffer's, reload dir-locals." (use-package eldoc-box :config - (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)) + (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t) + (remove-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode)) (use-package cmake-mode :mode ("\\CMakeLists.txt\\'" . cmake-mode)) diff --git a/org-publish.el b/org-publish.el index 4dd536c2..67e8909a 100644 --- a/org-publish.el +++ b/org-publish.el @@ -150,27 +150,15 @@ (defun quick/org-copy-notes (plist) (let ((files (--remove (string-match-p (plist-get plist :exclude) it) - (directory-files "~/docs/notes" t ".*.org$")))) + (directory-files (file-name-as-directory + (plist-get plist :denote-directory)) t ".*.org$"))) + (create-lockfiles nil)) (dolist (file files) (let ((filename (concat (file-name-as-directory (plist-get plist :base-directory)) (f-filename file)))) (copy-file - file filename t t)))) - (chris/site-index-update plist)) - -(defun quick/org-copy-lessons (plist) - (let ((files (--remove - (string-match-p (plist-get plist :exclude) it) - (directory-files "~/docs/notes/lessons" t ".*.org$")))) - (dolist (file files) - (let ((filename (concat (file-name-as-directory - (plist-get plist :base-directory)) - (f-filename file)))) - (copy-file - file filename t t)))) - (chris/site-index-update plist)) - + file filename t t))))) (defun chris/site-index-update (plist) (save-excursion @@ -183,6 +171,17 @@ (denote-org-convert-links-to-file-type) (save-buffer)))) +(defun chris/preparation-function (plist) + (quick/org-copy-notes plist) + (chris/site-index-update plist)) + +(defun chris/ignore-export-name-filter-function (plist _backend) + (when (plist-member plist :export-file-name) + (let ((name (plist-get plist :export-file-name)) + (key-gone (remove :export-file-name)) + (new-plist (remove name))) + new-plist))) + (defun chris/site-premble (plist) (let ((project (plist-get plist :title-of-project))) (format "")) :html-head "" - :publishing-directory "~/docs/site/public/notes/" :publishing-function org-html-publish-to-html) ("teaching" + :denote-directory "~/docs/notes/lessons/" :base-directory "~/docs/site/content/teaching/" :base-extension "org" - :preparation-function quick/org-copy-lessons + :publishing-directory "~/docs/site/public/teaching/" :exclude "_draft" + :preparation-function chris/preparation-function :recursive nil :with-broken-links t :with-author nil @@ -260,7 +262,6 @@ ")) :html-head "" - :publishing-directory "~/docs/site/public/teaching/" :publishing-function org-html-publish-to-html) ("static" :base-directory "~/docs/site/assets/" @@ -341,14 +342,14 @@ it will use the correct amount of " (org-publish-property :base-directory project))) (attachment-function? (eq #'org-publish-attachment (org-publish-property :publishing-function project))) + (org-export-filter-options-functions '(#'chris/ignore-export-name-filter-function)) (workers (if workers workers (* 2 (comp--effective-async-max-jobs)))) (files (org-publish-get-base-files project)) (chunks (if (> workers (length files)) files (seq-split files (ceiling (/ (length files) workers))))) - (futures (if attachment-function? - nil + (futures (unless attachment-function? (cl-loop for chunk in chunks collect (async-start `(lambda () @@ -361,19 +362,23 @@ it will use the correct amount of " (create-lockfiles nil) (org-publish-cache (org-publish-initialize-cache (car ',project))) + (org-export-filter-options-functions ',org-export-filter-options-functions) (files (if (listp ',chunk) ',chunk (list ,chunk)))) (dolist (file files) (unless (file-equal-p file ,theindex) - (org-publish-file file ',project t))))) - 'ignore))))) + (org-publish-file file ',project)))))))))) + (message "=========================") + (message "Starting project: %s" (car project)) + (message "=========================") + (when attachment-function? (message "OOOOPS AATTTTAAAACH")) (if attachment-function? (dolist (file files) (unless (file-equal-p file theindex) (org-publish-file file project t))) - (mapcar #'async-get futures)) + (mapcar #'async-wait futures)) ;; Populate "theindex.inc", if needed, and publish ;; "theindex.org". @@ -428,6 +433,4 @@ on your machine as makes sense." (quick/org-publish "cochrun.xyz" nil t) -(let ((httpd-root "~/docs/site/public") - (httpd-host "localhost")) - (httpd-serve-directory "~/docs/site/public")) +(httpd-serve-directory "~/docs/site/public")