From fdf3b2f659a6009533e9b702a11d589bddd7e155 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 31 Oct 2021 14:21:33 -0700 Subject: add paredit-space-for-delimiter-predicates entry for a few CL things --- .emacs.d/init-spw.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3