summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-08-11 12:42:37 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-08-11 12:47:28 +0200
commit9ddc23cd3438cba85b8a41e78d335c0d5071a212 (patch)
tree420e505bb943e6b83698284df4d41f8b750d5944 /lisp
parent878cacc7127426a51feff28dd323674a7e62a5e0 (diff)
downloademacs-9ddc23cd3438cba85b8a41e78d335c0d5071a212.tar.gz
emacs-9ddc23cd3438cba85b8a41e78d335c0d5071a212.tar.bz2
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'.
Diffstat (limited to 'lisp')
-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 @@
;; - Allow for automatic updating TODO
;; * Detect merge conflicts TODO
;; * Check if there are upstream changes TODO
-;; - Respect the .elpaignore file TODO
;; - Allow finding revisions that bump the version tag TODO
;; * Allow for `package-vc-fetch' to use the version
;; 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."
"Return the priority of the archive of package-desc object PKG-DESC."
(package-archive-priority (package-desc-archive pkg-desc)))
+(defun package--parse-elpaignore (pkg-desc)
+ "Return the of regular expression to match files ignored by PKG-DESC."
+ (let* ((pkg-dir (file-name-as-directory (package-desc-dir pkg-desc)))
+ (ignore (expand-file-name ".elpaignore" pkg-dir))
+ files)
+ (when (file-exists-p ignore)
+ (with-temp-buffer
+ (insert-file-contents ignore)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (push (wildcard-to-regexp
+ (let ((line (buffer-substring
+ (line-beginning-position)
+ (line-end-position))))
+ (file-name-concat pkg-dir (string-trim-left line "/"))))
+ files)
+ (forward-line)))
+ files)))
+
(cl-defstruct (package--bi-desc
(:constructor package-make-builtin (version summary))
(:type vector))
@@ -1073,11 +1092,13 @@ untar into a directory named DIR; otherwise, signal an error."
;;;; Compilation
(defvar warning-minimum-level)
+(defvar byte-compile-ignore-files)
(defun package--compile (pkg-desc)
"Byte-compile installed package PKG-DESC.
This assumes that `pkg-desc' has already been activated with
`package-activate-1'."
- (let ((warning-minimum-level :error)
+ (let ((byte-compile-ignore-files (package--parse-elpaignore pkg-desc))
+ (warning-minimum-level :error)
(load-path load-path))
(byte-recompile-directory (package-desc-dir pkg-desc) 0 t)))
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 @@
;;
;; Attempt to clone a REMOTE repository, into a local DIRECTORY.
;; Returns the symbol of the backend used if successful.
+;;
+;; - send-patch (addr &optional rev-list)
+;;
+;; Send a patch to ADDR
+
;;; Changes from the pre-25.1 API:
;;