From fd58b21f9af92ebf0bc37cf53eec05feacbe0780 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 10 Mar 2021 11:24:46 -0700 Subject: dynamically regenerate emacs/put-forms.el at package build time Signed-off-by: Sean Whitton --- .gitignore | 1 + debian/changelog | 2 +- debian/control | 6 ++++++ emacs/Makefile | 8 ++++++++ emacs/put-forms.el | 13 ------------- src/property.lisp | 21 +++++++++------------ 6 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 emacs/put-forms.el diff --git a/.gitignore b/.gitignore index 2d38eb6..0972ba5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /doc/_build/ +/emacs/put-forms.el /emacs/consfigurator.el diff --git a/debian/changelog b/debian/changelog index 2a583c6..d4558ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ consfigurator (0.2.1-2) UNRELEASED; urgency=medium * Install consfigurator.el using dh_elpa - - Add build-dep on dh-elpa + - Add build-deps on dh-elpa, each cl-* package used by Consfigurator, sbcl - Add Provides: elpa-consfigurator. -- Sean Whitton Tue, 09 Mar 2021 23:23:03 -0700 diff --git a/debian/control b/debian/control index fd9ab8a..1815d01 100644 --- a/debian/control +++ b/debian/control @@ -3,9 +3,15 @@ Section: admin Priority: optional Maintainer: Sean Whitton Build-Depends: + cl-alexandria, + cl-babel, + cl-cffi, + cl-interpol, + cl-ppcre, debhelper-compat (= 13), dh-elpa, python3-sphinx, + sbcl, sphinx-common, texinfo, Standards-Version: 4.5.1 diff --git a/emacs/Makefile b/emacs/Makefile index 1c29533..3f9309c 100644 --- a/emacs/Makefile +++ b/emacs/Makefile @@ -1,6 +1,14 @@ +LOAD = '(let ((asdf:*user-cache* "/tmp") \ + (asdf:*central-registry* (list (truename "..")))) \ + (asdf:load-system "consfigurator"))' + SUBSTITUTE = 'BEGIN { open FH, "<", "put-forms.el"; \ chomp($$forms = join "", map s/^/ /r, grep /^\(put/, ) } \ s/ \@putforms@/$$forms/' consfigurator.el: consfigurator.el.in put-forms.el perl -wpe$(SUBSTITUTE) consfigurator.el.in >consfigurator.el + +put-forms.el: + sbcl --disable-debugger --eval '(require "asdf")' --eval $(LOAD) \ + --eval '(consfigurator::dump-properties-for-emacs "$@")' --quit diff --git a/emacs/put-forms.el b/emacs/put-forms.el deleted file mode 100644 index 91273bb..0000000 --- a/emacs/put-forms.el +++ /dev/null @@ -1,13 +0,0 @@ -;; automatically generated by -;; CONSFIGURATOR::DUMP-PROPERTIES-FOR-EMACS; do not edit - -(put 'consfigurator:deploys. 'common-lisp-indent-function '2) -(put 'consfigurator:deploys-these. 'common-lisp-indent-function '2) -(put 'file:has-content 'common-lisp-indent-function '1) -(put 'file:has-content. 'common-lisp-indent-function '1) -(put 'file:contains-lines. 'common-lisp-indent-function '1) -(put 'file:data-uploaded. 'common-lisp-indent-function '2) -(put 'file:secret-uploaded. 'common-lisp-indent-function '2) -(put 'file:regex-replaced-lines. 'common-lisp-indent-function '2) -(put 'os:debian-stable. 'common-lisp-indent-function '1) -(put 'chroot:%os-bootstrapped. 'common-lisp-indent-function '2) diff --git a/src/property.lisp b/src/property.lisp index 11acab9..2aeb836 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -106,18 +106,15 @@ (defvar *properties-for-emacs* nil "List of properties whose symbols have Emacs indentation information.") -(defun dump-properties-for-emacs (dir) - (with-current-directory (dir) - (with-open-file (s "emacs/put-forms.el" - :direction :output :if-exists :supersede) - (format s ";; automatically generated by~%") - (format s ";; CONSFIGURATOR::DUMP-PROPERTIES-FOR-EMACS; do not edit~%~%") - (loop for (prop . indent) in (nreverse - (mappend (lambda (s) (get s 'indent)) - *properties-for-emacs*)) - do (format s "(put '~A 'common-lisp-indent-function '~A)~%" - prop indent))) - (run-program '("git" "add" "emacs/put-forms.el")))) +(defun dump-properties-for-emacs (file) + (with-open-file (s file :direction :output :if-exists :supersede) + (format s ";; automatically generated by~%") + (format s ";; CONSFIGURATOR::DUMP-PROPERTIES-FOR-EMACS; do not edit~%~%") + (loop for (prop . indent) in (nreverse + (mappend (lambda (s) (get s 'indent)) + *properties-for-emacs*)) + do (format s "(put '~A 'common-lisp-indent-function '~A)~%" + prop indent)))) (defun store-indentation-info-for-emacs (sym args &optional info) (let* ((short-name -- cgit v1.2.3