summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--eshell.el25
-rw-r--r--init.el135
-rw-r--r--lisp/acdw-modeline.el7
-rw-r--r--lisp/acdw-org.el7
-rw-r--r--lisp/acdw.el17
-rw-r--r--lisp/chd.el10
6 files changed, 135 insertions, 66 deletions
diff --git a/eshell.el b/eshell.el index 05f90bc..c6078c2 100644 --- a/eshell.el +++ b/eshell.el
@@ -3,20 +3,6 @@
3;; Copyright (C) 2021 Case Duckworth 3;; Copyright (C) 2021 Case Duckworth
4 4
5;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> 5;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")>
6;; Keywords:
7
8;; This program is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
12
13;; This program is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20 6
21;;; Commentary: 7;;; Commentary:
22 8
@@ -26,6 +12,8 @@
26;;; Code: 12;;; Code:
27 13
28(require 'setup) 14(require 'setup)
15(require 'eshell)
16(require 'em-alias)
29 17
30;;; Environment 18;;; Environment
31(setenv "PAGER" "cat") 19(setenv "PAGER" "cat")
@@ -52,8 +40,8 @@
52(setup (:straight eshell-syntax-highlighting) 40(setup (:straight eshell-syntax-highlighting)
53 (eshell-syntax-highlighting-global-mode +1)) 41 (eshell-syntax-highlighting-global-mode +1))
54 42
55(setup (:straight-if fish-completion 43(setup (:straight-when fish-completion
56 (executable-find "fish")) 44 (executable-find "fish"))
57 (:autoload global-fish-completion-mode) 45 (:autoload global-fish-completion-mode)
58 (global-fish-completion-mode +1)) 46 (global-fish-completion-mode +1))
59 47
@@ -63,8 +51,5 @@
63(when (boundp 'simple-modeline--mode-line) 51(when (boundp 'simple-modeline--mode-line)
64 (setq mode-line-format '(:eval simple-modeline--mode-line))) 52 (setq mode-line-format '(:eval simple-modeline--mode-line)))
65 53
66;;; Tell Emacs our customizations are loaded. 54(provide 'eshellrc)
67(defvar eshell-customizations-loaded t
68 "Whether eshell's customizations have been loaded yet.")
69
70;;; eshell.el ends here 55;;; eshell.el ends here
diff --git a/init.el b/init.el index 0958bd9..6467bd9 100644 --- a/init.el +++ b/init.el
@@ -448,12 +448,10 @@
448 (:local-set outline-regexp eshell-prompt-regexp 448 (:local-set outline-regexp eshell-prompt-regexp
449 page-delimiter eshell-prompt-regexp) 449 page-delimiter eshell-prompt-regexp)
450 450
451 (:bind "C-d" #'eshell-quit-or-delete-char)
452
453 (:hook #'eshell-arg-hist-mode 451 (:hook #'eshell-arg-hist-mode
454 (defun eshell-mode@setup () 452 (defun eshell-mode@setup ()
455 (unless (bound-and-true-p eshell-customizations-loaded) 453 (require 'eshellrc (locate-user-emacs-file "eshell") :noerror)
456 (load (expand-file-name "eshell" user-emacs-directory)))))) 454 (:bind "C-d" #'eshell-quit-or-delete-char))))
457 455
458(setup eww 456(setup eww
459 (:also-load acdw-eww) 457 (:also-load acdw-eww)
@@ -682,9 +680,6 @@ specific to most general, they are these:
682 ;; <anything> -> mouse-1 /always/ follows link 680 ;; <anything> -> mouse-1 /always/ follows link
683 (:option mouse-1-click-follows-link t)) 681 (:option mouse-1-click-follows-link t))
684 682
685(setup mouse-avoidance
686 (mouse-avoidance-mode 'banish))
687
688(setup mu4e 683(setup mu4e
689 (:load-from "/usr/share/emacs/site-lisp/mu4e") 684 (:load-from "/usr/share/emacs/site-lisp/mu4e")
690 (:option mu4e-change-filenames-when-moving t 685 (:option mu4e-change-filenames-when-moving t
@@ -752,16 +747,21 @@ specific to most general, they are these:
752 pulse-delay 0.5 747 pulse-delay 0.5
753 pulse-iterations 1) 748 pulse-iterations 1)
754 749
755 (defun pulse-line (&rest _) 750 ;; XXX: this doesn't work yet. I only want to pulse the line in the active
756 "Pulse the current line." 751 ;; window, so when I have the same buffer viewed in multiple windows I can
757 (pulse-momentary-highlight-one-line (point))) 752 ;; still see where my cursor is. To see the issue, C-x 2 then C-x o a few
753 ;; times.
754 (defun pulse-line-current-window (&rest _)
755 "Pulse the current line, but only if this window is active."
756 (pulse-momentary-highlight-one-line (window-point (selected-window))))
758 757
759 (dolist (func '(scroll-up-command 758 (dolist (func '(scroll-up-command
760 scroll-down-command 759 scroll-down-command
761 recenter-top-bottom other-window 760 recenter-top-bottom
761 other-window
762 switch-to-buffer 762 switch-to-buffer
763 redraw-frame)) 763 redraw-frame))
764 (advice-add func :after #'pulse-line))) 764 (advice-add func :after #'pulse-line-current-window)))
765 765
766(setup re-builder 766(setup re-builder
767 (require 'acdw-re) 767 (require 'acdw-re)
@@ -993,6 +993,11 @@ specific to most general, they are these:
993 :repo "willvaughn/emacs-0x0")) 993 :repo "willvaughn/emacs-0x0"))
994 (:option 0x0-default-server 'ttm)) 994 (:option 0x0-default-server 'ttm))
995 995
996(setup (:straight (actually-selected-window
997 :host github
998 :repo "duckwork/actually-selected-window.el"))
999 (actually-selected-window-mode +1))
1000
996(setup (:straight-when affe 1001(setup (:straight-when affe
997 (and (or (executable-find "fd") 1002 (and (or (executable-find "fd")
998 (executable-find "find")) 1003 (executable-find "find"))
@@ -1091,8 +1096,9 @@ specific to most general, they are these:
1091 (with-eval-after-load 'circe 1096 (with-eval-after-load 'circe
1092 (:face circe-nick-highlight-face 1097 (:face circe-nick-highlight-face
1093 ((t (:inherit (modus-themes-hl-line modus-themes-bold)))) 1098 ((t (:inherit (modus-themes-hl-line modus-themes-bold))))
1094 circe-my-message-face 1099 ;; circe-my-message-face
1095 ((t (:inherit (modus-themes-slant)))))) 1100 ;; ((t (:inherit (modus-themes-slant))))
1101 ))
1096 1102
1097 (:bind "C-c C-p" #'circe-command-PART 1103 (:bind "C-c C-p" #'circe-command-PART
1098 "C-l" #'lui-track-jump-to-indicator 1104 "C-l" #'lui-track-jump-to-indicator
@@ -1243,7 +1249,7 @@ specific to most general, they are these:
1243 1249
1244(setup (:straight crux) 1250(setup (:straight crux)
1245 (:global "C-o" #'crux-smart-open-line 1251 (:global "C-o" #'crux-smart-open-line
1246 "M-o" #'crux-smart-open-line-above 1252 "M-o" #'open-paragraph
1247 "C-M-\\" #'crux-cleanup-buffer-or-region 1253 "C-M-\\" #'crux-cleanup-buffer-or-region
1248 "C-x 4 t" #'crux-transpose-windows) 1254 "C-x 4 t" #'crux-transpose-windows)
1249 1255
@@ -1393,9 +1399,6 @@ specific to most general, they are these:
1393 (defun elfeed@protocol-update (&rest _) 1399 (defun elfeed@protocol-update (&rest _)
1394 (elfeed-search-fetch nil))) 1400 (elfeed-search-fetch nil)))
1395 1401
1396 (:face message-header-subject
1397 ((t (:height 1.5))))
1398
1399 (:with-mode elfeed-show-mode 1402 (:with-mode elfeed-show-mode
1400 (:hook #'reading-mode) 1403 (:hook #'reading-mode)
1401 1404
@@ -1444,11 +1447,11 @@ specific to most general, they are these:
1444 ;; (t (apply fn url args)))) 1447 ;; (t (apply fn url args))))
1445 ) 1448 )
1446 1449
1447(setup (:straight-if emacs-everywhere 1450(setup (:straight-when emacs-everywhere
1448 (and (executable-find "xclip") 1451 (and (executable-find "xclip")
1449 (executable-find "xdotool") 1452 (executable-find "xdotool")
1450 (executable-find "xprop") 1453 (executable-find "xprop")
1451 (executable-find "xwininfo")))) 1454 (executable-find "xwininfo"))))
1452 1455
1453(setup (:straight (embark ; gotta git that fresh fresh 1456(setup (:straight (embark ; gotta git that fresh fresh
1454 :host github 1457 :host github
@@ -1851,6 +1854,15 @@ browser defined in `browse-url-secondary-browser-function'."
1851 (:option nov-text-width fill-column) 1854 (:option nov-text-width fill-column)
1852 (:file-match (rx ".epub" eos))) 1855 (:file-match (rx ".epub" eos)))
1853 1856
1857(setup (:straight (nyan-mode
1858 :host github :repo "TeMPOraL/nyan-mode"
1859 :fork (:host github :repo "duckwork/nyan-mode")
1860 :files ("nyan-mode.el" "img")))
1861 (:option nyan-animate-nyancat nil
1862 nyan-bar-length 20
1863 nyan-minimum-window-width fill-column)
1864 (nyan-mode +1))
1865
1854;; (setup (:straight olivetti) 1866;; (setup (:straight olivetti)
1855;; (:option olivetti-body-width (+ fill-column 4) 1867;; (:option olivetti-body-width (+ fill-column 4)
1856;; olivetti-minimum-body-width fill-column) 1868;; olivetti-minimum-body-width fill-column)
@@ -1942,7 +1954,7 @@ browser defined in `browse-url-secondary-browser-function'."
1942 org-clock-clocked-in-display 'mode-line 1954 org-clock-clocked-in-display 'mode-line
1943 org-clock-frame-title-format (cons '(t org-mode-line-string) 1955 org-clock-frame-title-format (cons '(t org-mode-line-string)
1944 (cons " --- " frame-title-format)) 1956 (cons " --- " frame-title-format))
1945 ;;org-clock-string-limit 7 ; gives time and not title 1957 org-clock-string-limit 25 ; gives enough information
1946 org-clock-persist t 1958 org-clock-persist t
1947 org-confirm-babel-evaluate nil 1959 org-confirm-babel-evaluate nil
1948 org-cycle-separator-lines 0 1960 org-cycle-separator-lines 0
@@ -1989,12 +2001,24 @@ browser defined in `browse-url-secondary-browser-function'."
1989 (:unbind "C-j" ; org-return-and-maybe-indent 2001 (:unbind "C-j" ; org-return-and-maybe-indent
1990 "M-j") 2002 "M-j")
1991 2003
1992 (:local-set unfill-fill-function #'org-fill-paragraph) 2004 (:local-set unfill-fill-function #'org-fill-paragraph
2005 wc-count-words-function
2006 (lambda (start end) "Count words stupidly with a limit."
2007 (acdw-org/count-words-stupidly start
2008 end
2009 999)))
1993 2010
1994 (with-eval-after-load 'org-export 2011 (with-eval-after-load 'org-export
1995 (:option (append org-export-filter-final-output-functions) 2012 (:option (append org-export-filter-final-output-functions)
1996 #'org-export-remove-zero-width-spaces)) 2013 #'org-export-remove-zero-width-spaces))
1997 2014
2015 (:local-hook before-save-hook
2016 (defun org/before-save@fix-blank-lines ()
2017 (acdw-org/fix-blank-lines t))
2018 before-save-hook
2019 (defun org/before-save@align-tags ()
2020 (org-align-tags :all)))
2021
1998 (:hook ;; #'variable-pitch-mode 2022 (:hook ;; #'variable-pitch-mode
1999 2023
2000 ;; (defun org-mode@before-save@fill-buffer () 2024 ;; (defun org-mode@before-save@fill-buffer ()
@@ -2006,22 +2030,23 @@ browser defined in `browse-url-secondary-browser-function'."
2006 ;; This is super ugly because I need to add a function to 2030 ;; This is super ugly because I need to add a function to
2007 ;; `before-save-hook', but only in org-mode buffers. So I make a hook 2031 ;; `before-save-hook', but only in org-mode buffers. So I make a hook
2008 ;; to make a hook. I'm sure there's a better way to do this. 2032 ;; to make a hook. I'm sure there's a better way to do this.
2009 (defun org-mode@fix-blank-lines-on-save () 2033 ;; (defun org-mode@fix-blank-lines-on-save ()
2010 (add-hook 'before-save-hook 2034 ;; (add-hook 'before-save-hook
2011 (defun acdw-org/fix-blank-lines-in-buffer () 2035 ;; (defun acdw-org/fix-blank-lines-in-buffer ()
2012 (acdw-org/fix-blank-lines t)) 2036 ;; (acdw-org/fix-blank-lines t))
2013 0 :local)) 2037 ;; 0 :local))
2014 2038
2015 (defun org-mode@wc-stupid () 2039 ;; (defun org-mode@wc-stupid ()
2016 (unless (and wc-mode 2040 ;; (unless (and wc-mode
2017 (> 0 (+ (or wc-orig-words 0) 2041 ;; (> 0 (+ (or wc-orig-words 0)
2018 (or wc-words-delta 0))))) 2042 ;; (or wc-words-delta 0)))))
2019 (setq-local 2043 ;; (setq-local
2020 wc-count-words-function 2044 ;; wc-count-words-function
2021 (lambda (start end) "Count words stupidly with a limit." 2045 ;; (lambda (start end) "Count words stupidly with a limit."
2022 (acdw-org/count-words-stupidly start 2046 ;; (acdw-org/count-words-stupidly start
2023 end 2047 ;; end
2024 999))))) 2048 ;; 999))))
2049 )
2025 2050
2026 (with-eval-after-load 'org 2051 (with-eval-after-load 'org
2027 (org-clock-persistence-insinuate)) 2052 (org-clock-persistence-insinuate))
@@ -2197,6 +2222,7 @@ the default is \"/\"."
2197 acdw-modeline/buffer-name 2222 acdw-modeline/buffer-name
2198 acdw-modeline/vc-branch 2223 acdw-modeline/vc-branch
2199 acdw-modeline/wc 2224 acdw-modeline/wc
2225 acdw-modeline/nyan-cat
2200 acdw-modeline/position 2226 acdw-modeline/position
2201 ) (;; right 2227 ) (;; right
2202 acdw-modeline/track 2228 acdw-modeline/track
@@ -2324,6 +2350,18 @@ the default is \"/\"."
2324 (auto-save-visited-mode -1) 2350 (auto-save-visited-mode -1)
2325 (super-save-mode +1)) 2351 (super-save-mode +1))
2326 2352
2353(setup (:straight-when system-packages
2354 (seq-some #'executable-find
2355 ;; I can't use `system-packages-supported-package-managers'
2356 ;; because, well, the package isn't installed yet. So
2357 ;; ... update this list if any package managers are added.
2358 '("guix" "nix"
2359 "brew" "macports"
2360 "pacman" "emerge"
2361 "zypper" "dnf"
2362 "apt" "aptitude"
2363 "xbps"))))
2364
2327(setup (:straight-when systemd 2365(setup (:straight-when systemd
2328 (executable-find "systemd"))) 2366 (executable-find "systemd")))
2329 2367
@@ -2337,8 +2375,11 @@ the default is \"/\"."
2337 (list 2375 (list
2338 (propertize " " 2376 (propertize " "
2339 'display 2377 'display
2340 '((space :align-to 2378 '((space
2341 ,(unless visual-fill-column-mode 0)))) 2379 :align-to
2380 ,(unless
2381 (bound-and-true-p visual-fill-column-mode)
2382 0))))
2342 (funcall topsy-fn)))))) 2383 (funcall topsy-fn))))))
2343 2384
2344(setup (:straight trashed) 2385(setup (:straight trashed)
@@ -2434,7 +2475,15 @@ If used with a numeric prefix argument N, N backticks will be inserted."
2434 (setq-local indicate-empty-lines nil 2475 (setq-local indicate-empty-lines nil
2435 indicate-buffer-boundaries nil) 2476 indicate-buffer-boundaries nil)
2436 (acdw/setup-fringes)))) 2477 (acdw/setup-fringes))))
2437 (:advise text-scale-adjust :after #'visual-fill-column-adjust)) 2478 (:advise text-scale-adjust :after #'visual-fill-column-adjust)
2479 ;; Fix bindings
2480 (when (bound-and-true-p mouse-wheel-mode)
2481 (with-eval-after-load 'visual-fill-column
2482 (dolist (margin '(right-margin left-margin))
2483 (dolist (event '(wheel-down wheel-up))
2484 (define-key visual-fill-column-mode-map
2485 (vector margin event)
2486 #'mwheel-scroll))))))
2438 2487
2439(setup (:straight visual-regexp) 2488(setup (:straight visual-regexp)
2440 (:global "M-%" #'vr/query-replace)) 2489 (:global "M-%" #'vr/query-replace))
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 573a964..a9020c5 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el
@@ -82,6 +82,13 @@ Otherwise, cdr should be a function that takes two points (see `count-words')."
82 (minions-minor-modes-menu))))) 82 (minions-minor-modes-menu)))))
83 'mouse-face 'mode-line-highlight))) 83 'mouse-face 'mode-line-highlight)))
84 84
85(defun acdw-modeline/nyan-cat ()
86 "Display the nyan cat from function `nyan-mode' in the mode-line."
87 (when (and (bound-and-true-p nyan-mode)
88 (eq (bound-and-true-p actually-selected-window)
89 (get-buffer-window)))
90 '(" " (:eval (list (nyan-create))))))
91
85(defun acdw-modeline/modified () ; modified from `simple-modeline' 92(defun acdw-modeline/modified () ; modified from `simple-modeline'
86 "Displays a color-coded buffer modification/read-only 93 "Displays a color-coded buffer modification/read-only
87indicator in the mode-line." 94indicator in the mode-line."
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 8821b28..05e6409 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -299,11 +299,16 @@ instead of the true count."
299 ;; Ignore headings 299 ;; Ignore headings
300 ((or (org-at-heading-p)) 300 ((or (org-at-heading-p))
301 (forward-line)) 301 (forward-line))
302 ;; Ignore drawers 302 ;; Ignore property and log drawers
303 ((or (looking-at org-drawer-regexp) 303 ((or (looking-at org-drawer-regexp)
304 (looking-at org-clock-drawer-re)) 304 (looking-at org-clock-drawer-re))
305 (search-forward ":END:" nil :noerror) 305 (search-forward ":END:" nil :noerror)
306 (forward-line)) 306 (forward-line))
307 ;; Ignore DEADLINE and SCHEDULED keywords
308 ((or (looking-at org-deadline-regexp)
309 (looking-at org-scheduled-regexp)
310 (looking-at org-closed-time-regexp))
311 (forward-line))
307 ;; Ignore tables 312 ;; Ignore tables
308 ((org-at-table-p) (forward-line)) 313 ((org-at-table-p) (forward-line))
309 ;; Ignore hyperlinks, but count the descriptions 314 ;; Ignore hyperlinks, but count the descriptions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 969b6c8..cc73071 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -862,6 +862,23 @@ When called with PREFIX, just kill Emacs without confirmation."
862 (let ((b (get-buffer (if (consp b) (car b) b)))) 862 (let ((b (get-buffer (if (consp b) (car b) b))))
863 (member (buffer-local-value 'major-mode b) modes))))) 863 (member (buffer-local-value 'major-mode b) modes)))))
864 (pop-to-buffer (read-buffer "Buffer: " nil t pred)))) 864 (pop-to-buffer (read-buffer "Buffer: " nil t pred))))
865
866;;; BLAH
867
868(defun open-paragraph ()
869 "Open a paragraph after point.
870A paragraph is defined as continguous non-empty lines of text
871surrounded by empty lines, so opening a paragraph means to make
872three blank lines, then place the point on the second one."
873 (interactive)
874 ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because
875 ;; that's weird with org, and I'm guessing other modes too.
876 (while (not (looking-at "^$"))
877 (forward-line 1))
878 (newline)
879 (delete-blank-lines)
880 (newline 2)
881 (previous-line))
865 882
866(provide 'acdw) 883(provide 'acdw)
867;;; acdw.el ends here 884;;; acdw.el ends here
diff --git a/lisp/chd.el b/lisp/chd.el index 697c134..b301c8d 100644 --- a/lisp/chd.el +++ b/lisp/chd.el
@@ -40,10 +40,16 @@
40 (org-back-to-heading) 40 (org-back-to-heading)
41 (org-open-at-point))) 41 (org-open-at-point)))
42 42
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
43;;; NOTES 51;;; NOTES
44;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html 52;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html
45;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview") 53;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview")
46
47
48(provide 'chd) 54(provide 'chd)
49;;; chd.el ends here 55;;; chd.el ends here