diff options
-rw-r--r-- | init.el | 250 | ||||
-rw-r--r-- | lisp/+browse-url.el | 1 | ||||
-rw-r--r-- | lisp/+circe.el | 7 | ||||
-rw-r--r-- | lisp/+emacs.el | 13 | ||||
-rw-r--r-- | lisp/+modeline.el | 11 | ||||
-rw-r--r-- | lisp/+org.el | 6 | ||||
-rw-r--r-- | lisp/+scratch.el | 2 |
7 files changed, 173 insertions, 117 deletions
diff --git a/init.el b/init.el index 3f85381..bda1fd8 100644 --- a/init.el +++ b/init.el | |||
@@ -26,7 +26,8 @@ | |||
26 | ;; necessary for good functioning. In this block, I add extra | 26 | ;; necessary for good functioning. In this block, I add extra |
27 | ;; things or more "experimental" ones that might not belong in a | 27 | ;; things or more "experimental" ones that might not belong in a |
28 | ;; separate file. | 28 | ;; separate file. |
29 | (:global "C-x C-k" 'kill-this-buffer) | 29 | (:global "C-x C-k" 'kill-this-buffer |
30 | "C-x 4 n" 'clone-buffer) | ||
30 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults | 31 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults |
31 | (global-set-key (kbd "C-h") 'delete-backward-char) | 32 | (global-set-key (kbd "C-h") 'delete-backward-char) |
32 | (keyboard-translate ?\C-h ?\C-?)) | 33 | (keyboard-translate ?\C-h ?\C-?)) |
@@ -47,6 +48,11 @@ | |||
47 | "~/.authinfo" | 48 | "~/.authinfo" |
48 | "~/.authinfo.gpg"))) | 49 | "~/.authinfo.gpg"))) |
49 | 50 | ||
51 | (setup (:require goto-addr) | ||
52 | (if (fboundp #'global-goto-address-mode) | ||
53 | (global-goto-address-mode) | ||
54 | (add-hook 'after-change-major-mode-hook #'goto-address-mode))) | ||
55 | |||
50 | (setup (:require pulse) | 56 | (setup (:require pulse) |
51 | (:also-load +pulse) | 57 | (:also-load +pulse) |
52 | (:option pulse-flag nil | 58 | (:option pulse-flag nil |
@@ -55,6 +61,63 @@ | |||
55 | (append +pulse-location-commands) 'lui-track-jump-to-indicator) | 61 | (append +pulse-location-commands) 'lui-track-jump-to-indicator) |
56 | (+pulse-location-mode +1)) | 62 | (+pulse-location-mode +1)) |
57 | 63 | ||
64 | (setup abbrev | ||
65 | (:option abbrev-file-name (sync/ "abbrev.el") | ||
66 | save-abbrevs 'silent) | ||
67 | (:hook-into text-mode | ||
68 | circe-chat-mode)) | ||
69 | |||
70 | (setup autorevert | ||
71 | (:option global-auto-revert-non-file-buffers t | ||
72 | auto-revert-verbose nil) | ||
73 | (global-auto-revert-mode +1)) | ||
74 | |||
75 | (setup browse-url | ||
76 | (:require +browse-url) | ||
77 | (:option browse-url-secondary-browser-function (if (executable-find "firefox") | ||
78 | 'browse-url-firefox | ||
79 | 'browse-url-default-browser) | ||
80 | browse-url-new-window-flag nil | ||
81 | browse-url-firefox-arguments '("--new-tab") | ||
82 | browse-url-firefox-new-window-is-tab t) | ||
83 | ;; Set up URL handlers. | ||
84 | (+browse-url-set-handlers | ||
85 | (list | ||
86 | (cons (rx ; images | ||
87 | "." (or "jpeg" "jpg" "png") eos) | ||
88 | (lambda (&rest args) | ||
89 | (apply | ||
90 | (cond ((executable-find "mpv") '+browse-image-with-mpv) | ||
91 | (t 'eww-browse-url)) | ||
92 | args))) | ||
93 | (cons (rx ; videos | ||
94 | (or "youtube.com" "youtu.be" "yewtu.be" | ||
95 | (seq "." (or "mp4" "gif" "mov" "MOV") eos))) | ||
96 | (lambda (&rest args) | ||
97 | (apply (if (executable-find "mpv") | ||
98 | '+browse-url-with-mpv | ||
99 | browse-url-secondary-browser-function) | ||
100 | args))) | ||
101 | (cons (rx ; non-eww-friendly websites | ||
102 | (or | ||
103 | "github.com" | ||
104 | "gitlab.com" | ||
105 | "google.com" | ||
106 | "imgur.com" | ||
107 | "pixelfed" | ||
108 | "reddit.com" | ||
109 | "taskiq" | ||
110 | "twitter.com" "nitter.com" | ||
111 | )) | ||
112 | browse-url-secondary-browser-function) | ||
113 | (cons "." ; everything else | ||
114 | 'eww-browse-url))) | ||
115 | ;; Transform URLs before passing to `browse-url' | ||
116 | (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" | ||
117 | "youtu.be")) | ||
118 | . "//yewtu.be"))) | ||
119 | (+browse-url-transform-url-global-mode +1)) | ||
120 | |||
58 | (setup calendar | 121 | (setup calendar |
59 | (require '_location) | 122 | (require '_location) |
60 | (:option calendar-location-name _location-name | 123 | (:option calendar-location-name _location-name |
@@ -159,6 +222,13 @@ | |||
159 | 'display-fill-column-indicator-mode | 222 | 'display-fill-column-indicator-mode |
160 | 'turn-on-auto-fill)) | 223 | 'turn-on-auto-fill)) |
161 | 224 | ||
225 | (setup scratch | ||
226 | (:require +scratch) | ||
227 | (:option initial-major-mode 'lisp-interaction-mode | ||
228 | initial-scratch-message | ||
229 | ";; ABANDON ALL HOPE YE WHO ENTER HERE\n\n") | ||
230 | (add-hook 'kill-buffer-query-functions '+scratch-immortal)) | ||
231 | |||
162 | (setup text | 232 | (setup text |
163 | (:hook 'turn-on-auto-fill)) | 233 | (:hook 'turn-on-auto-fill)) |
164 | 234 | ||
@@ -200,16 +270,17 @@ | |||
200 | 270 | ||
201 | (setup (:straight (cape :host github :repo "minad/cape")) | 271 | (setup (:straight (cape :host github :repo "minad/cape")) |
202 | (dolist (fn '(;; All available cape capfs listed here. | 272 | (dolist (fn '(;; All available cape capfs listed here. |
203 | cape-file-capf | 273 | cape-file |
204 | cape-dabbrev-capf | 274 | cape-dabbrev |
205 | cape-keyword-capf | 275 | cape-keyword |
206 | ;;cape-abbrev-capf | 276 | ;;cape-abbrev |
207 | ;;cape-ispell-capf | 277 | ;;cape-ispell |
208 | ;;cape-dict-capf | 278 | ;;cape-dict |
209 | )) | 279 | )) |
210 | (add-to-list 'completion-at-point-functions fn))) | 280 | (add-to-list 'completion-at-point-functions fn))) |
211 | 281 | ||
212 | (setup (:straight (capf-autosuggest | 282 | (setup (:straight (capf-autosuggest |
283 | :host nil | ||
213 | :repo "https://repo.or.cz/emacs-capf-autosuggest.git")) | 284 | :repo "https://repo.or.cz/emacs-capf-autosuggest.git")) |
214 | (:hook-into eshell-mode | 285 | (:hook-into eshell-mode |
215 | comint-mode)) | 286 | comint-mode)) |
@@ -217,12 +288,13 @@ | |||
217 | (setup (:straight circadian) | 288 | (setup (:straight circadian) |
218 | (:option circadian-themes '((:sunrise . modus-operandi) | 289 | (:option circadian-themes '((:sunrise . modus-operandi) |
219 | (:sunset . modus-vivendi))) | 290 | (:sunset . modus-vivendi))) |
220 | (circadian-setup)) | 291 | (add-hook 'after-init-hook 'circadian-setup)) |
221 | 292 | ||
222 | (setup (:straight circe) | 293 | (setup (:straight circe) |
223 | (:require _circe | 294 | (:require _circe |
224 | +circe) | 295 | +circe) |
225 | (autoload '+irc "+circe" "Connect to IRC." t) | 296 | (:also-load circe-chanop) |
297 | ;;(autoload '+irc "+circe" "Connect to IRC." t) | ||
226 | 298 | ||
227 | ;; Formatting options | 299 | ;; Formatting options |
228 | (:option circe-format-action (format (format "%%%ds* {nick} {body}" | 300 | (:option circe-format-action (format (format "%%%ds* {nick} {body}" |
@@ -294,12 +366,8 @@ | |||
294 | visual-fill-column-extra-text-width | 366 | visual-fill-column-extra-text-width |
295 | (cons +circe-left-margin 0))) | 367 | (cons +circe-left-margin 0))) |
296 | 368 | ||
297 | (add-hook 'kill-emacs-hook | 369 | (add-hook 'modus-themes-after-load-theme-hook 'circe-nick-color-reset) |
298 | (defun circe-quit-all () | 370 | (add-hook 'kill-emacs-hook '+circe-quit-all@kill-emacs)) |
299 | (ignore-errors | ||
300 | (advice-remove 'circe-command-GQUIT | ||
301 | 'circe-gquit@kill-buffer) | ||
302 | (circe-command-GQUIT "Quitting Emacs, bye!"))))) | ||
303 | 371 | ||
304 | (setup (:straight consult) | 372 | (setup (:straight consult) |
305 | (:also-load +consult) | 373 | (:also-load +consult) |
@@ -424,12 +492,31 @@ See also `crux-reopen-as-root-mode'." | |||
424 | (autoload 'global-dictionary-tooltip-mode "dictionary" | 492 | (autoload 'global-dictionary-tooltip-mode "dictionary" |
425 | "Enable/disable dictionary-tooltip-mode for all buffers" t)) | 493 | "Enable/disable dictionary-tooltip-mode for all buffers" t)) |
426 | 494 | ||
495 | (setup (:straight (discord | ||
496 | :host github | ||
497 | :repo "davep/discord.el" | ||
498 | :fork (:repo "duckwork/discord.el")))) | ||
499 | |||
427 | (setup (:straight electric-cursor) | 500 | (setup (:straight electric-cursor) |
428 | (electric-cursor-mode +1)) | 501 | (electric-cursor-mode +1)) |
429 | 502 | ||
430 | (setup (:straight electric-cursor) | 503 | (setup (:straight electric-cursor) |
431 | (electric-cursor-mode +1)) | 504 | (electric-cursor-mode +1)) |
432 | 505 | ||
506 | (setup (:straight elfeed) | ||
507 | (:also-load +elfeed) | ||
508 | (:option elfeed-use-curl t | ||
509 | elfeed-curl-extra-arguments '("--insecure") | ||
510 | elfeed-show-unique-buffers t | ||
511 | elfeed-db-directory (sync/ "elfeed/db/" t)) | ||
512 | (:with-mode elfeed-show-mode | ||
513 | (:bind "SPC" '+elfeed-scroll-up-command | ||
514 | "S-SPC" '+elfeed-scroll-down-command))) | ||
515 | |||
516 | (setup (:straight elfeed-org) | ||
517 | (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t))) | ||
518 | (elfeed-org)) | ||
519 | |||
433 | (setup (:straight embark) | 520 | (setup (:straight embark) |
434 | (:option prefix-help-command 'embark-prefix-help-command) | 521 | (:option prefix-help-command 'embark-prefix-help-command) |
435 | (:+key "C-." 'embark-act | 522 | (:+key "C-." 'embark-act |
@@ -529,6 +616,20 @@ See also `crux-reopen-as-root-mode'." | |||
529 | (setup (:straight lacarte) | 616 | (setup (:straight lacarte) |
530 | (:+key "<f10>" 'lacarte-execute-menu-command)) | 617 | (:+key "<f10>" 'lacarte-execute-menu-command)) |
531 | 618 | ||
619 | (setup (:straight (lin :host gitlab :repo "protesilaos/lin")) | ||
620 | (require 'lin) | ||
621 | (:hook-into dired-mode | ||
622 | elfeed-search-mode | ||
623 | git-rebase-mode | ||
624 | ibuffer-mode | ||
625 | ledger-report-mode | ||
626 | log-view-mode | ||
627 | magit-log-mode | ||
628 | notmuch-search-mode | ||
629 | notmuch-tree-mode | ||
630 | org-agenda-mode | ||
631 | tabulated-list-mode)) | ||
632 | |||
532 | (setup (:straight marginalia) | 633 | (setup (:straight marginalia) |
533 | (marginalia-mode +1)) | 634 | (marginalia-mode +1)) |
534 | 635 | ||
@@ -543,7 +644,11 @@ See also `crux-reopen-as-root-mode'." | |||
543 | 644 | ||
544 | (setup (:straight (modus-themes | 645 | (setup (:straight (modus-themes |
545 | :host gitlab | 646 | :host gitlab |
546 | :repo "protesilaos/modus-themes"))) | 647 | :repo "protesilaos/modus-themes")) |
648 | (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) | ||
649 | (:option modus-themes-bold-constructs t | ||
650 | modus-themes-italic-constructs t | ||
651 | modus-themes-headings '((t . (background))))) | ||
547 | 652 | ||
548 | (setup (:straight mwim) | 653 | (setup (:straight mwim) |
549 | (:+key "C-a" #'mwim-beginning | 654 | (:+key "C-a" #'mwim-beginning |
@@ -553,7 +658,7 @@ See also `crux-reopen-as-root-mode'." | |||
553 | (:option completion-styles '(orderless))) | 658 | (:option completion-styles '(orderless))) |
554 | 659 | ||
555 | (setup (:straight (org | 660 | (setup (:straight (org |
556 | :type git | 661 | :type git :host nil |
557 | :repo "https://git.savannah.gnu.org/git/emacs/org-mode.git" | 662 | :repo "https://git.savannah.gnu.org/git/emacs/org-mode.git" |
558 | :local-repo "org" | 663 | :local-repo "org" |
559 | :depth full | 664 | :depth full |
@@ -563,7 +668,7 @@ See also `crux-reopen-as-root-mode'." | |||
563 | "lisp/*.el" | 668 | "lisp/*.el" |
564 | ("etc/styles/" "etc/styles/*"))) | 669 | ("etc/styles/" "etc/styles/*"))) |
565 | (org-contrib | 670 | (org-contrib |
566 | :type git | 671 | :type git :host nil |
567 | :repo "https://git.sr.ht/~bzg/org-contrib")) | 672 | :repo "https://git.sr.ht/~bzg/org-contrib")) |
568 | ;; DO NOT load system-installed org !!! | 673 | ;; DO NOT load system-installed org !!! |
569 | (setq load-path (cl-remove-if (lambda (path) | 674 | (setq load-path (cl-remove-if (lambda (path) |
@@ -572,6 +677,8 @@ See also `crux-reopen-as-root-mode'." | |||
572 | (:also-load +org | 677 | (:also-load +org |
573 | ox-md) | 678 | ox-md) |
574 | (:option org-adapt-indentation nil | 679 | (:option org-adapt-indentation nil |
680 | org-agenda-skip-deadline-if-done t | ||
681 | org-archive-mark-done t | ||
575 | org-catch-invisible-edits 'show-and-error | 682 | org-catch-invisible-edits 'show-and-error |
576 | org-clock-clocked-in-display 'mode-line | 683 | org-clock-clocked-in-display 'mode-line |
577 | org-clock-frame-title-format (cons | 684 | org-clock-frame-title-format (cons |
@@ -594,7 +701,7 @@ See also `crux-reopen-as-root-mode'." | |||
594 | org-fontify-quote-and-verse-blocks t | 701 | org-fontify-quote-and-verse-blocks t |
595 | org-fontify-whole-heading-line t | 702 | org-fontify-whole-heading-line t |
596 | org-hide-emphasis-markers t | 703 | org-hide-emphasis-markers t |
597 | org-html-coding-system 'utf-8-unix | 704 | org-html-coding-system 'utf-8-unix |
598 | org-image-actual-width (list (* (window-font-width) | 705 | org-image-actual-width (list (* (window-font-width) |
599 | (- fill-column 8))) | 706 | (- fill-column 8))) |
600 | org-imenu-depth 3 | 707 | org-imenu-depth 3 |
@@ -620,11 +727,14 @@ See also `crux-reopen-as-root-mode'." | |||
620 | "C-c C-l" '+org-insert-link-dwim | 727 | "C-c C-l" '+org-insert-link-dwim |
621 | "C-c C-n" '+org-next-heading-widen | 728 | "C-c C-n" '+org-next-heading-widen |
622 | "C-c C-p" '+org-previous-heading-widen) | 729 | "C-c C-p" '+org-previous-heading-widen) |
730 | (:+leader "c" 'org-capture "C-c" 'org-capture | ||
731 | "a" 'org-agenda "C-a" 'org-agenda) | ||
623 | (:local-set unfill-fill-function 'org-fill-paragraph) | 732 | (:local-set unfill-fill-function 'org-fill-paragraph) |
624 | (:local-hook before-save-hook '+org-before-save@prettify-buffer) | 733 | (:local-hook before-save-hook '+org-before-save@prettify-buffer) |
625 | (advice-add 'org-delete-backward-char :override '+org-delete-backward-char) | 734 | (advice-add 'org-delete-backward-char :override '+org-delete-backward-char) |
626 | (with-eval-after-load 'org | 735 | (with-eval-after-load 'org |
627 | (org-clock-persistence-insinuate))) | 736 | (org-clock-persistence-insinuate) |
737 | (org-link-set-parameters "tel" :follow '+org-tel-open))) | ||
628 | 738 | ||
629 | (setup (:straight org-appear) | 739 | (setup (:straight org-appear) |
630 | (:option org-appear-autoemphasis t | 740 | (:option org-appear-autoemphasis t |
@@ -653,13 +763,9 @@ See also `crux-reopen-as-root-mode'." | |||
653 | lisp-interaction-mode | 763 | lisp-interaction-mode |
654 | scheme-mode)) | 764 | scheme-mode)) |
655 | 765 | ||
656 | (setup (:straight scratch) | 766 | (setup (:straight-when pdf-tools |
657 | (:require +scratch) | 767 | (eq system-type 'gnu/linux)) |
658 | (:option initial-major-mode 'emacs-lisp-mode | 768 | (pdf-tools-install)) |
659 | initial-scratch-message | ||
660 | ";; ABANDON ALL HOPE YE WHO ENTER HERE\n") | ||
661 | (add-hook 'kill-buffer-query-functions '+scratch-immortal) | ||
662 | (add-hook 'scratch-create-buffer-hook '+scratch-buffer-setup)) | ||
663 | 769 | ||
664 | (setup (:straight (shell-command+ | 770 | (setup (:straight (shell-command+ |
665 | :host nil | 771 | :host nil |
@@ -673,7 +779,9 @@ See also `crux-reopen-as-root-mode'." | |||
673 | :fork (:repo "duckwork/simple-modeline"))) | 779 | :fork (:repo "duckwork/simple-modeline"))) |
674 | (:also-load +modeline) | 780 | (:also-load +modeline) |
675 | (:option simple-modeline-segments '((;; left | 781 | (:option simple-modeline-segments '((;; left |
782 | +modeline-ace-window-display | ||
676 | +modeline-modified | 783 | +modeline-modified |
784 | +modeline-narrowed | ||
677 | +modeline-buffer-name | 785 | +modeline-buffer-name |
678 | +modeline-position | 786 | +modeline-position |
679 | +modeline-anzu | 787 | +modeline-anzu |
@@ -684,7 +792,6 @@ See also `crux-reopen-as-root-mode'." | |||
684 | simple-modeline-segment-misc-info | 792 | simple-modeline-segment-misc-info |
685 | simple-modeline-segment-process | 793 | simple-modeline-segment-process |
686 | +modeline-text-scale | 794 | +modeline-text-scale |
687 | +modeline-narrowed | ||
688 | +modeline-minions | 795 | +modeline-minions |
689 | +modeline-major-mode))) | 796 | +modeline-major-mode))) |
690 | (simple-modeline-mode +1)) | 797 | (simple-modeline-mode +1)) |
@@ -692,6 +799,9 @@ See also `crux-reopen-as-root-mode'." | |||
692 | (setup (:straight smartscan) | 799 | (setup (:straight smartscan) |
693 | (smartscan-mode +1)) | 800 | (smartscan-mode +1)) |
694 | 801 | ||
802 | (setup (:straight smartscan) | ||
803 | (smartscan-mode +1)) | ||
804 | |||
695 | (setup (:straight (sophomore | 805 | (setup (:straight (sophomore |
696 | :host github | 806 | :host github |
697 | :repo "duckwork/sophomore.el")) | 807 | :repo "duckwork/sophomore.el")) |
@@ -732,6 +842,7 @@ See also `crux-reopen-as-root-mode'." | |||
732 | 0)))) | 842 | 0)))) |
733 | (funcall topsy-fn)))))) | 843 | (funcall topsy-fn)))))) |
734 | 844 | ||
845 | |||
735 | (setup (:straight trashed) | 846 | (setup (:straight trashed) |
736 | (:option trashed-action-confirmer #'y-or-n-p)) | 847 | (:option trashed-action-confirmer #'y-or-n-p)) |
737 | 848 | ||
@@ -779,6 +890,9 @@ See also `crux-reopen-as-root-mode'." | |||
779 | (with-eval-after-load 'visual-fill-column | 890 | (with-eval-after-load 'visual-fill-column |
780 | (advice-add 'text-scale-adjust :after 'visual-fill-column-adjust))) | 891 | (advice-add 'text-scale-adjust :after 'visual-fill-column-adjust))) |
781 | 892 | ||
893 | (setup (:straight vlf) | ||
894 | (:require vlf-setup)) | ||
895 | |||
782 | (setup (:straight whitespace-cleanup-mode) | 896 | (setup (:straight whitespace-cleanup-mode) |
783 | (:option whitespace-cleanup-mode-preserve-point t) | 897 | (:option whitespace-cleanup-mode-preserve-point t) |
784 | ;;(remove-hook 'before-save-hook 'whitespace-cleanup) | 898 | ;;(remove-hook 'before-save-hook 'whitespace-cleanup) |
@@ -790,83 +904,3 @@ See also `crux-reopen-as-root-mode'." | |||
790 | (interactive "P") | 904 | (interactive "P") |
791 | (call-interactively | 905 | (call-interactively |
792 | (if prefix #'zzz-up-to-char #'zzz-to-char))))) | 906 | (if prefix #'zzz-up-to-char #'zzz-to-char))))) |
793 | |||
794 | (setup (:straight elfeed) | ||
795 | (:also-load +elfeed) | ||
796 | (:option elfeed-use-curl t | ||
797 | elfeed-curl-extra-arguments '("--insecure") | ||
798 | elfeed-show-unique-buffers t | ||
799 | elfeed-db-directory (sync/ "elfeed/db/" t)) | ||
800 | (:with-mode elfeed-show-mode | ||
801 | (:bind "SPC" '+elfeed-scroll-up-command | ||
802 | "S-SPC" '+elfeed-scroll-down-command))) | ||
803 | |||
804 | (setup (:straight elfeed-org) | ||
805 | (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t))) | ||
806 | (elfeed-org)) | ||
807 | |||
808 | (setup (:straight (lin :host gitlab :repo "protesilaos/lin")) | ||
809 | (require 'lin) | ||
810 | (:hook-into dired-mode | ||
811 | elfeed-search-mode | ||
812 | git-rebase-mode | ||
813 | ibuffer-mode | ||
814 | ledger-report-mode | ||
815 | log-view-mode | ||
816 | magit-log-mode | ||
817 | notmuch-search-mode | ||
818 | notmuch-tree-mode | ||
819 | org-agenda-mode | ||
820 | tabulated-list-mode)) | ||
821 | |||
822 | |||
823 | (setup browse-url | ||
824 | (:also-load +browse-url) | ||
825 | (:option browse-url-secondary-browser-function (if (executable-find "firefox") | ||
826 | 'browse-url-firefox | ||
827 | 'browse-url-default-browser) | ||
828 | browse-url-new-window-flag nil | ||
829 | browse-url-firefox-arguments '("--new-tab") | ||
830 | browse-url-firefox-new-window-is-tab t) | ||
831 | ;; Set up URL handlers. | ||
832 | (+browse-url-set-handlers | ||
833 | (list | ||
834 | (cons (rx ; images | ||
835 | "." (or "jpeg" "jpg" "png") eos) | ||
836 | (lambda (&rest args) | ||
837 | (apply | ||
838 | (cond ((executable-find "feh") '+browse-url-with-feh) | ||
839 | ((executable-find "mpv") '+browse-image-with-mpv) | ||
840 | (t 'eww-browse-url)) | ||
841 | args))) | ||
842 | (cons (rx ; videos | ||
843 | (or "youtube.com" "youtu.be" "yewtu.be" | ||
844 | (seq "." (or "mp4" "gif" "mov" "MOV") eos))) | ||
845 | (lambda (&rest args) | ||
846 | (apply (if (executable-find "mpv") | ||
847 | 'browse-url-mpv | ||
848 | browse-url-secondary-browser-function) | ||
849 | args))) | ||
850 | (cons (rx ; non-eww-friendly websites | ||
851 | (or | ||
852 | "github.com" | ||
853 | "gitlab.com" | ||
854 | "google.com" | ||
855 | "imgur.com" | ||
856 | "pixelfed" | ||
857 | "reddit.com" | ||
858 | "taskiq" | ||
859 | "twitter.com" | ||
860 | )) | ||
861 | browse-url-secondary-browser-function) | ||
862 | (cons "." ; everything else | ||
863 | 'eww-browse-url))) | ||
864 | ;; Transform URLs before passing to `browse-url' | ||
865 | (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" | ||
866 | "youtu.be")) | ||
867 | . "//yewtu.be"))) | ||
868 | (+browse-url-transform-url-global-mode +1)) | ||
869 | |||
870 | (setup (:straight-when pdf-tools | ||
871 | (eq system-type 'gnu/linux)) | ||
872 | (pdf-tools-install)) | ||
diff --git a/lisp/+browse-url.el b/lisp/+browse-url.el index fad0826..d073d50 100644 --- a/lisp/+browse-url.el +++ b/lisp/+browse-url.el | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | ;;; Code: | 3 | ;;; Code: |
4 | 4 | ||
5 | (require 'browse-url) | ||
5 | (require 'cl-lib) | 6 | (require 'cl-lib) |
6 | 7 | ||
7 | (defgroup +browse-url nil | 8 | (defgroup +browse-url nil |
diff --git a/lisp/+circe.el b/lisp/+circe.el index fc8d0be..7b11ce2 100644 --- a/lisp/+circe.el +++ b/lisp/+circe.el | |||
@@ -86,6 +86,13 @@ message the current topic.") | |||
86 | (with-current-buffer buf | 86 | (with-current-buffer buf |
87 | (+circe-quit@kill-buffer)))) | 87 | (+circe-quit@kill-buffer)))) |
88 | 88 | ||
89 | (defun +circe-quit-all@kill-emacs () | ||
90 | "Quit all circe buffers when killing Emacs." | ||
91 | (ignore-errors | ||
92 | (advice-remove 'circe-command-GQUIT | ||
93 | 'circe-gquit@kill-buffer) | ||
94 | (circe-command-GQUIT "Quitting Emacs, bye!"))) | ||
95 | |||
89 | ;;; Patches | 96 | ;;; Patches |
90 | 97 | ||
91 | (require 'el-patch) | 98 | (require 'el-patch) |
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index a858cf6..15e23da 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el | |||
@@ -101,6 +101,7 @@ Do this only if the buffer is not visiting a file." | |||
101 | show-paren-style 'mixed | 101 | show-paren-style 'mixed |
102 | show-paren-when-point-in-periphery t | 102 | show-paren-when-point-in-periphery t |
103 | show-paren-when-point-inside-paren t | 103 | show-paren-when-point-inside-paren t |
104 | tab-bar-show 1 | ||
104 | tramp-backup-directory-alist backup-directory-alist | 105 | tramp-backup-directory-alist backup-directory-alist |
105 | use-dialog-box nil | 106 | use-dialog-box nil |
106 | use-file-dialog nil | 107 | use-file-dialog nil |
@@ -231,12 +232,12 @@ Do this only if the buffer is not visiting a file." | |||
231 | save-place-forget-unreadable-files (eq system-type 'gnu/linux)) | 232 | save-place-forget-unreadable-files (eq system-type 'gnu/linux)) |
232 | (save-place-mode +1)) | 233 | (save-place-mode +1)) |
233 | 234 | ||
234 | (when (require 'tramp) | 235 | ;; (when (require 'tramp) |
235 | ;; thanks Irreal! https://irreal.org/blog/?p=895 | 236 | ;; ;; thanks Irreal! https://irreal.org/blog/?p=895 |
236 | (add-to-list 'tramp-default-proxies-alist | 237 | ;; (add-to-list 'tramp-default-proxies-alist |
237 | '(nil "\\`root\\'" "/ssh:%h:")) | 238 | ;; '(nil "\\`root\\'" "/ssh:%h:")) |
238 | (add-to-list 'tramp-default-proxies-alist | 239 | ;; (add-to-list 'tramp-default-proxies-alist |
239 | '((regexp-quote (system-name)) nil nil))) | 240 | ;; '((regexp-quote (system-name)) nil nil))) |
240 | 241 | ||
241 | (provide '+emacs) | 242 | (provide '+emacs) |
242 | ;;; +emacs.el ends here | 243 | ;;; +emacs.el ends here |
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 7c74f76..7615ea7 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el | |||
@@ -20,7 +20,7 @@ | |||
20 | (defun +modeline-buffer-name () ; gonsie | 20 | (defun +modeline-buffer-name () ; gonsie |
21 | "Display the buffer name." | 21 | "Display the buffer name." |
22 | (propertize | 22 | (propertize |
23 | (+string-align (buffer-name) 20 :before " " :ellipsis "… ") | 23 | (+string-align (buffer-name) 20 :before " " :ellipsis "~ ") |
24 | 'face 'bold | 24 | 'face 'bold |
25 | 'help-echo (or (buffer-file-name) | 25 | 'help-echo (or (buffer-file-name) |
26 | (buffer-name)) | 26 | (buffer-name)) |
@@ -49,7 +49,7 @@ | |||
49 | "Display the current `major-mode'." | 49 | "Display the current `major-mode'." |
50 | (concat " " | 50 | (concat " " |
51 | (propertize (+string-truncate (format-mode-line mode-name) | 51 | (propertize (+string-truncate (format-mode-line mode-name) |
52 | 12 "…") | 52 | 12 "~") |
53 | 'face 'bold | 53 | 'face 'bold |
54 | 'keymap mode-line-major-mode-keymap | 54 | 'keymap mode-line-major-mode-keymap |
55 | 'mouse-face 'mode-line-highlight))) | 55 | 'mouse-face 'mode-line-highlight))) |
@@ -108,6 +108,7 @@ The order of elements matters: whichever one matches first is applied." | |||
108 | "mouse-2: widen buffer.") | 108 | "mouse-2: widen buffer.") |
109 | 'local-map (purecopy (simple-modeline-make-mouse-map | 109 | 'local-map (purecopy (simple-modeline-make-mouse-map |
110 | 'mouse-2 'mode-line-widen)) | 110 | 'mouse-2 'mode-line-widen)) |
111 | 'face 'font-lock-doc-face | ||
111 | 'mouse-face 'mode-line-highlight)))) | 112 | 'mouse-face 'mode-line-highlight)))) |
112 | 113 | ||
113 | (define-minor-mode file-percentage-mode | 114 | (define-minor-mode file-percentage-mode |
@@ -161,5 +162,11 @@ The order of elements matters: whichever one matches first is applied." | |||
161 | (format (if (> text-scale-mode-amount 0) " (%+d)" " (%-d)") | 162 | (format (if (> text-scale-mode-amount 0) " (%+d)" " (%-d)") |
162 | text-scale-mode-amount))) | 163 | text-scale-mode-amount))) |
163 | 164 | ||
165 | (defun +modeline-ace-window-display () | ||
166 | "Display `ace-window-display-mode' information in the modeline." | ||
167 | '(+ace-window-display-mode | ||
168 | (ace-window-mode | ||
169 | (" " (:eval (window-parameter (selected-window) 'ace-window-path)))))) | ||
170 | |||
164 | (provide '+modeline) | 171 | (provide '+modeline) |
165 | ;;; +modeline.el ends here | 172 | ;;; +modeline.el ends here |
diff --git a/lisp/+org.el b/lisp/+org.el index 9a91ef1..5631fed 100644 --- a/lisp/+org.el +++ b/lisp/+org.el | |||
@@ -392,5 +392,11 @@ the deletion might narrow the column." | |||
392 | 'face '+org-script-markers))) | 392 | 'face '+org-script-markers))) |
393 | t))) | 393 | t))) |
394 | 394 | ||
395 | ;; Extra link types | ||
396 | |||
397 | (defun +org-tel-open (number _) | ||
398 | "Notify the user of what phone NUMBER to call." | ||
399 | (message "Call: %s" number)) | ||
400 | |||
395 | (provide '+org) | 401 | (provide '+org) |
396 | ;;; +org.el ends here | 402 | ;;; +org.el ends here |
diff --git a/lisp/+scratch.el b/lisp/+scratch.el index 976b08c..2a89a95 100644 --- a/lisp/+scratch.el +++ b/lisp/+scratch.el | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | ;;; Code: | 3 | ;;; Code: |
4 | 4 | ||
5 | (require 'scratch) | 5 | ;;(require 'scratch) |
6 | 6 | ||
7 | (defun +scratch-immortal () | 7 | (defun +scratch-immortal () |
8 | "Bury, don't kill \"*scratc*\" buffer. | 8 | "Bury, don't kill \"*scratc*\" buffer. |