From ca03ad0d4a709c2a4b09e796e7bfcdc72b5064f8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 14 Mar 2020 14:01:35 -0500 Subject: [PATCH] Meta: Update makem.sh --- makem.sh | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/makem.sh b/makem.sh index 3fddb78..91c3000 100755 --- a/makem.sh +++ b/makem.sh @@ -60,6 +60,7 @@ Rules: lint-checkdoc Run checkdoc. lint-compile Byte-compile source files with warnings as errors. lint-declare Run check-declare. + lint-elsa Run Elsa (not included in "lint" rule). lint-indent Lint indentation. lint-package Run package-lint. lint-regexps Run relint. @@ -478,8 +479,10 @@ function sandbox { then debug "Installing linters: package-lint relint" - args_sandbox_package_install+=(--eval "(package-install 'package-lint)" - --eval "(package-install 'relint)") + args_sandbox_package_install+=( + --eval "(package-install 'elsa)" + --eval "(package-install 'package-lint)" + --eval "(package-install 'relint)") fi # *** Install packages into sandbox @@ -671,8 +674,9 @@ function compile { } function batch { - # Run Emacs with $args_batch and with project source and test files loaded. - verbose 1 "Executing Emacs with arguments: ${args_batch[@]}" + # Run Emacs in batch mode with ${args_batch_interactive[@]} and + # with project source and test files loaded. + verbose 1 "Executing Emacs with arguments: ${args_batch_interactive[@]}" run_emacs \ $(args-load-files "${files_project_feature[@]}" "${files_project_test[@]}") \ @@ -681,6 +685,9 @@ function batch { function interactive { # Run Emacs interactively. Most useful with --sandbox and --install-deps. + verbose 1 "Running Emacs interactively..." + verbose 2 "Loading files:" "${files_project_feature[@]}" "${files_project_test[@]}" + unset arg_batch run_emacs \ $(args-load-files "${files_project_feature[@]}" "${files_project_test[@]}") \ @@ -737,6 +744,20 @@ function lint-declare { || error "Linting declarations failed." } +function lint-elsa { + verbose 1 "Linting with Elsa..." + + # MAYBE: Install Elsa here rather than in sandbox init, to avoid installing + # it when not needed. However, we should be careful to be clear about when + # packages are installed, because installing them does execute code. + run_emacs \ + --load elsa \ + -f elsa-run-files-and-exit \ + "${files_project_feature[@]}" \ + && success "Linting with Elsa finished without errors." \ + || error "Linting with Elsa failed." +} + function lint-indent { verbose 1 "Linting indentation..." @@ -952,8 +973,7 @@ do ;; -f|--file) shift - project_source_files+=("$1") - project_byte_compile_files+=("$1") + args_files+=("$1") ;; -O|--no-org-repo) unset elisp_org_package_archive @@ -991,6 +1011,13 @@ files_project_feature=($(files-project-feature)) files_project_test=($(files-project-test)) files_project_byte_compile=("${files_project_feature[@]}" "${files_project_test[@]}") +if [[ ${args_files[@]} ]] +then + # Add specified files. + files_project_feature+=("${args_files[@]}") + files_project_byte_compile+=("${args_files[@]}") +fi + debug "EXCLUDING FILES: ${files_exclude[@]}" debug "FEATURE FILES: ${files_project_feature[@]}" debug "TEST FILES: ${files_project_test[@]}"