summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-08-20 12:30:23 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-08-20 12:30:23 -0400
commit63d2c2184941902e2358d0e9b0deb17b943db61a (patch)
treee6c6fcc94331c32b306232147a605a6b5d3b3076 /template
parenteb793e18ad9c9c41aa01b94592cbd51da08a3ada (diff)
Fix copyrights for GNU ELPAscratch/polymode
Assign the Copyright to the FSF. Include various other minor and cosmetic changes: - Prefer #' to quote function names. - Fix a few uses of ' in docstrings which can be rendered incorrectly. - Remove redundant `:group` args. - Use keyword args for `define-minor-mode` rather than obsolete positional arguments. - Use `lexical-binding`. - Add a `Copyright` line where missing. * polymode-classes.el (pm-chunkmode, pm-inner-chunkmode): Use `symbol` rather than `face` as type, since `face` is not actually defined as a type. * polymode-compat.el: Use `with-eval-after-load` throughout. * polymode-core.el: Don't use #' to quote the symbol passed to `advice-add` because this arg can't be just a function, it has to be a symbol. (pm-use-cache): Move before first use. * template/targets/utils.el (polymode-add-deps-to-load-path): Make better use of `expand-file-name`. * tests/compat-tests.el: Skip tests if `poly-markdown` is not available, instead of signaling an error.
Diffstat (limited to 'template')
-rw-r--r--template/poly-xyz.el2
-rw-r--r--template/targets/utils.el43
2 files changed, 39 insertions, 6 deletions
diff --git a/template/poly-xyz.el b/template/poly-xyz.el
index d4669fc..dda40c0 100644
--- a/template/poly-xyz.el
+++ b/template/poly-xyz.el
@@ -2,7 +2,7 @@
;;
;; Author: Vitalie Spinu
;; Maintainer: Vitalie Spinu
-;; Copyright (C) 2018 Vitalie Spinu
+;; Copyright (C) 2018-2022 Free Software Foundation, Inc.
;; Version: 0.1
;; Package-Requires: ((emacs "25") (polymode "__POLYMODE_VERSION__"))
;; URL: https://github.com/polymode/__MODULE__
diff --git a/template/targets/utils.el b/template/targets/utils.el
index 9b4e84d..77a2368 100644
--- a/template/targets/utils.el
+++ b/template/targets/utils.el
@@ -1,3 +1,29 @@
+;;; targets/utils.el --- Utility functions for Polymode makefile -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Vitalie Spinu
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; FIXME: This file should be folded into the (merged) poly-targets.el
+
+;;; Code:
+
(defun polymode-library-deps (file)
(let ((deps (let ((file (expand-file-name "targets/deps")))
@@ -9,18 +35,21 @@
(insert-file-contents file)
(goto-char (point-min))
(when (re-search-forward "Package-Requires:" nil t)
- (car (read-from-string (buffer-substring (point) (point-at-eol))))))))
+ (car (read-from-string
+ (buffer-substring (point) (point-at-eol))))))))
(delq 'emacs (delete-dups (append deps (mapcar #'car deps-requires))))))
(defun polymode-add-deps-to-load-path (file)
;; add .ELPA packages
- (let ((elpa-dirs (directory-files (expand-file-name (format ".ELPA/%s" emacs-version)) t)))
+ (let ((elpa-dirs (directory-files
+ (expand-file-name emacs-version ".ELPA") t)))
(setq load-path (append elpa-dirs load-path)))
;; add all poly* and deps in the parent directory and overate any in the .ELPA
(let* ((deps (cons 'poly (polymode-library-deps file)))
(regx (format "^\\(%s\\)" (mapconcat #'symbol-name deps "\\|")))
- (local-dirs (directory-files (file-name-directory (directory-file-name default-directory))
+ (local-dirs (directory-files (file-name-directory
+ (directory-file-name default-directory))
t regx)))
(setq load-path (append local-dirs load-path))))
@@ -47,13 +76,17 @@
(dolist (package deps)
(if (package-installed-p package)
(when (package-outdated-p package)
- (package-install-from-archive (cadr (assq package package-archive-contents))))
+ (package-install-from-archive
+ (cadr (assq package package-archive-contents))))
(package-install package)))
(message "INSTALLED DEPS: %s"
(mapconcat
(lambda (pkg)
(format "%s:%S" pkg
- (package-desc-version (cadr (assq pkg package-archive-contents)))))
+ (package-desc-version
+ (cadr (assq pkg package-archive-contents)))))
deps
" "))))
+
+;;; targets/utils.el ends here