[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/package+vc 9ddc23cd34 3/3: Ignore files in .elpaignore during by
From: |
Philip Kaludercic |
Subject: |
feature/package+vc 9ddc23cd34 3/3: Ignore files in .elpaignore during byte compilation |
Date: |
Thu, 11 Aug 2022 07:06:46 -0400 (EDT) |
branch: feature/package+vc
commit 9ddc23cd3438cba85b8a41e78d335c0d5071a212
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
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'.
---
lisp/emacs-lisp/package-vc.el | 1 -
lisp/emacs-lisp/package.el | 23 ++++++++++++++++++++++-
lisp/vc/vc.el | 5 +++++
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 5a707e1a60..0f5ee4305a 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 a582148640..1321c3728e 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 2dcf8f5654..290054d523 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:
;;