about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-10-02 00:04:16 -0500
committerCase Duckworth2021-10-02 00:04:16 -0500
commit96407712a799d06e4b24d50c84b4350233f04d98 (patch)
treea29d67e6648f2a6cddebe244eb40e01c20737d01
parentReorganize and shit (diff)
downloademacs-96407712a799d06e4b24d50c84b4350233f04d98.tar.gz
emacs-96407712a799d06e4b24d50c84b4350233f04d98.zip
Lisp stuff
-rw-r--r--init.el79
1 files changed, 58 insertions, 21 deletions
diff --git a/init.el b/init.el index 25aaad6..52eab26 100644 --- a/init.el +++ b/init.el
@@ -379,8 +379,9 @@
379 "Toggle `lexical-binding' in the current buffer." 379 "Toggle `lexical-binding' in the current buffer."
380 (interactive) 380 (interactive)
381 (setq lexical-binding (not lexical-binding)) 381 (setq lexical-binding (not lexical-binding))
382 (message "Lexical-binding is %s" 382 (message "Lexical-binding is %sabled."
383 (if lexical-binding "on." "off."))))) 383 (if lexical-binding "en" "dis"))
384 (force-mode-line-update))))
384 385
385 386
386 (:with-map case-map 387 (:with-map case-map
@@ -723,7 +724,7 @@ specific to most general, they are these:
723 smie-indent-basic tab-width) 724 smie-indent-basic tab-width)
724 725
725 (:hook #'show-paren-mode 726 (:hook #'show-paren-mode
726 #'electric-pair-local-mode 727 ;; #'electric-pair-local-mode
727 #'acdw/setup-fringes 728 #'acdw/setup-fringes
728 #'display-fill-column-indicator-mode 729 #'display-fill-column-indicator-mode
729 730
@@ -774,13 +775,14 @@ specific to most general, they are these:
774(setup scratch 775(setup scratch
775 (:option inhibit-startup-screen t 776 (:option inhibit-startup-screen t
776 initial-buffer-choice t 777 initial-buffer-choice t
777 initial-scratch-message "" 778 initial-major-mode #'lisp-interaction-mode
778 ;; (concat ";; Howdy, " 779 lexical-binding t
779 ;; (nth 0 (split-string 780 initial-scratch-message
780 ;; user-full-name)) 781 (concat ";; Howdy, "
781 ;; "! " 782 (nth 0 (split-string
782 ;; "Welcome to GNU Emacs.\n\n") 783 user-full-name))
783 ) 784 "! "
785 "Welcome to GNU Emacs.\n\n"))
784 786
785 (add-hook 'kill-buffer-query-functions 787 (add-hook 'kill-buffer-query-functions
786 (defun kill-buffer-query@immortal-scratch () 788 (defun kill-buffer-query@immortal-scratch ()
@@ -2110,17 +2112,18 @@ the default is \"/\"."
2110 (:file-match (rx ".pdf" eos)) 2112 (:file-match (rx ".pdf" eos))
2111 (pdf-loader-install)) 2113 (pdf-loader-install))
2112 2114
2113(setup (:straight persistent-scratch) 2115;; (setup (:straight persistent-scratch)
2114 (:option persistent-scratch-backup-directory (acdw/dir "scratch" t) 2116;; (:option persistent-scratch-backup-directory (acdw/dir "scratch" t)
2115 persistent-scratch-keep-n-newest-backups 12) 2117;; persistent-scratch-keep-n-newest-backups 12
2118;; persistent-scratch-what-to-save '(point))
2116 2119
2117 (persistent-scratch-setup-default) 2120;; (persistent-scratch-setup-default)
2118 2121
2119 (mapc (lambda (buf) 2122;; (mapc (lambda (buf)
2120 (with-current-buffer buf 2123;; (with-current-buffer buf
2121 (when (funcall persistent-scratch-scratch-buffer-p-function) 2124;; (when (funcall persistent-scratch-scratch-buffer-p-function)
2122 (persistent-scratch-mode +1)))) 2125;; (persistent-scratch-mode +1))))
2123 (buffer-list))) 2126;; (buffer-list)))
2124 2127
2125(setup (:straight restart-emacs) 2128(setup (:straight restart-emacs)
2126 (defun emacs-upgrade (&optional update-packages) 2129 (defun emacs-upgrade (&optional update-packages)
@@ -2140,6 +2143,8 @@ the default is \"/\"."
2140 (:bind "M-!" shell-command+)) 2143 (:bind "M-!" shell-command+))
2141 (:global "M-!" shell-command+)) 2144 (:global "M-!" shell-command+))
2142 2145
2146(setup (:straight sicp))
2147
2143(setup (:straight simple-modeline 2148(setup (:straight simple-modeline
2144 minions) 2149 minions)
2145 (:also-load acdw-modeline) 2150 (:also-load acdw-modeline)
@@ -2222,8 +2227,40 @@ the default is \"/\"."
2222 2227
2223(setup (:straight smartparens) 2228(setup (:straight smartparens)
2224 (require 'smartparens-config) 2229 (require 'smartparens-config)
2225 (add-hook 'prog-mode #'smartparens-strict-mode)) 2230 (sp-use-paredit-bindings)
2226 2231 (add-to-list 'sp-lisp-modes 'fennel-mode :append)
2232
2233 (dolist (mode '(cider-repl-mode-hook
2234 clojure-mode-hook
2235 common-lisp-mode-hook
2236 emacs-lisp-mode-hook
2237 fennel-mode-hook
2238 geiser-repl-mode-hook
2239 inferior-emacs-lisp-mode-hook
2240 inferior-lisp-mode-hook
2241 lisp-mode-hook
2242 racket-mode-hook
2243 racket-repl-mode-hook
2244 scheme-mode-hook
2245 sly-mrepl-mode-hook))
2246 (add-hook mode #'smartparens-strict-mode))
2247
2248 (dolist (mode '(eval-expression-minibuffer-setup-hook
2249 lisp-data-mode-hook))
2250 (add-hook mode #'aorst/minibuffer-enable-sp))
2251
2252 (add-hook 'prog-mode #'smartparens-mode)
2253
2254 (defun aorst/minibuffer-enable-sp ()
2255 "Enable `smartparens-strict-mode' in the minibuffer, during `eval-expression'."
2256 (setq-local comment-start ";")
2257 (sp-local-pair 'minibuffer-pairs "'" nil :actions nil)
2258 (sp-local-pair 'minibuffer-pairs "`" nil :actions nil)
2259 (sp-update-local-pairs 'minibuffer-pairs)
2260 (smartparens-strict-mode 1))
2261
2262 (:bind "C-M-q" #'sp-indent-defun
2263 "M-r" #'sp-rewrap-sexp))
2227(setup (:straight ssh-config-mode) 2264(setup (:straight ssh-config-mode)
2228 (:file-match (rx "/.ssh/config" eos) 2265 (:file-match (rx "/.ssh/config" eos)
2229 (rx "/ssh" (? "d") "_config" eos)) 2266 (rx "/ssh" (? "d") "_config" eos))