diff options
Diffstat (limited to 'src/property.lisp')
-rw-r--r-- | src/property.lisp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/property.lisp b/src/property.lisp index 56d8b72..82d1b92 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -107,15 +107,22 @@ (defvar *properties-for-emacs* nil "List of properties whose symbols have Emacs indentation information.") -(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 dump-properties-for-emacs (from to) + (let ((put-forms + (stripln + (with-output-to-string (s) + (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)))))) + (with-open-file (in from) + (with-open-file (out to :direction :output :if-exists :supersede) + (loop for line = (read-line in nil) + while line + do (princ (re:regex-replace " @putforms@" line put-forms) out) + (terpri out)))))) (defun store-indentation-info-for-emacs (sym args &optional info) (let* ((short-name |