diff options
-rw-r--r-- | init.el | 83 | ||||
-rw-r--r-- | lisp/+org.el | 49 | ||||
-rw-r--r-- | machines/bob.el | 1 |
3 files changed, 97 insertions, 36 deletions
diff --git a/init.el b/init.el index d295742..7f2c199 100644 --- a/init.el +++ b/init.el | |||
@@ -72,7 +72,8 @@ | |||
72 | (setup (:require autoinsert) | 72 | (setup (:require autoinsert) |
73 | (setf (alist-get "\\.scm" auto-insert-alist nil nil #'equal) | 73 | (setf (alist-get "\\.scm" auto-insert-alist nil nil #'equal) |
74 | '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n")) | 74 | '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n")) |
75 | (auto-insert-mode +1)) | 75 | ;; (auto-insert-mode +1) |
76 | ) | ||
76 | 77 | ||
77 | (setup (:require cus-edit) | 78 | (setup (:require cus-edit) |
78 | ;; I don't use Custom to actually /make/ any customizations, but it's handy to | 79 | ;; I don't use Custom to actually /make/ any customizations, but it's handy to |
@@ -283,18 +284,18 @@ | |||
283 | "\\" #'+ecomplete-remove-email))) | 284 | "\\" #'+ecomplete-remove-email))) |
284 | (add-hook 'message-sent-hook #'message-put-addresses-in-ecomplete)) | 285 | (add-hook 'message-sent-hook #'message-put-addresses-in-ecomplete)) |
285 | 286 | ||
286 | (setup ehelp | 287 | ;; (setup ehelp |
287 | ;; Trying this instead of `helpful' | 288 | ;; ;; Trying this instead of `helpful' |
288 | (:global [help] 'ehelp-command | 289 | ;; (:global [help] 'ehelp-command |
289 | [f1] 'ehelp-command) | 290 | ;; [f1] 'ehelp-command) |
290 | (with-eval-after-load 'vertico-multiform | 291 | ;; (with-eval-after-load 'vertico-multiform |
291 | (dolist (cmd '(electric-describe-key | 292 | ;; (dolist (cmd '(electric-describe-key |
292 | electric-describe-mode | 293 | ;; electric-describe-mode |
293 | electric-describe-syntax | 294 | ;; electric-describe-syntax |
294 | electric-describe-bindings | 295 | ;; electric-describe-bindings |
295 | electric-describe-function | 296 | ;; electric-describe-function |
296 | electric-describe-variable)) | 297 | ;; electric-describe-variable)) |
297 | (setf (alist-get cmd vertico-multiform-commands) nil)))) | 298 | ;; (setf (alist-get cmd vertico-multiform-commands) nil)))) |
298 | 299 | ||
299 | (setup eldoc | 300 | (setup eldoc |
300 | (:hook-into elisp-mode | 301 | (:hook-into elisp-mode |
@@ -569,6 +570,7 @@ | |||
569 | org-tags-column (- (- fill-column (length org-ellipsis))) | 570 | org-tags-column (- (- fill-column (length org-ellipsis))) |
570 | org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" | 571 | org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" |
571 | "|" "DONE(d!)") | 572 | "|" "DONE(d!)") |
573 | (sequence "ONGOING(o@)") | ||
572 | (sequence "|" "CANCELED(k@)") | 574 | (sequence "|" "CANCELED(k@)") |
573 | (sequence "MEETING(m)")) | 575 | (sequence "MEETING(m)")) |
574 | org-emphasis-alist '(("*" org-bold) | 576 | org-emphasis-alist '(("*" org-bold) |
@@ -1398,10 +1400,10 @@ See also `crux-reopen-as-root-mode'." | |||
1398 | (setup (:straight eshell-syntax-highlighting) | 1400 | (setup (:straight eshell-syntax-highlighting) |
1399 | (:hook-into eshell-mode)) | 1401 | (:hook-into eshell-mode)) |
1400 | 1402 | ||
1401 | (setup (:straight eshell-vterm) | 1403 | ;; (setup (:straight eshell-vterm) |
1402 | (:load-after eshell) | 1404 | ;; (:load-after eshell) |
1403 | (defalias 'eshell/v 'eshell-exec-visual) | 1405 | ;; (defalias 'eshell/v 'eshell-exec-visual) |
1404 | (eshell-vterm-mode +1)) | 1406 | ;; (eshell-vterm-mode +1)) |
1405 | 1407 | ||
1406 | (setup (:straight-when exec-path-from-shell | 1408 | (setup (:straight-when exec-path-from-shell |
1407 | (eq system-type 'gnu/linux)) | 1409 | (eq system-type 'gnu/linux)) |
@@ -1493,7 +1495,7 @@ See also `crux-reopen-as-root-mode'." | |||
1493 | (:bind "i" #'+god-mode-insert | 1495 | (:bind "i" #'+god-mode-insert |
1494 | "a" nil))) | 1496 | "a" nil))) |
1495 | 1497 | ||
1496 | (setup (:straight helpful) (:quit "Trying `electric-help' instead.") | 1498 | (setup (:straight helpful) |
1497 | (:+key "<f1> f" #'helpful-callable | 1499 | (:+key "<f1> f" #'helpful-callable |
1498 | "<f1> v" #'helpful-variable | 1500 | "<f1> v" #'helpful-variable |
1499 | "<f1> k" #'helpful-key | 1501 | "<f1> k" #'helpful-key |
@@ -1770,6 +1772,14 @@ See also `crux-reopen-as-root-mode'." | |||
1770 | (:else 'url-retrieve))) | 1772 | (:else 'url-retrieve))) |
1771 | (add-hook 'dired-mode-hook 'org-download-enable)) | 1773 | (add-hook 'dired-mode-hook 'org-download-enable)) |
1772 | 1774 | ||
1775 | (setup (:straight org-mime) | ||
1776 | (add-hook 'message-mode-hook | ||
1777 | (defun org-mime-setup@message-mode () | ||
1778 | (local-set-key (kbd "C-c M-o") 'org-mime-htmlize))) | ||
1779 | (add-hook 'org-mode-hook | ||
1780 | (defun org-mime-setup@org-mode () | ||
1781 | (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize)))) | ||
1782 | |||
1773 | (setup (:straight org-sticky-header) | 1783 | (setup (:straight org-sticky-header) |
1774 | ;; (:hook-into org-mode) | 1784 | ;; (:hook-into org-mode) |
1775 | ) | 1785 | ) |
@@ -1815,17 +1825,18 @@ See also `crux-reopen-as-root-mode'." | |||
1815 | lisp-interaction-mode | 1825 | lisp-interaction-mode |
1816 | scheme-mode)) | 1826 | scheme-mode)) |
1817 | 1827 | ||
1818 | (setup (:straight-when pdf-tools | 1828 | ;; (setup (:straight-when pdf-tools |
1819 | ;; Ensure we can build `pdf-tools' | 1829 | ;; ;; Ensure we can build `pdf-tools' |
1820 | (or (executable-find "gcc") | 1830 | ;; (or (executable-find "gcc") |
1821 | (executable-find "g++"))) | 1831 | ;; (executable-find "g++"))) |
1822 | (setf (alist-get "\\.pdf\\'" auto-mode-alist nil nil #'equal) | 1832 | ;; (setf (alist-get "\\.pdf\\'" auto-mode-alist nil nil #'equal) |
1823 | #'pdf-view-modei) | 1833 | ;; #'pdf-view-mode) |
1824 | (pdf-tools-install t)) | 1834 | ;; (pdf-tools-install t)) |
1825 | 1835 | ||
1826 | (setup (:straight (plancat | 1836 | (setup (:straight (plancat |
1827 | :host github | 1837 | :host github |
1828 | :repo "duckwork/plancat.el")) | 1838 | :repo "duckwork/plancat.el" |
1839 | :local-repo "~/src/emacs-packages/plancat.el/")) | ||
1829 | (:option plancat-user "acdw")) | 1840 | (:option plancat-user "acdw")) |
1830 | 1841 | ||
1831 | (setup (:straight pocket-reader) | 1842 | (setup (:straight pocket-reader) |
@@ -2059,16 +2070,16 @@ See also `crux-reopen-as-root-mode'." | |||
2059 | (setup (:straight vlf) | 2070 | (setup (:straight vlf) |
2060 | (:require vlf-setup)) | 2071 | (:require vlf-setup)) |
2061 | 2072 | ||
2062 | (setup (:straight-when vterm | 2073 | ;; (setup (:straight-when vterm |
2063 | (and module-file-suffix | 2074 | ;; (and module-file-suffix |
2064 | (executable-find "cmake"))) | 2075 | ;; (executable-find "cmake"))) |
2065 | (:also-load +vterm) | 2076 | ;; (:also-load +vterm) |
2066 | (:option vterm-always-compile-module t | 2077 | ;; (:option vterm-always-compile-module t |
2067 | vterm-buffer-name-string "vterm: %s" | 2078 | ;; vterm-buffer-name-string "vterm: %s" |
2068 | vterm-max-scrollback 100000 ; max allowed by vterm-module.h | 2079 | ;; vterm-max-scrollback 100000 ; max allowed by vterm-module.h |
2069 | ) | 2080 | ;; ) |
2070 | (advice-add 'counsel-yank-pop-action :around | 2081 | ;; (advice-add 'counsel-yank-pop-action :around |
2071 | #'+vterm-counsel-yank-pop-action)) | 2082 | ;; #'+vterm-counsel-yank-pop-action)) |
2072 | 2083 | ||
2073 | (setup (:straight-when w3m | 2084 | (setup (:straight-when w3m |
2074 | (executable-find "w3m")) | 2085 | (executable-find "w3m")) |
diff --git a/lisp/+org.el b/lisp/+org.el index 77c9836..7b4ac4a 100644 --- a/lisp/+org.el +++ b/lisp/+org.el | |||
@@ -542,5 +542,54 @@ language name.") | |||
542 | ;; `org-verbatim' and `org-code' are apparently already things, so we skip them | 542 | ;; `org-verbatim' and `org-code' are apparently already things, so we skip them |
543 | ;; here. | 543 | ;; here. |
544 | 544 | ||
545 | ;;; Copy org trees as HTML | ||
546 | |||
547 | ;; Thanks to Oleh Krehel, via [[https://emacs.stackexchange.com/questions/54292/copy-results-of-org-export-directly-to-clipboard][this StackExchange question]]. | ||
548 | (defun +org-export-clip-to-html | ||
549 | (&optional async subtreep visible-only body-only ext-plist post-process) | ||
550 | "Export region to HTML, and copy it to the clipboard. | ||
551 | Arguments ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST, | ||
552 | and POST-PROCESS are passed to `org-export-to-file'." | ||
553 | (message "Exporting Org to HTML...") | ||
554 | (let ((org-tmp-file "/tmp/org.html")) | ||
555 | (org-export-to-file 'html org-tmp-file | ||
556 | async subtreep visible-only body-only ext-plist post-process) | ||
557 | (start-process "xclicp" "*xclip*" | ||
558 | "xclip" "-verbose" | ||
559 | "-i" org-tmp-file | ||
560 | "-t" "text/html" | ||
561 | "-selection" "clipboard")) | ||
562 | (message "Exporting Org to HTML...done.")) | ||
563 | |||
564 | ;; Specialized functions | ||
565 | (defun +org-export-clip-subtree-to-html () | ||
566 | "Export current subtree to HTML." | ||
567 | (interactive) | ||
568 | (+org-export-clip-to-html nil :subtree nil :body-only)) | ||
569 | |||
570 | ;;; Taskwise functions | ||
571 | ;; TODO: break out into another library | ||
572 | |||
573 | (defun +org-upto-task () | ||
574 | "Go to the heading of the current task." | ||
575 | (interactive) | ||
576 | (while (not (org-get-todo-state)) | ||
577 | (org-up-heading-or-point-min))) | ||
578 | |||
579 | (defun +org-narrow-to-task () | ||
580 | "Narrow the buffer to current task." | ||
581 | (interactive) | ||
582 | (+org-upto-task) | ||
583 | (org-narrow-to-subtree)) | ||
584 | |||
585 | (defun +org-task-clock-in (&optional select start-time) | ||
586 | "Start the clock on the current task. | ||
587 | SELECT and START-TIME, if provided, are passed on to | ||
588 | `org-clock-in'." | ||
589 | (interactive) | ||
590 | (save-excursion | ||
591 | (+org-upto-task) | ||
592 | (call-interactively #'org-clock-in))) | ||
593 | |||
545 | (provide '+org) | 594 | (provide '+org) |
546 | ;;; +org.el ends here | 595 | ;;; +org.el ends here |
diff --git a/machines/bob.el b/machines/bob.el index ff358cf..8a2aefc 100644 --- a/machines/bob.el +++ b/machines/bob.el | |||
@@ -5,6 +5,7 @@ | |||
5 | ;;; Code: | 5 | ;;; Code: |
6 | 6 | ||
7 | (require 'acdw) | 7 | (require 'acdw) |
8 | (require 'machine) | ||
8 | 9 | ||
9 | ;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]] | 10 | ;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]] |
10 | (add-function :after machine-after-load-theme | 11 | (add-function :after machine-after-load-theme |