summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-10-20 17:31:13 -0500
committerCase Duckworth2021-10-20 17:31:13 -0500
commit0d311d36b9d5f430324d919ac097f2364588a432 (patch)
treea2e71547fac3fdeab473ca4083547b8b1dc26ed2
parentMove most of acdw-irc to acdw-circe (diff)
downloademacs-0d311d36b9d5f430324d919ac097f2364588a432.tar.gz
emacs-0d311d36b9d5f430324d919ac097f2364588a432.zip
blayfduoisaudfoiasdupjfoiu
-rw-r--r--TODO.org13
-rw-r--r--early-init.el2
-rw-r--r--eshell.el9
-rw-r--r--init.el81
-rw-r--r--lisp/acdw-circe.el10
-rw-r--r--lisp/acdw.el14
-rw-r--r--lisp/chd.el29
7 files changed, 90 insertions, 68 deletions
diff --git a/TODO.org b/TODO.org index 1759aca..bd146a8 100644 --- a/TODO.org +++ b/TODO.org
@@ -215,3 +215,16 @@ https://tildegit.org/acdw/emacs/src/branch/main/init.el#L1166, e.g.
215It adds one for blank lines. 215It adds one for blank lines.
216 216
217** TODO [[https://stackoverflow.com/questions/25161792/emacs-org-mode-how-can-i-fold-everything-but-the-current-headline][Org mode hide all but current heading]] 217** TODO [[https://stackoverflow.com/questions/25161792/emacs-org-mode-how-can-i-fold-everything-but-the-current-headline][Org mode hide all but current heading]]
218
219** Work around =C-m=, =RET=, etc
220
221#+begin_src emacs-lisp
222 ;; from artefact
223
224 (define-key key-translation-map (kbd "<return>") nil)
225 (define-key key-translation-map (kbd "C-m") nil)
226 (define-key key-translation-map (kbd "RET") nil)
227 (global-set-key (kbd "<return>") 'newline)
228 (define-key erc-mode-map (kbd "<return>") 'erc-send-current-line)
229 (global-set-key (kbd "C-m") (lambda () (interactive) (message "hello from C-m")))
230#+end_src
diff --git a/early-init.el b/early-init.el index 5f77c82..43dc045 100644 --- a/early-init.el +++ b/early-init.el
@@ -182,6 +182,6 @@ say, `tool-bar-mode' once to toggle the tool bar back on."
182(setup (:straight el-patch)) 182(setup (:straight el-patch))
183 183
184;; My private variables and stuff 184;; My private variables and stuff
185 (require 'acdw-private (acdw/sync-dir "private.el") :noerror) 185(require 'private (acdw/sync-dir "private") :noerror)
186 186
187;;; early-init.el ends here 187;;; early-init.el ends here
diff --git a/eshell.el b/eshell.el index a2ac33b..c6d8e16 100644 --- a/eshell.el +++ b/eshell.el
@@ -24,7 +24,9 @@
24 ("ff" . "find-file $1") 24 ("ff" . "find-file $1")
25 ("emacs" . "find-file $1") 25 ("emacs" . "find-file $1")
26 ("ee" . "find-file-other-window $1"))) 26 ("ee" . "find-file-other-window $1")))
27 (eshell/alias (car definition) (cdr definition))) 27 (cl-letf (((symbol-function 'eshell-write-aliases-list) #'ignore))
28 (eshell/alias (car definition) (cdr definition))))
29(eshell-write-aliases-list)
28 30
29;;; Functions 31;;; Functions
30 32
@@ -62,6 +64,11 @@ any directory proferred by `consult-dir'."
62 (:autoload global-fish-completion-mode) 64 (:autoload global-fish-completion-mode)
63 (global-fish-completion-mode +1)) 65 (global-fish-completion-mode +1))
64 66
67(setup (:straight-when eshell-vterm
68 (require 'vterm nil :noerror))
69 (eshell-vterm-mode +1)
70 (defalias 'eshell/v 'eshell-exec-visual))
71
65;;; Miscellaneous 72;;; Miscellaneous
66 73
67;; Fix modeline 74;; Fix modeline
diff --git a/init.el b/init.el index c2a3579..8886660 100644 --- a/init.el +++ b/init.el
@@ -95,6 +95,10 @@
95 (expand-file-name-exists-p "pkg/" user-emacs-directory))) 95 (expand-file-name-exists-p "pkg/" user-emacs-directory)))
96 (normal-top-level-add-subdirs-to-load-path))) 96 (normal-top-level-add-subdirs-to-load-path)))
97 97
98(setup auto-fill
99 (:hook (defun auto-fill@truncate-lines ()
100 (setq-local truncate-lines t))))
101
98(setup autoinsert 102(setup autoinsert
99 (require 'acdw-autoinsert) 103 (require 'acdw-autoinsert)
100 (acdw/define-auto-insert '(:replace t) 104 (acdw/define-auto-insert '(:replace t)
@@ -169,7 +173,8 @@
169 (cons (rx (or "youtube.com" ; videos 173 (cons (rx (or "youtube.com" ; videos
170 "youtu.be" 174 "youtu.be"
171 (seq "." (or "mp4" 175 (seq "." (or "mp4"
172 "gif") 176 "gif"
177 "mov" "MOV")
173 eos))) 178 eos)))
174 (lambda (&rest args) 179 (lambda (&rest args)
175 (apply (if (executable-find "mpv") 180 (apply (if (executable-find "mpv")
@@ -390,7 +395,9 @@
390 native-comp-async-report-warnings-errors nil 395 native-comp-async-report-warnings-errors nil
391 password-cache t 396 password-cache t
392 password-cache-expiry (* 60 5) ; seconds 397 password-cache-expiry (* 60 5) ; seconds
393 set-mark-command-repeat-pop t) 398 set-mark-command-repeat-pop t
399 hscroll-step 1
400 scroll-step 1)
394 401
395 (when (fboundp 'command-completion-default-include-p) 402 (when (fboundp 'command-completion-default-include-p)
396 (setq read-extended-command-predicate 403 (setq read-extended-command-predicate
@@ -414,6 +421,9 @@
414 "C-c _" #'add-file-local-variable 421 "C-c _" #'add-file-local-variable
415 "C-x C-c" #'acdw/fat-finger-exit) 422 "C-x C-c" #'acdw/fat-finger-exit)
416 423
424 (global-set-key (kbd "M-n") (kbd "C-u 1 C-v"))
425 (global-set-key (kbd "M-p") (kbd "C-u 1 M-v"))
426
417 ;; inspo: https://github.com/zaeph/.emacs.d/blob/master/init.el#L479 427 ;; inspo: https://github.com/zaeph/.emacs.d/blob/master/init.el#L479
418 (defvar toggle-map (make-sparse-keymap) 428 (defvar toggle-map (make-sparse-keymap)
419 "A keymap for toggling!") 429 "A keymap for toggling!")
@@ -555,7 +565,9 @@
555 "C-c l v" #'find-variable)) 565 "C-c l v" #'find-variable))
556 566
557(setup flymake 567(setup flymake
558 568 ;; TODO: look at flycheck for ideas around `flycheck-disabled-checkers' and
569 ;; `flycheck-emacs-lisp-load-path'... there must be a way to get flymake to
570 ;; recognize new values in the load path.
559 (defvar-local flymake-inhibit nil 571 (defvar-local flymake-inhibit nil
560 "Buffer-local variable to inhibit `flymake'.") 572 "Buffer-local variable to inhibit `flymake'.")
561 (add-to-list 'safe-local-variable-values '(flymake-inhibit . t)) 573 (add-to-list 'safe-local-variable-values '(flymake-inhibit . t))
@@ -1760,6 +1772,8 @@ See also `crux-reopen-as-root-mode'."
1760(setup (:straight (frowny 1772(setup (:straight (frowny
1761 :host github 1773 :host github
1762 :repo "duckwork/frowny.el")) 1774 :repo "duckwork/frowny.el"))
1775 (:option frowny-eyes (rx (| ":" ":-" ":'" "="))
1776 frowny-eyes-looking-back-limit 2)
1763 (global-frowny-mode +1)) 1777 (global-frowny-mode +1))
1764 1778
1765(setup (:straight gcmh) 1779(setup (:straight gcmh)
@@ -2194,7 +2208,7 @@ browser defined in `browse-url-secondary-browser-function'."
2194 2208
2195 (:bind "RET" #'acdw-org/return-dwim 2209 (:bind "RET" #'acdw-org/return-dwim
2196 "<S-return>" #'acdw-org/org-table-copy-down 2210 "<S-return>" #'acdw-org/org-table-copy-down
2197 "M-SPC M-SPC" #'insert-zero-width-space 2211 ;; "M-SPC M-SPC" #'insert-zero-width-space
2198 "C-c C-l" #'org-insert-link-dwim 2212 "C-c C-l" #'org-insert-link-dwim
2199 "C-c w" #'chd/do-the-thing 2213 "C-c w" #'chd/do-the-thing
2200 "C-c C-n" #'acdw/org-next-heading-widen 2214 "C-c C-n" #'acdw/org-next-heading-widen
@@ -2216,40 +2230,15 @@ browser defined in `browse-url-secondary-browser-function'."
2216 #'org-export-remove-zero-width-spaces)) 2230 #'org-export-remove-zero-width-spaces))
2217 2231
2218 (:local-hook before-save-hook 2232 (:local-hook before-save-hook
2219 (defun org/before-save@fix-blank-lines () 2233 (defun org/before-save@prettify-buffer ()
2220 (acdw-org/fix-blank-lines t)) 2234 (run-with-idle-timer 1 nil
2221 before-save-hook 2235 (lambda ()
2222 (defun org/before-save@align-tags () 2236 (with-temp-message "Filling..."
2237 (save-mark-and-excursion
2238 (mark-whole-buffer)
2239 (org-fill-paragraph nil t)))))
2240 (acdw-org/fix-blank-lines t)
2223 (org-align-tags :all))) 2241 (org-align-tags :all)))
2224
2225 (:hook ;; #'variable-pitch-mode
2226
2227 ;; (defun org-mode@before-save@fill-buffer ()
2228 ;; (add-hook 'before-save-hook
2229 ;; (defun before-save@fill-buffer ()
2230 ;; (fill-region (point-min) (point-max)))
2231 ;; nil :local))
2232
2233 ;; This is super ugly because I need to add a function to
2234 ;; `before-save-hook', but only in org-mode buffers. So I make a hook
2235 ;; to make a hook. I'm sure there's a better way to do this.
2236 ;; (defun org-mode@fix-blank-lines-on-save ()
2237 ;; (add-hook 'before-save-hook
2238 ;; (defun acdw-org/fix-blank-lines-in-buffer ()
2239 ;; (acdw-org/fix-blank-lines t))
2240 ;; 0 :local))
2241
2242 ;; (defun org-mode@wc-stupid ()
2243 ;; (unless (and wc-mode
2244 ;; (> 0 (+ (or wc-orig-words 0)
2245 ;; (or wc-words-delta 0)))))
2246 ;; (setq-local
2247 ;; wc-count-words-function
2248 ;; (lambda (start end) "Count words stupidly with a limit."
2249 ;; (acdw-org/count-words-stupidly start
2250 ;; end
2251 ;; 999))))
2252 )
2253 2242
2254 (with-eval-after-load 'org 2243 (with-eval-after-load 'org
2255 (org-clock-persistence-insinuate)) 2244 (org-clock-persistence-insinuate))
@@ -2708,16 +2697,16 @@ If used with a numeric prefix argument N, N backticks will be inserted."
2708(setup (:straight wgrep) 2697(setup (:straight wgrep)
2709 (wgrep-setup)) 2698 (wgrep-setup))
2710 2699
2711(setup (:straight which-key) 2700;; (setup (:straight which-key)
2712 (:option which-key-show-early-on-C-h t 2701;; (:option which-key-show-early-on-C-h t
2713 which-key-idle-delay 1 2702;; which-key-idle-delay 1
2714 which-key-idle-secondary-delay 0.5 2703;; which-key-idle-secondary-delay 0.5
2715 which-key-sort-order 'which-key-prefix-then-key-order) 2704;; which-key-sort-order 'which-key-prefix-then-key-order)
2716 2705
2717 (:global "C-h m" #'which-key-show-major-mode) 2706;; (:global "C-h m" #'which-key-show-major-mode)
2718 2707
2719 (which-key-setup-side-window-right-bottom) 2708;; (which-key-setup-side-window-right-bottom)
2720 (which-key-mode +1)) 2709;; (which-key-mode +1))
2721 2710
2722(setup (:straight whitespace-cleanup-mode) 2711(setup (:straight whitespace-cleanup-mode)
2723 (global-whitespace-cleanup-mode +1)) 2712 (global-whitespace-cleanup-mode +1))
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'.
11If MAKE-DIRECTORY is non-nil, ensure the file's
12containing 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")