summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-10-07 18:34:13 -0500
committerCase Duckworth2021-10-07 18:34:13 -0500
commitfcb03f1200560aab458255f7767bb7ad4e98b171 (patch)
tree7fe361de3b7315286070d89b4b59c438fdfe28c2
parentMerge branch 'main' of github.com:duckwork/.emacs.d (diff)
downloademacs-fcb03f1200560aab458255f7767bb7ad4e98b171.tar.gz
emacs-fcb03f1200560aab458255f7767bb7ad4e98b171.zip
Fix acdw/define-auto-insert
-rw-r--r--lisp/acdw-autoinsert.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/acdw-autoinsert.el b/lisp/acdw-autoinsert.el index a89bc80..bc0810a 100644 --- a/lisp/acdw-autoinsert.el +++ b/lisp/acdw-autoinsert.el
@@ -42,14 +42,17 @@ OPTIONS is a plist with three optional arguments:
42 (declare (indent 1)) 42 (declare (indent 1))
43 (let ((testfn (or (plist-get options :testfn) 43 (let ((testfn (or (plist-get options :testfn)
44 (lambda (a b) 44 (lambda (a b)
45 (string= (cdr a) (cdar b))))) 45 (string= (cdr-safe a) (cdar b)))))
46 (replace (or (plist-get options :replace) nil)) 46 (replace (or (plist-get options :replace) nil))
47 (after (or (plist-get options :after) nil))) 47 (after (or (plist-get options :after) nil)))
48 (when replace 48 (if replace
49 (setq auto-insert-alist 49 (progn (setq auto-insert-alist
50 (assoc-delete-all condition auto-insert-alist testfn))) 50 (assoc-delete-all (list condition)
51 (unless (assoc (list condition) auto-insert-alist testfn) 51 auto-insert-alist
52 (define-auto-insert condition action after)))) 52 testfn))
53 (define-auto-insert condition action after))
54 (unless (assoc (list condition) auto-insert-alist testfn)
55 (define-auto-insert condition action after)))))
53 56
54(provide 'acdw-autoinsert) 57(provide 'acdw-autoinsert)
55;;; acdw-autoinsert.el ends here 58;;; acdw-autoinsert.el ends here