aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2022-08-11 12:42:37 +0200
committerPhilip Kaludercic2022-08-11 12:47:28 +0200
commit9ddc23cd3438cba85b8a41e78d335c0d5071a212 (patch)
tree420e505bb943e6b83698284df4d41f8b750d5944
parent878cacc7127426a51feff28dd323674a7e62a5e0 (diff)
downloademacs-9ddc23cd3438cba85b8a41e78d335c0d5071a212.tar.gz
emacs-9ddc23cd3438cba85b8a41e78d335c0d5071a212.zip
Ignore files in .elpaignore during byte compilation
* package.el (package--parse-elpaignore): Add new function. (package--compile): Bind 'byte-compile-ignore-files' to the result of 'package--parse-elpaignore'.
-rw-r--r--lisp/emacs-lisp/package-vc.el1
-rw-r--r--lisp/emacs-lisp/package.el23
-rw-r--r--lisp/vc/vc.el5
3 files changed, 27 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 5a707e1a600..0f5ee4305a8 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -29,7 +29,6 @@
29;; - Allow for automatic updating TODO 29;; - Allow for automatic updating TODO
30;; * Detect merge conflicts TODO 30;; * Detect merge conflicts TODO
31;; * Check if there are upstream changes TODO 31;; * Check if there are upstream changes TODO
32;; - Respect the .elpaignore file TODO
33;; - Allow finding revisions that bump the version tag TODO 32;; - Allow finding revisions that bump the version tag TODO
34;; * Allow for `package-vc-fetch' to use the version 33;; * Allow for `package-vc-fetch' to use the version
35;; of the package if already installed. 34;; of the package if already installed.
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index a5821486405..1321c3728e8 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -599,6 +599,25 @@ package."
599 "Return the priority of the archive of package-desc object PKG-DESC." 599 "Return the priority of the archive of package-desc object PKG-DESC."
600 (package-archive-priority (package-desc-archive pkg-desc))) 600 (package-archive-priority (package-desc-archive pkg-desc)))
601 601
602(defun package--parse-elpaignore (pkg-desc)
603 "Return the of regular expression to match files ignored by PKG-DESC."
604 (let* ((pkg-dir (file-name-as-directory (package-desc-dir pkg-desc)))
605 (ignore (expand-file-name ".elpaignore" pkg-dir))
606 files)
607 (when (file-exists-p ignore)
608 (with-temp-buffer
609 (insert-file-contents ignore)
610 (goto-char (point-min))
611 (while (not (eobp))
612 (push (wildcard-to-regexp
613 (let ((line (buffer-substring
614 (line-beginning-position)
615 (line-end-position))))
616 (file-name-concat pkg-dir (string-trim-left line "/"))))
617 files)
618 (forward-line)))
619 files)))
620
602(cl-defstruct (package--bi-desc 621(cl-defstruct (package--bi-desc
603 (:constructor package-make-builtin (version summary)) 622 (:constructor package-make-builtin (version summary))
604 (:type vector)) 623 (:type vector))
@@ -1073,11 +1092,13 @@ untar into a directory named DIR; otherwise, signal an error."
1073 1092
1074;;;; Compilation 1093;;;; Compilation
1075(defvar warning-minimum-level) 1094(defvar warning-minimum-level)
1095(defvar byte-compile-ignore-files)
1076(defun package--compile (pkg-desc) 1096(defun package--compile (pkg-desc)
1077 "Byte-compile installed package PKG-DESC. 1097 "Byte-compile installed package PKG-DESC.
1078This assumes that `pkg-desc' has already been activated with 1098This assumes that `pkg-desc' has already been activated with
1079`package-activate-1'." 1099`package-activate-1'."
1080 (let ((warning-minimum-level :error) 1100 (let ((byte-compile-ignore-files (package--parse-elpaignore pkg-desc))
1101 (warning-minimum-level :error)
1081 (load-path load-path)) 1102 (load-path load-path))
1082 (byte-recompile-directory (package-desc-dir pkg-desc) 0 t))) 1103 (byte-recompile-directory (package-desc-dir pkg-desc) 0 t)))
1083 1104
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 2dcf8f56542..290054d523e 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -573,6 +573,11 @@
573;; 573;;
574;; Attempt to clone a REMOTE repository, into a local DIRECTORY. 574;; Attempt to clone a REMOTE repository, into a local DIRECTORY.
575;; Returns the symbol of the backend used if successful. 575;; Returns the symbol of the backend used if successful.
576;;
577;; - send-patch (addr &optional rev-list)
578;;
579;; Send a patch to ADDR
580
576 581
577;;; Changes from the pre-25.1 API: 582;;; Changes from the pre-25.1 API:
578;; 583;;