diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw-autoinsert.el | 15 |
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 |