From 45d179a4c3e3696798f53b8109868d4a5aa8ad31 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 23 Feb 2022 10:16:48 -0600 Subject: Remove :local-repo directive It just doesn't seem to work the way I'm using it. --- lisp/+org.el | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'lisp/+org.el') 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.") ;; `org-verbatim' and `org-code' are apparently already things, so we skip them ;; here. +;;; Copy org trees as HTML + +;; Thanks to Oleh Krehel, via [[https://emacs.stackexchange.com/questions/54292/copy-results-of-org-export-directly-to-clipboard][this StackExchange question]]. +(defun +org-export-clip-to-html + (&optional async subtreep visible-only body-only ext-plist post-process) + "Export region to HTML, and copy it to the clipboard. +Arguments ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST, +and POST-PROCESS are passed to `org-export-to-file'." + (message "Exporting Org to HTML...") + (let ((org-tmp-file "/tmp/org.html")) + (org-export-to-file 'html org-tmp-file + async subtreep visible-only body-only ext-plist post-process) + (start-process "xclicp" "*xclip*" + "xclip" "-verbose" + "-i" org-tmp-file + "-t" "text/html" + "-selection" "clipboard")) + (message "Exporting Org to HTML...done.")) + +;; Specialized functions +(defun +org-export-clip-subtree-to-html () + "Export current subtree to HTML." + (interactive) + (+org-export-clip-to-html nil :subtree nil :body-only)) + +;;; Taskwise functions +;; TODO: break out into another library + +(defun +org-upto-task () + "Go to the heading of the current task." + (interactive) + (while (not (org-get-todo-state)) + (org-up-heading-or-point-min))) + +(defun +org-narrow-to-task () + "Narrow the buffer to current task." + (interactive) + (+org-upto-task) + (org-narrow-to-subtree)) + +(defun +org-task-clock-in (&optional select start-time) + "Start the clock on the current task. +SELECT and START-TIME, if provided, are passed on to +`org-clock-in'." + (interactive) + (save-excursion + (+org-upto-task) + (call-interactively #'org-clock-in))) + (provide '+org) ;;; +org.el ends here -- cgit 1.4.1-21-gabe81