diff options
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/MAINTAINERS | 5 | ||||
| -rw-r--r-- | admin/authors.el | 1 | ||||
| -rw-r--r-- | admin/scrape-elpa.el | 128 |
3 files changed, 134 insertions, 0 deletions
diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index dd339f9af80..41bc780d1cc 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS | |||
| @@ -405,6 +405,11 @@ Spencer Baugh | |||
| 405 | Yuan Fu | 405 | Yuan Fu |
| 406 | lisp/progmodes/c-ts-mode.el | 406 | lisp/progmodes/c-ts-mode.el |
| 407 | 407 | ||
| 408 | Basil L. Contovounesios | ||
| 409 | lisp/battery.el (UPower support) | ||
| 410 | lisp/json.el | ||
| 411 | src/image.c (WebP support) | ||
| 412 | |||
| 408 | ============================================================================== | 413 | ============================================================================== |
| 409 | 3. Externally maintained packages. | 414 | 3. Externally maintained packages. |
| 410 | ============================================================================== | 415 | ============================================================================== |
diff --git a/admin/authors.el b/admin/authors.el index afcc56c6003..41653b8bddf 100644 --- a/admin/authors.el +++ b/admin/authors.el | |||
| @@ -69,6 +69,7 @@ files.") | |||
| 69 | (nil "BlaCk_Void" "alstjr7375@daum\\.net") | 69 | (nil "BlaCk_Void" "alstjr7375@daum\\.net") |
| 70 | (nil "bug-gnu-emacs@gnu\\.org") ; mistake | 70 | (nil "bug-gnu-emacs@gnu\\.org") ; mistake |
| 71 | ("Björn Torkelsson" "Bjorn Torkelsson") | 71 | ("Björn Torkelsson" "Bjorn Torkelsson") |
| 72 | ("Boris Buliga" "boris@d12frosted\\.io") | ||
| 72 | (nil "brandon\\.irizarry@gmail\\.com") | 73 | (nil "brandon\\.irizarry@gmail\\.com") |
| 73 | ("Brian Fox" "Brian J\\. Fox") | 74 | ("Brian Fox" "Brian J\\. Fox") |
| 74 | ("Brian P Templeton" "BT Templeton") | 75 | ("Brian P Templeton" "BT Templeton") |
diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el new file mode 100644 index 00000000000..e1072564db6 --- /dev/null +++ b/admin/scrape-elpa.el | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | ;;; scrape-elpa.el --- Collect ELPA package suggestions -*- lexical-binding: t; -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2024, 2026 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Philip Kaludercic <philipk@posteo.net> | ||
| 6 | ;; Keywords: tools | ||
| 7 | |||
| 8 | ;; This program is free software; you can redistribute it and/or modify | ||
| 9 | ;; it under the terms of the GNU General Public License as published by | ||
| 10 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 11 | ;; (at your option) any later version. | ||
| 12 | |||
| 13 | ;; This program is distributed in the hope that it will be useful, | ||
| 14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | ;; GNU General Public License for more details. | ||
| 17 | |||
| 18 | ;; You should have received a copy of the GNU General Public License | ||
| 19 | ;; along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 20 | |||
| 21 | ;;; Commentary: | ||
| 22 | |||
| 23 | ;; This file defines an administrative command to update the | ||
| 24 | ;; `package-autosuggest' database. | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | (require 'rx) | ||
| 29 | |||
| 30 | (defun scrape-elpa--safe-eval (exp &optional vars) | ||
| 31 | "Manually evaluate EXP without potentially dangerous side-effects. | ||
| 32 | The optional argument VARS may be an alist mapping symbols to values, | ||
| 33 | used when evaluating variables. The evaluation function is not meant to | ||
| 34 | be comprehensive, but just to handle the kinds of expressions that | ||
| 35 | `scrape-elpa' expects to encounter." | ||
| 36 | (pcase-exhaustive exp | ||
| 37 | ;; special handling for macros | ||
| 38 | (`(rx . ,body) (rx-to-string `(: . ,body) t)) | ||
| 39 | ;; quoting and quasi-quoting | ||
| 40 | (`',x x) | ||
| 41 | (`(purecopy ,x) x) | ||
| 42 | ((and (guard (eq '\` (car-safe exp))) (let `(,car . ,cdr) (cadr exp))) | ||
| 43 | (cons | ||
| 44 | (if (eq (car-safe car) '\,) (scrape-elpa--safe-eval (cadr car) vars) car) | ||
| 45 | (if (eq (car-safe cdr) '\,) (scrape-elpa--safe-eval (cadr cdr) vars) cdr))) | ||
| 46 | ;; allow calling `side-effect-free' functions | ||
| 47 | (`(,(and (pred symbolp) (pred (get _ 'side-effect-free)) fn) . ,args) | ||
| 48 | (apply fn (mapcar #'scrape-elpa--safe-eval args))) | ||
| 49 | ;; self-evaluating forms | ||
| 50 | ((pred macroexp-const-p) exp) | ||
| 51 | ;; variable evaluation | ||
| 52 | ((pred symbolp) | ||
| 53 | (let ((ent (assq exp vars))) | ||
| 54 | (if ent (cdr ent) (signal 'void-variable exp)))))) | ||
| 55 | |||
| 56 | (defun scrape-elpa (&rest directories) | ||
| 57 | "Scrape autoload files in DIRECTORIES for package suggestions. | ||
| 58 | This file will automatically update \"package-autosuggest.eld\", but not | ||
| 59 | save it. You should invoke this command with built GNU ELPA and NonGNU | ||
| 60 | ELPA checkouts (i.e. having run \"make autoloads\" in both directories). | ||
| 61 | Please review the results before updating the autosuggest database!" | ||
| 62 | (interactive (completing-read-multiple | ||
| 63 | "ELPA directories to scrape: " | ||
| 64 | #'completion-file-name-table | ||
| 65 | #'file-directory-p)) | ||
| 66 | (with-current-buffer | ||
| 67 | (find-file (expand-file-name "package-autosuggest.eld" data-directory)) | ||
| 68 | (erase-buffer) | ||
| 69 | (lisp-data-mode) | ||
| 70 | (insert ";; The contents of this file are loaded into `package--autosuggest-database'. | ||
| 71 | ;; were automatically generate by scraping ELPA for auto-loaded | ||
| 72 | ;; code using the `scrape-elpa' command from admin/scrape-elpa.el. Please do not | ||
| 73 | ;; update this file manually! | ||
| 74 | |||
| 75 | ") | ||
| 76 | (fill-paragraph) | ||
| 77 | (insert "(") | ||
| 78 | (let ((standard-output (current-buffer))) | ||
| 79 | (dolist-with-progress-reporter | ||
| 80 | (file (mapcan | ||
| 81 | (lambda (dir) | ||
| 82 | (directory-files-recursively | ||
| 83 | dir "-autoloads\\.el\\'")) | ||
| 84 | directories)) | ||
| 85 | "Scraping files..." | ||
| 86 | (and-let* (((string-match "/\\([^/]+?\\)-autoloads\\.el\\'" file)) | ||
| 87 | (pkg (intern (match-string 1 file))) | ||
| 88 | (vars (list '(#:nihil))) | ||
| 89 | (inhibit-message t)) | ||
| 90 | (with-temp-buffer | ||
| 91 | (insert-file-contents file) | ||
| 92 | (condition-case nil | ||
| 93 | (while t | ||
| 94 | (dolist (exp (macroexp-unprogn (read (current-buffer)))) | ||
| 95 | (pcase exp | ||
| 96 | (`(defconst ,(and (pred symbolp) var) ,val . ,_) | ||
| 97 | (catch 'ignore | ||
| 98 | (push | ||
| 99 | (cons var (condition-case err | ||
| 100 | (scrape-elpa--safe-eval val vars) | ||
| 101 | (t (message "Failed to evaluate %S: %S in %S" exp err vars) | ||
| 102 | (throw 'ignore nil)))) | ||
| 103 | vars))) | ||
| 104 | (`(add-to-list | ||
| 105 | ',(and (or 'interpreter-mode-alist | ||
| 106 | 'magic-mode-alist | ||
| 107 | 'auto-mode-alist) | ||
| 108 | variable) | ||
| 109 | ,(let `(,(and (pred stringp) regexp) . | ||
| 110 | ,(and (pred symbolp) mode)) | ||
| 111 | (condition-case err | ||
| 112 | (scrape-elpa--safe-eval _ vars) | ||
| 113 | (t (message "Failed to evaluate %S: %S in %S" exp err vars) | ||
| 114 | nil)))) | ||
| 115 | (terpri) | ||
| 116 | (prin1 (append (list pkg variable regexp) | ||
| 117 | (and (not (eq pkg mode)) (list mode))))) | ||
| 118 | (`(add-to-list | ||
| 119 | ',(or 'interpreter-mode-alist | ||
| 120 | 'magic-mode-alist | ||
| 121 | 'auto-mode-alist) | ||
| 122 | _) | ||
| 123 | (_ (message "Skipped over %S" exp)))))) | ||
| 124 | (end-of-file nil)))))) | ||
| 125 | (insert "\n)\n"))) | ||
| 126 | |||
| 127 | (provide 'scrape-elpa) | ||
| 128 | ;;; scrape-elpa.el ends here | ||