diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw-circe.el | 10 | ||||
-rw-r--r-- | lisp/acdw.el | 14 | ||||
-rw-r--r-- | lisp/chd.el | 29 |
3 files changed, 33 insertions, 20 deletions
diff --git a/lisp/acdw-circe.el b/lisp/acdw-circe.el index 4ff3fdf..73b1cdf 100644 --- a/lisp/acdw-circe.el +++ b/lisp/acdw-circe.el | |||
@@ -98,8 +98,8 @@ message the current topic." | |||
98 | (with-circe-server-buffer | 98 | (with-circe-server-buffer |
99 | (dolist (buf (circe-server-chat-buffers)) | 99 | (dolist (buf (circe-server-chat-buffers)) |
100 | (let ((circe-channel-killed-confirmation nil)) | 100 | (let ((circe-channel-killed-confirmation nil)) |
101 | (kill-buffer buf))) | 101 | (run-with-timer 0.1 nil #'kill-buffer buf))) |
102 | (kill-buffer)))) | 102 | (run-with-timer 0.1 nil #'kill-buffer)))) |
103 | 103 | ||
104 | (defun circe-gquit@kill-buffer (&rest _) | 104 | (defun circe-gquit@kill-buffer (&rest _) |
105 | "Advice to kill all Circe related buffers after GQUIT." | 105 | "Advice to kill all Circe related buffers after GQUIT." |
@@ -111,10 +111,8 @@ message the current topic." | |||
111 | (with-current-buffer buf | 111 | (with-current-buffer buf |
112 | (dolist (buf (circe-server-chat-buffers)) | 112 | (dolist (buf (circe-server-chat-buffers)) |
113 | (let ((circe-channel-killed-confirmation nil)) | 113 | (let ((circe-channel-killed-confirmation nil)) |
114 | (kill-buffer buf)) | 114 | (run-with-timer 0.1 nil #'kill-buffer buf))) |
115 | (cancel-timer 'irc-send--queue)) | 115 | (run-with-timer 0.1 nil #'kill-buffer))))) |
116 | (message "%s: %s" buf circe-server-killed-confirmation) | ||
117 | (kill-buffer))))) | ||
118 | 116 | ||
119 | ;;; Patches | 117 | ;;; Patches |
120 | 118 | ||
diff --git a/lisp/acdw.el b/lisp/acdw.el index 48ed19b..56b661f 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -474,12 +474,12 @@ first." | |||
474 | (let ((extracted-heading (acdw/org-extract-heading-text)) | 474 | (let ((extracted-heading (acdw/org-extract-heading-text)) |
475 | (org-export-show-temporary-export-buffer nil) | 475 | (org-export-show-temporary-export-buffer nil) |
476 | (org-export-filter-final-output-functions | 476 | (org-export-filter-final-output-functions |
477 | '(html-body-id-filter html-body-div-filter)) | 477 | '(html-body-id-filter html-body-div-filter))) |
478 | (org-export-with-smart-quotes nil) | ||
479 | (org-export-smart-quotes-alist nil)) | ||
480 | (insert "* ORG IS STUPID SOMETIMES\n") | 478 | (insert "* ORG IS STUPID SOMETIMES\n") |
481 | (goto-char (point-min)) | 479 | (goto-char (point-min)) |
482 | (org-html-export-as-html nil t nil t) | 480 | (org-html-export-as-html nil t nil t |
481 | (list :with-smart-quotes nil | ||
482 | :with-special-strings t)) | ||
483 | (with-current-buffer "*Org HTML Export*" | 483 | (with-current-buffer "*Org HTML Export*" |
484 | (goto-char (point-min)) | 484 | (goto-char (point-min)) |
485 | (replace-regexp "<h2>.*</h2>" "") | 485 | (replace-regexp "<h2>.*</h2>" "") |
@@ -498,13 +498,15 @@ first." | |||
498 | nil) | 498 | nil) |
499 | 499 | ||
500 | (defun acdw/org-export-copy () | 500 | (defun acdw/org-export-copy () |
501 | "copy a tree" | 501 | "Copy a tree as ASCII." |
502 | (interactive) | 502 | (interactive) |
503 | (require 'ox-ascii) | 503 | (require 'ox-ascii) |
504 | (let ((extracted-heading (acdw/org-extract-heading-text))) | 504 | (let ((extracted-heading (acdw/org-extract-heading-text))) |
505 | ;; Export to ASCII - not async, subtree only, visible-only, body-only | 505 | ;; Export to ASCII - not async, subtree only, visible-only, body-only |
506 | (let ((org-export-show-temporary-export-buffer nil)) | 506 | (let ((org-export-show-temporary-export-buffer nil)) |
507 | (org-ascii-export-as-ascii nil t nil t)) | 507 | (org-ascii-export-as-ascii nil t nil t |
508 | (list :with-smart-quotes t | ||
509 | :with-special-strings t))) | ||
508 | (with-current-buffer "*Org ASCII Export*" | 510 | (with-current-buffer "*Org ASCII Export*" |
509 | (goto-char (point-min)) | 511 | (goto-char (point-min)) |
510 | (insert extracted-heading) | 512 | (insert extracted-heading) |
diff --git a/lisp/chd.el b/lisp/chd.el index e1d96cb..c6efad0 100644 --- a/lisp/chd.el +++ b/lisp/chd.el | |||
@@ -3,6 +3,19 @@ | |||
3 | (require 'acdw-org) | 3 | (require 'acdw-org) |
4 | (require 'org) | 4 | (require 'org) |
5 | 5 | ||
6 | (defvar chd/dir (acdw/sync-dir "Click Here Digital/") | ||
7 | "Where Click Here stuff is stored.") | ||
8 | |||
9 | (defun chd/dir (file &optional make-directory) | ||
10 | "Expand FILE relative to variable `chd/dir'. | ||
11 | If MAKE-DIRECTORY is non-nil, ensure the file's | ||
12 | containing directory exists." | ||
13 | (let ((file-name (expand-file-name (convert-standard-filename file) | ||
14 | chd/dir))) | ||
15 | (when make-directory | ||
16 | (make-directory (file-name-directory file-name) :parents)) | ||
17 | file-name)) | ||
18 | |||
6 | (defun chd/narrow-to-task (&optional point) | 19 | (defun chd/narrow-to-task (&optional point) |
7 | "Narrow the buffer to the task POINT is in." | 20 | "Narrow the buffer to the task POINT is in." |
8 | (interactive "d") | 21 | (interactive "d") |
@@ -40,14 +53,6 @@ | |||
40 | (org-back-to-heading) | 53 | (org-back-to-heading) |
41 | (org-open-at-point))) | 54 | (org-open-at-point))) |
42 | 55 | ||
43 | (defun chd/click-bits (date) | ||
44 | "Create a new Click Bits org file, or edit the one for DATE." | ||
45 | (interactive (list (progn | ||
46 | (require 'org) | ||
47 | (org-read-date)))) | ||
48 | ;; TODO: implement actual logic. | ||
49 | (message "%s" date)) | ||
50 | |||
51 | (defun chd/insert-client () | 56 | (defun chd/insert-client () |
52 | "Insert the current client at point." | 57 | "Insert the current client at point." |
53 | (interactive) | 58 | (interactive) |
@@ -56,6 +61,14 @@ | |||
56 | (beep) | 61 | (beep) |
57 | (user-error "No client found in current subtree"))) | 62 | (user-error "No client found in current subtree"))) |
58 | 63 | ||
64 | ;;; Click Bits! | ||
65 | (require 'acdw-autoinsert) | ||
66 | (require 'acdw) | ||
67 | (require 'private (acdw/sync-dir "private")) | ||
68 | (acdw/define-auto-insert '(:replace t) | ||
69 | (cons (chd/dir "Click Bits" t) "Click Bits!") | ||
70 | chd/click-bits-skeleton) | ||
71 | |||
59 | ;;; NOTES | 72 | ;;; NOTES |
60 | ;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html | 73 | ;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html |
61 | ;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview") | 74 | ;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview") |