diff options
-rw-r--r-- | TODO.org | 63 | ||||
-rw-r--r-- | init.el | 83 | ||||
-rw-r--r-- | lisp/acdw-browse-url.el | 9 | ||||
-rw-r--r-- | lisp/acdw-org.el | 2 | ||||
-rw-r--r-- | lisp/acdw.el | 13 |
5 files changed, 146 insertions, 24 deletions
diff --git a/TODO.org b/TODO.org index 347684d..ddbcd30 100644 --- a/TODO.org +++ b/TODO.org | |||
@@ -4,11 +4,17 @@ | |||
4 | 4 | ||
5 | * Packages | 5 | * Packages |
6 | 6 | ||
7 | ** TODO insert-kaomoji | 7 | ** DONE insert-kaomoji |
8 | 8 | ||
9 | - [ ] Add =( ¬‿¬)═ɜ ɛ═(⌐‿⌐ )= to list | 9 | - [X] Add =(¬‿¬)═ɜ ɛ═(⌐‿⌐ )= to list |
10 | - [ ] and =▬▬▬▬▬▬▬▋ Ò╭╮Ó= | 10 | - [X] and =▬▬▬▬▬▬▬▋ Ò╭╮Ó= |
11 | - [ ] Clean up code and package it properly | 11 | - [X] Clean up code and package it properly |
12 | |||
13 | ** TODO keep-acs (name?) | ||
14 | |||
15 | - keepassxc-cli | ||
16 | - interface with emacs | ||
17 | - plug into =auth-sources= | ||
12 | 18 | ||
13 | * Configuring | 19 | * Configuring |
14 | 20 | ||
@@ -42,6 +48,33 @@ | |||
42 | 48 | ||
43 | *** Also cf. [[https://blog.jethro.dev/posts/org_mode_workflow_preview/][Org-mode Workflow: A Preview · Jethro Kuan]] | 49 | *** Also cf. [[https://blog.jethro.dev/posts/org_mode_workflow_preview/][Org-mode Workflow: A Preview · Jethro Kuan]] |
44 | 50 | ||
51 | * Buffer display stuff | ||
52 | |||
53 | #+begin_src emacs-lisp | ||
54 | ;; from alphapapa | ||
55 | (cl-defun ap/display-buffer-in-side-window (&optional (buffer (current-buffer))) | ||
56 | "Display BUFFER in dedicated side window." | ||
57 | (interactive) | ||
58 | (let ((display-buffer-mark-dedicated t)) | ||
59 | (display-buffer-in-side-window buffer | ||
60 | '((side . right) | ||
61 | (window-parameters | ||
62 | (no-delete-other-windows . t)))))) | ||
63 | #+end_src | ||
64 | |||
65 | - [[https://old.reddit.com/r/emacs/comments/pka1sm/my_first_package_aside_for_easier_configuration/][My first package: Aside, for easier configuration and use of side windows : | ||
66 | emacs]] | ||
67 | - [[https://github.com/alphapapa/burly.el][GitHub - alphapapa/burly.el: Save and restore frames and windows with their | ||
68 | buffers in Emacs]] | ||
69 | - [[https://depp.brause.cc/shackle/][shackle: Enforce rules for popup windows]] | ||
70 | - [[https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-shackle.el][.emacs.d/setup-shackle.el at master · kaushalmodi/.emacs.d · GitHub]] | ||
71 | - [[https://www.reddit.com/r/emacs/comments/3icpv8/help_with_shackle_configuration/][help with shackle configuration : emacs]] | ||
72 | - [[https://mullikine.github.io/posts/making-shackle-split-sensibly/][Sensible Splits: Extending shackle.el // Bodacious Blog]] | ||
73 | - [[https://news.ycombinator.com/item?id=18598863][Oh man, your link led me to shackle[1] to make transient buffers behave and | ||
74 | I ha... | Hacker News]] | ||
75 | - [[https://emacsninja.com/posts/design-is-hard.html][Emacs Ninja - Design Is Hard]] | ||
76 | - Alternatively: [[https://web.archive.org/web/20160409014815/https://www.lunaryorn.com/2015/04/29/the-power-of-display-buffer-alist.html][Emacs Spotlight: Configure buffer display - Emacs. What else?]] | ||
77 | |||
45 | * Random shit | 78 | * Random shit |
46 | 79 | ||
47 | ** A way to map over buffers | 80 | ** A way to map over buffers |
@@ -84,3 +117,25 @@ daviwil | minikN: I connect to the hostname/port of my ZNC server, | |||
84 | - acdw > daviwil: I just see ******* | 117 | - acdw > daviwil: I just see ******* |
85 | benoitj | I use two networks | 118 | benoitj | I use two networks |
86 | #+end_quote | 119 | #+end_quote |
120 | |||
121 | ** Teach =link-hint= about =lui-buttons= | ||
122 | |||
123 | See =lui-next-button-or-complete=, etc. Also possibly: | ||
124 | - [[https://github.com/abo-abo/avy/issues/255][Feature request: ability to select objects in overlays · Issue #255 · abo-abo/avy · GitHub]] | ||
125 | - [[https://github.com/noctuid/link-hint.el/issues/24][Enhancement: Detect links in overlays · Issue #24 · noctuid/link-hint.el · | ||
126 | GitHub]] | ||
127 | |||
128 | |||
129 | (I /think/ a button is an overlay….) | ||
130 | |||
131 | ** Write =self-promote-shamelessly= function | ||
132 | |||
133 | Link to the line of a file on a git forge with a command, for linking. | ||
134 | |||
135 | https://tildegit.org/acdw/emacs/src/branch/main/init.el#L1166, e.g. | ||
136 | |||
137 | - *OR* install this: [[https://github.com/sshaw/git-link][GitHub - sshaw/git-link: Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location]] | ||
138 | |||
139 | ** Fix =acdw-org/count-words-stupidly= | ||
140 | |||
141 | It adds one for blank lines. | ||
diff --git a/init.el b/init.el index c398e1d..b281671 100644 --- a/init.el +++ b/init.el | |||
@@ -202,7 +202,7 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
202 | (concat | 202 | (concat |
203 | (acdw-irc/margin-format (plist-get plist :nick) "-" " >" t) | 203 | (acdw-irc/margin-format (plist-get plist :nick) "-" " >" t) |
204 | " " (plist-get plist :body))) | 204 | " " (plist-get plist :body))) |
205 | circe-highlight-nick-type 'sender | 205 | ;; circe-highlight-nick-type 'message |
206 | circe-network-options | 206 | circe-network-options |
207 | `(("Libera Chat" | 207 | `(("Libera Chat" |
208 | :channels ("#emacs" "#systemcrafters" "##webpals") | 208 | :channels ("#emacs" "#systemcrafters" "##webpals") |
@@ -223,10 +223,11 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
223 | circe-reduce-lurker-spam t | 223 | circe-reduce-lurker-spam t |
224 | circe-server-auto-join-default-type :after-auth) | 224 | circe-server-auto-join-default-type :after-auth) |
225 | 225 | ||
226 | (:face circe-nick-highlight-face | 226 | ;; (:face circe-nick-highlight-face |
227 | ((t (:inherit (modus-themes-hl-line))))) | 227 | ;; ((t (:inherit (modus-themes-hl-line))))) |
228 | 228 | ||
229 | (:bind "C-c C-p" #'circe-command-PART) | 229 | (:bind "C-c C-p" #'circe-command-PART |
230 | "C-l" #'lui-track-jump-to-indicator) | ||
230 | 231 | ||
231 | (:advise circe-command-PART :after | 232 | (:advise circe-command-PART :after |
232 | (defun circe-part@kill-buffer (&rest _) | 233 | (defun circe-part@kill-buffer (&rest _) |
@@ -438,9 +439,10 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
438 | (setup debugger | 439 | (setup debugger |
439 | (:hook visual-line-mode)) | 440 | (:hook visual-line-mode)) |
440 | 441 | ||
441 | (setup (:straight (define-repeat-map | 442 | (setup (:straight-if (define-repeat-map |
442 | :host nil | 443 | :host nil |
443 | :repo "https://tildegit.org/acdw/define-repeat-map.el")) | 444 | :repo "https://tildegit.org/acdw/define-repeat-map.el") |
445 | (acdw/system :home)) | ||
444 | 446 | ||
445 | (defun acdw/other-window-or-switch-buffer-backward () | 447 | (defun acdw/other-window-or-switch-buffer-backward () |
446 | (interactive) | 448 | (interactive) |
@@ -725,7 +727,8 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
725 | "C-c d" #'acdw/insert-iso-date | 727 | "C-c d" #'acdw/insert-iso-date |
726 | "M-`" nil | 728 | "M-`" nil |
727 | "C-x o" #'acdw/other-window-or-switch-buffer | 729 | "C-x o" #'acdw/other-window-or-switch-buffer |
728 | "C-x O" #'acdw/other-window-or-switch-buffer-backward) | 730 | "C-x O" #'acdw/other-window-or-switch-buffer-backward |
731 | "C-c _" #'add-file-local-variable) | ||
729 | 732 | ||
730 | (:with-map toggle-map | 733 | (:with-map toggle-map |
731 | (:bind "c" #'column-number-mode | 734 | (:bind "c" #'column-number-mode |
@@ -934,7 +937,53 @@ successive invocations." | |||
934 | "C-c l v" #'find-variable)) | 937 | "C-c l v" #'find-variable)) |
935 | 938 | ||
936 | (setup flymake | 939 | (setup flymake |
937 | ;; (:hook-into prog-mode) ; this is very annoying. | 940 | |
941 | (defvar flymake-inhibit-major-modes nil | ||
942 | "Which major-modes NOT to enable `flymake' in.") | ||
943 | |||
944 | (defvar flymake-inhibit-file-name-regexps '("init\\.el\\'" | ||
945 | "early-init\\.el\\'") | ||
946 | "List of file regexps NOT to enable `flymake' in.") | ||
947 | |||
948 | (defvar flymake-inhibit-buffer-name-regexps (list (rx "*scratch*")) | ||
949 | "List of buffer-name regexps NOT to enable `flymake' in.") | ||
950 | |||
951 | (defun list-string-match-p (string regexp-list) | ||
952 | "Return t if at least one regex in RETGEXP-LIST matches STRING, else nil." | ||
953 | (when string ; if STRING is nil, return nil. | ||
954 | (catch 'found | ||
955 | (dolist (regexp regexp-list) | ||
956 | (when (string-match regexp string) | ||
957 | (throw 'found t)))))) | ||
958 | |||
959 | (defun flymake-unless () | ||
960 | "Turn on `flymake-mode', UNLESS it's inhibited. | ||
961 | There are three methods to inhibit flymake in a file. From most | ||
962 | specific to most general, they are these: | ||
963 | |||
964 | - `flymake-inhibit': a file-local-variable | ||
965 | |||
966 | - `flymake-inhibit-buffer-name-regexps': a list of regexps to | ||
967 | match the buffer name against. If one of them matches, inhibit | ||
968 | `flymake-mode'. | ||
969 | |||
970 | - `flymake-inhibit-file-name-regexps': a list of regexps to match | ||
971 | the filename against. If one of them matches, inhibit | ||
972 | `flymake-mode'. | ||
973 | |||
974 | - `flymake-inhibit-major-modes': a list of major-modes in which | ||
975 | to inhibit `flymake-mode'. Really only useful if you want to | ||
976 | generally add `flymake-mode' to `prog-mode-hook'." | ||
977 | (unless (or (bound-and-true-p flymake-inhibit) ; file-local variable | ||
978 | (list-string-match-p (buffer-name) | ||
979 | flymake-inhibit-buffer-name-regexps) | ||
980 | (list-string-match-p (buffer-file-name) | ||
981 | flymake-inhibit-file-name-regexps) | ||
982 | (apply #'derived-mode-p flymake-inhibit-major-modes)) | ||
983 | (flymake-mode-on))) | ||
984 | |||
985 | (add-hook 'prog-mode-hook #'flymake-unless) | ||
986 | |||
938 | (:bind "M-n" #'flymake-goto-next-error | 987 | (:bind "M-n" #'flymake-goto-next-error |
939 | "M-p" #'flymake-goto-prev-error)) | 988 | "M-p" #'flymake-goto-prev-error)) |
940 | 989 | ||
@@ -1132,6 +1181,12 @@ successive invocations." | |||
1132 | (setup (:straight (kaomoji | 1181 | (setup (:straight (kaomoji |
1133 | :host nil | 1182 | :host nil |
1134 | :repo "https://tildegit.org/acdw/kaomoji-insert")) | 1183 | :repo "https://tildegit.org/acdw/kaomoji-insert")) |
1184 | (dolist (km'(("(Ծ‸ Ծ)" "suspicious") | ||
1185 | ("(¬‿¬)═ɜ ɛ═(⌐‿⌐ )" "pound it" "fist bump") | ||
1186 | ("▬▬▬▬▬▬▬▋ Ò╭╮Ó" "hammer") | ||
1187 | ("👁👄👁" "lewk") | ||
1188 | ("( ͡~ ͜ʖ ͡°)" "wink"))) | ||
1189 | (add-to-list 'kaomoji-alist km)) | ||
1135 | (:global "C-x 8 k" #'kaomoji-insert)) | 1190 | (:global "C-x 8 k" #'kaomoji-insert)) |
1136 | 1191 | ||
1137 | (setup (:straight lacarte) | 1192 | (setup (:straight lacarte) |
@@ -1523,14 +1578,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1523 | 1578 | ||
1524 | (:hook show-paren-mode | 1579 | (:hook show-paren-mode |
1525 | electric-pair-local-mode | 1580 | electric-pair-local-mode |
1526 | acdw/setup-fringes | 1581 | acdw/setup-fringes |
1527 | |||
1528 | (defun flymake-mode-except () | ||
1529 | "Turn on flymake mode, except in some modes." | ||
1530 | (let ((no-flymake-modes '(emacs-lisp-mode))) | ||
1531 | (unless (or (member major-mode no-flymake-modes) | ||
1532 | (apply #'derived-mode-p no-flymake-modes)) | ||
1533 | (flymake-mode-on)))) | ||
1534 | 1582 | ||
1535 | (defun prog-mode@auto-fill () | 1583 | (defun prog-mode@auto-fill () |
1536 | (setq-local comment-auto-fill-only-comments t) | 1584 | (setq-local comment-auto-fill-only-comments t) |
@@ -1761,6 +1809,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1761 | 1809 | ||
1762 | (setup text | 1810 | (setup text |
1763 | (:hook turn-on-auto-fill | 1811 | (:hook turn-on-auto-fill |
1812 | tildify-mode | ||
1764 | acdw/setup-fringes)) | 1813 | acdw/setup-fringes)) |
1765 | 1814 | ||
1766 | (setup (:straight (topsy | 1815 | (setup (:straight (topsy |
diff --git a/lisp/acdw-browse-url.el b/lisp/acdw-browse-url.el index 93f470c..9f8e484 100644 --- a/lisp/acdw-browse-url.el +++ b/lisp/acdw-browse-url.el | |||
@@ -6,7 +6,7 @@ | |||
6 | "Arguments to pass to mpv in `browse-url-mpv'.") | 6 | "Arguments to pass to mpv in `browse-url-mpv'.") |
7 | 7 | ||
8 | (defun browse-url-mpv (url &optional new-window) | 8 | (defun browse-url-mpv (url &optional new-window) |
9 | "Play `URL' in mpv." | 9 | "Play URL in mpv." |
10 | (interactive (browse-url-interactive-arg "Video URL: ")) | 10 | (interactive (browse-url-interactive-arg "Video URL: ")) |
11 | (ignore new-window) ;; mpv always opens a new window | 11 | (ignore new-window) ;; mpv always opens a new window |
12 | (let* ((url (browse-url-encode-url url)) | 12 | (let* ((url (browse-url-encode-url url)) |
@@ -112,6 +112,13 @@ Then, build `browse-url-button-regexp' with the new protocol." | |||
112 | 112 | ||
113 | ;;; Browse-URL tweaks | 113 | ;;; Browse-URL tweaks |
114 | 114 | ||
115 | ;; convert reddit.com to teddit | ||
116 | (defun acdw/eww-browse-reddit-url (url &rest args) | ||
117 | "Browse a Reddit.com URL using Teddit." | ||
118 | (let* ((teddit "teddit.com") | ||
119 | (url (replace-regexp-in-string "reddit\\.com" teddit url))) | ||
120 | (eww-browse-url url args))) | ||
121 | |||
115 | ;; convert twitter.com to nitter | 122 | ;; convert twitter.com to nitter |
116 | (defun acdw/eww-browse-twitter-url (url &rest args) | 123 | (defun acdw/eww-browse-twitter-url (url &rest args) |
117 | "Browse a Twitter.com URL using Nitter." | 124 | "Browse a Twitter.com URL using Nitter." |
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 89269ab..63f6516 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el | |||
@@ -288,7 +288,7 @@ instead of the true count." | |||
288 | desc "\\W"))))))) | 288 | desc "\\W"))))))) |
289 | (goto-char (match-end 0))) | 289 | (goto-char (match-end 0))) |
290 | ;; Ignore source blocks | 290 | ;; Ignore source blocks |
291 | ((org-in-src-block-p) (foreward-line)) | 291 | ((org-in-src-block-p) (forward-line)) |
292 | ;; Count everything else | 292 | ;; Count everything else |
293 | (t | 293 | (t |
294 | ;; ... unless it's in a few weird contexts | 294 | ;; ... unless it's in a few weird contexts |
diff --git a/lisp/acdw.el b/lisp/acdw.el index 1a7e7f2..cdd6cf9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -461,7 +461,7 @@ Prompt only if there are unsaved changes." | |||
461 | (repeat 1 2 digit) | 461 | (repeat 1 2 digit) |
462 | (: (any ?a ?A ?p ?P) (any ?m ?M))) | 462 | (: (any ?a ?A ?p ?P) (any ?m ?M))) |
463 | (* nonl))) | 463 | (* nonl))) |
464 | (ss (sunrise-sunset)) | 464 | (ss (acdw/supress-messages #'sunrise-sunset)) |
465 | (_m (string-match times-regex ss)) | 465 | (_m (string-match times-regex ss)) |
466 | (sunrise-time (match-string 1 ss)) | 466 | (sunrise-time (match-string 1 ss)) |
467 | (sunset-time (match-string 2 ss))) | 467 | (sunset-time (match-string 2 ss))) |
@@ -469,6 +469,17 @@ Prompt only if there are unsaved changes." | |||
469 | (run-at-time sunset-time (* 60 60 24) sunset-command) | 469 | (run-at-time sunset-time (* 60 60 24) sunset-command) |
470 | (run-at-time "12:00am" (* 60 60 24) sunset-command))) | 470 | (run-at-time "12:00am" (* 60 60 24) sunset-command))) |
471 | 471 | ||
472 | (defun acdw/supress-messages (oldfn &rest args) ; from pkal | ||
473 | "Advice wrapper for suppressing `message'. | ||
474 | OLDFN is the wrapped function, that is passed the arguments | ||
475 | ARGS." | ||
476 | (let ((msg (current-message))) | ||
477 | (prog1 | ||
478 | (let ((inhibit-message t)) | ||
479 | (apply oldfn args)) | ||
480 | (when msg | ||
481 | (message "%s" msg))))) | ||
482 | |||
472 | (defun acdw/setup-fringes () | 483 | (defun acdw/setup-fringes () |
473 | "Set up fringes how I likes 'em." | 484 | "Set up fringes how I likes 'em." |
474 | (define-fringe-bitmap 'left-curly-arrow | 485 | (define-fringe-bitmap 'left-curly-arrow |