From: Philip Kaludercic Date: Thu, 11 Aug 2022 10:42:37 +0000 (+0200) Subject: Ignore files in .elpaignore during byte compilation X-Git-Tag: emacs-29.0.90~1616^2~307^2~94 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9ddc23cd3438cba85b8a41e78d335c0d5071a212;p=emacs.git 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'. --- 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: ;;