summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-05-04 20:02:17 -0500
committerCase Duckworth2021-05-04 20:02:17 -0500
commit7372de33554414f744f02e6e8bb45f71fee6980e (patch)
tree9bc3168cdc4a4b674be60f247e1e25b6c4dc60da
parentChange which-key setup (diff)
parentRemap C-w to backward-kill-word if the region isn't active (diff)
downloademacs-7372de33554414f744f02e6e8bb45f71fee6980e.tar.gz
emacs-7372de33554414f744f02e6e8bb45f71fee6980e.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
-rw-r--r--early-init.el4
-rw-r--r--gnus.el9
-rw-r--r--init.el99
-rw-r--r--lisp/acdw.el9
4 files changed, 73 insertions, 48 deletions
diff --git a/early-init.el b/early-init.el index 25bc58c..3f1ebb0 100644 --- a/early-init.el +++ b/early-init.el
@@ -85,7 +85,7 @@
85 (:home "DejaVu Sans") 85 (:home "DejaVu Sans")
86 (:work "Calibri") 86 (:work "Calibri")
87 (:other "sans-serif")) 87 (:other "sans-serif"))
88 acdw-fonts/variable-size 11) 88 acdw-fonts/variable-size 12)
89 (acdw-fonts/set) 89 (acdw-fonts/set)
90 (acdw-fonts/setup-emoji-fonts "Segoe UI Emoji" 90 (acdw-fonts/setup-emoji-fonts "Segoe UI Emoji"
91 "Noto Color Emoji" 91 "Noto Color Emoji"
@@ -95,7 +95,7 @@
95 (acdw/setup-fringes) 95 (acdw/setup-fringes)
96 ;; only run this once 96 ;; only run this once
97 (remove-function after-focus-change-function 97 (remove-function after-focus-change-function
98 'hook--setup-fonts))) 98 'acdw/first-frame-setup)))
99 99
100 100
101;;; Bootstrap package manager (`straight.el') 101;;; Bootstrap package manager (`straight.el')
diff --git a/gnus.el b/gnus.el index c5c96a3..1b550f1 100644 --- a/gnus.el +++ b/gnus.el
@@ -45,6 +45,15 @@
45 gnus-use-cache t 45 gnus-use-cache t
46 gnus-read-active-file 'some) 46 gnus-read-active-file 'some)
47 47
48;; Keybindings
49(define-key gnus-group-mode-map (kbd "q")
50 (defun gnus-cloud-upload-and-bury-buffer ()
51 (interactive)
52 (gnus-cloud-upload-all-data)
53 (bury-buffer)))
54(define-key gnus-group-mode-map (kbd "Q") #'gnus-group-exit)
55(define-key gnus-group-mode-map (kbd "C-q") #'gnus-group-quit)
56
48;;; Other parameters 57;;; Other parameters
49(setq gnus-parameters 58(setq gnus-parameters
50 '(("nnimap\\.*" 59 '(("nnimap\\.*"
diff --git a/init.el b/init.el index fdb28c5..07f856c 100644 --- a/init.el +++ b/init.el
@@ -53,9 +53,6 @@
53 no-littering-var-directory (acdw/dir)) 53 no-littering-var-directory (acdw/dir))
54 (require 'no-littering)) 54 (require 'no-littering))
55 55
56;;;; `idle-require'
57(setup (:straight idle-require))
58
59;;;; My packages 56;;;; My packages
60(when-let ((default-directory 57(when-let ((default-directory
61 (expand-file-name-exists-p "pkg/" user-emacs-directory))) 58 (expand-file-name-exists-p "pkg/" user-emacs-directory)))
@@ -266,8 +263,6 @@
266 (:option eshell-directory-name (acdw/dir "eshell/" t) 263 (:option eshell-directory-name (acdw/dir "eshell/" t)
267 eshell-aliases-file (acdw/dir "eshell/aliases" t)) 264 eshell-aliases-file (acdw/dir "eshell/aliases" t))
268 265
269 (idle-require 'eshell)
270
271 (defun eshell-quit-or-delete-char (arg) 266 (defun eshell-quit-or-delete-char (arg)
272 "Delete the character to the right, or quit eshell on an empty line." 267 "Delete the character to the right, or quit eshell on an empty line."
273 (interactive "p") 268 (interactive "p")
@@ -346,8 +341,6 @@
346 (when (not (file-exists-p gnus-directory)) 341 (when (not (file-exists-p gnus-directory))
347 (make-directory gnus-directory :parents)) 342 (make-directory gnus-directory :parents))
348 343
349 (idle-require 'gnus)
350
351 (:leader "m" gnus)) 344 (:leader "m" gnus))
352 345
353(setup imenu 346(setup imenu
@@ -563,7 +556,9 @@
563 w32-pass-apps-to-system nil 556 w32-pass-apps-to-system nil
564 w32-apps-modifier 'hyper)) 557 w32-apps-modifier 'hyper))
565 558
566;; "Et cetera" settings 559;;; "Et cetera" settings
560;; This should stay as /minimal/ as possible. Anything that can go somewhere
561;; else /should/ go there.
567(setup emacs 562(setup emacs
568 (:option disabled-command-function nil 563 (:option disabled-command-function nil
569 load-prefer-newer t 564 load-prefer-newer t
@@ -573,8 +568,12 @@
573 attempt-orderly-shutdown-on-fatal-signal nil 568 attempt-orderly-shutdown-on-fatal-signal nil
574 find-function-C-source-directory (acdw/find-emacs-source)) 569 find-function-C-source-directory (acdw/find-emacs-source))
575 570
576 (:global "M-=" count-words) 571 (:global "M-=" count-words
572 "C-w" acdw/kill-region-or-backward-word)
577 573
574 ;; Remap C-h to DEL -- <f1> can be the "help" key
575 (define-key key-translation-map [?\C-h] [?\C-?])
576
578 (:leader "C-c" save-buffers-kill-emacs 577 (:leader "C-c" save-buffers-kill-emacs
579 "t" acdw/insert-iso-date)) 578 "t" acdw/insert-iso-date))
580 579
@@ -613,10 +612,52 @@
613 (eval-after-load "isearch" 612 (eval-after-load "isearch"
614 '(define-key isearch-mode-map (kbd "C-'") #'avy-isearch))) 613 '(define-key isearch-mode-map (kbd "C-'") #'avy-isearch)))
615 614
616(setup (:straight (beginend 615(setup (:straight (beginend))
617 :fork (:repo "duckwork/beginend")))
618 (beginend-global-mode +1)) 616 (beginend-global-mode +1))
619 617
618(setup common-lisp-ide
619 (defvar acdw/cl-ide :sly)
620 (defvar acdw/lisp-bin (or (executable-find "sbcl")
621 (executable-find "clisp")))
622 (:needs acdw/lisp-bin)
623 (:option inferior-lisp-program acdw/lisp-bin)
624
625 (setup (:straight clhs))
626
627 (pcase acdw/cl-ide
628 (:slime
629 (setup (:straight slime)
630 (:also-load slime-autoloads)
631
632 (when-let ((slime-helper (or (expand-file-name-exists-p
633 "~/quicklisp/slime-helper.el")
634 (expand-file-name-exists-p
635 "~/var/quicklisp/slime-helper.el"))))
636 (load slime-helper))
637
638 (define-key slime-repl-mode-map (kbd "RET") #'slime-repl-return-at-end)
639 (define-key slime-repl-mode-map (kbd "<return>")
640 #'slime-repl-return-at-end)
641
642 (defun slime-repl-return-at-end ()
643 (interactive)
644 (if (<= (point-max) (point))
645 (slime-repl-return)
646 (slime-repl-newline-and-indent)))
647
648
649 (with-eval-after-load 'company
650 (setup (:straight slime-company)
651 (:option slime-company-completion 'fuzzy
652 slime-company-after-completion nil)
653 (slime-setup '(slime-fancy slime-company))))))
654
655 (:sly
656 (setup (:straight sly)
657 (:option sly-kill-without-query-p t)
658
659 (:also-load sly-autoloads)))))
660
620(setup (:straight (consult 661(setup (:straight (consult
621 :host github 662 :host github
622 :repo "minad/consult")) 663 :repo "minad/consult"))
@@ -749,9 +790,7 @@ if ripgrep is installed, otherwise `consult-grep'."
749 (require 'gemini-write)))) 790 (require 'gemini-write))))
750 791
751(setup (:straight expand-region) 792(setup (:straight expand-region)
752 (:global "C-=" er/expand-region) 793 (:global "C-=" er/expand-region))
753
754 (idle-require 'expand-region))
755 794
756(setup (:straight fennel-mode) 795(setup (:straight fennel-mode)
757 (:needs "fennel") 796 (:needs "fennel")
@@ -763,36 +802,6 @@ if ripgrep is installed, otherwise `consult-grep'."
763 802
764(setup (:straight geiser)) 803(setup (:straight geiser))
765 804
766(setup common-lisp-ide
767 (defvar acdw/cl-ide :sly)
768 (defvar acdw/lisp-bin (or (executable-find "sbcl")
769 (executable-find "clisp")))
770 (:needs acdw/lisp-bin)
771 (:option inferior-lisp-program acdw/lisp-bin)
772
773 (pcase acdw/cl-ide
774 (:slime
775 (setup (:straight slime)
776 (:also-load slime-autoloads)
777
778 (when-let ((slime-helper (or (expand-file-name-exists-p
779 "~/quicklisp/slime-helper.el")
780 (expand-file-name-exists-p
781 "~/var/quicklisp/slime-helper.el"))))
782 (load slime-helper))
783
784 (with-eval-after-load 'company
785 (setup (:straight slime-company)
786 (:option slime-company-completion 'fuzzy
787 slime-company-after-completion nil)
788 (slime-setup '(slime-fancy slime-company))))))
789
790 (:sly
791 (setup (:straight sly)
792 (:option sly-kill-without-query-p t)
793
794 (:also-load sly-autoloads)))))
795
796(setup (:straight (gemini-mode 805(setup (:straight (gemini-mode
797 :host nil 806 :host nil
798 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) 807 :repo "https://git.carcosa.net/jmcbray/gemini.el.git"))
@@ -901,8 +910,6 @@ if ripgrep is installed, otherwise `consult-grep'."
901 org-tags-column (- 0 fill-column -3) 910 org-tags-column (- 0 fill-column -3)
902 org-directory "~/org") 911 org-directory "~/org")
903 912
904 (idle-require 'org)
905
906 (:bind "RET" acdw-org/return-dwim 913 (:bind "RET" acdw-org/return-dwim
907 "<S-return>" acdw-org/org-table-copy-down) 914 "<S-return>" acdw-org/org-table-copy-down)
908 915
diff --git a/lisp/acdw.el b/lisp/acdw.el index f297691..a798069 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -29,6 +29,8 @@
29 29
30 30
31;;; Utility functions 31;;; Utility functions
32;; I don't prefix these because ... reasons. Honestly I probably should prefix
33;; them.
32 34
33(defun dos2unix (buffer) 35(defun dos2unix (buffer)
34 "Replace \r\n with \n in BUFFER." 36 "Replace \r\n with \n in BUFFER."
@@ -58,6 +60,13 @@ each hook in HOOKS."
58 ,@(dolist (hook hook-list hook-defun-add-hook-list) 60 ,@(dolist (hook hook-list hook-defun-add-hook-list)
59 (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list))))) 61 (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list)))))
60 62
63(defun kill-region-or-backward-word (arg)
64 "Kill region if active, or backward word if not."
65 (interactive "p")
66 (if (region-active-p)
67 (kill-region (region-beginning) (region-end))
68 (backward-kill-word arg)))
69
61(defmacro when-unfocused (name &rest forms) 70(defmacro when-unfocused (name &rest forms)
62 "Define a function NAME, executing FORMS, that fires when Emacs 71 "Define a function NAME, executing FORMS, that fires when Emacs
63is unfocused." 72is unfocused."