diff options
-rw-r--r-- | init.el | 43 | ||||
-rw-r--r-- | lisp/+circe.el | 16 | ||||
-rw-r--r-- | lisp/+emacs.el | 31 |
3 files changed, 68 insertions, 22 deletions
diff --git a/init.el b/init.el index b165abf..e8dd1c9 100644 --- a/init.el +++ b/init.el | |||
@@ -106,10 +106,10 @@ | |||
106 | "gitlab.com" | 106 | "gitlab.com" |
107 | "google.com" | 107 | "google.com" |
108 | "imgur.com" | 108 | "imgur.com" |
109 | "pixelfed" | 109 | "pixelfed" "instagram.com" "bibliogram.art" |
110 | "reddit.com" | 110 | "reddit.com" "teddit.net" |
111 | "taskiq" | 111 | "taskiq" |
112 | "twitter.com" "nitter.com" | 112 | "twitter.com" "nitter.net" |
113 | )) | 113 | )) |
114 | browse-url-secondary-browser-function) | 114 | browse-url-secondary-browser-function) |
115 | (cons "." ; everything else | 115 | (cons "." ; everything else |
@@ -117,7 +117,16 @@ | |||
117 | ;; Transform URLs before passing to `browse-url' | 117 | ;; Transform URLs before passing to `browse-url' |
118 | (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" | 118 | (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" |
119 | "youtu.be")) | 119 | "youtu.be")) |
120 | . "//yewtu.be"))) | 120 | . "//yewtu.be") |
121 | ("twitter\\.com" | ||
122 | . "nitter.net") | ||
123 | ("instagram\\.com" | ||
124 | . "bibilogram.art") | ||
125 | (,(rx (or "reddit.com" | ||
126 | "old.reddit.com")) | ||
127 | . "teddit.net") | ||
128 | ("medium\\.com" | ||
129 | . "scribe.rip"))) | ||
121 | (+browse-url-transform-url-global-mode +1)) | 130 | (+browse-url-transform-url-global-mode +1)) |
122 | 131 | ||
123 | (setup calendar | 132 | (setup calendar |
@@ -257,10 +266,8 @@ | |||
257 | [remap query-replace-regexp] 'anzu-query-replace-regexp) | 266 | [remap query-replace-regexp] 'anzu-query-replace-regexp) |
258 | (global-anzu-mode +1) | 267 | (global-anzu-mode +1) |
259 | (:bind-into isearch | 268 | (:bind-into isearch |
260 | [remap isearch-query-replace] | 269 | [remap isearch-query-replace] 'anzu-isearch-query-replace |
261 | 'anzu-isearch-query-replace | 270 | [remap isearch-query-replace-regexp] 'anzu-isearch-query-replace-regexp)) |
262 | [remap isearch-query-replace-regexp] | ||
263 | 'anzu-isearch-query-replace-regexp)) | ||
264 | 271 | ||
265 | (setup (:straight avy) | 272 | (setup (:straight avy) |
266 | (:also-load +avy) | 273 | (:also-load +avy) |
@@ -374,7 +381,11 @@ | |||
374 | visual-fill-column-extra-text-width | 381 | visual-fill-column-extra-text-width |
375 | (cons +circe-left-margin 0))) | 382 | (cons +circe-left-margin 0))) |
376 | 383 | ||
377 | (add-hook 'modus-themes-after-load-theme-hook 'circe-nick-color-reset) | 384 | (with-eval-after-load 'topsy |
385 | (:option (append topsy-mode-functions) | ||
386 | '(circe-channel-mode . +circe-current-topic))) | ||
387 | |||
388 | (add-hook 'circadian-after-load-theme-hook 'circe-nick-color-reset) | ||
378 | (add-hook 'kill-emacs-hook '+circe-quit-all@kill-emacs)) | 389 | (add-hook 'kill-emacs-hook '+circe-quit-all@kill-emacs)) |
379 | 390 | ||
380 | (setup (:straight consult) | 391 | (setup (:straight consult) |
@@ -460,7 +471,6 @@ | |||
460 | 471 | ||
461 | (setup (:straight crux) | 472 | (setup (:straight crux) |
462 | (:+key "C-o" 'crux-smart-open-line | 473 | (:+key "C-o" 'crux-smart-open-line |
463 | "M-o" 'crux-other-window-or-switch-buffer | ||
464 | "C-x 4 t" 'crux-transpose-windows) | 474 | "C-x 4 t" 'crux-transpose-windows) |
465 | 475 | ||
466 | (el-patch-feature crux) | 476 | (el-patch-feature crux) |
@@ -508,9 +518,6 @@ See also `crux-reopen-as-root-mode'." | |||
508 | (setup (:straight electric-cursor) | 518 | (setup (:straight electric-cursor) |
509 | (electric-cursor-mode +1)) | 519 | (electric-cursor-mode +1)) |
510 | 520 | ||
511 | (setup (:straight electric-cursor) | ||
512 | (electric-cursor-mode +1)) | ||
513 | |||
514 | (setup (:straight elfeed) | 521 | (setup (:straight elfeed) |
515 | (:also-load +elfeed) | 522 | (:also-load +elfeed) |
516 | (:option elfeed-use-curl t | 523 | (:option elfeed-use-curl t |
@@ -586,6 +593,9 @@ See also `crux-reopen-as-root-mode'." | |||
586 | (:option hungry-delete-chars-to-skip " \t" | 593 | (:option hungry-delete-chars-to-skip " \t" |
587 | hungry-delete-join-reluctantly nil) | 594 | hungry-delete-join-reluctantly nil) |
588 | (:bind-into paredit | 595 | (:bind-into paredit |
596 | ;; I define these functions here because they really require both packages | ||
597 | ;; to make any sense. So, would I put them in `+hungry-delete' or | ||
598 | ;; `+paredit' ? There's no satisfactory answer. | ||
589 | [remap paredit-backward-delete] | 599 | [remap paredit-backward-delete] |
590 | (defun acdw/paredit-hungry-delete-backward (arg) | 600 | (defun acdw/paredit-hungry-delete-backward (arg) |
591 | (interactive "P") | 601 | (interactive "P") |
@@ -810,13 +820,6 @@ See also `crux-reopen-as-root-mode'." | |||
810 | (setup (:straight smartscan) | 820 | (setup (:straight smartscan) |
811 | (smartscan-mode +1)) | 821 | (smartscan-mode +1)) |
812 | 822 | ||
813 | (setup (:straight (sophomore | ||
814 | :host github | ||
815 | :repo "duckwork/sophomore.el")) | ||
816 | (:option disabled-command-function 'sophomore-dispatch | ||
817 | sophomore-dispatch-alist '((fatfinger . sophomore-fat-finger))) | ||
818 | (put 'save-buffers-kill-terminal 'disabled 'fatfinger)) | ||
819 | |||
820 | (setup (:straight ssh-config-mode) | 823 | (setup (:straight ssh-config-mode) |
821 | (:file-match (rx "/.ssh/config" eos) | 824 | (:file-match (rx "/.ssh/config" eos) |
822 | (rx "/ssh" (? "d") "_config" eos)) | 825 | (rx "/ssh" (? "d") "_config" eos)) |
diff --git a/lisp/+circe.el b/lisp/+circe.el index d9ea9cf..9078907 100644 --- a/lisp/+circe.el +++ b/lisp/+circe.el | |||
@@ -48,7 +48,21 @@ | |||
48 | (defun +circe-current-topic (&optional message) | 48 | (defun +circe-current-topic (&optional message) |
49 | "Return the topic of the current channel. | 49 | "Return the topic of the current channel. |
50 | When called with optional MESSAGE non-nil, or interactively, also | 50 | When called with optional MESSAGE non-nil, or interactively, also |
51 | message the current topic.") | 51 | message the current topic." |
52 | (interactive "p") | ||
53 | (let ((topic | ||
54 | (save-excursion | ||
55 | (goto-char (point-max)) | ||
56 | (or (re-search-backward | ||
57 | (rx (group "*** " | ||
58 | (or "Topic" "topic" "TOPIC") | ||
59 | (* (not ":")) ": ") | ||
60 | (group (+ nonl))))) | ||
61 | (buffer-substring-no-properties | ||
62 | (match-beginning 2) (match-end 2))))) | ||
63 | (when message | ||
64 | (message "%s" topic)) | ||
65 | topic)) | ||
52 | 66 | ||
53 | ;;; Formatting messages | 67 | ;;; Formatting messages |
54 | 68 | ||
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index 15e23da..3fe243c 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el | |||
@@ -120,7 +120,8 @@ Do this only if the buffer is not visiting a file." | |||
120 | (when (version< emacs-version "28") | 120 | (when (version< emacs-version "28") |
121 | (fset 'yes-or-no-p 'y-or-n-p)) | 121 | (fset 'yes-or-no-p 'y-or-n-p)) |
122 | 122 | ||
123 | ;; Encoding -- UTF-8 everywhere | 123 | ;;; Encodings |
124 | |||
124 | (setq-default locale-coding-system 'utf-8-unix | 125 | (setq-default locale-coding-system 'utf-8-unix |
125 | coding-system-for-read 'utf-8-unix | 126 | coding-system-for-read 'utf-8-unix |
126 | coding-system-for-write 'utf-8-unix | 127 | coding-system-for-write 'utf-8-unix |
@@ -174,8 +175,36 @@ Do this only if the buffer is not visiting a file." | |||
174 | (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) | 175 | (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) |
175 | (add-hook 'minibuffer-setup-hook 'cursor-intangible-mode) | 176 | (add-hook 'minibuffer-setup-hook 'cursor-intangible-mode) |
176 | 177 | ||
178 | ;;; Better-default functions | ||
179 | |||
180 | (defun +cycle-spacing (&optional n preserve-nl-back mode) | ||
181 | "Negate N argument on `cycle-spacing'. | ||
182 | That is, with a positive N, deletes newlines as well, leaving -N | ||
183 | spaces. If N is negative, it will not delete newlines and leave | ||
184 | N spaces. See docstring of `cycle-spacing' for the meaning of | ||
185 | PRESERVE-NL-BACK and MODE." | ||
186 | (interactive "*p") | ||
187 | (cycle-spacing (- n) preserve-nl-back mode)) | ||
188 | |||
189 | (defun +save-buffers-quit (&optional arg) | ||
190 | "Silently save each buffer, then kill the current connection. | ||
191 | If the current frame has no client, kill Emacs itself using | ||
192 | `save-buffers-kill-emacs' after confirming with the user. | ||
193 | |||
194 | With prefix ARG, silently save all file-visiting buffers, then | ||
195 | kill without asking." | ||
196 | (interactive "P") | ||
197 | (save-some-buffers t) | ||
198 | (if (and (not (frame-parameter nil 'client)) | ||
199 | (and (not arg))) | ||
200 | (when (yes-or-no-p "Sure you want to quit? ") | ||
201 | (save-buffers-kill-emacs)) | ||
202 | (server-save-buffers-kill-terminal nil))) | ||
203 | |||
177 | ;;; Bindings | 204 | ;;; Bindings |
178 | 205 | ||
206 | (global-set-key (kbd "C-x C-c") '+save-buffers-quit) | ||
207 | (global-set-key (kbd "M-SPC") '+cycle-spacing) | ||
179 | (global-set-key (kbd "M-/") 'hippie-expand) | 208 | (global-set-key (kbd "M-/") 'hippie-expand) |
180 | (global-set-key (kbd "M-=") 'count-words) | 209 | (global-set-key (kbd "M-=") 'count-words) |
181 | (global-set-key (kbd "C-x C-b") 'ibuffer) | 210 | (global-set-key (kbd "C-x C-b") 'ibuffer) |