From: Eshel Yaron Date: Fri, 18 Nov 2022 10:05:37 +0000 (+0200) Subject: Use define-auto-insert instead of manual add-to-list X-Git-Tag: V8.5.20-sweep-0.8.9~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2d1a7bbb3932784444704f73e721a6d8b93b7cc8;p=sweep.git Use define-auto-insert instead of manual add-to-list --- diff --git a/sweeprolog.el b/sweeprolog.el index 56f7277..36523e5 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -3348,24 +3348,32 @@ certain contexts to maintain conventional Prolog layout." #'sweeprolog-analyze-fragment-variable nil t) (cursor-sensor-mode 1))) -(add-to-list 'auto-insert-alist - '((sweeprolog-mode . "SWI-Prolog module header") - (or (and (buffer-file-name) - (file-name-sans-extension (file-name-base (buffer-file-name)))) - (read-string "Module name: ")) - "/*" - "\n Author: " - (progn user-full-name) - "\n Email: " - (progn user-mail-address) - (progn sweeprolog-module-header-comment-skeleton) - "\n*/" - "\n\n:- module(" - str - ", [])." - "\n\n/** " - - - "\n\n*/\n\n")) + +;;;; Auto-insert Prolog module header + +(defconst sweeprolog-module-header-skeleton + '((or (and (buffer-file-name) + (file-name-sans-extension + (file-name-base (buffer-file-name)))) + (read-string "Module name: ")) + "/*" + "\n Author: " + (progn user-full-name) + "\n Email: " + (progn user-mail-address) + (progn sweeprolog-module-header-comment-skeleton) + "\n*/" + "\n\n:- module(" + str + ", [])." + "\n\n/** " + - + "\n\n*/\n\n") + "Prolog module header skeleton inserted by \\[auto-insert].") + +(define-auto-insert + '(sweeprolog-mode . "SWI-Prolog module header") + sweeprolog-module-header-skeleton) ;;;; Indentation