From 7bee3489efdcaa2002c294bf9bf18f02cc9218f2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 09:10:36 -0500 Subject: Add slime-repl-return-at-end Get the benefits of paredit with easy keys in the REPL! --- init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.el b/init.el index 934f3db..5452a0d 100644 --- a/init.el +++ b/init.el @@ -770,6 +770,17 @@ if ripgrep is installed, otherwise `consult-grep'." "~/var/quicklisp/slime-helper.el")))) (load slime-helper)) + (define-key slime-repl-mode-map (kbd "RET") #'slime-repl-return-at-end) + (define-key slime-repl-mode-map (kbd "") + #'slime-repl-return-at-end) + + (defun slime-repl-return-at-end () + (interactive) + (if (<= (point-max) (point)) + (slime-repl-return) + (slime-repl-newline-and-indent))) + + (with-eval-after-load 'company (setup (:straight slime-company) (:option slime-company-completion 'fuzzy -- cgit 1.4.1-21-gabe81 From 278990cb9b7ba672b879b6826f82cf34a18926b1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 09:54:59 -0500 Subject: Change gnus-group-mode keybindings To save some time, I remap 'q' to bury the Gnus buffer, but to keep the functionality, I moved the original bindings (gnus-group-exit, gnus-group-quit) to 'Q' and '^Q', respectively. --- gnus.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.el b/gnus.el index db7b0c9..b7fd69e 100644 --- a/gnus.el +++ b/gnus.el @@ -89,6 +89,11 @@ gnus-read-newsrc-file nil gnus-interactive-exit nil) +;; Keybindings +(define-key gnus-group-mode-map (kbd "q") #'bury-buffer) +(define-key gnus-group-mode-map (kbd "Q") #'gnus-group-exit) +(define-key gnus-group-mode-map (kbd "C-q") #'gnus-group-quit) + ;;; Other parameters (setq gnus-parameters '(("nnimap\\.*" -- cgit 1.4.1-21-gabe81 From 117727151ffb86f8aa9f1f0dcdc0e99fd227a2a9 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 09:57:13 -0500 Subject: Only show 200 messages in IMAP --- gnus.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnus.el b/gnus.el index b7fd69e..886297b 100644 --- a/gnus.el +++ b/gnus.el @@ -97,7 +97,7 @@ ;;; Other parameters (setq gnus-parameters '(("nnimap\\.*" - (display . all)))) + (display . 200)))) ;;; Gnus UI options (setq gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date -- cgit 1.4.1-21-gabe81 From 2166e0f3231be7963ca2ccf746a04ec90c3c0820 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 09:57:43 -0500 Subject: Go back to OG beginend I think the author fixed the issue. --- init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.el b/init.el index a528896..55abfd0 100644 --- a/init.el +++ b/init.el @@ -614,8 +614,7 @@ (eval-after-load "isearch" '(define-key isearch-mode-map (kbd "C-'") #'avy-isearch))) -(setup (:straight (beginend - :fork (:repo "duckwork/beginend"))) +(setup (:straight (beginend)) (beginend-global-mode +1)) (setup (:straight (consult -- cgit 1.4.1-21-gabe81 From a4c3a6d3b959243d7f17f883b6e19f4d39e85e92 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 09:58:16 -0500 Subject: Add clhs and move common-lisp-ide to be in alpha order --- init.el | 84 +++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/init.el b/init.el index 55abfd0..c17714e 100644 --- a/init.el +++ b/init.el @@ -617,6 +617,49 @@ (setup (:straight (beginend)) (beginend-global-mode +1)) +(setup common-lisp-ide + (defvar acdw/cl-ide :sly) + (defvar acdw/lisp-bin (or (executable-find "sbcl") + (executable-find "clisp"))) + (:needs acdw/lisp-bin) + (:option inferior-lisp-program acdw/lisp-bin) + + (setup (:straight clhs)) + + (pcase acdw/cl-ide + (:slime + (setup (:straight slime) + (:also-load slime-autoloads) + + (when-let ((slime-helper (or (expand-file-name-exists-p + "~/quicklisp/slime-helper.el") + (expand-file-name-exists-p + "~/var/quicklisp/slime-helper.el")))) + (load slime-helper)) + + (define-key slime-repl-mode-map (kbd "RET") #'slime-repl-return-at-end) + (define-key slime-repl-mode-map (kbd "") + #'slime-repl-return-at-end) + + (defun slime-repl-return-at-end () + (interactive) + (if (<= (point-max) (point)) + (slime-repl-return) + (slime-repl-newline-and-indent))) + + + (with-eval-after-load 'company + (setup (:straight slime-company) + (:option slime-company-completion 'fuzzy + slime-company-after-completion nil) + (slime-setup '(slime-fancy slime-company)))))) + + (:sly + (setup (:straight sly) + (:option sly-kill-without-query-p t) + + (:also-load sly-autoloads))))) + (setup (:straight (consult :host github :repo "minad/consult")) @@ -763,47 +806,6 @@ if ripgrep is installed, otherwise `consult-grep'." (setup (:straight geiser)) -(setup common-lisp-ide - (defvar acdw/cl-ide :sly) - (defvar acdw/lisp-bin (or (executable-find "sbcl") - (executable-find "clisp"))) - (:needs acdw/lisp-bin) - (:option inferior-lisp-program acdw/lisp-bin) - - (pcase acdw/cl-ide - (:slime - (setup (:straight slime) - (:also-load slime-autoloads) - - (when-let ((slime-helper (or (expand-file-name-exists-p - "~/quicklisp/slime-helper.el") - (expand-file-name-exists-p - "~/var/quicklisp/slime-helper.el")))) - (load slime-helper)) - - (define-key slime-repl-mode-map (kbd "RET") #'slime-repl-return-at-end) - (define-key slime-repl-mode-map (kbd "") - #'slime-repl-return-at-end) - - (defun slime-repl-return-at-end () - (interactive) - (if (<= (point-max) (point)) - (slime-repl-return) - (slime-repl-newline-and-indent))) - - - (with-eval-after-load 'company - (setup (:straight slime-company) - (:option slime-company-completion 'fuzzy - slime-company-after-completion nil) - (slime-setup '(slime-fancy slime-company)))))) - - (:sly - (setup (:straight sly) - (:option sly-kill-without-query-p t) - - (:also-load sly-autoloads))))) - (setup (:straight (gemini-mode :host nil :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) -- cgit 1.4.1-21-gabe81 From ea9318e5f9eb1f64337d880911054385d473662f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 11:42:32 -0500 Subject: Change default variable-width font size Also fix a typo in hook name. --- early-init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 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 @@ (:home "DejaVu Sans") (:work "Calibri") (:other "sans-serif")) - acdw-fonts/variable-size 11) + acdw-fonts/variable-size 12) (acdw-fonts/set) (acdw-fonts/setup-emoji-fonts "Segoe UI Emoji" "Noto Color Emoji" @@ -95,7 +95,7 @@ (acdw/setup-fringes) ;; only run this once (remove-function after-focus-change-function - 'hook--setup-fonts))) + 'acdw/first-frame-setup))) ;;; Bootstrap package manager (`straight.el') -- cgit 1.4.1-21-gabe81 From 91a22256da368b20ed1ec96523db77c3e98e6439 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 12:23:21 -0500 Subject: Remove `idle-require' It wasn't ... sparking joy. --- init.el | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/init.el b/init.el index c17714e..e38a135 100644 --- a/init.el +++ b/init.el @@ -53,10 +53,6 @@ no-littering-var-directory (acdw/dir)) (require 'no-littering)) -;;;; `idle-require' -(setup (:straight idle-require) - (idle-require-mode +1)) - ;;;; My packages (when-let ((default-directory (expand-file-name-exists-p "pkg/" user-emacs-directory))) @@ -267,8 +263,6 @@ (:option eshell-directory-name (acdw/dir "eshell/" t) eshell-aliases-file (acdw/dir "eshell/aliases" t)) - (idle-require 'eshell) - (defun eshell-quit-or-delete-char (arg) "Delete the character to the right, or quit eshell on an empty line." (interactive "p") @@ -347,8 +341,6 @@ (when (not (file-exists-p gnus-directory)) (make-directory gnus-directory :parents)) - (idle-require 'gnus) - (:leader "m" gnus)) (setup imenu @@ -792,9 +784,7 @@ if ripgrep is installed, otherwise `consult-grep'." (require 'gemini-write)))) (setup (:straight expand-region) - (:global "C-=" er/expand-region) - - (idle-require 'expand-region)) + (:global "C-=" er/expand-region)) (setup (:straight fennel-mode) (:needs "fennel") @@ -914,8 +904,6 @@ if ripgrep is installed, otherwise `consult-grep'." org-tags-column (- 0 fill-column -3) org-directory "~/org") - (idle-require 'org) - (:bind "RET" acdw-org/return-dwim "" acdw-org/org-table-copy-down) -- cgit 1.4.1-21-gabe81 From 8927cf5a8930e14d518f6e1ba2e8a01660d8ec01 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 12:55:12 -0500 Subject: Make sure gnus uploads all data to the cloud before burying buffer --- gnus.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnus.el b/gnus.el index 886297b..35e9a51 100644 --- a/gnus.el +++ b/gnus.el @@ -90,7 +90,11 @@ gnus-interactive-exit nil) ;; Keybindings -(define-key gnus-group-mode-map (kbd "q") #'bury-buffer) +(define-key gnus-group-mode-map (kbd "q") + (defun gnus-cloud-upload-and-bury-buffer () + (interactive) + (gnus-cloud-upload-all-data) + (bury-buffer))) (define-key gnus-group-mode-map (kbd "Q") #'gnus-group-exit) (define-key gnus-group-mode-map (kbd "C-q") #'gnus-group-quit) -- cgit 1.4.1-21-gabe81 From 388dc3c704e738f36153e49cfc8697153973368a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 17:27:09 -0500 Subject: Remap C-h to DEL --- init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index e38a135..f520e02 100644 --- a/init.el +++ b/init.el @@ -556,7 +556,9 @@ w32-pass-apps-to-system nil w32-apps-modifier 'hyper)) -;; "Et cetera" settings +;;; "Et cetera" settings +;; This should stay as /minimal/ as possible. Anything that can go somewhere +;; else /should/ go there. (setup emacs (:option disabled-command-function nil load-prefer-newer t @@ -568,6 +570,9 @@ (:global "M-=" count-words) + ;; Remap C-h to DEL -- can be the "help" key + (define-key key-translation-map [?\C-h] [?\C-?]) + (:leader "C-c" save-buffers-kill-emacs "t" acdw/insert-iso-date)) -- cgit 1.4.1-21-gabe81 From 9e0e42554e0c2619fcb4ce8a8b48da4288c44298 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 May 2021 17:27:36 -0500 Subject: Remap C-w to backward-kill-word if the region isn't active --- init.el | 3 ++- lisp/acdw.el | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index f520e02..ef50dc7 100644 --- a/init.el +++ b/init.el @@ -568,7 +568,8 @@ attempt-orderly-shutdown-on-fatal-signal nil find-function-C-source-directory (acdw/find-emacs-source)) - (:global "M-=" count-words) + (:global "M-=" count-words + "C-w" acdw/kill-region-or-backward-word) ;; Remap C-h to DEL -- can be the "help" key (define-key key-translation-map [?\C-h] [?\C-?]) 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 @@ ;;; Utility functions +;; I don't prefix these because ... reasons. Honestly I probably should prefix +;; them. (defun dos2unix (buffer) "Replace \r\n with \n in BUFFER." @@ -58,6 +60,13 @@ each hook in HOOKS." ,@(dolist (hook hook-list hook-defun-add-hook-list) (push `(add-hook ',hook #',func-name) hook-defun-add-hook-list))))) +(defun kill-region-or-backward-word (arg) + "Kill region if active, or backward word if not." + (interactive "p") + (if (region-active-p) + (kill-region (region-beginning) (region-end)) + (backward-kill-word arg))) + (defmacro when-unfocused (name &rest forms) "Define a function NAME, executing FORMS, that fires when Emacs is unfocused." -- cgit 1.4.1-21-gabe81