summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-10-31 14:21:33 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-10-31 14:21:33 -0700
commitfdf3b2f659a6009533e9b702a11d589bddd7e155 (patch)
tree91eb2eacbb3df6573da6678a34ac8db410bfc224
parent17738e54ee7c90e14f632907de9f27cd9429c634 (diff)
downloaddotfiles-fdf3b2f659a6009533e9b702a11d589bddd7e155.tar.gz
add paredit-space-for-delimiter-predicates entry for a few CL things
-rw-r--r--.emacs.d/init-spw.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 72c5478b..8a205790 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -2362,7 +2362,21 @@ mutt's review view, after exiting EDITOR."
(dolist (fun '(try-expand-line try-expand-list))
(setq hippie-expand-try-functions-list
(remq fun hippie-expand-try-functions-list))))
- (add-hook 'paredit-mode-hook #'spw/lisp-hippie-expand))
+ (add-hook 'paredit-mode-hook #'spw/lisp-hippie-expand)
+
+ (defun spw/paredit-no-space-after (endp delimiter)
+ (or endp
+ (let ((two-before (buffer-substring (- (point) 2) (point))))
+ (cl-case delimiter
+ (?\(
+ (not
+ (or (char-equal (char-before) ?,) (string= ",@" two-before))))
+ (?\"
+ (not
+ (or (string= "#P" two-before) (string= "#?" two-before))))
+ (t t)))))
+ (add-to-list
+ 'paredit-space-for-delimiter-predicates #'spw/paredit-no-space-after))
(spw/when-library-available elisp-slime-nav
(dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook))