From bd0674c9321da4a1e4fcf37df98cec9f51dc728f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 00:40:39 +0100 Subject: [PATCH 01/52] Allow suggesting to install packages * etc/package-autosuggest.eld: Add a manual sketch of the database * lisp/emacs-lisp/package.el (package-autosuggest-database) (package-autosuggest-mode, package--suggestion-applies-p) (package--autosuggest-find-candidates) (package--autosuggest-install-and-enable) (package--autosuggest-suggested, package--autosugest-line-format) (package-autosuggest-face, mode-line-misc-info) (package--autosuggest-after-change-mode, package-autosuggest): Implement the feature. --- etc/package-autosuggest.eld | 7 ++ lisp/emacs-lisp/package.el | 147 ++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 etc/package-autosuggest.eld diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld new file mode 100644 index 00000000000..e6c2c805edd --- /dev/null +++ b/etc/package-autosuggest.eld @@ -0,0 +1,7 @@ +;; Database of suggestions for `package-autosuggest' + +( + (sml-mode auto-mode-alist "\\.sml\\'") + (ada-mode auto-mode-alist "\\.ada\\'") + (go-mode auto-mode-alist "\\.go\\'") +) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index af07ba44e28..c6ab77fc3d3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4536,6 +4536,153 @@ the `Version:' header." (or (lm-header "package-version") (lm-header "version"))))))))) + +;;;; Autosuggest + +(defconst package-autosuggest-database + (eval-when-compile + (with-temp-buffer + (insert-file-contents + (expand-file-name "package-autosuggest.eld" data-directory)"/home/phi/Source/emacs/etc/package-autosuggest.eld") + (read (current-buffer)))) + "Database of hints for packages to suggest installing.") + +(define-minor-mode package-autosuggest-mode + "Enable the automatic suggestion and installation of packages." + :init-value 'mode-line :global t + :type '(choice (const :tag "Indicate in mode line" mode-line) + (const :tag "Always prompt" always) + (const :tag "Prompt only once" once) + (const :tag "Indicate with message" message) + (const :tag "Do not suggest anything" nil)) + (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) + 'after-change-major-mode-hook + #'package--autosuggest-after-change-mode)) + +(defun package--suggestion-applies-p (pkg-sug) + "Check if a suggestion PKG-SUG is applicable to the current buffer." + (pcase pkg-sug + (`(,(pred package-installed-p) . ,_) nil) + ((or `(,_ auto-mode-alist ,ext _) + `(,_ auto-mode-alist ,ext)) + (and (string-match-p ext (buffer-name)) t)) + ((or `(,_ magic-mode-alist ,mag _) + `(,_ magic-mode-alist ,mag)) + (save-restriction + (widen) + (save-excursion + (goto-char (point-min)) + (looking-at-p mag)))) + ((or `(,_ interpreter-mode-alist ,magic _) + `(,_ interpreter-mode-alist ,magic)) + (save-restriction + (widen) + (save-excursion + (goto-char (point-min)) + (and (looking-at auto-mode-interpreter-regexp) + (string-match-p + (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") + magic))))))) + +(defun package--autosuggest-find-candidates () + "Return a list of packages that might be interesting the current buffer." + (and package-autosuggest-mode + (let (suggetions) + (dolist (sug package-autosuggest-database) + (when (package--suggestion-applies-p sug) + (push sug suggetions))) + suggetions))) + +(defun package--autosuggest-install-and-enable (pkg-sug) + "Install and enable a package suggestion PKG-ENT. +PKG-SUG has the same form as an element of +`package-autosuggest-database'." + (let ((buffers-to-update '())) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (and (eq major-mode 'fundamental-mode) (buffer-file-name) + (package--suggestion-applies-p pkg-sug)) + (push buf buffers-to-update)))) + (package-install (car pkg-sug)) + (dolist (buf buffers-to-update) + (with-demoted-errors "Failed to enable major mode: %S" + (with-current-buffer buf + (funcall-interactively (or (cadddr pkg-sug) (car pkg-sug)))))))) + +(defvar package--autosuggest-suggested '() + "List of packages that have already been suggested.") + +(defvar package--autosugest-line-format + '(:eval (package--autosugest-line-format))) +(put 'package--autosugest-line-format 'risky-local-variable t) + +(defface package-autosuggest-face + '((t :inherit (success))) + "Face to use in the mode line to highlight suggested packages." + :version "30.1") + +(defun package--autosugest-line-format () + "Generate a mode-line string to indicate a suggested package." + `(,@(and-let* (((eq package-autosuggest-mode 'mode-line)) + (avail (seq-difference (package--autosuggest-find-candidates) + package--autosuggest-suggested))) + (propertize + (format "Install %s?" + (mapconcat + #'symbol-name + (delete-dups (mapcar #'car avail)) + ", ")) + 'face 'package-autosuggest-face + 'mouse-face 'mode-line-highlight + 'help-echo "Click to install suggested package." + 'keymap (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] #'package-autosuggest) + map))))) + +(add-to-list + 'mode-line-misc-info + '(package-autosuggest-mode ("" package--autosugest-line-format))) + +(defun package--autosuggest-after-change-mode () + "Hook function to suggest packages for installation." + (when-let* ((avail (seq-difference (package--autosuggest-find-candidates) + package--autosuggest-suggested)) + (pkgs (mapconcat #'symbol-name + (delete-dups (mapcar #'car avail)) + ", ")) + (use-dialog-box t)) + (pcase package-autosuggest-mode + ('mode-line + (force-mode-line-update t)) + ('always + (when (yes-or-no-p (format "Install suggested packages (%s)?" pkgs)) + (mapc #'package--autosuggest-install-and-enable avail))) + ('once + (when (yes-or-no-p (format "Install suggested packages (%s)?" pkgs)) + (mapc #'package--autosuggest-install-and-enable avail)) + (setq package--autosuggest-suggested (append avail package--autosuggest-suggested))) + ('message + (message + (substitute-command-keys + (format "Found suggested packages: %s. Install using \\[package-autosuggest]" + pkgs))))))) + +(defun package-autosuggest () + "Prompt the user for suggested packages." + (interactive) + (let* ((avail (or (package--autosuggest-find-candidates) + (user-error "No suggestions found"))) + (pkgs (completing-read-multiple + "Install suggested packages: " avail + nil t + (mapconcat #'symbol-name + (delete-dups (mapcar #'car avail)) + ","))) + (choice (concat "\\`" (regexp-opt pkgs) "\\'"))) + (dolist (ent avail) + (when (string-match-p choice (symbol-name (car ent))) + (package--autosuggest-install-and-enable ent))))) + ;;;; Quickstart: precompute activation actions for faster start up. From 81869a5b9fad86503afd8c8cb063555627bc21ff Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 13:51:08 +0100 Subject: [PATCH 02/52] Improve prompting of autosuggested packages * lisp/emacs-lisp/package.el (package--autosuggest-suggested): Move declaration up. (package--suggestion-applies-p): Respect 'package--autosuggest-suggested', avoiding to suggest packages multiple times. (package--autosugest-line-format) (package--autosuggest-after-change-mode): Simplify due to 'package--suggestion-applies-p' respecting 'package--autosuggest-suggested'. (package-autosuggest): Replace CRM prompt with a yes-or-no-p, so that 'use-dialog-box' can take effect. --- lisp/emacs-lisp/package.el | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c6ab77fc3d3..7bf26ff1ba3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4559,10 +4559,16 @@ the `Version:' header." 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) +(defvar package--autosuggest-suggested '() + "List of packages that have already been suggested.") + (defun package--suggestion-applies-p (pkg-sug) "Check if a suggestion PKG-SUG is applicable to the current buffer." (pcase pkg-sug - (`(,(pred package-installed-p) . ,_) nil) + (`(,(or (pred (assq _ package--autosuggest-suggested)) + (pred package-installed-p)) + . ,_) + nil) ((or `(,_ auto-mode-alist ,ext _) `(,_ auto-mode-alist ,ext)) (and (string-match-p ext (buffer-name)) t)) @@ -4609,9 +4615,6 @@ PKG-SUG has the same form as an element of (with-current-buffer buf (funcall-interactively (or (cadddr pkg-sug) (car pkg-sug)))))))) -(defvar package--autosuggest-suggested '() - "List of packages that have already been suggested.") - (defvar package--autosugest-line-format '(:eval (package--autosugest-line-format))) (put 'package--autosugest-line-format 'risky-local-variable t) @@ -4624,8 +4627,7 @@ PKG-SUG has the same form as an element of (defun package--autosugest-line-format () "Generate a mode-line string to indicate a suggested package." `(,@(and-let* (((eq package-autosuggest-mode 'mode-line)) - (avail (seq-difference (package--autosuggest-find-candidates) - package--autosuggest-suggested))) + (avail (package--autosuggest-find-candidates))) (propertize (format "Install %s?" (mapconcat @@ -4645,12 +4647,10 @@ PKG-SUG has the same form as an element of (defun package--autosuggest-after-change-mode () "Hook function to suggest packages for installation." - (when-let* ((avail (seq-difference (package--autosuggest-find-candidates) - package--autosuggest-suggested)) + (when-let* ((avail (package--autosuggest-find-candidates)) (pkgs (mapconcat #'symbol-name (delete-dups (mapcar #'car avail)) - ", ")) - (use-dialog-box t)) + ", "))) (pcase package-autosuggest-mode ('mode-line (force-mode-line-update t)) @@ -4672,17 +4672,17 @@ PKG-SUG has the same form as an element of (interactive) (let* ((avail (or (package--autosuggest-find-candidates) (user-error "No suggestions found"))) - (pkgs (completing-read-multiple - "Install suggested packages: " avail - nil t - (mapconcat #'symbol-name - (delete-dups (mapcar #'car avail)) - ","))) - (choice (concat "\\`" (regexp-opt pkgs) "\\'"))) - (dolist (ent avail) - (when (string-match-p choice (symbol-name (car ent))) - (package--autosuggest-install-and-enable ent))))) - + (use-dialog-box t) + (prompt (concat + "Install " + (mapconcat + #'symbol-name + (delete-dups (mapcar #'car avail)) + ", ") + "?"))) + (if (yes-or-no-p prompt) + (mapc #'package--autosuggest-install-and-enable avail) + (setq package--autosuggest-suggested (append avail package--autosuggest-suggested))))) ;;;; Quickstart: precompute activation actions for faster start up. From 90d6044e23b65c76ba529a7b20c7d8e27634b6f0 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 13:55:40 +0100 Subject: [PATCH 03/52] * lisp/emacs-lisp/package.el (package-autosuggest): New command --- lisp/emacs-lisp/package.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7bf26ff1ba3..50095d92ae3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4683,6 +4683,16 @@ PKG-SUG has the same form as an element of (if (yes-or-no-p prompt) (mapc #'package--autosuggest-install-and-enable avail) (setq package--autosuggest-suggested (append avail package--autosuggest-suggested))))) + +(defun package-reset-suggestions () + "Forget previous package suggestions. +Emacs will remember if you have previously rejected a suggestion during +a session and won't mention it afterwards. If you have made a mistake +or would like to reconsider this, use this command to want to reset the +suggestions." + (interactive) + (setq package--autosuggest-suggested nil)) + ;;;; Quickstart: precompute activation actions for faster start up. From 73c76caa1a5871a81500b3e2df8da38f48cc5d1e Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 19:41:12 +0100 Subject: [PATCH 04/52] Improve package-autosuggest documentation * lisp/emacs-lisp/package.el (package-autosuggest-database) (package-autosuggest-mode, package--autosuggest-suggested) (package--suggestion-applies-p) (package--autosuggest-find-candidates) (package--autosuggest-install-and-enable) (package--autosuggest-after-change-mode, package-autosuggest): Elaborate docstrings. --- lisp/emacs-lisp/package.el | 63 +++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 50095d92ae3..bead32bdaf8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4545,10 +4545,24 @@ the `Version:' header." (insert-file-contents (expand-file-name "package-autosuggest.eld" data-directory)"/home/phi/Source/emacs/etc/package-autosuggest.eld") (read (current-buffer)))) - "Database of hints for packages to suggest installing.") + "List of hints for packages to suggest installing. +Each hint has the form (PACKAGE TYPE DATA), where PACKAGE is a symbol +denoting the package the hint applies to, TYPE is one of +`auto-mode-alist', `magic-mode-alist' or `interpreter-mode-alist' +indicating the type of check to be made and DATA is the value to check +against TYPE in the intuitive way (e.g. for `auto-mode-alist' DATA is a +regular expression matching a file name that PACKAGE should be suggested +for).") (define-minor-mode package-autosuggest-mode - "Enable the automatic suggestion and installation of packages." + "Enable the automatic suggestion and installation of packages. +As a user option, you can set this value to `mode-line' (default) to +indicate the availability of a package suggestion in the minor mode, +`always' to prompt the user in the minibuffer every time a suggestion is +available in a `fundamenta-mode' buffer, `once' to do only prompt the +user once for each suggestion or `message' to just display a message +hinting at the existence of a suggestion. If `package-autosuggest-mode' +is set to nil, the minor mode will be disabled and no suggestions occur." :init-value 'mode-line :global t :type '(choice (const :tag "Indicate in mode line" mode-line) (const :tag "Always prompt" always) @@ -4560,27 +4574,30 @@ the `Version:' header." #'package--autosuggest-after-change-mode)) (defvar package--autosuggest-suggested '() - "List of packages that have already been suggested.") + "List of packages that have already been suggested. +The elements of this list should be a subset of elements from +`package-autosuggest-database'. Suggestions found in this list will not +count as suggestions (e.g. if `package-autosuggest-mode' is set to +`mode-line', a suggestion found in here will inhibit +`package-autosuggest-mode' from displaying a hint in the mode line).") -(defun package--suggestion-applies-p (pkg-sug) - "Check if a suggestion PKG-SUG is applicable to the current buffer." - (pcase pkg-sug +(defun package--suggestion-applies-p (sug) + "Check if a suggestion SUG is applicable to the current buffer. +SUG should be an element of `package-autosuggest-database'." + (pcase sug (`(,(or (pred (assq _ package--autosuggest-suggested)) (pred package-installed-p)) . ,_) nil) - ((or `(,_ auto-mode-alist ,ext _) - `(,_ auto-mode-alist ,ext)) + (`(,_ auto-mode-alist ,ext) (and (string-match-p ext (buffer-name)) t)) - ((or `(,_ magic-mode-alist ,mag _) - `(,_ magic-mode-alist ,mag)) + (`(,_ magic-mode-alist ,mag) (save-restriction (widen) (save-excursion (goto-char (point-min)) (looking-at-p mag)))) - ((or `(,_ interpreter-mode-alist ,magic _) - `(,_ interpreter-mode-alist ,magic)) + (`(,_ interpreter-mode-alist ,magic) (save-restriction (widen) (save-excursion @@ -4591,7 +4608,9 @@ the `Version:' header." magic))))))) (defun package--autosuggest-find-candidates () - "Return a list of packages that might be interesting the current buffer." + "Return a list of suggestions that might be interesting the current buffer. +The elements of the returned list will be a subset of the elements of +`package--autosuggest-suggested'." (and package-autosuggest-mode (let (suggetions) (dolist (sug package-autosuggest-database) @@ -4599,21 +4618,20 @@ the `Version:' header." (push sug suggetions))) suggetions))) -(defun package--autosuggest-install-and-enable (pkg-sug) +(defun package--autosuggest-install-and-enable (sug) "Install and enable a package suggestion PKG-ENT. -PKG-SUG has the same form as an element of -`package-autosuggest-database'." +SUG should be an element of `package-autosuggest-database'." (let ((buffers-to-update '())) (dolist (buf (buffer-list)) (with-current-buffer buf (when (and (eq major-mode 'fundamental-mode) (buffer-file-name) - (package--suggestion-applies-p pkg-sug)) + (package--suggestion-applies-p sug)) (push buf buffers-to-update)))) - (package-install (car pkg-sug)) + (package-install (car sug)) (dolist (buf buffers-to-update) (with-demoted-errors "Failed to enable major mode: %S" (with-current-buffer buf - (funcall-interactively (or (cadddr pkg-sug) (car pkg-sug)))))))) + (funcall-interactively (or (cadddr sug) (car sug)))))))) (defvar package--autosugest-line-format '(:eval (package--autosugest-line-format))) @@ -4646,7 +4664,8 @@ PKG-SUG has the same form as an element of '(package-autosuggest-mode ("" package--autosugest-line-format))) (defun package--autosuggest-after-change-mode () - "Hook function to suggest packages for installation." + "Display package suggestions for the current buffer. +This function should be added to `after-change-major-mode-hook'." (when-let* ((avail (package--autosuggest-find-candidates)) (pkgs (mapconcat #'symbol-name (delete-dups (mapcar #'car avail)) @@ -4665,10 +4684,10 @@ PKG-SUG has the same form as an element of (message (substitute-command-keys (format "Found suggested packages: %s. Install using \\[package-autosuggest]" - pkgs))))))) + pkgs)))p)))) (defun package-autosuggest () - "Prompt the user for suggested packages." + "Prompt the user to install the suggested packages." (interactive) (let* ((avail (or (package--autosuggest-find-candidates) (user-error "No suggestions found"))) From d9214f157359f6ed00de27ba2756127ee754140f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 19:42:34 +0100 Subject: [PATCH 05/52] Ensure a valid value for 'package-autosuggest-mode' * lisp/emacs-lisp/package.el (package-autosuggest-mode): If 'define-minor-mode' sets the value of the variable to t, then we will override this to the default value. --- lisp/emacs-lisp/package.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index bead32bdaf8..4f20a1735f2 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4569,6 +4569,9 @@ is set to nil, the minor mode will be disabled and no suggestions occur." (const :tag "Prompt only once" once) (const :tag "Indicate with message" message) (const :tag "Do not suggest anything" nil)) + (unless (memq package-autosuggest-mode '(mode-line always once message)) + (let ((def (custom--standard-value 'package-autosuggest-mode))) + (setq package-autosuggest-mode def))) (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) From 6b65feabf1b0528e16e0ead84c8e2a3bb5ce55c3 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 19:55:05 +0100 Subject: [PATCH 06/52] ; Remove thinko value from 'package-autosuggest-database' * lisp/emacs-lisp/package.el (package-autosuggest-database): Read the result of evaluating 'expand-file-name' instead of discarding the value. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4f20a1735f2..ec56c327dae 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4543,7 +4543,7 @@ the `Version:' header." (eval-when-compile (with-temp-buffer (insert-file-contents - (expand-file-name "package-autosuggest.eld" data-directory)"/home/phi/Source/emacs/etc/package-autosuggest.eld") + (expand-file-name "package-autosuggest.eld" data-directory)) (read (current-buffer)))) "List of hints for packages to suggest installing. Each hint has the form (PACKAGE TYPE DATA), where PACKAGE is a symbol From 33c349dd3ac65d56e629d6cf94e66276815068f8 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 20:58:31 +0100 Subject: [PATCH 07/52] Create separate 'package-autosuggest-style' user option * lisp/emacs-lisp/package.el (package-autosuggest-mode): Extract part of the logic into a separate user option. (package--autosuggest-suggested, package--suggestion-applies-p) (package--autosugest-line-format) (package--autosuggest-after-change-mode): Respect the change. --- lisp/emacs-lisp/package.el | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ec56c327dae..ec4b569b6ca 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4554,24 +4554,22 @@ against TYPE in the intuitive way (e.g. for `auto-mode-alist' DATA is a regular expression matching a file name that PACKAGE should be suggested for).") -(define-minor-mode package-autosuggest-mode - "Enable the automatic suggestion and installation of packages. -As a user option, you can set this value to `mode-line' (default) to -indicate the availability of a package suggestion in the minor mode, -`always' to prompt the user in the minibuffer every time a suggestion is -available in a `fundamenta-mode' buffer, `once' to do only prompt the -user once for each suggestion or `message' to just display a message -hinting at the existence of a suggestion. If `package-autosuggest-mode' -is set to nil, the minor mode will be disabled and no suggestions occur." - :init-value 'mode-line :global t +(defcustom package-autosuggest-style 'mode-line + "How to draw attention to `package-autosuggest-mode' suggestions. +You can set this value to `mode-line' (default) to indicate the +availability of a package suggestion in the minor mode, `always' to +prompt the user in the minibuffer every time a suggestion is available +in a `fundamenta-mode' buffer, `once' to do only prompt the user once +for each suggestion or `message' to just display a message hinting at +the existence of a suggestion." :type '(choice (const :tag "Indicate in mode line" mode-line) (const :tag "Always prompt" always) (const :tag "Prompt only once" once) - (const :tag "Indicate with message" message) - (const :tag "Do not suggest anything" nil)) - (unless (memq package-autosuggest-mode '(mode-line always once message)) - (let ((def (custom--standard-value 'package-autosuggest-mode))) - (setq package-autosuggest-mode def))) + (const :tag "Indicate with message" message))) + +(define-minor-mode package-autosuggest-mode + "Enable the automatic suggestion and installation of packages." + :init-value t :global t (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) @@ -4580,7 +4578,7 @@ is set to nil, the minor mode will be disabled and no suggestions occur." "List of packages that have already been suggested. The elements of this list should be a subset of elements from `package-autosuggest-database'. Suggestions found in this list will not -count as suggestions (e.g. if `package-autosuggest-mode' is set to +count as suggestions (e.g. if `package-autosuggest-style' is set to `mode-line', a suggestion found in here will inhibit `package-autosuggest-mode' from displaying a hint in the mode line).") @@ -4588,7 +4586,7 @@ count as suggestions (e.g. if `package-autosuggest-mode' is set to "Check if a suggestion SUG is applicable to the current buffer. SUG should be an element of `package-autosuggest-database'." (pcase sug - (`(,(or (pred (assq _ package--autosuggest-suggested)) + (`(,(or (pred (lambda (e) (assq e package--autosuggest-suggested))) (pred package-installed-p)) . ,_) nil) @@ -4647,7 +4645,8 @@ SUG should be an element of `package-autosuggest-database'." (defun package--autosugest-line-format () "Generate a mode-line string to indicate a suggested package." - `(,@(and-let* (((eq package-autosuggest-mode 'mode-line)) + `(,@(and-let* (((not (null package-autosuggest-mode))) + ((eq package-autosuggest-style 'mode-line)) (avail (package--autosuggest-find-candidates))) (propertize (format "Install %s?" @@ -4673,7 +4672,7 @@ This function should be added to `after-change-major-mode-hook'." (pkgs (mapconcat #'symbol-name (delete-dups (mapcar #'car avail)) ", "))) - (pcase package-autosuggest-mode + (pcase-exhaustive package-autosuggest-style ('mode-line (force-mode-line-update t)) ('always From e2965e25529a6f2113e44e54c566d729bfd5c955 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 20:59:53 +0100 Subject: [PATCH 08/52] Update mode line after rejecting a suggestion * lisp/emacs-lisp/package.el (package-autosuggest): Call 'force-mode-line-update' if it would make sense. --- lisp/emacs-lisp/package.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ec4b569b6ca..308c6ad1a51 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4703,7 +4703,9 @@ This function should be added to `after-change-major-mode-hook'." "?"))) (if (yes-or-no-p prompt) (mapc #'package--autosuggest-install-and-enable avail) - (setq package--autosuggest-suggested (append avail package--autosuggest-suggested))))) + (setq package--autosuggest-suggested (append avail package--autosuggest-suggested)) + (when (eq package-autosuggest-style 'mode-line) + (force-mode-line-update t))))) (defun package-reset-suggestions () "Forget previous package suggestions. From 0cb99c51a3aa7453a524ab7498fb982416308875 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 6 Nov 2024 21:09:57 +0100 Subject: [PATCH 09/52] Add command to scrape ELPA for package suggestions * admin/scrape-elpa.el (scrape-elpa): Add new command. * etc/package-autosuggest.eld: Generate file using 'scrape-elpa'. --- admin/scrape-elpa.el | 78 ++++++++++++++++++++++++++++++++++++ etc/package-autosuggest.eld | 80 +++++++++++++++++++++++++++++++++++-- 2 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 admin/scrape-elpa.el diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el new file mode 100644 index 00000000000..78dbd7349d0 --- /dev/null +++ b/admin/scrape-elpa.el @@ -0,0 +1,78 @@ +;;; scrape-elpa.el --- Collect ELPA package suggestions -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; Author: Philip Kaludercic +;; Keywords: tools + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This file defines an administrative command to update the +;; `package-autosuggest' database. + +;;; Code: + +(defun scrape-elpa (&rest directories) + "Scrape autoload files in DIRECTORIES for package suggestions. +This file will automatically update \"package-autosuggest.eld\", but not +save it. You should invoke this command with built GNU ELPA and NonGNU +ELPA checkouts (i.e. having run \"make build-all\" in both directories). +Please review the results before updating the autosuggest database!" + (interactive (completing-read-multiple + "ELPA directories to scrape: " + #'completion-file-name-table + #'file-directory-p)) + (with-current-buffer + (find-file (expand-file-name "package-autosuggest.eld" data-directory)) + (erase-buffer) + (lisp-data-mode) + (insert ";; The contents of this file are loaded into `package-autosuggest-database' +;; and were automatically generate by scraping ELPA for auto-loaded +;; code using the `scrape-elpa' command. Please avoid updating this +;; file manually! + +") + (fill-paragraph) + (insert "(") + (let ((standard-output (current-buffer))) + (dolist-with-progress-reporter + (file (mapcan + (lambda (dir) + (directory-files-recursively + dir "-autoloads\\.el\\'")) + directories)) + "Scraping files..." + (let ((inhibit-message t)) + (with-temp-buffer + (insert-file-contents file) + (condition-case nil + (while t + (pcase (read (current-buffer)) + (`(add-to-list + ',(and (or 'interpreter-mode-alist + 'magic-mode-alist + 'auto-mode-alist) + variable) + '(,(and (pred stringp) regexp) . + ,(and (pred symbolp) mode))) + (terpri) + (prin1 `(,mode ,variable ,regexp)) + (princ (concat " ;from " file))))) + (end-of-file nil)))))) + (insert "\n)\n"))) + +(provide 'scrape-elpa) +;;; scrape-elpa.el ends here diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index e6c2c805edd..742983fa9eb 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -1,7 +1,79 @@ -;; Database of suggestions for `package-autosuggest' +;; The contents of this file are loaded into `package-autosuggest-database' +;; and were automatically generate by scraping ELPA for auto-loaded +;; code using the `scrape-elpa' command. Please avoid updating this +;; file manually! ( - (sml-mode auto-mode-alist "\\.sml\\'") - (ada-mode auto-mode-alist "\\.ada\\'") - (go-mode auto-mode-alist "\\.go\\'") +(ada-mode auto-mode-alist "\\.ad[abs]\\'") ;from ~/Source/elpa/packages/ada-mode/ada-mode-autoloads.el +(arbitools-mode auto-mode-alist "\\.trf?\\'") ;from ~/Source/elpa/packages/arbitools/arbitools-autoloads.el +(LaTeX-mode auto-mode-alist "\\.hva\\'") ;from ~/Source/elpa/packages/auctex/auctex-autoloads.el +(bnf-mode auto-mode-alist "\\.bnf\\'") ;from ~/Source/elpa/packages/bnf-mode/bnf-mode-autoloads.el +(chess-pgn-mode auto-mode-alist "\\.pgn\\'") ;from ~/Source/elpa/packages/chess/chess-autoloads.el +(cobol-mode auto-mode-alist "\\.c\\(ob\\|bl\\|py\\)\\'") ;from ~/Source/elpa/packages/cobol-mode/cobol-mode-autoloads.el +(code-cells-convert-ipynb auto-mode-alist "\\.ipynb\\'") ;from ~/Source/elpa/packages/code-cells/code-cells-autoloads.el +(csharp-mode auto-mode-alist "\\.cs\\'") ;from ~/Source/elpa/packages/csharp-mode/csharp-mode-autoloads.el +(csv-mode auto-mode-alist "\\.[Cc][Ss][Vv]\\'") ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el +(tsv-mode auto-mode-alist "\\.tsv\\'") ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el +(dismal-mode auto-mode-alist "\\.dis\\'") ;from ~/Source/elpa/packages/dismal/dismal-autoloads.el +(djvu-init-mode auto-mode-alist "\\.djvu\\'") ;from ~/Source/elpa/packages/djvu/djvu-autoloads.el +(dts-mode auto-mode-alist "\\.dtsi?\\'") ;from ~/Source/elpa/packages/dts-mode/dts-mode-autoloads.el +(ess-bugs-mode auto-mode-alist "\\.[Bb][Uu][Gg]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-bugs-mode auto-mode-alist "\\.[Bb][Oo][Gg]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-bugs-mode auto-mode-alist "\\.[Bb][Mm][Dd]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-jags-mode auto-mode-alist "\\.[Jj][Aa][Gg]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode auto-mode-alist "/R/.*\\.q\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode auto-mode-alist "\\.[rR]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode auto-mode-alist "\\.[rR]profile\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode auto-mode-alist "NAMESPACE\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode auto-mode-alist "CITATION\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-transcript-mode auto-mode-alist "\\.[Rr]out\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode interpreter-mode-alist "Rscript") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess-r-mode interpreter-mode-alist "r") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(makefile-mode auto-mode-alist "/Makevars\\(\\.win\\)?\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(conf-colon-mode auto-mode-alist "DESCRIPTION\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(Rd-mode auto-mode-alist "\\.Rd\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(S-transcript-mode auto-mode-alist "\\.[Ss]t\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(S-transcript-mode auto-mode-alist "\\.Sout\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(SAS-mode auto-mode-alist "\\.[Ss][Aa][Ss]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(gle-mode auto-mode-alist "\\.gle\\'") ;from ~/Source/elpa/packages/gle-mode/gle-mode-autoloads.el +(gpr-mode auto-mode-alist "\\.gpr\\'") ;from ~/Source/elpa/packages/gpr-mode/gpr-mode-autoloads.el +(nxml-mode auto-mode-alist "\\.html?\\'") ;from ~/Source/elpa/packages/html5-schema/html5-schema-autoloads.el +(jgraph-mode auto-mode-alist "\\.jgr\\'") ;from ~/Source/elpa/packages/jgraph-mode/jgraph-mode-autoloads.el +(json-mode auto-mode-alist "\\.json\\'") ;from ~/Source/elpa/packages/json-mode/json-mode-autoloads.el +(lmc-asm-mode auto-mode-alist "\\.elmc\\'") ;from ~/Source/elpa/packages/lmc/lmc-autoloads.el +(muse-mode-choose-mode auto-mode-alist "\\.muse\\'") ;from ~/Source/elpa/packages/muse/lisp/muse-autoloads.el +(latex-mode auto-mode-alist "\\.drv\\'") ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el +(doctex-mode auto-mode-alist "\\.dtx\\'") ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el +(nftables-mode auto-mode-alist "\\.nft\\(?:ables\\)?\\'") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el +(nftables-mode auto-mode-alist "/etc/nftables.conf") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el +(nftables-mode interpreter-mode-alist "nft\\(?:ables\\)?") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el +(omn-mode auto-mode-alist "\\.pomn\\'") ;from ~/Source/elpa/packages/omn-mode/omn-mode-autoloads.el +(omn-mode auto-mode-alist "\\.omn\\'") ;from ~/Source/elpa/packages/omn-mode/omn-mode-autoloads.el +(poke-mode auto-mode-alist "\\.pk\\'") ;from ~/Source/elpa/packages/poke-mode/poke-mode-autoloads.el +(pspp-mode auto-mode-alist "\\.sps\\'") ;from ~/Source/elpa/packages/pspp-mode/pspp-mode-autoloads.el +(conf-mode auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'") ;from ~/Source/elpa/packages/python/python-autoloads.el +(rec-mode auto-mode-alist "\\.rec\\'") ;from ~/Source/elpa/packages/rec-mode/rec-mode-autoloads.el +(rnc-mode auto-mode-alist "\\.rnc\\'") ;from ~/Source/elpa/packages/rnc-mode/rnc-mode-autoloads.el +(sed-mode auto-mode-alist "\\.sed\\'") ;from ~/Source/elpa/packages/sed-mode/sed-mode-autoloads.el +(sed-mode interpreter-mode-alist "sed") ;from ~/Source/elpa/packages/sed-mode/sed-mode-autoloads.el +(shen-mode auto-mode-alist "\\.shen\\'") ;from ~/Source/elpa/packages/shen-mode/shen-mode-autoloads.el +(sisu-mode auto-mode-alist "\\.ss[imt]\\'") ;from ~/Source/elpa/packages/sisu-mode/sisu-mode-autoloads.el +(smalltalk-mode auto-mode-alist "\\.st\\'") ;from ~/Source/elpa/packages/smalltalk-mode/smalltalk-mode-autoloads.el +(sml-mode auto-mode-alist "\\.s\\(ml\\|ig\\)\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el +(sml-cm-mode auto-mode-alist "\\.cm\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el +(sml-yacc-mode auto-mode-alist "\\.grm\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el +(sql-mode auto-mode-alist "\\.cql\\'") ;from ~/Source/elpa/packages/sql-cassandra/sql-cassandra-autoloads.el +(sxhkdrc-mode auto-mode-alist "sxhkdrc\\'") ;from ~/Source/elpa/packages/sxhkdrc-mode/sxhkdrc-mode-autoloads.el +(systemd-automount-mode auto-mode-alist "\\.automount\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd-mount-mode auto-mode-alist "\\.mount\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd-path-mode auto-mode-alist "\\.path\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd-service-mode auto-mode-alist "\\.service\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd-socket-mode auto-mode-alist "\\.socket\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd-swap-mode auto-mode-alist "\\.swap\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd-timer-mode auto-mode-alist "\\.timer\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(vcard-mode auto-mode-alist "\\.[Vv][Cc][Ff]\\'") ;from ~/Source/elpa/packages/vcard/vcard-autoloads.el +(wisitoken-parse_table-mode auto-mode-alist "\\.parse_table.*\\'") ;from ~/Source/elpa/packages/wisi/wisi-autoloads.el +(simple-indent-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el +(wisitoken-grammar-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el +(coq-mode auto-mode-alist "\\.v\\'") ;from ~/Source/nongnu/packages/proof-general/generic/proof-autoloads.el ) From 8cc5013d5c6e013e59b7b9987f704138307ffd22 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 12:30:25 +0100 Subject: [PATCH 10/52] * doc/emacs/package.texi: Document 'package-autosuggest' --- doc/emacs/package.texi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 2022ea61f6b..b91a49cbf2e 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -408,6 +408,14 @@ name of the package archive directory. You can alter this list if you wish to use third party package archives---but do so at your own risk, and use only third parties that you think you can trust! +@cindex suggestions +@findex package-autosuggest + Emacs has a built-in database of suggested packages for certain file +types. If Emacs opens a file with no specific mode, you can use the +@code{package-autosuggest} command to install the recommended packages +from ELPA. By default, Emacs will display a clickable hint in the +mode-line if it there is a suggested package. + @anchor{Package Signing} @cindex package security @cindex package signing From 5a6717695ae1ce2ca3d13cd2db05f19f889f10ed Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 12:33:14 +0100 Subject: [PATCH 11/52] * etc/NEWS: Mention 'package-autosuggest' --- etc/NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index af6259a68c8..a808cc30b58 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -659,6 +659,13 @@ cloning, or prompts for that, too. When the argument is non-nil, the function switches to a buffer visiting the directory into which the repository was cloned. +** Package + ++++ +*** New command 'package-autosuggest' +Using a built-in database of package suggestions from ELPA, this command +will install viable packages if no specific major mode is available. + * New Modes and Packages in Emacs 31.1 From d9c581ead4da3764817939a7ff67ac3ecebab765 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 12:34:33 +0100 Subject: [PATCH 12/52] ; Fix typo in 'package--autosuggest-after-change-mode' --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 308c6ad1a51..2849c05fa41 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4686,7 +4686,7 @@ This function should be added to `after-change-major-mode-hook'." (message (substitute-command-keys (format "Found suggested packages: %s. Install using \\[package-autosuggest]" - pkgs)))p)))) + pkgs))))))) (defun package-autosuggest () "Prompt the user to install the suggested packages." From 48eefe094f3cfdd7135b1fb2a98f0699a4fb777e Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 12:44:50 +0100 Subject: [PATCH 13/52] Do not enable 'package-autosuggest-mode' by default As the feature is intrusive and can slow down startup time it is safer to disable the feature by default. * doc/emacs/package.texi (Package Installation): Explicitly mention the minor mode in the manual. * etc/NEWS: Document it here as well. * lisp/emacs-lisp/package.el (package-autosuggest-mode): Change default value to nil and autoload it. --- doc/emacs/package.texi | 6 ++++-- etc/NEWS | 6 ++++++ lisp/emacs-lisp/package.el | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index b91a49cbf2e..7f8b199c9f3 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -410,11 +410,13 @@ and use only third parties that you think you can trust! @cindex suggestions @findex package-autosuggest +@findex package-autosuggest-mode Emacs has a built-in database of suggested packages for certain file types. If Emacs opens a file with no specific mode, you can use the @code{package-autosuggest} command to install the recommended packages -from ELPA. By default, Emacs will display a clickable hint in the -mode-line if it there is a suggested package. +from ELPA. After enabling @code{package-autosuggest-mode}, Emacs will +display a clickable hint in the mode-line if it there is a suggested +package. @anchor{Package Signing} @cindex package security diff --git a/etc/NEWS b/etc/NEWS index a808cc30b58..dcbe75b6b8b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -666,6 +666,12 @@ the directory into which the repository was cloned. Using a built-in database of package suggestions from ELPA, this command will install viable packages if no specific major mode is available. ++++ +*** New minor mode 'package-autosuggest-mode' +When enabled, this displays a hint in the mode line indicating the +availability of a suggested package. You can customise the presentation +of these hints using 'package-autosuggest-style'. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 2849c05fa41..b5c48928fc5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4567,9 +4567,10 @@ the existence of a suggestion." (const :tag "Prompt only once" once) (const :tag "Indicate with message" message))) +;;;###autoload (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." - :init-value t :global t + :global t (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) From bf72666d41e643a842f1a18950f83874e88d588d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 15:26:01 +0100 Subject: [PATCH 14/52] Update 'package-autosuggest' database * admin/scrape-elpa.el (scrape-elpa): Detect 'add-to-list' expressions that are "hidden" under a 'progn'. * etc/package-autosuggest.eld: Re-generate database with more packages (after having run "make autoloads") and with the above improvement. --- admin/scrape-elpa.el | 25 +++++---- etc/package-autosuggest.eld | 109 ++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 12 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index 78dbd7349d0..0b04ba79982 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -29,7 +29,7 @@ "Scrape autoload files in DIRECTORIES for package suggestions. This file will automatically update \"package-autosuggest.eld\", but not save it. You should invoke this command with built GNU ELPA and NonGNU -ELPA checkouts (i.e. having run \"make build-all\" in both directories). +ELPA checkouts (i.e. having run \"make autoloads\" in both directories). Please review the results before updating the autosuggest database!" (interactive (completing-read-multiple "ELPA directories to scrape: " @@ -60,17 +60,18 @@ Please review the results before updating the autosuggest database!" (insert-file-contents file) (condition-case nil (while t - (pcase (read (current-buffer)) - (`(add-to-list - ',(and (or 'interpreter-mode-alist - 'magic-mode-alist - 'auto-mode-alist) - variable) - '(,(and (pred stringp) regexp) . - ,(and (pred symbolp) mode))) - (terpri) - (prin1 `(,mode ,variable ,regexp)) - (princ (concat " ;from " file))))) + (dolist (exp (macroexp-unprogn (read (current-buffer)))) + (pcase exp + (`(add-to-list + ',(and (or 'interpreter-mode-alist + 'magic-mode-alist + 'auto-mode-alist) + variable) + '(,(and (pred stringp) regexp) . + ,(and (pred symbolp) mode))) + (terpri) + (prin1 `(,mode ,variable ,regexp)) + (princ (concat " ;from " file)))))) (end-of-file nil)))))) (insert "\n)\n"))) diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index 742983fa9eb..a8977f194e5 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -41,6 +41,8 @@ (jgraph-mode auto-mode-alist "\\.jgr\\'") ;from ~/Source/elpa/packages/jgraph-mode/jgraph-mode-autoloads.el (json-mode auto-mode-alist "\\.json\\'") ;from ~/Source/elpa/packages/json-mode/json-mode-autoloads.el (lmc-asm-mode auto-mode-alist "\\.elmc\\'") ;from ~/Source/elpa/packages/lmc/lmc-autoloads.el +(tlc-mode auto-mode-alist "\\.tlc\\'") ;from ~/Source/elpa/packages/matlab-mode/matlab-mode-autoloads.el +(tlc-mode auto-mode-alist "\\.tlc\\'") ;from ~/Source/elpa/packages/matlab/matlab-autoloads.el (muse-mode-choose-mode auto-mode-alist "\\.muse\\'") ;from ~/Source/elpa/packages/muse/lisp/muse-autoloads.el (latex-mode auto-mode-alist "\\.drv\\'") ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el (doctex-mode auto-mode-alist "\\.dtx\\'") ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el @@ -75,5 +77,112 @@ (wisitoken-parse_table-mode auto-mode-alist "\\.parse_table.*\\'") ;from ~/Source/elpa/packages/wisi/wisi-autoloads.el (simple-indent-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el (wisitoken-grammar-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el +(adoc-mode auto-mode-alist "\\.a\\(?:scii\\)?doc\\'") ;from ~/Source/nongnu/packages/adoc-mode/adoc-mode-autoloads.el +(apache-mode auto-mode-alist "/\\.htaccess\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el +(apache-mode auto-mode-alist "/\\(?:access\\|httpd\\|srm\\)\\.conf\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el +(apache-mode auto-mode-alist "/apache2/.+\\.conf\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el +(apache-mode auto-mode-alist "/httpd/conf/.+\\.conf\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el +(apache-mode auto-mode-alist "/apache2/sites-\\(?:available\\|enabled\\)/") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el +(arduino-mode auto-mode-alist "\\.pde\\'") ;from ~/Source/nongnu/packages/arduino-mode/arduino-mode-autoloads.el +(arduino-mode auto-mode-alist "\\.ino\\'") ;from ~/Source/nongnu/packages/arduino-mode/arduino-mode-autoloads.el +(beancount-mode auto-mode-alist "\\.beancount\\'") ;from ~/Source/nongnu/packages/beancount/beancount-autoloads.el +(bison-mode auto-mode-alist "\\.y\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el +(flex-mode auto-mode-alist "\\.l\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el +(jison-mode auto-mode-alist "\\.jison\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el +(bqn-mode auto-mode-alist "\\.bqn\\'") ;from ~/Source/nongnu/packages/bqn-mode/bqn-mode-autoloads.el +(bqn-mode interpreter-mode-alist "bqn") ;from ~/Source/nongnu/packages/bqn-mode/bqn-mode-autoloads.el +(clojure-mode auto-mode-alist "\\.\\(clj\\|cljd\\|dtm\\|edn\\|lpy\\)\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojurec-mode auto-mode-alist "\\.cljc\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojurescript-mode auto-mode-alist "\\.cljs\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojure-mode auto-mode-alist "\\(?:build\\|profile\\)\\.boot\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojure-mode interpreter-mode-alist "bb") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojurescript-mode interpreter-mode-alist "nbb") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(coffee-mode auto-mode-alist "\\.coffee\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el +(coffee-mode auto-mode-alist "\\.iced\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el +(coffee-mode auto-mode-alist "Cakefile\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el +(coffee-mode auto-mode-alist "\\.cson\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el +(coffee-mode interpreter-mode-alist "coffee") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el +(d-mode auto-mode-alist "\\.d[i]?\\'") ;from ~/Source/nongnu/packages/d-mode/d-mode-autoloads.el +(dart-mode auto-mode-alist "\\.dart\\'") ;from ~/Source/nongnu/packages/dart-mode/dart-mode-autoloads.el +(dockerfile-mode auto-mode-alist "\\.dockerfile\\'") ;from ~/Source/nongnu/packages/dockerfile-mode/dockerfile-mode-autoloads.el +(php-mode auto-mode-alist "[^/]\\.\\(module\\|test\\|install\\|profile\\|tpl\\.php\\|theme\\|inc\\)\\'") ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el +(conf-windows-mode auto-mode-alist "[^/]\\.info\\'") ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el +(drush-make-mode auto-mode-alist "[^/]\\.make\\'") ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el +(editorconfig-conf-mode auto-mode-alist "\\.editorconfig\\'") ;from ~/Source/nongnu/packages/editorconfig/editorconfig-autoloads.el +(elixir-mode auto-mode-alist "\\.elixir\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el +(elixir-mode auto-mode-alist "\\.ex\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el +(elixir-mode auto-mode-alist "\\.exs\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el +(elixir-mode auto-mode-alist "mix\\.lock") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el +(ett-mode auto-mode-alist "\\.ett\\'") ;from ~/Source/nongnu/packages/ett/ett-autoloads.el +(forth-mode auto-mode-alist "\\.\\(f\\|fs\\|fth\\|4th\\)\\'") ;from ~/Source/nongnu/packages/forth-mode/forth-mode-autoloads.el +(scheme-mode auto-mode-alist "\\.rkt\\'") ;from ~/Source/nongnu/packages/geiser-racket/geiser-racket-autoloads.el +(gnu-apl-mode auto-mode-alist "\\.apl\\'") ;from ~/Source/nongnu/packages/gnu-apl-mode/gnu-apl-mode-autoloads.el +(gnu-apl-mode interpreter-mode-alist "apl") ;from ~/Source/nongnu/packages/gnu-apl-mode/gnu-apl-mode-autoloads.el +(go-dot-mod-mode auto-mode-alist "go\\.mod\\'") ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el +(go-dot-work-mode auto-mode-alist "go\\.work\\'") ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el +(graphql-mode auto-mode-alist "\\.graphql\\'") ;from ~/Source/nongnu/packages/graphql-mode/graphql-mode-autoloads.el +(graphql-mode auto-mode-alist "\\.gql\\'") ;from ~/Source/nongnu/packages/graphql-mode/graphql-mode-autoloads.el +(haml-mode auto-mode-alist "\\.haml\\'") ;from ~/Source/nongnu/packages/haml-mode/haml-mode-autoloads.el +(ghc-core-mode auto-mode-alist "\\.hcr\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(ghc-core-mode auto-mode-alist "\\.dump-simpl\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(ghci-script-mode auto-mode-alist "\\.ghci\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-c2hs-mode auto-mode-alist "\\.chs\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-cabal-mode auto-mode-alist "\\.cabal\\'\\|/cabal\\.project\\|/\\.cabal/config\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.[gh]s\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.hsig\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-literate-mode auto-mode-alist "\\.l[gh]s\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.hsc\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode interpreter-mode-alist "runghc") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode interpreter-mode-alist "runhaskell") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(j-mode auto-mode-alist "\\.ij[rsp]$") ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el +(j-lab-mode auto-mode-alist "\\.ijt$") ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el +(jade-mode auto-mode-alist "\\.jade\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el +(jade-mode auto-mode-alist "\\.pug\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el +(stylus-mode auto-mode-alist "\\.styl\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el +(jinja2-mode auto-mode-alist "\\.jinja2\\'") ;from ~/Source/nongnu/packages/jinja2-mode/jinja2-mode-autoloads.el +(jinja2-mode auto-mode-alist "\\.j2\\'") ;from ~/Source/nongnu/packages/jinja2-mode/jinja2-mode-autoloads.el +(julia-mode auto-mode-alist "\\.jl\\'") ;from ~/Source/nongnu/packages/julia-mode/julia-mode-autoloads.el +(lua-mode auto-mode-alist "\\.lua\\'") ;from ~/Source/nongnu/packages/lua-mode/lua-mode-autoloads.el +(lua-mode interpreter-mode-alist "lua") ;from ~/Source/nongnu/packages/lua-mode/lua-mode-autoloads.el +(markdown-mode auto-mode-alist "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'") ;from ~/Source/nongnu/packages/markdown-mode/markdown-mode-autoloads.el +(nginx-mode auto-mode-alist "nginx\\.conf\\'") ;from ~/Source/nongnu/packages/nginx-mode/nginx-mode-autoloads.el +(nginx-mode auto-mode-alist "/nginx/.+\\.conf\\'") ;from ~/Source/nongnu/packages/nginx-mode/nginx-mode-autoloads.el +(nix-drv-mode auto-mode-alist "^/nix/store/.+\\.drv\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el +(js-mode auto-mode-alist "\\flake.lock\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el +(nix-mode auto-mode-alist "\\.nix\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el +(php-mode auto-mode-alist "/\\.php_cs\\(?:\\.dist\\)?\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el +(php-mode auto-mode-alist "\\.\\(?:php\\.inc\\|stub\\)\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el +(php-mode-maybe auto-mode-alist "\\.\\(?:php[s345]?\\|phtml\\)\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el (coq-mode auto-mode-alist "\\.v\\'") ;from ~/Source/nongnu/packages/proof-general/generic/proof-autoloads.el +(racket-mode auto-mode-alist "\\.rkt\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el +(racket-mode auto-mode-alist "\\.rktd\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el +(racket-mode auto-mode-alist "\\.rktl\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el +(racket-mode interpreter-mode-alist "racket") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el +(raku-mode interpreter-mode-alist "perl6\\|raku") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el +(raku-mode auto-mode-alist "\\.p[lm]?6\\'") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el +(raku-mode auto-mode-alist "\\.nqp\\'") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el +(raku-mode auto-mode-alist "\\.raku\\(?:mod\\|test\\)?\\'") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el +(rfc-mode auto-mode-alist "/rfc[0-9]+\\.txt\\'") ;from ~/Source/nongnu/packages/rfc-mode/rfc-mode-autoloads.el +(rust-mode auto-mode-alist "\\.rs\\'") ;from ~/Source/nongnu/packages/rust-mode/rust-mode-autoloads.el +(sass-mode auto-mode-alist "\\.sass\\'") ;from ~/Source/nongnu/packages/sass-mode/sass-mode-autoloads.el +(scad-mode auto-mode-alist "\\.scad\\'") ;from ~/Source/nongnu/packages/scad-mode/scad-mode-autoloads.el +(scala-mode auto-mode-alist "\\.\\(scala\\|sbt\\|worksheet\\.sc\\)\\'") ;from ~/Source/nongnu/packages/scala-mode/scala-mode-autoloads.el +(jade-mode auto-mode-alist "\\.jade\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el +(jade-mode auto-mode-alist "\\.pug\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el +(stylus-mode auto-mode-alist "\\.styl\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el +(subed-ass-mode auto-mode-alist "\\.ass\\'") ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el +(subed-srt-mode auto-mode-alist "\\.srt\\'") ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el +(subed-vtt-mode auto-mode-alist "\\.vtt\\'") ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el +(swift-mode auto-mode-alist "\\.swift\\(interface\\)?\\'") ;from ~/Source/nongnu/packages/swift-mode/swift-mode-autoloads.el +(systemd-mode auto-mode-alist "\\.nspawn\\'") ;from ~/Source/nongnu/packages/systemd/systemd-autoloads.el +(tuareg-mode auto-mode-alist "\\.ml[ip]?\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg-mode auto-mode-alist "\\.eliomi?\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg-mode interpreter-mode-alist "ocamlrun") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg-mode interpreter-mode-alist "ocaml") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg-menhir-mode auto-mode-alist "\\.mly\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg-opam-mode auto-mode-alist "[./]opam_?\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(typescript-mode auto-mode-alist "\\.ts\\'") ;from ~/Source/nongnu/packages/typescript-mode/typescript-mode-autoloads.el +(yaml-mode auto-mode-alist "\\.\\(e?ya?\\|ra\\)ml\\'") ;from ~/Source/nongnu/packages/yaml-mode/yaml-mode-autoloads.el +(yaml-mode magic-mode-alist "^%YAML\\s-+[0-9]+\\.[0-9]+\\(\\s-+#\\|\\s-*$\\)") ;from ~/Source/nongnu/packages/yaml-mode/yaml-mode-autoloads.el +(zig-mode auto-mode-alist "\\.\\(zig\\|zon\\)\\'") ;from ~/Source/nongnu/packages/zig-mode/zig-mode-autoloads.el ) From 450c49af1c629c06669732ca12869f747f773963 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 15:56:52 +0100 Subject: [PATCH 15/52] Distinguish between suggested packages and major modes * admin/scrape-elpa.el (scrape-elpa): Infer package names from autoloads file. * etc/package-autosuggest.eld: Recompute database. * lisp/emacs-lisp/package.el (package-autosuggest-database): Update documentation to clarify how the major mode can be explicitly indicated. (package--suggestion-applies-p): Handle the optional fourth element. --- admin/scrape-elpa.el | 7 +- etc/package-autosuggest.eld | 168 ++++++++++++++++++------------------ lisp/emacs-lisp/package.el | 15 ++-- 3 files changed, 99 insertions(+), 91 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index 0b04ba79982..ef2b189883e 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -55,7 +55,9 @@ Please review the results before updating the autosuggest database!" dir "-autoloads\\.el\\'")) directories)) "Scraping files..." - (let ((inhibit-message t)) + (and-let* (((string-match "/\\([^/]+?\\)-autoloads\\.el\\'" file)) + (pkg (intern (match-string 1 file))) + (inhibit-message t)) (with-temp-buffer (insert-file-contents file) (condition-case nil @@ -70,7 +72,8 @@ Please review the results before updating the autosuggest database!" '(,(and (pred stringp) regexp) . ,(and (pred symbolp) mode))) (terpri) - (prin1 `(,mode ,variable ,regexp)) + (prin1 (append (list pkg variable regexp) + (and (not (eq pkg mode)) (list mode)))) (princ (concat " ;from " file)))))) (end-of-file nil)))))) (insert "\n)\n"))) diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index a8977f194e5..38cf121a49e 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -5,47 +5,47 @@ ( (ada-mode auto-mode-alist "\\.ad[abs]\\'") ;from ~/Source/elpa/packages/ada-mode/ada-mode-autoloads.el -(arbitools-mode auto-mode-alist "\\.trf?\\'") ;from ~/Source/elpa/packages/arbitools/arbitools-autoloads.el -(LaTeX-mode auto-mode-alist "\\.hva\\'") ;from ~/Source/elpa/packages/auctex/auctex-autoloads.el +(arbitools auto-mode-alist "\\.trf?\\'" arbitools-mode) ;from ~/Source/elpa/packages/arbitools/arbitools-autoloads.el +(auctex auto-mode-alist "\\.hva\\'" LaTeX-mode) ;from ~/Source/elpa/packages/auctex/auctex-autoloads.el (bnf-mode auto-mode-alist "\\.bnf\\'") ;from ~/Source/elpa/packages/bnf-mode/bnf-mode-autoloads.el -(chess-pgn-mode auto-mode-alist "\\.pgn\\'") ;from ~/Source/elpa/packages/chess/chess-autoloads.el +(chess auto-mode-alist "\\.pgn\\'" chess-pgn-mode) ;from ~/Source/elpa/packages/chess/chess-autoloads.el (cobol-mode auto-mode-alist "\\.c\\(ob\\|bl\\|py\\)\\'") ;from ~/Source/elpa/packages/cobol-mode/cobol-mode-autoloads.el -(code-cells-convert-ipynb auto-mode-alist "\\.ipynb\\'") ;from ~/Source/elpa/packages/code-cells/code-cells-autoloads.el +(code-cells auto-mode-alist "\\.ipynb\\'" code-cells-convert-ipynb) ;from ~/Source/elpa/packages/code-cells/code-cells-autoloads.el (csharp-mode auto-mode-alist "\\.cs\\'") ;from ~/Source/elpa/packages/csharp-mode/csharp-mode-autoloads.el (csv-mode auto-mode-alist "\\.[Cc][Ss][Vv]\\'") ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el -(tsv-mode auto-mode-alist "\\.tsv\\'") ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el -(dismal-mode auto-mode-alist "\\.dis\\'") ;from ~/Source/elpa/packages/dismal/dismal-autoloads.el -(djvu-init-mode auto-mode-alist "\\.djvu\\'") ;from ~/Source/elpa/packages/djvu/djvu-autoloads.el +(csv-mode auto-mode-alist "\\.tsv\\'" tsv-mode) ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el +(dismal auto-mode-alist "\\.dis\\'" dismal-mode) ;from ~/Source/elpa/packages/dismal/dismal-autoloads.el +(djvu auto-mode-alist "\\.djvu\\'" djvu-init-mode) ;from ~/Source/elpa/packages/djvu/djvu-autoloads.el (dts-mode auto-mode-alist "\\.dtsi?\\'") ;from ~/Source/elpa/packages/dts-mode/dts-mode-autoloads.el -(ess-bugs-mode auto-mode-alist "\\.[Bb][Uu][Gg]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-bugs-mode auto-mode-alist "\\.[Bb][Oo][Gg]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-bugs-mode auto-mode-alist "\\.[Bb][Mm][Dd]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-jags-mode auto-mode-alist "\\.[Jj][Aa][Gg]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode auto-mode-alist "/R/.*\\.q\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode auto-mode-alist "\\.[rR]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode auto-mode-alist "\\.[rR]profile\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode auto-mode-alist "NAMESPACE\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode auto-mode-alist "CITATION\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-transcript-mode auto-mode-alist "\\.[Rr]out\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode interpreter-mode-alist "Rscript") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess-r-mode interpreter-mode-alist "r") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(makefile-mode auto-mode-alist "/Makevars\\(\\.win\\)?\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(conf-colon-mode auto-mode-alist "DESCRIPTION\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(Rd-mode auto-mode-alist "\\.Rd\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(S-transcript-mode auto-mode-alist "\\.[Ss]t\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(S-transcript-mode auto-mode-alist "\\.Sout\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(SAS-mode auto-mode-alist "\\.[Ss][Aa][Ss]\\'") ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Bb][Uu][Gg]\\'" ess-bugs-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Bb][Oo][Gg]\\'" ess-bugs-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Bb][Mm][Dd]\\'" ess-bugs-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Jj][Aa][Gg]\\'" ess-jags-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "/R/.*\\.q\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[rR]\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[rR]profile\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "NAMESPACE\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "CITATION\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Rr]out\\'" ess-r-transcript-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess interpreter-mode-alist "Rscript" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess interpreter-mode-alist "r" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "/Makevars\\(\\.win\\)?\\'" makefile-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "DESCRIPTION\\'" conf-colon-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.Rd\\'" Rd-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Ss]t\\'" S-transcript-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.Sout\\'" S-transcript-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el +(ess auto-mode-alist "\\.[Ss][Aa][Ss]\\'" SAS-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el (gle-mode auto-mode-alist "\\.gle\\'") ;from ~/Source/elpa/packages/gle-mode/gle-mode-autoloads.el (gpr-mode auto-mode-alist "\\.gpr\\'") ;from ~/Source/elpa/packages/gpr-mode/gpr-mode-autoloads.el -(nxml-mode auto-mode-alist "\\.html?\\'") ;from ~/Source/elpa/packages/html5-schema/html5-schema-autoloads.el +(html5-schema auto-mode-alist "\\.html?\\'" nxml-mode) ;from ~/Source/elpa/packages/html5-schema/html5-schema-autoloads.el (jgraph-mode auto-mode-alist "\\.jgr\\'") ;from ~/Source/elpa/packages/jgraph-mode/jgraph-mode-autoloads.el (json-mode auto-mode-alist "\\.json\\'") ;from ~/Source/elpa/packages/json-mode/json-mode-autoloads.el -(lmc-asm-mode auto-mode-alist "\\.elmc\\'") ;from ~/Source/elpa/packages/lmc/lmc-autoloads.el -(tlc-mode auto-mode-alist "\\.tlc\\'") ;from ~/Source/elpa/packages/matlab-mode/matlab-mode-autoloads.el -(tlc-mode auto-mode-alist "\\.tlc\\'") ;from ~/Source/elpa/packages/matlab/matlab-autoloads.el -(muse-mode-choose-mode auto-mode-alist "\\.muse\\'") ;from ~/Source/elpa/packages/muse/lisp/muse-autoloads.el -(latex-mode auto-mode-alist "\\.drv\\'") ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el -(doctex-mode auto-mode-alist "\\.dtx\\'") ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el +(lmc auto-mode-alist "\\.elmc\\'" lmc-asm-mode) ;from ~/Source/elpa/packages/lmc/lmc-autoloads.el +(matlab-mode auto-mode-alist "\\.tlc\\'" tlc-mode) ;from ~/Source/elpa/packages/matlab-mode/matlab-mode-autoloads.el +(matlab auto-mode-alist "\\.tlc\\'" tlc-mode) ;from ~/Source/elpa/packages/matlab/matlab-autoloads.el +(muse auto-mode-alist "\\.muse\\'" muse-mode-choose-mode) ;from ~/Source/elpa/packages/muse/lisp/muse-autoloads.el +(auctex auto-mode-alist "\\.drv\\'" latex-mode) ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el +(auctex auto-mode-alist "\\.dtx\\'" doctex-mode) ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el (nftables-mode auto-mode-alist "\\.nft\\(?:ables\\)?\\'") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el (nftables-mode auto-mode-alist "/etc/nftables.conf") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el (nftables-mode interpreter-mode-alist "nft\\(?:ables\\)?") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el @@ -53,7 +53,7 @@ (omn-mode auto-mode-alist "\\.omn\\'") ;from ~/Source/elpa/packages/omn-mode/omn-mode-autoloads.el (poke-mode auto-mode-alist "\\.pk\\'") ;from ~/Source/elpa/packages/poke-mode/poke-mode-autoloads.el (pspp-mode auto-mode-alist "\\.sps\\'") ;from ~/Source/elpa/packages/pspp-mode/pspp-mode-autoloads.el -(conf-mode auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'") ;from ~/Source/elpa/packages/python/python-autoloads.el +(python auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'" conf-mode) ;from ~/Source/elpa/packages/python/python-autoloads.el (rec-mode auto-mode-alist "\\.rec\\'") ;from ~/Source/elpa/packages/rec-mode/rec-mode-autoloads.el (rnc-mode auto-mode-alist "\\.rnc\\'") ;from ~/Source/elpa/packages/rnc-mode/rnc-mode-autoloads.el (sed-mode auto-mode-alist "\\.sed\\'") ;from ~/Source/elpa/packages/sed-mode/sed-mode-autoloads.el @@ -62,20 +62,20 @@ (sisu-mode auto-mode-alist "\\.ss[imt]\\'") ;from ~/Source/elpa/packages/sisu-mode/sisu-mode-autoloads.el (smalltalk-mode auto-mode-alist "\\.st\\'") ;from ~/Source/elpa/packages/smalltalk-mode/smalltalk-mode-autoloads.el (sml-mode auto-mode-alist "\\.s\\(ml\\|ig\\)\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el -(sml-cm-mode auto-mode-alist "\\.cm\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el -(sml-yacc-mode auto-mode-alist "\\.grm\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el -(sql-mode auto-mode-alist "\\.cql\\'") ;from ~/Source/elpa/packages/sql-cassandra/sql-cassandra-autoloads.el +(sml-mode auto-mode-alist "\\.cm\\'" sml-cm-mode) ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el +(sml-mode auto-mode-alist "\\.grm\\'" sml-yacc-mode) ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el +(sql-cassandra auto-mode-alist "\\.cql\\'" sql-mode) ;from ~/Source/elpa/packages/sql-cassandra/sql-cassandra-autoloads.el (sxhkdrc-mode auto-mode-alist "sxhkdrc\\'") ;from ~/Source/elpa/packages/sxhkdrc-mode/sxhkdrc-mode-autoloads.el -(systemd-automount-mode auto-mode-alist "\\.automount\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd-mount-mode auto-mode-alist "\\.mount\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd-path-mode auto-mode-alist "\\.path\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd-service-mode auto-mode-alist "\\.service\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd-socket-mode auto-mode-alist "\\.socket\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd-swap-mode auto-mode-alist "\\.swap\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd-timer-mode auto-mode-alist "\\.timer\\'") ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(vcard-mode auto-mode-alist "\\.[Vv][Cc][Ff]\\'") ;from ~/Source/elpa/packages/vcard/vcard-autoloads.el -(wisitoken-parse_table-mode auto-mode-alist "\\.parse_table.*\\'") ;from ~/Source/elpa/packages/wisi/wisi-autoloads.el -(simple-indent-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el +(systemd auto-mode-alist "\\.automount\\'" systemd-automount-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd auto-mode-alist "\\.mount\\'" systemd-mount-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd auto-mode-alist "\\.path\\'" systemd-path-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd auto-mode-alist "\\.service\\'" systemd-service-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd auto-mode-alist "\\.socket\\'" systemd-socket-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd auto-mode-alist "\\.swap\\'" systemd-swap-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(systemd auto-mode-alist "\\.timer\\'" systemd-timer-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el +(vcard auto-mode-alist "\\.[Vv][Cc][Ff]\\'" vcard-mode) ;from ~/Source/elpa/packages/vcard/vcard-autoloads.el +(wisi auto-mode-alist "\\.parse_table.*\\'" wisitoken-parse_table-mode) ;from ~/Source/elpa/packages/wisi/wisi-autoloads.el +(wisitoken-grammar-mode auto-mode-alist "\\.wy\\'" simple-indent-mode) ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el (wisitoken-grammar-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el (adoc-mode auto-mode-alist "\\.a\\(?:scii\\)?doc\\'") ;from ~/Source/nongnu/packages/adoc-mode/adoc-mode-autoloads.el (apache-mode auto-mode-alist "/\\.htaccess\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el @@ -85,18 +85,18 @@ (apache-mode auto-mode-alist "/apache2/sites-\\(?:available\\|enabled\\)/") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el (arduino-mode auto-mode-alist "\\.pde\\'") ;from ~/Source/nongnu/packages/arduino-mode/arduino-mode-autoloads.el (arduino-mode auto-mode-alist "\\.ino\\'") ;from ~/Source/nongnu/packages/arduino-mode/arduino-mode-autoloads.el -(beancount-mode auto-mode-alist "\\.beancount\\'") ;from ~/Source/nongnu/packages/beancount/beancount-autoloads.el +(beancount auto-mode-alist "\\.beancount\\'" beancount-mode) ;from ~/Source/nongnu/packages/beancount/beancount-autoloads.el (bison-mode auto-mode-alist "\\.y\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el -(flex-mode auto-mode-alist "\\.l\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el -(jison-mode auto-mode-alist "\\.jison\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el +(bison-mode auto-mode-alist "\\.l\\'" flex-mode) ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el +(bison-mode auto-mode-alist "\\.jison\\'" jison-mode) ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el (bqn-mode auto-mode-alist "\\.bqn\\'") ;from ~/Source/nongnu/packages/bqn-mode/bqn-mode-autoloads.el (bqn-mode interpreter-mode-alist "bqn") ;from ~/Source/nongnu/packages/bqn-mode/bqn-mode-autoloads.el (clojure-mode auto-mode-alist "\\.\\(clj\\|cljd\\|dtm\\|edn\\|lpy\\)\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojurec-mode auto-mode-alist "\\.cljc\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojurescript-mode auto-mode-alist "\\.cljs\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojure-mode auto-mode-alist "\\.cljc\\'" clojurec-mode) ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojure-mode auto-mode-alist "\\.cljs\\'" clojurescript-mode) ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el (clojure-mode auto-mode-alist "\\(?:build\\|profile\\)\\.boot\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el (clojure-mode interpreter-mode-alist "bb") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojurescript-mode interpreter-mode-alist "nbb") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el +(clojure-mode interpreter-mode-alist "nbb" clojurescript-mode) ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el (coffee-mode auto-mode-alist "\\.coffee\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el (coffee-mode auto-mode-alist "\\.iced\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el (coffee-mode auto-mode-alist "Cakefile\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el @@ -105,40 +105,40 @@ (d-mode auto-mode-alist "\\.d[i]?\\'") ;from ~/Source/nongnu/packages/d-mode/d-mode-autoloads.el (dart-mode auto-mode-alist "\\.dart\\'") ;from ~/Source/nongnu/packages/dart-mode/dart-mode-autoloads.el (dockerfile-mode auto-mode-alist "\\.dockerfile\\'") ;from ~/Source/nongnu/packages/dockerfile-mode/dockerfile-mode-autoloads.el -(php-mode auto-mode-alist "[^/]\\.\\(module\\|test\\|install\\|profile\\|tpl\\.php\\|theme\\|inc\\)\\'") ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el -(conf-windows-mode auto-mode-alist "[^/]\\.info\\'") ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el -(drush-make-mode auto-mode-alist "[^/]\\.make\\'") ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el -(editorconfig-conf-mode auto-mode-alist "\\.editorconfig\\'") ;from ~/Source/nongnu/packages/editorconfig/editorconfig-autoloads.el +(drupal-mode auto-mode-alist "[^/]\\.\\(module\\|test\\|install\\|profile\\|tpl\\.php\\|theme\\|inc\\)\\'" php-mode) ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el +(drupal-mode auto-mode-alist "[^/]\\.info\\'" conf-windows-mode) ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el +(drupal-mode auto-mode-alist "[^/]\\.make\\'" drush-make-mode) ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el +(editorconfig auto-mode-alist "\\.editorconfig\\'" editorconfig-conf-mode) ;from ~/Source/nongnu/packages/editorconfig/editorconfig-autoloads.el (elixir-mode auto-mode-alist "\\.elixir\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el (elixir-mode auto-mode-alist "\\.ex\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el (elixir-mode auto-mode-alist "\\.exs\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el (elixir-mode auto-mode-alist "mix\\.lock") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el -(ett-mode auto-mode-alist "\\.ett\\'") ;from ~/Source/nongnu/packages/ett/ett-autoloads.el +(ett auto-mode-alist "\\.ett\\'" ett-mode) ;from ~/Source/nongnu/packages/ett/ett-autoloads.el (forth-mode auto-mode-alist "\\.\\(f\\|fs\\|fth\\|4th\\)\\'") ;from ~/Source/nongnu/packages/forth-mode/forth-mode-autoloads.el -(scheme-mode auto-mode-alist "\\.rkt\\'") ;from ~/Source/nongnu/packages/geiser-racket/geiser-racket-autoloads.el +(geiser-racket auto-mode-alist "\\.rkt\\'" scheme-mode) ;from ~/Source/nongnu/packages/geiser-racket/geiser-racket-autoloads.el (gnu-apl-mode auto-mode-alist "\\.apl\\'") ;from ~/Source/nongnu/packages/gnu-apl-mode/gnu-apl-mode-autoloads.el (gnu-apl-mode interpreter-mode-alist "apl") ;from ~/Source/nongnu/packages/gnu-apl-mode/gnu-apl-mode-autoloads.el -(go-dot-mod-mode auto-mode-alist "go\\.mod\\'") ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el -(go-dot-work-mode auto-mode-alist "go\\.work\\'") ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el +(go-mode auto-mode-alist "go\\.mod\\'" go-dot-mod-mode) ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el +(go-mode auto-mode-alist "go\\.work\\'" go-dot-work-mode) ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el (graphql-mode auto-mode-alist "\\.graphql\\'") ;from ~/Source/nongnu/packages/graphql-mode/graphql-mode-autoloads.el (graphql-mode auto-mode-alist "\\.gql\\'") ;from ~/Source/nongnu/packages/graphql-mode/graphql-mode-autoloads.el (haml-mode auto-mode-alist "\\.haml\\'") ;from ~/Source/nongnu/packages/haml-mode/haml-mode-autoloads.el -(ghc-core-mode auto-mode-alist "\\.hcr\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(ghc-core-mode auto-mode-alist "\\.dump-simpl\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(ghci-script-mode auto-mode-alist "\\.ghci\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-c2hs-mode auto-mode-alist "\\.chs\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-cabal-mode auto-mode-alist "\\.cabal\\'\\|/cabal\\.project\\|/\\.cabal/config\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.hcr\\'" ghc-core-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.dump-simpl\\'" ghc-core-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.ghci\\'" ghci-script-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.chs\\'" haskell-c2hs-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.cabal\\'\\|/cabal\\.project\\|/\\.cabal/config\\'" haskell-cabal-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el (haskell-mode auto-mode-alist "\\.[gh]s\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el (haskell-mode auto-mode-alist "\\.hsig\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-literate-mode auto-mode-alist "\\.l[gh]s\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el +(haskell-mode auto-mode-alist "\\.l[gh]s\\'" haskell-literate-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el (haskell-mode auto-mode-alist "\\.hsc\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el (haskell-mode interpreter-mode-alist "runghc") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el (haskell-mode interpreter-mode-alist "runhaskell") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el (j-mode auto-mode-alist "\\.ij[rsp]$") ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el -(j-lab-mode auto-mode-alist "\\.ijt$") ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el +(j-mode auto-mode-alist "\\.ijt$" j-lab-mode) ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el (jade-mode auto-mode-alist "\\.jade\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el (jade-mode auto-mode-alist "\\.pug\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el -(stylus-mode auto-mode-alist "\\.styl\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el +(jade-mode auto-mode-alist "\\.styl\\'" stylus-mode) ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el (jinja2-mode auto-mode-alist "\\.jinja2\\'") ;from ~/Source/nongnu/packages/jinja2-mode/jinja2-mode-autoloads.el (jinja2-mode auto-mode-alist "\\.j2\\'") ;from ~/Source/nongnu/packages/jinja2-mode/jinja2-mode-autoloads.el (julia-mode auto-mode-alist "\\.jl\\'") ;from ~/Source/nongnu/packages/julia-mode/julia-mode-autoloads.el @@ -147,13 +147,13 @@ (markdown-mode auto-mode-alist "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'") ;from ~/Source/nongnu/packages/markdown-mode/markdown-mode-autoloads.el (nginx-mode auto-mode-alist "nginx\\.conf\\'") ;from ~/Source/nongnu/packages/nginx-mode/nginx-mode-autoloads.el (nginx-mode auto-mode-alist "/nginx/.+\\.conf\\'") ;from ~/Source/nongnu/packages/nginx-mode/nginx-mode-autoloads.el -(nix-drv-mode auto-mode-alist "^/nix/store/.+\\.drv\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el -(js-mode auto-mode-alist "\\flake.lock\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el +(nix-mode auto-mode-alist "^/nix/store/.+\\.drv\\'" nix-drv-mode) ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el +(nix-mode auto-mode-alist "\\flake.lock\\'" js-mode) ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el (nix-mode auto-mode-alist "\\.nix\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el (php-mode auto-mode-alist "/\\.php_cs\\(?:\\.dist\\)?\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el (php-mode auto-mode-alist "\\.\\(?:php\\.inc\\|stub\\)\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el -(php-mode-maybe auto-mode-alist "\\.\\(?:php[s345]?\\|phtml\\)\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el -(coq-mode auto-mode-alist "\\.v\\'") ;from ~/Source/nongnu/packages/proof-general/generic/proof-autoloads.el +(php-mode auto-mode-alist "\\.\\(?:php[s345]?\\|phtml\\)\\'" php-mode-maybe) ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el +(proof auto-mode-alist "\\.v\\'" coq-mode) ;from ~/Source/nongnu/packages/proof-general/generic/proof-autoloads.el (racket-mode auto-mode-alist "\\.rkt\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el (racket-mode auto-mode-alist "\\.rktd\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el (racket-mode auto-mode-alist "\\.rktl\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el @@ -167,20 +167,20 @@ (sass-mode auto-mode-alist "\\.sass\\'") ;from ~/Source/nongnu/packages/sass-mode/sass-mode-autoloads.el (scad-mode auto-mode-alist "\\.scad\\'") ;from ~/Source/nongnu/packages/scad-mode/scad-mode-autoloads.el (scala-mode auto-mode-alist "\\.\\(scala\\|sbt\\|worksheet\\.sc\\)\\'") ;from ~/Source/nongnu/packages/scala-mode/scala-mode-autoloads.el -(jade-mode auto-mode-alist "\\.jade\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el -(jade-mode auto-mode-alist "\\.pug\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el +(stylus-mode auto-mode-alist "\\.jade\\'" jade-mode) ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el +(stylus-mode auto-mode-alist "\\.pug\\'" jade-mode) ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el (stylus-mode auto-mode-alist "\\.styl\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el -(subed-ass-mode auto-mode-alist "\\.ass\\'") ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el -(subed-srt-mode auto-mode-alist "\\.srt\\'") ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el -(subed-vtt-mode auto-mode-alist "\\.vtt\\'") ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el +(subed auto-mode-alist "\\.ass\\'" subed-ass-mode) ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el +(subed auto-mode-alist "\\.srt\\'" subed-srt-mode) ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el +(subed auto-mode-alist "\\.vtt\\'" subed-vtt-mode) ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el (swift-mode auto-mode-alist "\\.swift\\(interface\\)?\\'") ;from ~/Source/nongnu/packages/swift-mode/swift-mode-autoloads.el -(systemd-mode auto-mode-alist "\\.nspawn\\'") ;from ~/Source/nongnu/packages/systemd/systemd-autoloads.el -(tuareg-mode auto-mode-alist "\\.ml[ip]?\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg-mode auto-mode-alist "\\.eliomi?\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg-mode interpreter-mode-alist "ocamlrun") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg-mode interpreter-mode-alist "ocaml") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg-menhir-mode auto-mode-alist "\\.mly\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg-opam-mode auto-mode-alist "[./]opam_?\\'") ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(systemd auto-mode-alist "\\.nspawn\\'" systemd-mode) ;from ~/Source/nongnu/packages/systemd/systemd-autoloads.el +(tuareg auto-mode-alist "\\.ml[ip]?\\'" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg auto-mode-alist "\\.eliomi?\\'" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg interpreter-mode-alist "ocamlrun" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg interpreter-mode-alist "ocaml" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg auto-mode-alist "\\.mly\\'" tuareg-menhir-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el +(tuareg auto-mode-alist "[./]opam_?\\'" tuareg-opam-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el (typescript-mode auto-mode-alist "\\.ts\\'") ;from ~/Source/nongnu/packages/typescript-mode/typescript-mode-autoloads.el (yaml-mode auto-mode-alist "\\.\\(e?ya?\\|ra\\)ml\\'") ;from ~/Source/nongnu/packages/yaml-mode/yaml-mode-autoloads.el (yaml-mode magic-mode-alist "^%YAML\\s-+[0-9]+\\.[0-9]+\\(\\s-+#\\|\\s-*$\\)") ;from ~/Source/nongnu/packages/yaml-mode/yaml-mode-autoloads.el diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b5c48928fc5..2ded76c0832 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4547,12 +4547,14 @@ the `Version:' header." (read (current-buffer)))) "List of hints for packages to suggest installing. Each hint has the form (PACKAGE TYPE DATA), where PACKAGE is a symbol -denoting the package the hint applies to, TYPE is one of +denoting the package and major-mode the hint applies to, TYPE is one of `auto-mode-alist', `magic-mode-alist' or `interpreter-mode-alist' indicating the type of check to be made and DATA is the value to check against TYPE in the intuitive way (e.g. for `auto-mode-alist' DATA is a regular expression matching a file name that PACKAGE should be suggested -for).") +for). If the package name and the major mode name differ, then an +optional forth element MAJOR-MODE can indicate what command to invoke to +enable the package.") (defcustom package-autosuggest-style 'mode-line "How to draw attention to `package-autosuggest-mode' suggestions. @@ -4591,15 +4593,18 @@ SUG should be an element of `package-autosuggest-database'." (pred package-installed-p)) . ,_) nil) - (`(,_ auto-mode-alist ,ext) + ((or `(,_ auto-mode-alist ,ext ,_) + `(,_ auto-mode-alist ,ext)) (and (string-match-p ext (buffer-name)) t)) - (`(,_ magic-mode-alist ,mag) + ((or `(,_ magic-mode-alist ,mag ,_) + `(,_ magic-mode-alist ,mag)) (save-restriction (widen) (save-excursion (goto-char (point-min)) (looking-at-p mag)))) - (`(,_ interpreter-mode-alist ,magic) + ((or `(,_ interpreter-mode-alist ,magic ,_) + `(,_ interpreter-mode-alist ,magic)) (save-restriction (widen) (save-excursion From 40f15ff2dd124e2f7263f0c2c14badb20222a1c3 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 16:10:13 +0100 Subject: [PATCH 16/52] Drop comments indicating origin of package sugggestions * admin/scrape-elpa.el (scrape-elpa): Do it. * etc/package-autosuggest.eld: Regenerate file. --- admin/scrape-elpa.el | 3 +- etc/package-autosuggest.eld | 362 ++++++++++++++++++------------------ 2 files changed, 182 insertions(+), 183 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index ef2b189883e..bf3846c0fcb 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -73,8 +73,7 @@ Please review the results before updating the autosuggest database!" ,(and (pred symbolp) mode))) (terpri) (prin1 (append (list pkg variable regexp) - (and (not (eq pkg mode)) (list mode)))) - (princ (concat " ;from " file)))))) + (and (not (eq pkg mode)) (list mode)))))))) (end-of-file nil)))))) (insert "\n)\n"))) diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index 38cf121a49e..cf8b8288e27 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -4,185 +4,185 @@ ;; file manually! ( -(ada-mode auto-mode-alist "\\.ad[abs]\\'") ;from ~/Source/elpa/packages/ada-mode/ada-mode-autoloads.el -(arbitools auto-mode-alist "\\.trf?\\'" arbitools-mode) ;from ~/Source/elpa/packages/arbitools/arbitools-autoloads.el -(auctex auto-mode-alist "\\.hva\\'" LaTeX-mode) ;from ~/Source/elpa/packages/auctex/auctex-autoloads.el -(bnf-mode auto-mode-alist "\\.bnf\\'") ;from ~/Source/elpa/packages/bnf-mode/bnf-mode-autoloads.el -(chess auto-mode-alist "\\.pgn\\'" chess-pgn-mode) ;from ~/Source/elpa/packages/chess/chess-autoloads.el -(cobol-mode auto-mode-alist "\\.c\\(ob\\|bl\\|py\\)\\'") ;from ~/Source/elpa/packages/cobol-mode/cobol-mode-autoloads.el -(code-cells auto-mode-alist "\\.ipynb\\'" code-cells-convert-ipynb) ;from ~/Source/elpa/packages/code-cells/code-cells-autoloads.el -(csharp-mode auto-mode-alist "\\.cs\\'") ;from ~/Source/elpa/packages/csharp-mode/csharp-mode-autoloads.el -(csv-mode auto-mode-alist "\\.[Cc][Ss][Vv]\\'") ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el -(csv-mode auto-mode-alist "\\.tsv\\'" tsv-mode) ;from ~/Source/elpa/packages/csv-mode/csv-mode-autoloads.el -(dismal auto-mode-alist "\\.dis\\'" dismal-mode) ;from ~/Source/elpa/packages/dismal/dismal-autoloads.el -(djvu auto-mode-alist "\\.djvu\\'" djvu-init-mode) ;from ~/Source/elpa/packages/djvu/djvu-autoloads.el -(dts-mode auto-mode-alist "\\.dtsi?\\'") ;from ~/Source/elpa/packages/dts-mode/dts-mode-autoloads.el -(ess auto-mode-alist "\\.[Bb][Uu][Gg]\\'" ess-bugs-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[Bb][Oo][Gg]\\'" ess-bugs-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[Bb][Mm][Dd]\\'" ess-bugs-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[Jj][Aa][Gg]\\'" ess-jags-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "/R/.*\\.q\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[rR]\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[rR]profile\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "NAMESPACE\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "CITATION\\'" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[Rr]out\\'" ess-r-transcript-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess interpreter-mode-alist "Rscript" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess interpreter-mode-alist "r" ess-r-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "/Makevars\\(\\.win\\)?\\'" makefile-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "DESCRIPTION\\'" conf-colon-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.Rd\\'" Rd-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[Ss]t\\'" S-transcript-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.Sout\\'" S-transcript-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(ess auto-mode-alist "\\.[Ss][Aa][Ss]\\'" SAS-mode) ;from ~/Source/elpa/packages/ess/lisp/ess-autoloads.el -(gle-mode auto-mode-alist "\\.gle\\'") ;from ~/Source/elpa/packages/gle-mode/gle-mode-autoloads.el -(gpr-mode auto-mode-alist "\\.gpr\\'") ;from ~/Source/elpa/packages/gpr-mode/gpr-mode-autoloads.el -(html5-schema auto-mode-alist "\\.html?\\'" nxml-mode) ;from ~/Source/elpa/packages/html5-schema/html5-schema-autoloads.el -(jgraph-mode auto-mode-alist "\\.jgr\\'") ;from ~/Source/elpa/packages/jgraph-mode/jgraph-mode-autoloads.el -(json-mode auto-mode-alist "\\.json\\'") ;from ~/Source/elpa/packages/json-mode/json-mode-autoloads.el -(lmc auto-mode-alist "\\.elmc\\'" lmc-asm-mode) ;from ~/Source/elpa/packages/lmc/lmc-autoloads.el -(matlab-mode auto-mode-alist "\\.tlc\\'" tlc-mode) ;from ~/Source/elpa/packages/matlab-mode/matlab-mode-autoloads.el -(matlab auto-mode-alist "\\.tlc\\'" tlc-mode) ;from ~/Source/elpa/packages/matlab/matlab-autoloads.el -(muse auto-mode-alist "\\.muse\\'" muse-mode-choose-mode) ;from ~/Source/elpa/packages/muse/lisp/muse-autoloads.el -(auctex auto-mode-alist "\\.drv\\'" latex-mode) ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el -(auctex auto-mode-alist "\\.dtx\\'" doctex-mode) ;from ~/Source/elpa/packages/names/tests/auctex-11.87.7/auctex-autoloads.el -(nftables-mode auto-mode-alist "\\.nft\\(?:ables\\)?\\'") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el -(nftables-mode auto-mode-alist "/etc/nftables.conf") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el -(nftables-mode interpreter-mode-alist "nft\\(?:ables\\)?") ;from ~/Source/elpa/packages/nftables-mode/nftables-mode-autoloads.el -(omn-mode auto-mode-alist "\\.pomn\\'") ;from ~/Source/elpa/packages/omn-mode/omn-mode-autoloads.el -(omn-mode auto-mode-alist "\\.omn\\'") ;from ~/Source/elpa/packages/omn-mode/omn-mode-autoloads.el -(poke-mode auto-mode-alist "\\.pk\\'") ;from ~/Source/elpa/packages/poke-mode/poke-mode-autoloads.el -(pspp-mode auto-mode-alist "\\.sps\\'") ;from ~/Source/elpa/packages/pspp-mode/pspp-mode-autoloads.el -(python auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'" conf-mode) ;from ~/Source/elpa/packages/python/python-autoloads.el -(rec-mode auto-mode-alist "\\.rec\\'") ;from ~/Source/elpa/packages/rec-mode/rec-mode-autoloads.el -(rnc-mode auto-mode-alist "\\.rnc\\'") ;from ~/Source/elpa/packages/rnc-mode/rnc-mode-autoloads.el -(sed-mode auto-mode-alist "\\.sed\\'") ;from ~/Source/elpa/packages/sed-mode/sed-mode-autoloads.el -(sed-mode interpreter-mode-alist "sed") ;from ~/Source/elpa/packages/sed-mode/sed-mode-autoloads.el -(shen-mode auto-mode-alist "\\.shen\\'") ;from ~/Source/elpa/packages/shen-mode/shen-mode-autoloads.el -(sisu-mode auto-mode-alist "\\.ss[imt]\\'") ;from ~/Source/elpa/packages/sisu-mode/sisu-mode-autoloads.el -(smalltalk-mode auto-mode-alist "\\.st\\'") ;from ~/Source/elpa/packages/smalltalk-mode/smalltalk-mode-autoloads.el -(sml-mode auto-mode-alist "\\.s\\(ml\\|ig\\)\\'") ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el -(sml-mode auto-mode-alist "\\.cm\\'" sml-cm-mode) ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el -(sml-mode auto-mode-alist "\\.grm\\'" sml-yacc-mode) ;from ~/Source/elpa/packages/sml-mode/sml-mode-autoloads.el -(sql-cassandra auto-mode-alist "\\.cql\\'" sql-mode) ;from ~/Source/elpa/packages/sql-cassandra/sql-cassandra-autoloads.el -(sxhkdrc-mode auto-mode-alist "sxhkdrc\\'") ;from ~/Source/elpa/packages/sxhkdrc-mode/sxhkdrc-mode-autoloads.el -(systemd auto-mode-alist "\\.automount\\'" systemd-automount-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd auto-mode-alist "\\.mount\\'" systemd-mount-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd auto-mode-alist "\\.path\\'" systemd-path-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd auto-mode-alist "\\.service\\'" systemd-service-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd auto-mode-alist "\\.socket\\'" systemd-socket-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd auto-mode-alist "\\.swap\\'" systemd-swap-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(systemd auto-mode-alist "\\.timer\\'" systemd-timer-mode) ;from ~/Source/elpa/packages/systemd/systemd-autoloads.el -(vcard auto-mode-alist "\\.[Vv][Cc][Ff]\\'" vcard-mode) ;from ~/Source/elpa/packages/vcard/vcard-autoloads.el -(wisi auto-mode-alist "\\.parse_table.*\\'" wisitoken-parse_table-mode) ;from ~/Source/elpa/packages/wisi/wisi-autoloads.el -(wisitoken-grammar-mode auto-mode-alist "\\.wy\\'" simple-indent-mode) ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el -(wisitoken-grammar-mode auto-mode-alist "\\.wy\\'") ;from ~/Source/elpa/packages/wisitoken-grammar-mode/wisitoken-grammar-mode-autoloads.el -(adoc-mode auto-mode-alist "\\.a\\(?:scii\\)?doc\\'") ;from ~/Source/nongnu/packages/adoc-mode/adoc-mode-autoloads.el -(apache-mode auto-mode-alist "/\\.htaccess\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el -(apache-mode auto-mode-alist "/\\(?:access\\|httpd\\|srm\\)\\.conf\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el -(apache-mode auto-mode-alist "/apache2/.+\\.conf\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el -(apache-mode auto-mode-alist "/httpd/conf/.+\\.conf\\'") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el -(apache-mode auto-mode-alist "/apache2/sites-\\(?:available\\|enabled\\)/") ;from ~/Source/nongnu/packages/apache-mode/apache-mode-autoloads.el -(arduino-mode auto-mode-alist "\\.pde\\'") ;from ~/Source/nongnu/packages/arduino-mode/arduino-mode-autoloads.el -(arduino-mode auto-mode-alist "\\.ino\\'") ;from ~/Source/nongnu/packages/arduino-mode/arduino-mode-autoloads.el -(beancount auto-mode-alist "\\.beancount\\'" beancount-mode) ;from ~/Source/nongnu/packages/beancount/beancount-autoloads.el -(bison-mode auto-mode-alist "\\.y\\'") ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el -(bison-mode auto-mode-alist "\\.l\\'" flex-mode) ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el -(bison-mode auto-mode-alist "\\.jison\\'" jison-mode) ;from ~/Source/nongnu/packages/bison-mode/bison-mode-autoloads.el -(bqn-mode auto-mode-alist "\\.bqn\\'") ;from ~/Source/nongnu/packages/bqn-mode/bqn-mode-autoloads.el -(bqn-mode interpreter-mode-alist "bqn") ;from ~/Source/nongnu/packages/bqn-mode/bqn-mode-autoloads.el -(clojure-mode auto-mode-alist "\\.\\(clj\\|cljd\\|dtm\\|edn\\|lpy\\)\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojure-mode auto-mode-alist "\\.cljc\\'" clojurec-mode) ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojure-mode auto-mode-alist "\\.cljs\\'" clojurescript-mode) ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojure-mode auto-mode-alist "\\(?:build\\|profile\\)\\.boot\\'") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojure-mode interpreter-mode-alist "bb") ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(clojure-mode interpreter-mode-alist "nbb" clojurescript-mode) ;from ~/Source/nongnu/packages/clojure-mode/clojure-mode-autoloads.el -(coffee-mode auto-mode-alist "\\.coffee\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el -(coffee-mode auto-mode-alist "\\.iced\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el -(coffee-mode auto-mode-alist "Cakefile\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el -(coffee-mode auto-mode-alist "\\.cson\\'") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el -(coffee-mode interpreter-mode-alist "coffee") ;from ~/Source/nongnu/packages/coffee-mode/coffee-mode-autoloads.el -(d-mode auto-mode-alist "\\.d[i]?\\'") ;from ~/Source/nongnu/packages/d-mode/d-mode-autoloads.el -(dart-mode auto-mode-alist "\\.dart\\'") ;from ~/Source/nongnu/packages/dart-mode/dart-mode-autoloads.el -(dockerfile-mode auto-mode-alist "\\.dockerfile\\'") ;from ~/Source/nongnu/packages/dockerfile-mode/dockerfile-mode-autoloads.el -(drupal-mode auto-mode-alist "[^/]\\.\\(module\\|test\\|install\\|profile\\|tpl\\.php\\|theme\\|inc\\)\\'" php-mode) ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el -(drupal-mode auto-mode-alist "[^/]\\.info\\'" conf-windows-mode) ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el -(drupal-mode auto-mode-alist "[^/]\\.make\\'" drush-make-mode) ;from ~/Source/nongnu/packages/drupal-mode/drupal-mode-autoloads.el -(editorconfig auto-mode-alist "\\.editorconfig\\'" editorconfig-conf-mode) ;from ~/Source/nongnu/packages/editorconfig/editorconfig-autoloads.el -(elixir-mode auto-mode-alist "\\.elixir\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el -(elixir-mode auto-mode-alist "\\.ex\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el -(elixir-mode auto-mode-alist "\\.exs\\'") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el -(elixir-mode auto-mode-alist "mix\\.lock") ;from ~/Source/nongnu/packages/elixir-mode/elixir-mode-autoloads.el -(ett auto-mode-alist "\\.ett\\'" ett-mode) ;from ~/Source/nongnu/packages/ett/ett-autoloads.el -(forth-mode auto-mode-alist "\\.\\(f\\|fs\\|fth\\|4th\\)\\'") ;from ~/Source/nongnu/packages/forth-mode/forth-mode-autoloads.el -(geiser-racket auto-mode-alist "\\.rkt\\'" scheme-mode) ;from ~/Source/nongnu/packages/geiser-racket/geiser-racket-autoloads.el -(gnu-apl-mode auto-mode-alist "\\.apl\\'") ;from ~/Source/nongnu/packages/gnu-apl-mode/gnu-apl-mode-autoloads.el -(gnu-apl-mode interpreter-mode-alist "apl") ;from ~/Source/nongnu/packages/gnu-apl-mode/gnu-apl-mode-autoloads.el -(go-mode auto-mode-alist "go\\.mod\\'" go-dot-mod-mode) ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el -(go-mode auto-mode-alist "go\\.work\\'" go-dot-work-mode) ;from ~/Source/nongnu/packages/go-mode/go-mode-autoloads.el -(graphql-mode auto-mode-alist "\\.graphql\\'") ;from ~/Source/nongnu/packages/graphql-mode/graphql-mode-autoloads.el -(graphql-mode auto-mode-alist "\\.gql\\'") ;from ~/Source/nongnu/packages/graphql-mode/graphql-mode-autoloads.el -(haml-mode auto-mode-alist "\\.haml\\'") ;from ~/Source/nongnu/packages/haml-mode/haml-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.hcr\\'" ghc-core-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.dump-simpl\\'" ghc-core-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.ghci\\'" ghci-script-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.chs\\'" haskell-c2hs-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.cabal\\'\\|/cabal\\.project\\|/\\.cabal/config\\'" haskell-cabal-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.[gh]s\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.hsig\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.l[gh]s\\'" haskell-literate-mode) ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode auto-mode-alist "\\.hsc\\'") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode interpreter-mode-alist "runghc") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(haskell-mode interpreter-mode-alist "runhaskell") ;from ~/Source/nongnu/packages/haskell-mode/haskell-mode-autoloads.el -(j-mode auto-mode-alist "\\.ij[rsp]$") ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el -(j-mode auto-mode-alist "\\.ijt$" j-lab-mode) ;from ~/Source/nongnu/packages/j-mode/j-mode-autoloads.el -(jade-mode auto-mode-alist "\\.jade\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el -(jade-mode auto-mode-alist "\\.pug\\'") ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el -(jade-mode auto-mode-alist "\\.styl\\'" stylus-mode) ;from ~/Source/nongnu/packages/jade-mode/jade-mode-autoloads.el -(jinja2-mode auto-mode-alist "\\.jinja2\\'") ;from ~/Source/nongnu/packages/jinja2-mode/jinja2-mode-autoloads.el -(jinja2-mode auto-mode-alist "\\.j2\\'") ;from ~/Source/nongnu/packages/jinja2-mode/jinja2-mode-autoloads.el -(julia-mode auto-mode-alist "\\.jl\\'") ;from ~/Source/nongnu/packages/julia-mode/julia-mode-autoloads.el -(lua-mode auto-mode-alist "\\.lua\\'") ;from ~/Source/nongnu/packages/lua-mode/lua-mode-autoloads.el -(lua-mode interpreter-mode-alist "lua") ;from ~/Source/nongnu/packages/lua-mode/lua-mode-autoloads.el -(markdown-mode auto-mode-alist "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'") ;from ~/Source/nongnu/packages/markdown-mode/markdown-mode-autoloads.el -(nginx-mode auto-mode-alist "nginx\\.conf\\'") ;from ~/Source/nongnu/packages/nginx-mode/nginx-mode-autoloads.el -(nginx-mode auto-mode-alist "/nginx/.+\\.conf\\'") ;from ~/Source/nongnu/packages/nginx-mode/nginx-mode-autoloads.el -(nix-mode auto-mode-alist "^/nix/store/.+\\.drv\\'" nix-drv-mode) ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el -(nix-mode auto-mode-alist "\\flake.lock\\'" js-mode) ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el -(nix-mode auto-mode-alist "\\.nix\\'") ;from ~/Source/nongnu/packages/nix-mode/nix-mode-autoloads.el -(php-mode auto-mode-alist "/\\.php_cs\\(?:\\.dist\\)?\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el -(php-mode auto-mode-alist "\\.\\(?:php\\.inc\\|stub\\)\\'") ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el -(php-mode auto-mode-alist "\\.\\(?:php[s345]?\\|phtml\\)\\'" php-mode-maybe) ;from ~/Source/nongnu/packages/php-mode/lisp/php-mode-autoloads.el -(proof auto-mode-alist "\\.v\\'" coq-mode) ;from ~/Source/nongnu/packages/proof-general/generic/proof-autoloads.el -(racket-mode auto-mode-alist "\\.rkt\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el -(racket-mode auto-mode-alist "\\.rktd\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el -(racket-mode auto-mode-alist "\\.rktl\\'") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el -(racket-mode interpreter-mode-alist "racket") ;from ~/Source/nongnu/packages/racket-mode/racket-mode-autoloads.el -(raku-mode interpreter-mode-alist "perl6\\|raku") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el -(raku-mode auto-mode-alist "\\.p[lm]?6\\'") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el -(raku-mode auto-mode-alist "\\.nqp\\'") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el -(raku-mode auto-mode-alist "\\.raku\\(?:mod\\|test\\)?\\'") ;from ~/Source/nongnu/packages/raku-mode/raku-mode-autoloads.el -(rfc-mode auto-mode-alist "/rfc[0-9]+\\.txt\\'") ;from ~/Source/nongnu/packages/rfc-mode/rfc-mode-autoloads.el -(rust-mode auto-mode-alist "\\.rs\\'") ;from ~/Source/nongnu/packages/rust-mode/rust-mode-autoloads.el -(sass-mode auto-mode-alist "\\.sass\\'") ;from ~/Source/nongnu/packages/sass-mode/sass-mode-autoloads.el -(scad-mode auto-mode-alist "\\.scad\\'") ;from ~/Source/nongnu/packages/scad-mode/scad-mode-autoloads.el -(scala-mode auto-mode-alist "\\.\\(scala\\|sbt\\|worksheet\\.sc\\)\\'") ;from ~/Source/nongnu/packages/scala-mode/scala-mode-autoloads.el -(stylus-mode auto-mode-alist "\\.jade\\'" jade-mode) ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el -(stylus-mode auto-mode-alist "\\.pug\\'" jade-mode) ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el -(stylus-mode auto-mode-alist "\\.styl\\'") ;from ~/Source/nongnu/packages/stylus-mode/stylus-mode-autoloads.el -(subed auto-mode-alist "\\.ass\\'" subed-ass-mode) ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el -(subed auto-mode-alist "\\.srt\\'" subed-srt-mode) ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el -(subed auto-mode-alist "\\.vtt\\'" subed-vtt-mode) ;from ~/Source/nongnu/packages/subed/subed/subed-autoloads.el -(swift-mode auto-mode-alist "\\.swift\\(interface\\)?\\'") ;from ~/Source/nongnu/packages/swift-mode/swift-mode-autoloads.el -(systemd auto-mode-alist "\\.nspawn\\'" systemd-mode) ;from ~/Source/nongnu/packages/systemd/systemd-autoloads.el -(tuareg auto-mode-alist "\\.ml[ip]?\\'" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg auto-mode-alist "\\.eliomi?\\'" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg interpreter-mode-alist "ocamlrun" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg interpreter-mode-alist "ocaml" tuareg-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg auto-mode-alist "\\.mly\\'" tuareg-menhir-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(tuareg auto-mode-alist "[./]opam_?\\'" tuareg-opam-mode) ;from ~/Source/nongnu/packages/tuareg/tuareg-autoloads.el -(typescript-mode auto-mode-alist "\\.ts\\'") ;from ~/Source/nongnu/packages/typescript-mode/typescript-mode-autoloads.el -(yaml-mode auto-mode-alist "\\.\\(e?ya?\\|ra\\)ml\\'") ;from ~/Source/nongnu/packages/yaml-mode/yaml-mode-autoloads.el -(yaml-mode magic-mode-alist "^%YAML\\s-+[0-9]+\\.[0-9]+\\(\\s-+#\\|\\s-*$\\)") ;from ~/Source/nongnu/packages/yaml-mode/yaml-mode-autoloads.el -(zig-mode auto-mode-alist "\\.\\(zig\\|zon\\)\\'") ;from ~/Source/nongnu/packages/zig-mode/zig-mode-autoloads.el +(ada-mode auto-mode-alist "\\.ad[abs]\\'") +(arbitools auto-mode-alist "\\.trf?\\'" arbitools-mode) +(auctex auto-mode-alist "\\.hva\\'" LaTeX-mode) +(bnf-mode auto-mode-alist "\\.bnf\\'") +(chess auto-mode-alist "\\.pgn\\'" chess-pgn-mode) +(cobol-mode auto-mode-alist "\\.c\\(ob\\|bl\\|py\\)\\'") +(code-cells auto-mode-alist "\\.ipynb\\'" code-cells-convert-ipynb) +(csharp-mode auto-mode-alist "\\.cs\\'") +(csv-mode auto-mode-alist "\\.[Cc][Ss][Vv]\\'") +(csv-mode auto-mode-alist "\\.tsv\\'" tsv-mode) +(dismal auto-mode-alist "\\.dis\\'" dismal-mode) +(djvu auto-mode-alist "\\.djvu\\'" djvu-init-mode) +(dts-mode auto-mode-alist "\\.dtsi?\\'") +(ess auto-mode-alist "\\.[Bb][Uu][Gg]\\'" ess-bugs-mode) +(ess auto-mode-alist "\\.[Bb][Oo][Gg]\\'" ess-bugs-mode) +(ess auto-mode-alist "\\.[Bb][Mm][Dd]\\'" ess-bugs-mode) +(ess auto-mode-alist "\\.[Jj][Aa][Gg]\\'" ess-jags-mode) +(ess auto-mode-alist "/R/.*\\.q\\'" ess-r-mode) +(ess auto-mode-alist "\\.[rR]\\'" ess-r-mode) +(ess auto-mode-alist "\\.[rR]profile\\'" ess-r-mode) +(ess auto-mode-alist "NAMESPACE\\'" ess-r-mode) +(ess auto-mode-alist "CITATION\\'" ess-r-mode) +(ess auto-mode-alist "\\.[Rr]out\\'" ess-r-transcript-mode) +(ess interpreter-mode-alist "Rscript" ess-r-mode) +(ess interpreter-mode-alist "r" ess-r-mode) +(ess auto-mode-alist "/Makevars\\(\\.win\\)?\\'" makefile-mode) +(ess auto-mode-alist "DESCRIPTION\\'" conf-colon-mode) +(ess auto-mode-alist "\\.Rd\\'" Rd-mode) +(ess auto-mode-alist "\\.[Ss]t\\'" S-transcript-mode) +(ess auto-mode-alist "\\.Sout\\'" S-transcript-mode) +(ess auto-mode-alist "\\.[Ss][Aa][Ss]\\'" SAS-mode) +(gle-mode auto-mode-alist "\\.gle\\'") +(gpr-mode auto-mode-alist "\\.gpr\\'") +(html5-schema auto-mode-alist "\\.html?\\'" nxml-mode) +(jgraph-mode auto-mode-alist "\\.jgr\\'") +(json-mode auto-mode-alist "\\.json\\'") +(lmc auto-mode-alist "\\.elmc\\'" lmc-asm-mode) +(matlab-mode auto-mode-alist "\\.tlc\\'" tlc-mode) +(matlab auto-mode-alist "\\.tlc\\'" tlc-mode) +(muse auto-mode-alist "\\.muse\\'" muse-mode-choose-mode) +(auctex auto-mode-alist "\\.drv\\'" latex-mode) +(auctex auto-mode-alist "\\.dtx\\'" doctex-mode) +(nftables-mode auto-mode-alist "\\.nft\\(?:ables\\)?\\'") +(nftables-mode auto-mode-alist "/etc/nftables.conf") +(nftables-mode interpreter-mode-alist "nft\\(?:ables\\)?") +(omn-mode auto-mode-alist "\\.pomn\\'") +(omn-mode auto-mode-alist "\\.omn\\'") +(poke-mode auto-mode-alist "\\.pk\\'") +(pspp-mode auto-mode-alist "\\.sps\\'") +(python auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'" conf-mode) +(rec-mode auto-mode-alist "\\.rec\\'") +(rnc-mode auto-mode-alist "\\.rnc\\'") +(sed-mode auto-mode-alist "\\.sed\\'") +(sed-mode interpreter-mode-alist "sed") +(shen-mode auto-mode-alist "\\.shen\\'") +(sisu-mode auto-mode-alist "\\.ss[imt]\\'") +(smalltalk-mode auto-mode-alist "\\.st\\'") +(sml-mode auto-mode-alist "\\.s\\(ml\\|ig\\)\\'") +(sml-mode auto-mode-alist "\\.cm\\'" sml-cm-mode) +(sml-mode auto-mode-alist "\\.grm\\'" sml-yacc-mode) +(sql-cassandra auto-mode-alist "\\.cql\\'" sql-mode) +(sxhkdrc-mode auto-mode-alist "sxhkdrc\\'") +(systemd auto-mode-alist "\\.automount\\'" systemd-automount-mode) +(systemd auto-mode-alist "\\.mount\\'" systemd-mount-mode) +(systemd auto-mode-alist "\\.path\\'" systemd-path-mode) +(systemd auto-mode-alist "\\.service\\'" systemd-service-mode) +(systemd auto-mode-alist "\\.socket\\'" systemd-socket-mode) +(systemd auto-mode-alist "\\.swap\\'" systemd-swap-mode) +(systemd auto-mode-alist "\\.timer\\'" systemd-timer-mode) +(vcard auto-mode-alist "\\.[Vv][Cc][Ff]\\'" vcard-mode) +(wisi auto-mode-alist "\\.parse_table.*\\'" wisitoken-parse_table-mode) +(wisitoken-grammar-mode auto-mode-alist "\\.wy\\'" simple-indent-mode) +(wisitoken-grammar-mode auto-mode-alist "\\.wy\\'") +(adoc-mode auto-mode-alist "\\.a\\(?:scii\\)?doc\\'") +(apache-mode auto-mode-alist "/\\.htaccess\\'") +(apache-mode auto-mode-alist "/\\(?:access\\|httpd\\|srm\\)\\.conf\\'") +(apache-mode auto-mode-alist "/apache2/.+\\.conf\\'") +(apache-mode auto-mode-alist "/httpd/conf/.+\\.conf\\'") +(apache-mode auto-mode-alist "/apache2/sites-\\(?:available\\|enabled\\)/") +(arduino-mode auto-mode-alist "\\.pde\\'") +(arduino-mode auto-mode-alist "\\.ino\\'") +(beancount auto-mode-alist "\\.beancount\\'" beancount-mode) +(bison-mode auto-mode-alist "\\.y\\'") +(bison-mode auto-mode-alist "\\.l\\'" flex-mode) +(bison-mode auto-mode-alist "\\.jison\\'" jison-mode) +(bqn-mode auto-mode-alist "\\.bqn\\'") +(bqn-mode interpreter-mode-alist "bqn") +(clojure-mode auto-mode-alist "\\.\\(clj\\|cljd\\|dtm\\|edn\\|lpy\\)\\'") +(clojure-mode auto-mode-alist "\\.cljc\\'" clojurec-mode) +(clojure-mode auto-mode-alist "\\.cljs\\'" clojurescript-mode) +(clojure-mode auto-mode-alist "\\(?:build\\|profile\\)\\.boot\\'") +(clojure-mode interpreter-mode-alist "bb") +(clojure-mode interpreter-mode-alist "nbb" clojurescript-mode) +(coffee-mode auto-mode-alist "\\.coffee\\'") +(coffee-mode auto-mode-alist "\\.iced\\'") +(coffee-mode auto-mode-alist "Cakefile\\'") +(coffee-mode auto-mode-alist "\\.cson\\'") +(coffee-mode interpreter-mode-alist "coffee") +(d-mode auto-mode-alist "\\.d[i]?\\'") +(dart-mode auto-mode-alist "\\.dart\\'") +(dockerfile-mode auto-mode-alist "\\.dockerfile\\'") +(drupal-mode auto-mode-alist "[^/]\\.\\(module\\|test\\|install\\|profile\\|tpl\\.php\\|theme\\|inc\\)\\'" php-mode) +(drupal-mode auto-mode-alist "[^/]\\.info\\'" conf-windows-mode) +(drupal-mode auto-mode-alist "[^/]\\.make\\'" drush-make-mode) +(editorconfig auto-mode-alist "\\.editorconfig\\'" editorconfig-conf-mode) +(elixir-mode auto-mode-alist "\\.elixir\\'") +(elixir-mode auto-mode-alist "\\.ex\\'") +(elixir-mode auto-mode-alist "\\.exs\\'") +(elixir-mode auto-mode-alist "mix\\.lock") +(ett auto-mode-alist "\\.ett\\'" ett-mode) +(forth-mode auto-mode-alist "\\.\\(f\\|fs\\|fth\\|4th\\)\\'") +(geiser-racket auto-mode-alist "\\.rkt\\'" scheme-mode) +(gnu-apl-mode auto-mode-alist "\\.apl\\'") +(gnu-apl-mode interpreter-mode-alist "apl") +(go-mode auto-mode-alist "go\\.mod\\'" go-dot-mod-mode) +(go-mode auto-mode-alist "go\\.work\\'" go-dot-work-mode) +(graphql-mode auto-mode-alist "\\.graphql\\'") +(graphql-mode auto-mode-alist "\\.gql\\'") +(haml-mode auto-mode-alist "\\.haml\\'") +(haskell-mode auto-mode-alist "\\.hcr\\'" ghc-core-mode) +(haskell-mode auto-mode-alist "\\.dump-simpl\\'" ghc-core-mode) +(haskell-mode auto-mode-alist "\\.ghci\\'" ghci-script-mode) +(haskell-mode auto-mode-alist "\\.chs\\'" haskell-c2hs-mode) +(haskell-mode auto-mode-alist "\\.cabal\\'\\|/cabal\\.project\\|/\\.cabal/config\\'" haskell-cabal-mode) +(haskell-mode auto-mode-alist "\\.[gh]s\\'") +(haskell-mode auto-mode-alist "\\.hsig\\'") +(haskell-mode auto-mode-alist "\\.l[gh]s\\'" haskell-literate-mode) +(haskell-mode auto-mode-alist "\\.hsc\\'") +(haskell-mode interpreter-mode-alist "runghc") +(haskell-mode interpreter-mode-alist "runhaskell") +(j-mode auto-mode-alist "\\.ij[rsp]$") +(j-mode auto-mode-alist "\\.ijt$" j-lab-mode) +(jade-mode auto-mode-alist "\\.jade\\'") +(jade-mode auto-mode-alist "\\.pug\\'") +(jade-mode auto-mode-alist "\\.styl\\'" stylus-mode) +(jinja2-mode auto-mode-alist "\\.jinja2\\'") +(jinja2-mode auto-mode-alist "\\.j2\\'") +(julia-mode auto-mode-alist "\\.jl\\'") +(lua-mode auto-mode-alist "\\.lua\\'") +(lua-mode interpreter-mode-alist "lua") +(markdown-mode auto-mode-alist "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'") +(nginx-mode auto-mode-alist "nginx\\.conf\\'") +(nginx-mode auto-mode-alist "/nginx/.+\\.conf\\'") +(nix-mode auto-mode-alist "^/nix/store/.+\\.drv\\'" nix-drv-mode) +(nix-mode auto-mode-alist "\\flake.lock\\'" js-mode) +(nix-mode auto-mode-alist "\\.nix\\'") +(php-mode auto-mode-alist "/\\.php_cs\\(?:\\.dist\\)?\\'") +(php-mode auto-mode-alist "\\.\\(?:php\\.inc\\|stub\\)\\'") +(php-mode auto-mode-alist "\\.\\(?:php[s345]?\\|phtml\\)\\'" php-mode-maybe) +(proof auto-mode-alist "\\.v\\'" coq-mode) +(racket-mode auto-mode-alist "\\.rkt\\'") +(racket-mode auto-mode-alist "\\.rktd\\'") +(racket-mode auto-mode-alist "\\.rktl\\'") +(racket-mode interpreter-mode-alist "racket") +(raku-mode interpreter-mode-alist "perl6\\|raku") +(raku-mode auto-mode-alist "\\.p[lm]?6\\'") +(raku-mode auto-mode-alist "\\.nqp\\'") +(raku-mode auto-mode-alist "\\.raku\\(?:mod\\|test\\)?\\'") +(rfc-mode auto-mode-alist "/rfc[0-9]+\\.txt\\'") +(rust-mode auto-mode-alist "\\.rs\\'") +(sass-mode auto-mode-alist "\\.sass\\'") +(scad-mode auto-mode-alist "\\.scad\\'") +(scala-mode auto-mode-alist "\\.\\(scala\\|sbt\\|worksheet\\.sc\\)\\'") +(stylus-mode auto-mode-alist "\\.jade\\'" jade-mode) +(stylus-mode auto-mode-alist "\\.pug\\'" jade-mode) +(stylus-mode auto-mode-alist "\\.styl\\'") +(subed auto-mode-alist "\\.ass\\'" subed-ass-mode) +(subed auto-mode-alist "\\.srt\\'" subed-srt-mode) +(subed auto-mode-alist "\\.vtt\\'" subed-vtt-mode) +(swift-mode auto-mode-alist "\\.swift\\(interface\\)?\\'") +(systemd auto-mode-alist "\\.nspawn\\'" systemd-mode) +(tuareg auto-mode-alist "\\.ml[ip]?\\'" tuareg-mode) +(tuareg auto-mode-alist "\\.eliomi?\\'" tuareg-mode) +(tuareg interpreter-mode-alist "ocamlrun" tuareg-mode) +(tuareg interpreter-mode-alist "ocaml" tuareg-mode) +(tuareg auto-mode-alist "\\.mly\\'" tuareg-menhir-mode) +(tuareg auto-mode-alist "[./]opam_?\\'" tuareg-opam-mode) +(typescript-mode auto-mode-alist "\\.ts\\'") +(yaml-mode auto-mode-alist "\\.\\(e?ya?\\|ra\\)ml\\'") +(yaml-mode magic-mode-alist "^%YAML\\s-+[0-9]+\\.[0-9]+\\(\\s-+#\\|\\s-*$\\)") +(zig-mode auto-mode-alist "\\.\\(zig\\|zon\\)\\'") ) From e9f8dbf19439425568198deb44e48bff150212a4 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Nov 2024 16:47:31 +0100 Subject: [PATCH 17/52] Demote errors when failing to install package suggestions * lisp/emacs-lisp/package.el (package--autosuggest-install-and-enable): Wrap 'package-install' and following code in a 'with-demoted-errors'. --- lisp/emacs-lisp/package.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 2ded76c0832..335a08b2206 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4634,11 +4634,12 @@ SUG should be an element of `package-autosuggest-database'." (when (and (eq major-mode 'fundamental-mode) (buffer-file-name) (package--suggestion-applies-p sug)) (push buf buffers-to-update)))) - (package-install (car sug)) - (dolist (buf buffers-to-update) - (with-demoted-errors "Failed to enable major mode: %S" - (with-current-buffer buf - (funcall-interactively (or (cadddr sug) (car sug)))))))) + (with-demoted-errors "Failed to install package: %S" + (package-install (car sug)) + (dolist (buf buffers-to-update) + (with-demoted-errors "Failed to enable major mode: %S" + (with-current-buffer buf + (funcall-interactively (or (cadddr sug) (car sug))))))))) (defvar package--autosugest-line-format '(:eval (package--autosugest-line-format))) From 2a88c6dc3c36f726275554f1b93e32fd726e415c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 8 Nov 2024 11:41:47 -0500 Subject: [PATCH 18/52] Do not suggest packages outside of 'fundamental-mode' * lisp/emacs-lisp/package.el (package--autosuggest-find-candidates): Check 'major-mode' before computing suggestions. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 335a08b2206..f687839f206 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4618,7 +4618,7 @@ SUG should be an element of `package-autosuggest-database'." "Return a list of suggestions that might be interesting the current buffer. The elements of the returned list will be a subset of the elements of `package--autosuggest-suggested'." - (and package-autosuggest-mode + (and package-autosuggest-mode (eq major-mode 'fundamental-mode) (let (suggetions) (dolist (sug package-autosuggest-database) (when (package--suggestion-applies-p sug) From c4dc5bc76632a75eff17426e7f1b855799296464 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 25 Jan 2026 15:47:18 +0100 Subject: [PATCH 19/52] ; Use 'without-restriction' * lisp/emacs-lisp/package.el (package--suggestion-applies-p): Replace 'save-restriction'+'widen' with 'without-restriction'. --- lisp/emacs-lisp/package.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 51dd4f6ef18..6c2f3772d3c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4591,15 +4591,13 @@ SUG should be an element of `package-autosuggest-database'." (and (string-match-p ext (buffer-name)) t)) ((or `(,_ magic-mode-alist ,mag ,_) `(,_ magic-mode-alist ,mag)) - (save-restriction - (widen) + (without-restriction (save-excursion (goto-char (point-min)) (looking-at-p mag)))) ((or `(,_ interpreter-mode-alist ,magic ,_) `(,_ interpreter-mode-alist ,magic)) - (save-restriction - (widen) + (without-restriction (save-excursion (goto-char (point-min)) (and (looking-at auto-mode-interpreter-regexp) From 3a3a9e21c1540873714ce2175d2a4a06d18ce99d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 25 Jan 2026 15:49:38 +0100 Subject: [PATCH 20/52] Mark 'package-autosuggest-database' as private * admin/scrape-elpa.el (scrape-elpa): * etc/package-autosuggest.eld: * lisp/emacs-lisp/package.el (package-autosuggest-database) (package--autosuggest-suggested, package--suggestion-applies-p) (package--autosuggest-find-candidates) (package--autosuggest-install-and-enable): Rename constant name to add double-dash. --- admin/scrape-elpa.el | 2 +- etc/package-autosuggest.eld | 2 +- lisp/emacs-lisp/package.el | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index bf3846c0fcb..f2b5439d082 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -39,7 +39,7 @@ Please review the results before updating the autosuggest database!" (find-file (expand-file-name "package-autosuggest.eld" data-directory)) (erase-buffer) (lisp-data-mode) - (insert ";; The contents of this file are loaded into `package-autosuggest-database' + (insert ";; The contents of this file are loaded into `package--autosuggest-database' ;; and were automatically generate by scraping ELPA for auto-loaded ;; code using the `scrape-elpa' command. Please avoid updating this ;; file manually! diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index cf8b8288e27..ba27252f0da 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -1,4 +1,4 @@ -;; The contents of this file are loaded into `package-autosuggest-database' +;; The contents of this file are loaded into `package--autosuggest-database' ;; and were automatically generate by scraping ELPA for auto-loaded ;; code using the `scrape-elpa' command. Please avoid updating this ;; file manually! diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6c2f3772d3c..d283bcbc4ae 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4532,7 +4532,7 @@ The list is displayed in a buffer named `*Packages*'." ;;;; Autosuggest -(defconst package-autosuggest-database +(defconst package--autosuggest-database (eval-when-compile (with-temp-buffer (insert-file-contents @@ -4573,14 +4573,14 @@ the existence of a suggestion." (defvar package--autosuggest-suggested '() "List of packages that have already been suggested. The elements of this list should be a subset of elements from -`package-autosuggest-database'. Suggestions found in this list will not +`package--autosuggest-database'. Suggestions found in this list will not count as suggestions (e.g. if `package-autosuggest-style' is set to `mode-line', a suggestion found in here will inhibit `package-autosuggest-mode' from displaying a hint in the mode line).") (defun package--suggestion-applies-p (sug) "Check if a suggestion SUG is applicable to the current buffer. -SUG should be an element of `package-autosuggest-database'." +SUG should be an element of `package--autosuggest-database'." (pcase sug (`(,(or (pred (lambda (e) (assq e package--autosuggest-suggested))) (pred package-installed-p)) @@ -4611,14 +4611,14 @@ The elements of the returned list will be a subset of the elements of `package--autosuggest-suggested'." (and package-autosuggest-mode (eq major-mode 'fundamental-mode) (let (suggetions) - (dolist (sug package-autosuggest-database) + (dolist (sug package--autosuggest-database) (when (package--suggestion-applies-p sug) (push sug suggetions))) suggetions))) (defun package--autosuggest-install-and-enable (sug) "Install and enable a package suggestion PKG-ENT. -SUG should be an element of `package-autosuggest-database'." +SUG should be an element of `package--autosuggest-database'." (let ((buffers-to-update '())) (dolist (buf (buffer-list)) (with-current-buffer buf From e0c5cc70d2c746350e8a58e0396f7b4f13497feb Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 25 Jan 2026 15:52:40 +0100 Subject: [PATCH 21/52] Mention scrape-elpa.el file name in autosuggest database * admin/scrape-elpa.el (scrape-elpa): Update the inserted comment. --- admin/scrape-elpa.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index f2b5439d082..f513dc36550 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -39,10 +39,10 @@ Please review the results before updating the autosuggest database!" (find-file (expand-file-name "package-autosuggest.eld" data-directory)) (erase-buffer) (lisp-data-mode) - (insert ";; The contents of this file are loaded into `package--autosuggest-database' -;; and were automatically generate by scraping ELPA for auto-loaded -;; code using the `scrape-elpa' command. Please avoid updating this -;; file manually! + (insert ";; The contents of this file are loaded into `package--autosuggest-database'. +;; were automatically generate by scraping ELPA for auto-loaded +;; code using the `scrape-elpa' command from admin/scrape-elpa.el. Please do not +;; update this file manually! ") (fill-paragraph) From e6fd21faf7aa9ed14ee0a045550a5ad1010b824c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 25 Jan 2026 15:57:06 +0100 Subject: [PATCH 22/52] Update 'package-autosuggest' database * etc/package-autosuggest.eld: Add changes detected by the 'scrape-elpa' command. --- etc/package-autosuggest.eld | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index ba27252f0da..987dc6a6e6b 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -1,9 +1,10 @@ -;; The contents of this file are loaded into `package--autosuggest-database' -;; and were automatically generate by scraping ELPA for auto-loaded -;; code using the `scrape-elpa' command. Please avoid updating this -;; file manually! +;; The contents of this file are loaded into `package--autosuggest-database'. +;; were automatically generate by scraping ELPA for auto-loaded +;; code using the `scrape-elpa' command from admin/scrape-elpa.el. Please do not +;; update this file manually! ( +(a68-mode auto-mode-alist "\\.a68\\'") (ada-mode auto-mode-alist "\\.ad[abs]\\'") (arbitools auto-mode-alist "\\.trf?\\'" arbitools-mode) (auctex auto-mode-alist "\\.hva\\'" LaTeX-mode) @@ -14,6 +15,8 @@ (csharp-mode auto-mode-alist "\\.cs\\'") (csv-mode auto-mode-alist "\\.[Cc][Ss][Vv]\\'") (csv-mode auto-mode-alist "\\.tsv\\'" tsv-mode) +(dicom auto-mode-alist "\\.\\(?:dcm\\|ima\\)\\'" dicom-auto-mode) +(dicom auto-mode-alist "DICOMDIR" dicom-auto-mode) (dismal auto-mode-alist "\\.dis\\'" dismal-mode) (djvu auto-mode-alist "\\.djvu\\'" djvu-init-mode) (dts-mode auto-mode-alist "\\.dtsi?\\'") @@ -42,7 +45,6 @@ (json-mode auto-mode-alist "\\.json\\'") (lmc auto-mode-alist "\\.elmc\\'" lmc-asm-mode) (matlab-mode auto-mode-alist "\\.tlc\\'" tlc-mode) -(matlab auto-mode-alist "\\.tlc\\'" tlc-mode) (muse auto-mode-alist "\\.muse\\'" muse-mode-choose-mode) (auctex auto-mode-alist "\\.drv\\'" latex-mode) (auctex auto-mode-alist "\\.dtx\\'" doctex-mode) @@ -53,6 +55,7 @@ (omn-mode auto-mode-alist "\\.omn\\'") (poke-mode auto-mode-alist "\\.pk\\'") (pspp-mode auto-mode-alist "\\.sps\\'") +(python interpreter-mode-alist "python[0-9.]*" python-mode) (python auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'" conf-mode) (rec-mode auto-mode-alist "\\.rec\\'") (rnc-mode auto-mode-alist "\\.rnc\\'") From 7e3d7a3bcaae562251ae0c3b4ec3d37276f09754 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 25 Jan 2026 16:09:06 +0100 Subject: [PATCH 23/52] ; Fix typo in docstring * lisp/emacs-lisp/package.el (package-autosuggest-style): Refer to 'fundamental-mode'. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d283bcbc4ae..ebec10e3739 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4554,7 +4554,7 @@ enable the package.") You can set this value to `mode-line' (default) to indicate the availability of a package suggestion in the minor mode, `always' to prompt the user in the minibuffer every time a suggestion is available -in a `fundamenta-mode' buffer, `once' to do only prompt the user once +in a `fundamental-mode' buffer, `once' to do only prompt the user once for each suggestion or `message' to just display a message hinting at the existence of a suggestion." :type '(choice (const :tag "Indicate in mode line" mode-line) From 7fe88de4848d8184d73ac00be942b77130277324 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 25 Jan 2026 16:11:00 +0100 Subject: [PATCH 24/52] Refer to 'package-autosuggest-style' in manual. * doc/emacs/package.texi (Package Installation): Mention the user option. --- doc/emacs/package.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index db8d9914d35..fdb0822e85c 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -462,7 +462,8 @@ types. If Emacs opens a file with no specific mode, you can use the @code{package-autosuggest} command to install the recommended packages from ELPA. After enabling @code{package-autosuggest-mode}, Emacs will display a clickable hint in the mode-line if it there is a suggested -package. +package. Using the @code{package-autosuggest-style} user option, you +can adjust how Emacs presents the hint to install a package. @anchor{Package Signing} @cindex package security From d13769955eea8b448805bc8cba18a983d91fc477 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 14:14:17 +0100 Subject: [PATCH 25/52] Inline database of package suggestions * lisp/emacs-lisp/package.el (package--autosuggest-database): Remove unnecessary variable. (package--autosuggest-find-candidates): Load the database at compile time. (package--autosuggest-suggested, package--suggestion-applies-p) (package--autosuggest-install-and-enable): Update documentation. --- lisp/emacs-lisp/package.el | 69 ++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ebec10e3739..d50e06845b8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4532,23 +4532,6 @@ The list is displayed in a buffer named `*Packages*'." ;;;; Autosuggest -(defconst package--autosuggest-database - (eval-when-compile - (with-temp-buffer - (insert-file-contents - (expand-file-name "package-autosuggest.eld" data-directory)) - (read (current-buffer)))) - "List of hints for packages to suggest installing. -Each hint has the form (PACKAGE TYPE DATA), where PACKAGE is a symbol -denoting the package and major-mode the hint applies to, TYPE is one of -`auto-mode-alist', `magic-mode-alist' or `interpreter-mode-alist' -indicating the type of check to be made and DATA is the value to check -against TYPE in the intuitive way (e.g. for `auto-mode-alist' DATA is a -regular expression matching a file name that PACKAGE should be suggested -for). If the package name and the major mode name differ, then an -optional forth element MAJOR-MODE can indicate what command to invoke to -enable the package.") - (defcustom package-autosuggest-style 'mode-line "How to draw attention to `package-autosuggest-mode' suggestions. You can set this value to `mode-line' (default) to indicate the @@ -4572,19 +4555,25 @@ the existence of a suggestion." (defvar package--autosuggest-suggested '() "List of packages that have already been suggested. -The elements of this list should be a subset of elements from -`package--autosuggest-database'. Suggestions found in this list will not -count as suggestions (e.g. if `package-autosuggest-style' is set to -`mode-line', a suggestion found in here will inhibit -`package-autosuggest-mode' from displaying a hint in the mode line).") +Suggestions found in this list will not count as suggestions (e.g. if +`package-autosuggest-style' is set to `mode-line', a suggestion found in +here will inhibit `package-autosuggest-mode' from displaying a hint in +the mode line).") (defun package--suggestion-applies-p (sug) "Check if a suggestion SUG is applicable to the current buffer. -SUG should be an element of `package--autosuggest-database'." +Each suggestion has the form (PACKAGE TYPE DATA), where PACKAGE is a +symbol denoting the package and major-mode the suggestion applies to, +TYPE is one of `auto-mode-alist', `magic-mode-alist' or +`interpreter-mode-alist' indicating the type of check to be made and +DATA is the value to check against TYPE in the intuitive way (e.g. for +`auto-mode-alist' DATA is a regular expression matching a file name that +PACKAGE should be suggested for). If the package name and the major +mode name differ, then an optional forth element MAJOR-MODE can indicate +what command to invoke to enable the package." (pcase sug - (`(,(or (pred (lambda (e) (assq e package--autosuggest-suggested))) - (pred package-installed-p)) - . ,_) + ((or (guard (not (eq major-mode 'fundamental-mode))) + `(,(pred package-installed-p) . ,_)) nil) ((or `(,_ auto-mode-alist ,ext ,_) `(,_ auto-mode-alist ,ext)) @@ -4606,19 +4595,27 @@ SUG should be an element of `package--autosuggest-database'." magic))))))) (defun package--autosuggest-find-candidates () - "Return a list of suggestions that might be interesting the current buffer. -The elements of the returned list will be a subset of the elements of -`package--autosuggest-suggested'." - (and package-autosuggest-mode (eq major-mode 'fundamental-mode) - (let (suggetions) - (dolist (sug package--autosuggest-database) - (when (package--suggestion-applies-p sug) - (push sug suggetions))) - suggetions))) + "Return a list of suggestions that might be interesting the current buffer. +The elements of the returned list will have the form described in +`package--suggestion-applies-p'." + (and (eq major-mode 'fundamental-mode) + (let ((suggetions '())) + (dolist (sug (eval-when-compile + (with-temp-buffer + (insert-file-contents + (expand-file-name "package-autosuggest.eld" + data-directory)) + (read (current-buffer))))) + (when (and (package--suggestion-applies-p sug) + (if (eq package-autosuggest-style 'once) + (not (memq (car sug) package--autosuggest-suggested)) + t)) + (push sug suggetions))) + suggetions))) (defun package--autosuggest-install-and-enable (sug) "Install and enable a package suggestion PKG-ENT. -SUG should be an element of `package--autosuggest-database'." +SUG should be of the form as described in `package--suggestion-applies-p'." (let ((buffers-to-update '())) (dolist (buf (buffer-list)) (with-current-buffer buf From ad89a3e8d66a8100a9deb1331242cdcd63fc451f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 14:20:01 +0100 Subject: [PATCH 26/52] Display hint for package suggestions after mode name * lisp/emacs-lisp/package.el (package--autosugest-line-format): Insert a space before the mode-line hint. (package--autosuggest-after-change-mode): Add hint to 'mode-name'. --- lisp/emacs-lisp/package.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d50e06845b8..5aae6babc67 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4644,7 +4644,7 @@ SUG should be of the form as described in `package--suggestion-applies-p'." ((eq package-autosuggest-style 'mode-line)) (avail (package--autosuggest-find-candidates))) (propertize - (format "Install %s?" + (format " Install %s?" (mapconcat #'symbol-name (delete-dups (mapcar #'car avail)) @@ -4656,10 +4656,6 @@ SUG should be of the form as described in `package--suggestion-applies-p'." (define-key map [mode-line down-mouse-1] #'package-autosuggest) map))))) -(add-to-list - 'mode-line-misc-info - '(package-autosuggest-mode ("" package--autosugest-line-format))) - (defun package--autosuggest-after-change-mode () "Display package suggestions for the current buffer. This function should be added to `after-change-major-mode-hook'." @@ -4669,6 +4665,9 @@ This function should be added to `after-change-major-mode-hook'." ", "))) (pcase-exhaustive package-autosuggest-style ('mode-line + (setq mode-name (append (ensure-list mode-name) + '((package-autosuggest-mode + package--autosugest-line-format)))) (force-mode-line-update t)) ('always (when (yes-or-no-p (format "Install suggested packages (%s)?" pkgs)) From b6b599aa83e56a8a70a9cdccd4640830558d288d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 15:14:10 +0100 Subject: [PATCH 27/52] Add more elaborate prompt when suggesting packages * lisp/emacs-lisp/package.el (package--autosugest-prompt): Add new function. (package--autosuggest-after-change-mode, package-autosuggest): Call new function. --- lisp/emacs-lisp/package.el | 80 +++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 5aae6babc67..f68bd4f7d55 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4656,6 +4656,59 @@ SUG should be of the form as described in `package--suggestion-applies-p'." (define-key map [mode-line down-mouse-1] #'package-autosuggest) map))))) +(defun package--autosugest-prompt (packages) + "Query the user whether to install PACKAGES or not. +PACKAGES is a list of package suggestions in the form as described in +`package--suggestion-applies-p'. The function returns a non-nil value +if affirmative, otherwise nil" + (let* ((inhibit-read-only t) (use-hard-newlines t) + (nl (propertize "\n" 'hard t)) (nlnl (concat nl nl)) + (buf (current-buffer))) + (with-current-buffer (get-buffer-create + (format "*package suggestion: %s*" + (buffer-name buf))) + (erase-buffer) + (insert + "The buffer \"" + (buffer-name buf) + "\" currently lacks any language-specific support. +The package manager has detected that by installing a third-party package, +Emacs can provide the editor support for these kinds of files:" nl) + + (when (length> packages 1) + (insert nl "(Note that there are multiple candidate packages, +so you have to select which to install!)" nl)) + + (pcase-dolist ((and sug `(,pkg . ,_)) packages) + (insert nl "* " (buttonize "Install" #'package--autosuggest-install-and-enable sug) + " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\".") + (add-to-list 'package--autosuggest-suggested pkg)) + + (insert nl "* " (buttonize "Do not install anything" (lambda (_) (quit-window))) "." + nl "* " (buttonize "Permanently disable package suggestions" + (lambda (_) + (customize-save-variable + 'package-autosuggest-mode nil + "Disabled at user's request") + (quit-window))) + "." + + nlnl "To learn more about package management, read " + (buttonize "(emacs) Packages" (lambda (_) (info "(emacs) Packages"))) + ".") + + (fill-region (point-min) (point-max)) + (special-mode) + (button-mode t) + (enriched-mode t) + (variable-pitch-mode t) + + (let ((win (display-buffer-below-selected (current-buffer) '()))) + (fit-window-to-buffer win) + (select-window win) + (set-window-dedicated-p win t) + (set-window-point win (point-min)))))) + (defun package--autosuggest-after-change-mode () "Display package suggestions for the current buffer. This function should be added to `after-change-major-mode-hook'." @@ -4669,13 +4722,8 @@ This function should be added to `after-change-major-mode-hook'." '((package-autosuggest-mode package--autosugest-line-format)))) (force-mode-line-update t)) - ('always - (when (yes-or-no-p (format "Install suggested packages (%s)?" pkgs)) - (mapc #'package--autosuggest-install-and-enable avail))) - ('once - (when (yes-or-no-p (format "Install suggested packages (%s)?" pkgs)) - (mapc #'package--autosuggest-install-and-enable avail)) - (setq package--autosuggest-suggested (append avail package--autosuggest-suggested))) + ((or 'once 'always) + (package--autosugest-prompt avail)) ('message (message (substitute-command-keys @@ -4685,21 +4733,9 @@ This function should be added to `after-change-major-mode-hook'." (defun package-autosuggest () "Prompt the user to install the suggested packages." (interactive) - (let* ((avail (or (package--autosuggest-find-candidates) - (user-error "No suggestions found"))) - (use-dialog-box t) - (prompt (concat - "Install " - (mapconcat - #'symbol-name - (delete-dups (mapcar #'car avail)) - ", ") - "?"))) - (if (yes-or-no-p prompt) - (mapc #'package--autosuggest-install-and-enable avail) - (setq package--autosuggest-suggested (append avail package--autosuggest-suggested)) - (when (eq package-autosuggest-style 'mode-line) - (force-mode-line-update t))))) + (let ((avail (or (package--autosuggest-find-candidates) + (user-error "No package suggestions found")))) + (package--autosugest-prompt avail))) (defun package-reset-suggestions () "Forget previous package suggestions. From a234b9004887f1fb640d32a91d38c93d8133294c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 16:13:31 +0100 Subject: [PATCH 28/52] ; Close package suggestion window after installing package * lisp/emacs-lisp/package.el (package--autosuggest-after-change-mode): Call 'quit-window' after installing package. --- lisp/emacs-lisp/package.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f68bd4f7d55..e01d38c3c9c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4680,7 +4680,10 @@ Emacs can provide the editor support for these kinds of files:" nl) so you have to select which to install!)" nl)) (pcase-dolist ((and sug `(,pkg . ,_)) packages) - (insert nl "* " (buttonize "Install" #'package--autosuggest-install-and-enable sug) + (insert nl "* " (buttonize "Install" + (lambda (_) + (package--autosuggest-install-and-enable sug) + (quit-window))) " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\".") (add-to-list 'package--autosuggest-suggested pkg)) From 24f45c85ea0d9ac90e7be96712ac23b3e80bd1d3 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 16:14:24 +0100 Subject: [PATCH 29/52] Enable 'package-autosuggest-mode' by default * lisp/emacs-lisp/package.el (package-autosuggest-mode): Set :init-value. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index e01d38c3c9c..23a95c73416 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4548,7 +4548,7 @@ the existence of a suggestion." ;;;###autoload (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." - :global t + :global t :init-value t (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) From 9b1935dc2e600d47fff9250b052dd80cc658b34f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 19:41:04 +0100 Subject: [PATCH 30/52] Explain why package suggestions match * lisp/emacs-lisp/package.el (package--autosugest-prompt): Go through all suggestions for the same package and mention why a package suggestion was relevant. --- lisp/emacs-lisp/package.el | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 23a95c73416..d587c8bbfd9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4679,12 +4679,25 @@ Emacs can provide the editor support for these kinds of files:" nl) (insert nl "(Note that there are multiple candidate packages, so you have to select which to install!)" nl)) - (pcase-dolist ((and sug `(,pkg . ,_)) packages) + (pcase-dolist (`(,pkg . ,sugs) (seq-group-by #'car packages)) (insert nl "* " (buttonize "Install" (lambda (_) - (package--autosuggest-install-and-enable sug) + (package--autosuggest-install-and-enable + (car sugs)) (quit-window))) - " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\".") + " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\" (") + (dolist (sug sugs) + (unless (eq (char-before) ?\() + (insert ", ")) + (pcase sug + (`(,_ auto-mode-alist . ,_) + (insert "matches file extension ")) + (`(,_ magic-mode-alist . ,_) + (insert "matches magic bytes")) + (`(,_ interpreter-mode-alist . ,_) + (insert "matches interpreter ")))) + (delete-horizontal-space) (insert ")") + (add-to-list 'package--autosuggest-suggested pkg)) (insert nl "* " (buttonize "Do not install anything" (lambda (_) (quit-window))) "." From 0054a5ff0cbb06fea6035a0eeab7bcc110c90767 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 19:43:26 +0100 Subject: [PATCH 31/52] Clarify that package suggestions have to be confirmed * lisp/emacs-lisp/package.el (package--autosugest-prompt): Adjust message to indicate that no changes have yet occurred. Co-Developed-By: Jens Schmidt --- lisp/emacs-lisp/package.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d587c8bbfd9..32294169d74 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4672,8 +4672,8 @@ if affirmative, otherwise nil" "The buffer \"" (buffer-name buf) "\" currently lacks any language-specific support. -The package manager has detected that by installing a third-party package, -Emacs can provide the editor support for these kinds of files:" nl) +The Emacs package manager can provide the editor support for these kinds +of files by installing a third-party package:" nl) (when (length> packages 1) (insert nl "(Note that there are multiple candidate packages, From 1b8eaed7231b2849ca310ce2c1f15100875517f0 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 19:44:06 +0100 Subject: [PATCH 32/52] ; Use right variable name in 'pcase' * lisp/emacs-lisp/package.el (package--suggestion-applies-p): Do not refer to the interpreter regexp as "magic". --- lisp/emacs-lisp/package.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 32294169d74..1f1b44f9531 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4584,15 +4584,15 @@ what command to invoke to enable the package." (save-excursion (goto-char (point-min)) (looking-at-p mag)))) - ((or `(,_ interpreter-mode-alist ,magic ,_) - `(,_ interpreter-mode-alist ,magic)) + ((or `(,_ interpreter-mode-alist ,intr ,_) + `(,_ interpreter-mode-alist ,intr)) (without-restriction (save-excursion (goto-char (point-min)) (and (looking-at auto-mode-interpreter-regexp) (string-match-p (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") - magic))))))) + intr))))))) (defun package--autosuggest-find-candidates () "Return a list of suggestions that might be interesting the current buffer. From 850382c7d6ec386cb5f42ea125b0458953322504 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 1 Feb 2026 20:58:17 +0100 Subject: [PATCH 33/52] Adjust formatting of package suggestion buffer * lisp/emacs-lisp/package.el (package--autosugest-prompt): Move 'describe-package' link into the parentheses after the "Install ..." button. --- lisp/emacs-lisp/package.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 1f1b44f9531..c88f3b2c1c5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4680,23 +4680,25 @@ of files by installing a third-party package:" nl) so you have to select which to install!)" nl)) (pcase-dolist (`(,pkg . ,sugs) (seq-group-by #'car packages)) - (insert nl "* " (buttonize "Install" - (lambda (_) - (package--autosuggest-install-and-enable - (car sugs)) - (quit-window))) - " \"" (buttonize (symbol-name pkg) #'describe-package pkg) "\" (") + (insert nl "* " + (buttonize (concat "Install " (symbol-name pkg)) + (lambda (_) + (package--autosuggest-install-and-enable + (car sugs)) + (quit-window))) + " (" (buttonize "about" #'describe-package pkg) + ", matches ") (dolist (sug sugs) - (unless (eq (char-before) ?\() + (unless (eq (char-before) ?\s) (insert ", ")) (pcase sug (`(,_ auto-mode-alist . ,_) - (insert "matches file extension ")) + (insert "file extension ")) (`(,_ magic-mode-alist . ,_) - (insert "matches magic bytes")) + (insert "magic bytes")) (`(,_ interpreter-mode-alist . ,_) - (insert "matches interpreter ")))) - (delete-horizontal-space) (insert ")") + (insert "interpreter ")))) + (delete-horizontal-space) (insert ").") (add-to-list 'package--autosuggest-suggested pkg)) From 4ab81f82bf6cb5f2318cbdd27fca88f76aeae85a Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 3 Feb 2026 17:25:57 +0100 Subject: [PATCH 34/52] Do not compile database into package.el * lisp/emacs-lisp/package.el (package--autosuggest-database): Add new variable. (package--autosuggest-find-candidates): Load the contents of the database from 'data-directory' if necessary, and store them in the new variable. --- lisp/emacs-lisp/package.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c88f3b2c1c5..93c02b678e7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4594,18 +4594,27 @@ what command to invoke to enable the package." (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") intr))))))) +(defvar package--autosuggest-database 'unset + "A list of package suggestions. +Each entry in the list is of a form suitable to for +`package--suggestion-applies-p', which see. The special value `unset' +is used to indicate that `package--autosuggest-find-candidates' should +load the database into memory.") + (defun package--autosuggest-find-candidates () "Return a list of suggestions that might be interesting the current buffer. The elements of the returned list will have the form described in `package--suggestion-applies-p'." (and (eq major-mode 'fundamental-mode) (let ((suggetions '())) - (dolist (sug (eval-when-compile - (with-temp-buffer - (insert-file-contents - (expand-file-name "package-autosuggest.eld" - data-directory)) - (read (current-buffer))))) + (when (eq package--autosuggest-database 'unset) + (setq package--autosuggest-database + (with-temp-buffer + (insert-file-contents + (expand-file-name "package-autosuggest.eld" + data-directory)) + (read (current-buffer))))) + (dolist (sug package--autosuggest-database) (when (and (package--suggestion-applies-p sug) (if (eq package-autosuggest-style 'once) (not (memq (car sug) package--autosuggest-suggested)) From 0277fd791bca001254652d581172124c0c5f2f14 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 4 Feb 2026 17:36:32 +0100 Subject: [PATCH 35/52] Rephrase package suggestion message * lisp/emacs-lisp/package.el (package--autosugest-prompt): Follow Richard's suggestion from https://mail.gnu.org/archive/html/emacs-devel/2026-02/msg00040.html. --- lisp/emacs-lisp/package.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 93c02b678e7..bf7e08580f9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4681,8 +4681,8 @@ if affirmative, otherwise nil" "The buffer \"" (buffer-name buf) "\" currently lacks any language-specific support. -The Emacs package manager can provide the editor support for these kinds -of files by installing a third-party package:" nl) +The package manager can provide the editor support for these kinds of +files by downloading a package from Emacs's package archive:" nl) (when (length> packages 1) (insert nl "(Note that there are multiple candidate packages, From ae673183625aa76fb5d7160730c92eda659b10ee Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 21:14:23 +0100 Subject: [PATCH 36/52] Enable 'package-autosuggest-mode' at startup * lisp/emacs-lisp/package.el (package-autosuggest-style) (package-autosuggest-mode, package--autosuggest-suggested) (package--suggestion-applies-p, package--autosuggest-database) (package--autosuggest-find-candidates) (package--autosugest-line-format, package-autosuggest-face) (package--autosuggest-after-change-mode, package-autosuggest): Remove definitions needed to recognise suggestions from here. * lisp/emacs-lisp/package-activate.el (package-autosuggest-style) (package--autosuggest-database, package--autosuggest-suggested) (package--suggestion-applies-p) (package--autosuggest-find-candidates) (package--autosugest-line-format, package-autosuggest) (package--autosuggest-after-change-mode) (package-autosuggest-mode): Move definitions from package.el. (package--activated, package-installed-p, package-get-version) (package-activate-all, package-activate-all): Remove unnecessary autoloads. * lisp/loadup.el: Load "package-activate.el". --- lisp/emacs-lisp/package-activate.el | 146 ++++++++++++++++++++++++-- lisp/emacs-lisp/package.el | 155 ++-------------------------- lisp/loadup.el | 1 + 3 files changed, 151 insertions(+), 151 deletions(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index e130304be5c..3d62c6f085e 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -209,7 +209,6 @@ loaded and/or activated, customize `package-load-list'.") ;;;; Public interfaces for accessing built-in package info -;;;###autoload (defvar package-activated-list nil ;; FIXME: This should implicitly include all builtin packages. "List of the names of currently activated packages.") @@ -425,12 +424,9 @@ Newer versions are always activated, regardless of FORCE." ;;;; Unpacking -;;;###autoload (defvar package--activated nil "Non-nil if `package-activate-all' has been run.") -;;;###autoload -(progn ;; Make the function usable without loading `package.el'. (defun package-activate-all () "Activate all installed packages. The variable `package-load-list' controls which packages to load." @@ -459,7 +455,7 @@ The variable `package-load-list' controls which packages to load." ;; `declare-function' is currently not scoped, so if we use ;; it here, we end up with a redefinition warning instead :-) (with-no-warnings - (package--activate-all))))))) + (package--activate-all)))))) (defun package--activate-all () (dolist (elt (package--alist)) @@ -473,7 +469,6 @@ The variable `package-load-list' controls which packages to load." (declare-function lm-package-version "lisp-mnt" (&optional file)) -;;;###autoload (defun package-installed-p (package &optional min-version) "Return non-nil if PACKAGE, of MIN-VERSION or newer, is installed. If PACKAGE is a symbol, it is the package name and MIN-VERSION @@ -503,7 +498,6 @@ If PACKAGE is a `package-desc' object, MIN-VERSION is ignored." ;; Also check built-in packages. (package-built-in-p package min-version))))) -;;;###autoload (defun package-get-version () "Return the version number of the package in which this is used. Assumes it is used from an Elisp file placed inside the top-level directory @@ -534,5 +528,143 @@ the `Version:' header." (require 'lisp-mnt) (lm-package-version mainfile))))))) + +;;;; Package suggestions system + +;; Note that only the definitions necessary to recognise package +;; suggestions are defined here. The user interface to select and act +;; on package suggestions is to be found in package.el. + +(defcustom package-autosuggest-style 'mode-line + "How to draw attention to `package-autosuggest-mode' suggestions. +You can set this value to `mode-line' (default) to indicate the +availability of a package suggestion in the minor mode, `always' to +prompt the user in the minibuffer every time a suggestion is available +in a `fundamental-mode' buffer, `once' to do only prompt the user once +for each suggestion or `message' to just display a message hinting at +the existence of a suggestion." + :type '(choice (const :tag "Indicate in mode line" mode-line) + (const :tag "Always prompt" always) + (const :tag "Prompt only once" once) + (const :tag "Indicate with message" message)) + :group 'package) + +(defvar package--autosuggest-database 'unset + "A list of package suggestions. +Each entry in the list is of a form suitable to for +`package--suggestion-applies-p', which see. The special value `unset' +is used to indicate that `package--autosuggest-find-candidates' should +load the database into memory.") + +(defvar package--autosuggest-suggested '() + "List of packages that have already been suggested. +Suggestions found in this list will not count as suggestions (e.g. if +`package-autosuggest-style' is set to `mode-line', a suggestion found in +here will inhibit `package-autosuggest-mode' from displaying a hint in +the mode line).") + +(defun package--suggestion-applies-p (sug) + "Check if a suggestion SUG is applicable to the current buffer. +Each suggestion has the form (PACKAGE TYPE DATA), where PACKAGE is a +symbol denoting the package and major-mode the suggestion applies to, +TYPE is one of `auto-mode-alist', `magic-mode-alist' or +`interpreter-mode-alist' indicating the type of check to be made and +DATA is the value to check against TYPE in the intuitive way (e.g. for +`auto-mode-alist' DATA is a regular expression matching a file name that +PACKAGE should be suggested for). If the package name and the major +mode name differ, then an optional forth element MAJOR-MODE can indicate +what command to invoke to enable the package." + (pcase sug + ((or (guard (not (eq major-mode 'fundamental-mode))) + (guard (and (memq package-autosuggest-style '(once mode-line)) + (not (memq (car sug) package--autosuggest-suggested)))) + `(,(pred package-installed-p) . ,_)) + nil) + (`(,_ auto-mode-alist ,ext . ,_) + (and (string-match-p ext (buffer-name)) t)) + (`(,_ magic-mode-alist ,mag . ,_) + (without-restriction + (save-excursion + (goto-char (point-min)) + (looking-at-p mag)))) + (`(,_ interpreter-mode-alist ,intr . ,_) + (without-restriction + (save-excursion + (goto-char (point-min)) + (and (looking-at auto-mode-interpreter-regexp) + (string-match-p + (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") + intr))))))) + +(defun package--autosuggest-find-candidates () + "Return a list of suggestions that might be interesting the current buffer. +The elements of the returned list will have the form described in +`package--suggestion-applies-p'." + (and (eq major-mode 'fundamental-mode) + (let ((suggetions '())) + (when (eq package--autosuggest-database 'unset) + (setq package--autosuggest-database + (with-temp-buffer + (insert-file-contents + (expand-file-name "package-autosuggest.eld" + data-directory)) + (read (current-buffer))))) + (dolist (sug package--autosuggest-database) + (when (package--suggestion-applies-p sug) + (push sug suggetions))) + suggetions))) + +(defvar package--autosugest-line-format + '(:eval (package--autosugest-line-format))) +(put 'package--autosugest-line-format 'risky-local-variable t) + +(defun package--autosugest-line-format () + "Generate a mode-line string to indicate a suggested package." + `(,@(and-let* (((not (null package-autosuggest-mode))) + ((eq package-autosuggest-style 'mode-line)) + (avail (package--autosuggest-find-candidates))) + (propertize + (format " Install %s?" + (mapconcat + #'symbol-name + (delete-dups (mapcar #'car avail)) + ", ")) + 'face 'mode-line-emphasismode-line- + 'mouse-face 'mode-line-highlight + 'help-echo "Click to install suggested package." + 'keymap (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] #'package-autosuggest) + map))))) + +(declare-function package-autosuggest "package" (&optional candidates)) + +(defun package--autosuggest-after-change-mode () + "Display package suggestions for the current buffer. +This function should be added to `after-change-major-mode-hook'." + (when-let* ((avail (package--autosuggest-find-candidates)) + (pkgs (mapconcat #'symbol-name + (delete-dups (mapcar #'car avail)) + ", "))) + (pcase-exhaustive package-autosuggest-style + ('mode-line + (setq mode-name (append (ensure-list mode-name) + '((package-autosuggest-mode + package--autosugest-line-format)))) + (force-mode-line-update t)) + ((or 'once 'always) + (package-autosuggest avail)) + ('message + (message + (substitute-command-keys + (format "Found suggested packages: %s. Install using \\[package-autosuggest]" + pkgs))))))) + +(define-minor-mode package-autosuggest-mode + "Enable the automatic suggestion and installation of packages." + :global t :init-value t :group 'package + (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) + 'after-change-major-mode-hook + #'package--autosuggest-after-change-mode)) + (provide 'package-activate) ;;; package-activate.el ends here diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index bf7e08580f9..94e1dc99b3f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4530,97 +4530,7 @@ The list is displayed in a buffer named `*Packages*'." (list-packages t)) -;;;; Autosuggest - -(defcustom package-autosuggest-style 'mode-line - "How to draw attention to `package-autosuggest-mode' suggestions. -You can set this value to `mode-line' (default) to indicate the -availability of a package suggestion in the minor mode, `always' to -prompt the user in the minibuffer every time a suggestion is available -in a `fundamental-mode' buffer, `once' to do only prompt the user once -for each suggestion or `message' to just display a message hinting at -the existence of a suggestion." - :type '(choice (const :tag "Indicate in mode line" mode-line) - (const :tag "Always prompt" always) - (const :tag "Prompt only once" once) - (const :tag "Indicate with message" message))) - -;;;###autoload -(define-minor-mode package-autosuggest-mode - "Enable the automatic suggestion and installation of packages." - :global t :init-value t - (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) - 'after-change-major-mode-hook - #'package--autosuggest-after-change-mode)) - -(defvar package--autosuggest-suggested '() - "List of packages that have already been suggested. -Suggestions found in this list will not count as suggestions (e.g. if -`package-autosuggest-style' is set to `mode-line', a suggestion found in -here will inhibit `package-autosuggest-mode' from displaying a hint in -the mode line).") - -(defun package--suggestion-applies-p (sug) - "Check if a suggestion SUG is applicable to the current buffer. -Each suggestion has the form (PACKAGE TYPE DATA), where PACKAGE is a -symbol denoting the package and major-mode the suggestion applies to, -TYPE is one of `auto-mode-alist', `magic-mode-alist' or -`interpreter-mode-alist' indicating the type of check to be made and -DATA is the value to check against TYPE in the intuitive way (e.g. for -`auto-mode-alist' DATA is a regular expression matching a file name that -PACKAGE should be suggested for). If the package name and the major -mode name differ, then an optional forth element MAJOR-MODE can indicate -what command to invoke to enable the package." - (pcase sug - ((or (guard (not (eq major-mode 'fundamental-mode))) - `(,(pred package-installed-p) . ,_)) - nil) - ((or `(,_ auto-mode-alist ,ext ,_) - `(,_ auto-mode-alist ,ext)) - (and (string-match-p ext (buffer-name)) t)) - ((or `(,_ magic-mode-alist ,mag ,_) - `(,_ magic-mode-alist ,mag)) - (without-restriction - (save-excursion - (goto-char (point-min)) - (looking-at-p mag)))) - ((or `(,_ interpreter-mode-alist ,intr ,_) - `(,_ interpreter-mode-alist ,intr)) - (without-restriction - (save-excursion - (goto-char (point-min)) - (and (looking-at auto-mode-interpreter-regexp) - (string-match-p - (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") - intr))))))) - -(defvar package--autosuggest-database 'unset - "A list of package suggestions. -Each entry in the list is of a form suitable to for -`package--suggestion-applies-p', which see. The special value `unset' -is used to indicate that `package--autosuggest-find-candidates' should -load the database into memory.") - -(defun package--autosuggest-find-candidates () - "Return a list of suggestions that might be interesting the current buffer. -The elements of the returned list will have the form described in -`package--suggestion-applies-p'." - (and (eq major-mode 'fundamental-mode) - (let ((suggetions '())) - (when (eq package--autosuggest-database 'unset) - (setq package--autosuggest-database - (with-temp-buffer - (insert-file-contents - (expand-file-name "package-autosuggest.eld" - data-directory)) - (read (current-buffer))))) - (dolist (sug package--autosuggest-database) - (when (and (package--suggestion-applies-p sug) - (if (eq package-autosuggest-style 'once) - (not (memq (car sug) package--autosuggest-suggested)) - t)) - (push sug suggetions))) - suggetions))) +;;;; Package Suggestions (defun package--autosuggest-install-and-enable (sug) "Install and enable a package suggestion PKG-ENT. @@ -4638,33 +4548,6 @@ SUG should be of the form as described in `package--suggestion-applies-p'." (with-current-buffer buf (funcall-interactively (or (cadddr sug) (car sug))))))))) -(defvar package--autosugest-line-format - '(:eval (package--autosugest-line-format))) -(put 'package--autosugest-line-format 'risky-local-variable t) - -(defface package-autosuggest-face - '((t :inherit (success))) - "Face to use in the mode line to highlight suggested packages." - :version "30.1") - -(defun package--autosugest-line-format () - "Generate a mode-line string to indicate a suggested package." - `(,@(and-let* (((not (null package-autosuggest-mode))) - ((eq package-autosuggest-style 'mode-line)) - (avail (package--autosuggest-find-candidates))) - (propertize - (format " Install %s?" - (mapconcat - #'symbol-name - (delete-dups (mapcar #'car avail)) - ", ")) - 'face 'package-autosuggest-face - 'mouse-face 'mode-line-highlight - 'help-echo "Click to install suggested package." - 'keymap (let ((map (make-sparse-keymap))) - (define-key map [mode-line down-mouse-1] #'package-autosuggest) - map))))) - (defun package--autosugest-prompt (packages) "Query the user whether to install PACKAGES or not. PACKAGES is a list of package suggestions in the form as described in @@ -4736,33 +4619,17 @@ so you have to select which to install!)" nl)) (set-window-dedicated-p win t) (set-window-point win (point-min)))))) -(defun package--autosuggest-after-change-mode () - "Display package suggestions for the current buffer. -This function should be added to `after-change-major-mode-hook'." - (when-let* ((avail (package--autosuggest-find-candidates)) - (pkgs (mapconcat #'symbol-name - (delete-dups (mapcar #'car avail)) - ", "))) - (pcase-exhaustive package-autosuggest-style - ('mode-line - (setq mode-name (append (ensure-list mode-name) - '((package-autosuggest-mode - package--autosugest-line-format)))) - (force-mode-line-update t)) - ((or 'once 'always) - (package--autosugest-prompt avail)) - ('message - (message - (substitute-command-keys - (format "Found suggested packages: %s. Install using \\[package-autosuggest]" - pkgs))))))) - -(defun package-autosuggest () - "Prompt the user to install the suggested packages." +;;;###autoload +(defun package-autosuggest (&optional candidates) + "Prompt the user to install the suggested packages. +The optional argument CANDIDATES may be a list of packages that match +for form described in `package--suggestion-applies-p'. If omitted, the +list of candidates will be computed from the database." (interactive) - (let ((avail (or (package--autosuggest-find-candidates) - (user-error "No package suggestions found")))) - (package--autosugest-prompt avail))) + (package--autosugest-prompt + (or candidates + (package--autosuggest-find-candidates) + (user-error "No package suggestions found")))) (defun package-reset-suggestions () "Forget previous package suggestions. diff --git a/lisp/loadup.el b/lisp/loadup.el index 665aeb4a595..24b54275778 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -383,6 +383,7 @@ (load "uniquify") (load "electric") (load "paren") +(load "emacs-lisp/package-activate") (load "emacs-lisp/shorthands") From 4a1e4a6edcaa0300d62f26126e212e8e273fd15d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 22:15:06 +0100 Subject: [PATCH 37/52] ; * lisp/emacs-lisp/package-activate.el: Add note on preloading --- lisp/emacs-lisp/package-activate.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 3d62c6f085e..40456b54dee 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -30,6 +30,8 @@ ;; activate packages at startup, as well as other functions that are ;; useful without having to load the entirety of package.el. +;; Note that the contents of this file are preloaded! + ;;; Code: (eval-when-compile (require 'cl-lib)) From f64430fbadb655e43d818b1cbcd91bf56cbc0d5b Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 22:15:49 +0100 Subject: [PATCH 38/52] ; Fix typo * lisp/emacs-lisp/package-activate.el (package--autosugest-line-format): Use actually existing face symbol. --- lisp/emacs-lisp/package-activate.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 40456b54dee..6934ba91361 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -631,7 +631,7 @@ The elements of the returned list will have the form described in #'symbol-name (delete-dups (mapcar #'car avail)) ", ")) - 'face 'mode-line-emphasismode-line- + 'face 'mode-line-emphasis 'mouse-face 'mode-line-highlight 'help-echo "Click to install suggested package." 'keymap (let ((map (make-sparse-keymap))) From 5808909d1e31dc77b4dac358599ee9a0e1d3fbf7 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 22:24:09 +0100 Subject: [PATCH 39/52] ; Properly initialize 'package-autosuggest-mode' * lisp/emacs-lisp/package-activate.el (package-autosuggest-mode): Add :initialize property to minor mode definition as recommended in (elisp) Variable Definitions. --- lisp/emacs-lisp/package-activate.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 6934ba91361..f00831c9ba2 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -664,6 +664,7 @@ This function should be added to `after-change-major-mode-hook'." (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." :global t :init-value t :group 'package + :initialize #'custom-initialize-delay (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) From f561eed4d654345dba68d38bf47ab7637db536fb Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 22:31:30 +0100 Subject: [PATCH 40/52] Add separate user option to prevent repetitive package suggestions * lisp/emacs-lisp/package-activate.el (package-autosuggest-style): Remove option 'once' and defer to new user option. (package-autosuggest-once): Add new option. (package--suggestion-applies-p) (package--autosuggest-after-change-mode): Respect new user option. --- lisp/emacs-lisp/package-activate.el | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index f00831c9ba2..cc73860708d 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -542,15 +542,20 @@ the `Version:' header." You can set this value to `mode-line' (default) to indicate the availability of a package suggestion in the minor mode, `always' to prompt the user in the minibuffer every time a suggestion is available -in a `fundamental-mode' buffer, `once' to do only prompt the user once -for each suggestion or `message' to just display a message hinting at -the existence of a suggestion." +in a `fundamental-mode' buffer, or `message' to just display a message +hinting at the existence of a suggestion. If you only wish to be +reminded of package suggestions once every session, consider customizing +the `package-autosuggest-once' user option." :type '(choice (const :tag "Indicate in mode line" mode-line) (const :tag "Always prompt" always) - (const :tag "Prompt only once" once) (const :tag "Indicate with message" message)) :group 'package) +(defcustom package-autosuggest-once nil + "Non-nil means not to repeat package suggestions." + :type 'boolean + :group 'package) + (defvar package--autosuggest-database 'unset "A list of package suggestions. Each entry in the list is of a form suitable to for @@ -578,7 +583,7 @@ mode name differ, then an optional forth element MAJOR-MODE can indicate what command to invoke to enable the package." (pcase sug ((or (guard (not (eq major-mode 'fundamental-mode))) - (guard (and (memq package-autosuggest-style '(once mode-line)) + (guard (and package-autosuggest-once (not (memq (car sug) package--autosuggest-suggested)))) `(,(pred package-installed-p) . ,_)) nil) @@ -653,13 +658,15 @@ This function should be added to `after-change-major-mode-hook'." '((package-autosuggest-mode package--autosugest-line-format)))) (force-mode-line-update t)) - ((or 'once 'always) + ('always (package-autosuggest avail)) ('message (message (substitute-command-keys (format "Found suggested packages: %s. Install using \\[package-autosuggest]" - pkgs))))))) + pkgs))) + (dolist (rec avail) + (add-to-list 'package--autosuggest-suggested (car rec))))))) (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." From 6314c08c6b0aeed078061d1adb97ce80a7355964 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 22:36:29 +0100 Subject: [PATCH 41/52] Link to "Major Mode" node in manual when suggesting packges * lisp/emacs-lisp/package.el (package--autosugest-prompt): Add another button. --- lisp/emacs-lisp/package.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 94e1dc99b3f..1315cd6fbed 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4605,6 +4605,8 @@ so you have to select which to install!)" nl)) nlnl "To learn more about package management, read " (buttonize "(emacs) Packages" (lambda (_) (info "(emacs) Packages"))) + ", and to learn more about how Emacs supports specific languages, read " + (buttonize "(emacs) Major modes" (lambda (_) (info "(emacs) Major modes"))) ".") (fill-region (point-min) (point-max)) From bc413b3507c19a376af08808c4e00c3e5842d4b7 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Feb 2026 22:50:49 +0100 Subject: [PATCH 42/52] Use 'buffer-file-name' when matching 'auto-mode-alist' * lisp/emacs-lisp/package-activate.el (package--suggestion-applies-p): The file name associated with a buffer is a better match for entries in 'auto-mode-alist', so we use that instead of the buffer name that can have additional noise to make the name unique. --- lisp/emacs-lisp/package-activate.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index cc73860708d..3965906f5d8 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -588,7 +588,7 @@ what command to invoke to enable the package." `(,(pred package-installed-p) . ,_)) nil) (`(,_ auto-mode-alist ,ext . ,_) - (and (string-match-p ext (buffer-name)) t)) + (and (buffer-file-name) (string-match-p ext (buffer-file-name)) t)) (`(,_ magic-mode-alist ,mag . ,_) (without-restriction (save-excursion From c31e7ef4d5a2164f6b3c60d79239659069c965c8 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sat, 7 Feb 2026 09:25:27 +0100 Subject: [PATCH 43/52] Revert "Enable 'package-autosuggest-mode' at startup" This reverts commit ae673183625aa76fb5d7160730c92eda659b10ee. --- lisp/emacs-lisp/package-activate.el | 9 +- lisp/emacs-lisp/package.el | 154 ++++++++++++++++++++++++++-- lisp/loadup.el | 1 - 3 files changed, 152 insertions(+), 12 deletions(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 3965906f5d8..24d168c5d05 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -211,6 +211,7 @@ loaded and/or activated, customize `package-load-list'.") ;;;; Public interfaces for accessing built-in package info +;;;###autoload (defvar package-activated-list nil ;; FIXME: This should implicitly include all builtin packages. "List of the names of currently activated packages.") @@ -426,9 +427,12 @@ Newer versions are always activated, regardless of FORCE." ;;;; Unpacking +;;;###autoload (defvar package--activated nil "Non-nil if `package-activate-all' has been run.") +;;;###autoload +(progn ;; Make the function usable without loading `package.el'. (defun package-activate-all () "Activate all installed packages. The variable `package-load-list' controls which packages to load." @@ -457,7 +461,7 @@ The variable `package-load-list' controls which packages to load." ;; `declare-function' is currently not scoped, so if we use ;; it here, we end up with a redefinition warning instead :-) (with-no-warnings - (package--activate-all)))))) + (package--activate-all))))))) (defun package--activate-all () (dolist (elt (package--alist)) @@ -471,6 +475,7 @@ The variable `package-load-list' controls which packages to load." (declare-function lm-package-version "lisp-mnt" (&optional file)) +;;;###autoload (defun package-installed-p (package &optional min-version) "Return non-nil if PACKAGE, of MIN-VERSION or newer, is installed. If PACKAGE is a symbol, it is the package name and MIN-VERSION @@ -500,6 +505,7 @@ If PACKAGE is a `package-desc' object, MIN-VERSION is ignored." ;; Also check built-in packages. (package-built-in-p package min-version))))) +;;;###autoload (defun package-get-version () "Return the version number of the package in which this is used. Assumes it is used from an Elisp file placed inside the top-level directory @@ -668,6 +674,7 @@ This function should be added to `after-change-major-mode-hook'." (dolist (rec avail) (add-to-list 'package--autosuggest-suggested (car rec))))))) +;;;###autoload (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." :global t :init-value t :group 'package diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 1315cd6fbed..9b23655430d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4530,7 +4530,97 @@ The list is displayed in a buffer named `*Packages*'." (list-packages t)) -;;;; Package Suggestions +;;;; Autosuggest + +(defcustom package-autosuggest-style 'mode-line + "How to draw attention to `package-autosuggest-mode' suggestions. +You can set this value to `mode-line' (default) to indicate the +availability of a package suggestion in the minor mode, `always' to +prompt the user in the minibuffer every time a suggestion is available +in a `fundamental-mode' buffer, `once' to do only prompt the user once +for each suggestion or `message' to just display a message hinting at +the existence of a suggestion." + :type '(choice (const :tag "Indicate in mode line" mode-line) + (const :tag "Always prompt" always) + (const :tag "Prompt only once" once) + (const :tag "Indicate with message" message))) + +;;;###autoload +(define-minor-mode package-autosuggest-mode + "Enable the automatic suggestion and installation of packages." + :global t :init-value t + (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) + 'after-change-major-mode-hook + #'package--autosuggest-after-change-mode)) + +(defvar package--autosuggest-suggested '() + "List of packages that have already been suggested. +Suggestions found in this list will not count as suggestions (e.g. if +`package-autosuggest-style' is set to `mode-line', a suggestion found in +here will inhibit `package-autosuggest-mode' from displaying a hint in +the mode line).") + +(defun package--suggestion-applies-p (sug) + "Check if a suggestion SUG is applicable to the current buffer. +Each suggestion has the form (PACKAGE TYPE DATA), where PACKAGE is a +symbol denoting the package and major-mode the suggestion applies to, +TYPE is one of `auto-mode-alist', `magic-mode-alist' or +`interpreter-mode-alist' indicating the type of check to be made and +DATA is the value to check against TYPE in the intuitive way (e.g. for +`auto-mode-alist' DATA is a regular expression matching a file name that +PACKAGE should be suggested for). If the package name and the major +mode name differ, then an optional forth element MAJOR-MODE can indicate +what command to invoke to enable the package." + (pcase sug + ((or (guard (not (eq major-mode 'fundamental-mode))) + `(,(pred package-installed-p) . ,_)) + nil) + ((or `(,_ auto-mode-alist ,ext ,_) + `(,_ auto-mode-alist ,ext)) + (and (string-match-p ext (buffer-name)) t)) + ((or `(,_ magic-mode-alist ,mag ,_) + `(,_ magic-mode-alist ,mag)) + (without-restriction + (save-excursion + (goto-char (point-min)) + (looking-at-p mag)))) + ((or `(,_ interpreter-mode-alist ,intr ,_) + `(,_ interpreter-mode-alist ,intr)) + (without-restriction + (save-excursion + (goto-char (point-min)) + (and (looking-at auto-mode-interpreter-regexp) + (string-match-p + (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") + intr))))))) + +(defvar package--autosuggest-database 'unset + "A list of package suggestions. +Each entry in the list is of a form suitable to for +`package--suggestion-applies-p', which see. The special value `unset' +is used to indicate that `package--autosuggest-find-candidates' should +load the database into memory.") + +(defun package--autosuggest-find-candidates () + "Return a list of suggestions that might be interesting the current buffer. +The elements of the returned list will have the form described in +`package--suggestion-applies-p'." + (and (eq major-mode 'fundamental-mode) + (let ((suggetions '())) + (when (eq package--autosuggest-database 'unset) + (setq package--autosuggest-database + (with-temp-buffer + (insert-file-contents + (expand-file-name "package-autosuggest.eld" + data-directory)) + (read (current-buffer))))) + (dolist (sug package--autosuggest-database) + (when (and (package--suggestion-applies-p sug) + (if (eq package-autosuggest-style 'once) + (not (memq (car sug) package--autosuggest-suggested)) + t)) + (push sug suggetions))) + suggetions))) (defun package--autosuggest-install-and-enable (sug) "Install and enable a package suggestion PKG-ENT. @@ -4548,6 +4638,33 @@ SUG should be of the form as described in `package--suggestion-applies-p'." (with-current-buffer buf (funcall-interactively (or (cadddr sug) (car sug))))))))) +(defvar package--autosugest-line-format + '(:eval (package--autosugest-line-format))) +(put 'package--autosugest-line-format 'risky-local-variable t) + +(defface package-autosuggest-face + '((t :inherit (success))) + "Face to use in the mode line to highlight suggested packages." + :version "30.1") + +(defun package--autosugest-line-format () + "Generate a mode-line string to indicate a suggested package." + `(,@(and-let* (((not (null package-autosuggest-mode))) + ((eq package-autosuggest-style 'mode-line)) + (avail (package--autosuggest-find-candidates))) + (propertize + (format " Install %s?" + (mapconcat + #'symbol-name + (delete-dups (mapcar #'car avail)) + ", ")) + 'face 'package-autosuggest-face + 'mouse-face 'mode-line-highlight + 'help-echo "Click to install suggested package." + 'keymap (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] #'package-autosuggest) + map))))) + (defun package--autosugest-prompt (packages) "Query the user whether to install PACKAGES or not. PACKAGES is a list of package suggestions in the form as described in @@ -4621,17 +4738,34 @@ so you have to select which to install!)" nl)) (set-window-dedicated-p win t) (set-window-point win (point-min)))))) +(defun package--autosuggest-after-change-mode () + "Display package suggestions for the current buffer. +This function should be added to `after-change-major-mode-hook'." + (when-let* ((avail (package--autosuggest-find-candidates)) + (pkgs (mapconcat #'symbol-name + (delete-dups (mapcar #'car avail)) + ", "))) + (pcase-exhaustive package-autosuggest-style + ('mode-line + (setq mode-name (append (ensure-list mode-name) + '((package-autosuggest-mode + package--autosugest-line-format)))) + (force-mode-line-update t)) + ((or 'once 'always) + (package--autosugest-prompt avail)) + ('message + (message + (substitute-command-keys + (format "Found suggested packages: %s. Install using \\[package-autosuggest]" + pkgs))))))) + ;;;###autoload -(defun package-autosuggest (&optional candidates) - "Prompt the user to install the suggested packages. -The optional argument CANDIDATES may be a list of packages that match -for form described in `package--suggestion-applies-p'. If omitted, the -list of candidates will be computed from the database." +(defun package-autosuggest () + "Prompt the user to install the suggested packages." (interactive) - (package--autosugest-prompt - (or candidates - (package--autosuggest-find-candidates) - (user-error "No package suggestions found")))) + (let ((avail (or (package--autosuggest-find-candidates) + (user-error "No package suggestions found")))) + (package--autosugest-prompt avail))) (defun package-reset-suggestions () "Forget previous package suggestions. diff --git a/lisp/loadup.el b/lisp/loadup.el index 24b54275778..665aeb4a595 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -383,7 +383,6 @@ (load "uniquify") (load "electric") (load "paren") -(load "emacs-lisp/package-activate") (load "emacs-lisp/shorthands") From 1aabe135e644a5f8703cd6d6eac0402b728c9cd3 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sat, 7 Feb 2026 11:02:19 +0100 Subject: [PATCH 44/52] ; Fix partial revert from c31e7ef4d5a * lisp/emacs-lisp/package.el (package-autosuggest-style) (package-autosuggest-mode, package--autosuggest-suggested) (package--suggestion-applies-p, package--autosuggest-database) (package--autosuggest-find-candidates) (package--autosugest-line-format, package-autosuggest-face) (package--autosuggest-after-change-mode, package-autosuggest): Remove definitions that were kept in package-activate.el. --- lisp/emacs-lisp/package.el | 154 +++---------------------------------- 1 file changed, 10 insertions(+), 144 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 9b23655430d..1315cd6fbed 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4530,97 +4530,7 @@ The list is displayed in a buffer named `*Packages*'." (list-packages t)) -;;;; Autosuggest - -(defcustom package-autosuggest-style 'mode-line - "How to draw attention to `package-autosuggest-mode' suggestions. -You can set this value to `mode-line' (default) to indicate the -availability of a package suggestion in the minor mode, `always' to -prompt the user in the minibuffer every time a suggestion is available -in a `fundamental-mode' buffer, `once' to do only prompt the user once -for each suggestion or `message' to just display a message hinting at -the existence of a suggestion." - :type '(choice (const :tag "Indicate in mode line" mode-line) - (const :tag "Always prompt" always) - (const :tag "Prompt only once" once) - (const :tag "Indicate with message" message))) - -;;;###autoload -(define-minor-mode package-autosuggest-mode - "Enable the automatic suggestion and installation of packages." - :global t :init-value t - (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) - 'after-change-major-mode-hook - #'package--autosuggest-after-change-mode)) - -(defvar package--autosuggest-suggested '() - "List of packages that have already been suggested. -Suggestions found in this list will not count as suggestions (e.g. if -`package-autosuggest-style' is set to `mode-line', a suggestion found in -here will inhibit `package-autosuggest-mode' from displaying a hint in -the mode line).") - -(defun package--suggestion-applies-p (sug) - "Check if a suggestion SUG is applicable to the current buffer. -Each suggestion has the form (PACKAGE TYPE DATA), where PACKAGE is a -symbol denoting the package and major-mode the suggestion applies to, -TYPE is one of `auto-mode-alist', `magic-mode-alist' or -`interpreter-mode-alist' indicating the type of check to be made and -DATA is the value to check against TYPE in the intuitive way (e.g. for -`auto-mode-alist' DATA is a regular expression matching a file name that -PACKAGE should be suggested for). If the package name and the major -mode name differ, then an optional forth element MAJOR-MODE can indicate -what command to invoke to enable the package." - (pcase sug - ((or (guard (not (eq major-mode 'fundamental-mode))) - `(,(pred package-installed-p) . ,_)) - nil) - ((or `(,_ auto-mode-alist ,ext ,_) - `(,_ auto-mode-alist ,ext)) - (and (string-match-p ext (buffer-name)) t)) - ((or `(,_ magic-mode-alist ,mag ,_) - `(,_ magic-mode-alist ,mag)) - (without-restriction - (save-excursion - (goto-char (point-min)) - (looking-at-p mag)))) - ((or `(,_ interpreter-mode-alist ,intr ,_) - `(,_ interpreter-mode-alist ,intr)) - (without-restriction - (save-excursion - (goto-char (point-min)) - (and (looking-at auto-mode-interpreter-regexp) - (string-match-p - (concat "\\`" (file-name-nondirectory (match-string 2)) "\\'") - intr))))))) - -(defvar package--autosuggest-database 'unset - "A list of package suggestions. -Each entry in the list is of a form suitable to for -`package--suggestion-applies-p', which see. The special value `unset' -is used to indicate that `package--autosuggest-find-candidates' should -load the database into memory.") - -(defun package--autosuggest-find-candidates () - "Return a list of suggestions that might be interesting the current buffer. -The elements of the returned list will have the form described in -`package--suggestion-applies-p'." - (and (eq major-mode 'fundamental-mode) - (let ((suggetions '())) - (when (eq package--autosuggest-database 'unset) - (setq package--autosuggest-database - (with-temp-buffer - (insert-file-contents - (expand-file-name "package-autosuggest.eld" - data-directory)) - (read (current-buffer))))) - (dolist (sug package--autosuggest-database) - (when (and (package--suggestion-applies-p sug) - (if (eq package-autosuggest-style 'once) - (not (memq (car sug) package--autosuggest-suggested)) - t)) - (push sug suggetions))) - suggetions))) +;;;; Package Suggestions (defun package--autosuggest-install-and-enable (sug) "Install and enable a package suggestion PKG-ENT. @@ -4638,33 +4548,6 @@ SUG should be of the form as described in `package--suggestion-applies-p'." (with-current-buffer buf (funcall-interactively (or (cadddr sug) (car sug))))))))) -(defvar package--autosugest-line-format - '(:eval (package--autosugest-line-format))) -(put 'package--autosugest-line-format 'risky-local-variable t) - -(defface package-autosuggest-face - '((t :inherit (success))) - "Face to use in the mode line to highlight suggested packages." - :version "30.1") - -(defun package--autosugest-line-format () - "Generate a mode-line string to indicate a suggested package." - `(,@(and-let* (((not (null package-autosuggest-mode))) - ((eq package-autosuggest-style 'mode-line)) - (avail (package--autosuggest-find-candidates))) - (propertize - (format " Install %s?" - (mapconcat - #'symbol-name - (delete-dups (mapcar #'car avail)) - ", ")) - 'face 'package-autosuggest-face - 'mouse-face 'mode-line-highlight - 'help-echo "Click to install suggested package." - 'keymap (let ((map (make-sparse-keymap))) - (define-key map [mode-line down-mouse-1] #'package-autosuggest) - map))))) - (defun package--autosugest-prompt (packages) "Query the user whether to install PACKAGES or not. PACKAGES is a list of package suggestions in the form as described in @@ -4738,34 +4621,17 @@ so you have to select which to install!)" nl)) (set-window-dedicated-p win t) (set-window-point win (point-min)))))) -(defun package--autosuggest-after-change-mode () - "Display package suggestions for the current buffer. -This function should be added to `after-change-major-mode-hook'." - (when-let* ((avail (package--autosuggest-find-candidates)) - (pkgs (mapconcat #'symbol-name - (delete-dups (mapcar #'car avail)) - ", "))) - (pcase-exhaustive package-autosuggest-style - ('mode-line - (setq mode-name (append (ensure-list mode-name) - '((package-autosuggest-mode - package--autosugest-line-format)))) - (force-mode-line-update t)) - ((or 'once 'always) - (package--autosugest-prompt avail)) - ('message - (message - (substitute-command-keys - (format "Found suggested packages: %s. Install using \\[package-autosuggest]" - pkgs))))))) - ;;;###autoload -(defun package-autosuggest () - "Prompt the user to install the suggested packages." +(defun package-autosuggest (&optional candidates) + "Prompt the user to install the suggested packages. +The optional argument CANDIDATES may be a list of packages that match +for form described in `package--suggestion-applies-p'. If omitted, the +list of candidates will be computed from the database." (interactive) - (let ((avail (or (package--autosuggest-find-candidates) - (user-error "No package suggestions found")))) - (package--autosugest-prompt avail))) + (package--autosugest-prompt + (or candidates + (package--autosuggest-find-candidates) + (user-error "No package suggestions found")))) (defun package-reset-suggestions () "Forget previous package suggestions. From 4a3640c3f82142f115c6a7a7e64a4869700d1f64 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 9 Feb 2026 19:22:07 +0100 Subject: [PATCH 45/52] Detect more package suggestions * admin/scrape-elpa.el (scrape-elpa--safe-eval): Add new function. (scrape-elpa): Evaluate part of the matched expression to catch more entries. * etc/package-autosuggest.eld: Update database. --- admin/scrape-elpa.el | 60 ++++++++++++++++++++++++++++++++++--- etc/package-autosuggest.eld | 14 +++++++++ 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index f513dc36550..f3e9d7f8d0f 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -1,6 +1,6 @@ ;;; scrape-elpa.el --- Collect ELPA package suggestions -*- lexical-binding: t; -*- -;; Copyright (C) 2024 Free Software Foundation, Inc. +;; Copyright (C) 2024, 2026 Free Software Foundation, Inc. ;; Author: Philip Kaludercic ;; Keywords: tools @@ -25,6 +25,39 @@ ;;; Code: +(require 'rx) + +(defun scrape-elpa--safe-eval (exp &optional vars) + "Manually evaluate EXP without potentially dangerous side-effects. +The optional argument VARS may be an alist mapping symbols to values, +used when evaluating variables. The evaluation function is not meant to +be comprehensive, but just to handle the kinds of expressions that +`scrape-elpa' expects to encounter." + (pcase-exhaustive exp + ;; special handling for macros + (`(rx . ,body) (rx-to-string `(: . ,body) t)) + ;; quoting and quasi-quoting + (`',x x) + (`(purecopy ,x) x) + ((and (guard (eq '\` (car-safe exp))) (let `(,car . ,cdr) (cadr exp))) + (cons + (if (eq (car-safe car) '\,) (scrape-elpa--safe-eval (cadr car) vars) car) + (if (eq (car-safe cdr) '\,) (scrape-elpa--safe-eval (cadr cdr) vars) cdr))) + ;; supported functions + (`(cons ,car ,cdr) + (cons (scrape-elpa--safe-eval car vars) + (scrape-elpa--safe-eval cdr vars))) + (`(concat . ,args) + (apply #'concat (mapcar #'scrape-elpa--safe-eval args))) + ;; self-evaluating forms + ((pred macroexp-const-p) exp) + ;; variable evaluation + ((pred symbolp) + (let ((ent (assq exp vars))) + (if ent (cdr ent) (signal 'void-variable exp)))))) + +(scrape-elpa--safe-eval '(cons "\\.go\\'" 'go-mode)) + (defun scrape-elpa (&rest directories) "Scrape autoload files in DIRECTORIES for package suggestions. This file will automatically update \"package-autosuggest.eld\", but not @@ -57,6 +90,7 @@ Please review the results before updating the autosuggest database!" "Scraping files..." (and-let* (((string-match "/\\([^/]+?\\)-autoloads\\.el\\'" file)) (pkg (intern (match-string 1 file))) + (vars (list '(#:nihil))) (inhibit-message t)) (with-temp-buffer (insert-file-contents file) @@ -64,16 +98,34 @@ Please review the results before updating the autosuggest database!" (while t (dolist (exp (macroexp-unprogn (read (current-buffer)))) (pcase exp + (`(defconst ,(and (pred symbolp) var) ,val . ,_) + (catch 'ignore + (push + (cons var (condition-case err + (scrape-elpa--safe-eval val vars) + (t (message "Failed to evaluate %S: %S in %S" exp err vars) + (throw 'ignore nil)))) + vars))) (`(add-to-list ',(and (or 'interpreter-mode-alist 'magic-mode-alist 'auto-mode-alist) variable) - '(,(and (pred stringp) regexp) . - ,(and (pred symbolp) mode))) + ,(let `(,(and (pred stringp) regexp) . + ,(and (pred symbolp) mode)) + (condition-case err + (scrape-elpa--safe-eval _ vars) + (t (message "Failed to evaluate %S: %S in %S" exp err vars) + nil)))) (terpri) (prin1 (append (list pkg variable regexp) - (and (not (eq pkg mode)) (list mode)))))))) + (and (not (eq pkg mode)) (list mode))))) + (`(add-to-list + ',(or 'interpreter-mode-alist + 'magic-mode-alist + 'auto-mode-alist) + _) + (_ (message "Skipped over %S" exp)))))) (end-of-file nil)))))) (insert "\n)\n"))) diff --git a/etc/package-autosuggest.eld b/etc/package-autosuggest.eld index 987dc6a6e6b..257ad853b97 100644 --- a/etc/package-autosuggest.eld +++ b/etc/package-autosuggest.eld @@ -41,6 +41,7 @@ (gle-mode auto-mode-alist "\\.gle\\'") (gpr-mode auto-mode-alist "\\.gpr\\'") (html5-schema auto-mode-alist "\\.html?\\'" nxml-mode) +(idlwave auto-mode-alist "\\.pro\\'" idlwave-mode) (jgraph-mode auto-mode-alist "\\.jgr\\'") (json-mode auto-mode-alist "\\.json\\'") (lmc auto-mode-alist "\\.elmc\\'" lmc-asm-mode) @@ -55,6 +56,7 @@ (omn-mode auto-mode-alist "\\.omn\\'") (poke-mode auto-mode-alist "\\.pk\\'") (pspp-mode auto-mode-alist "\\.sps\\'") +(python auto-mode-alist "\\(?:\\.\\(?:p\\(?:th\\|y[iw]?\\)\\)\\|/\\(?:SCons\\(?:\\(?:crip\\|truc\\)t\\)\\)\\)\\'" python-mode) (python interpreter-mode-alist "python[0-9.]*" python-mode) (python auto-mode-alist "/\\(?:Pipfile\\|\\.?flake8\\)\\'" conf-mode) (rec-mode auto-mode-alist "\\.rec\\'") @@ -62,8 +64,10 @@ (sed-mode auto-mode-alist "\\.sed\\'") (sed-mode interpreter-mode-alist "sed") (shen-mode auto-mode-alist "\\.shen\\'") +(show-font auto-mode-alist "\\.\\(ttf\\|otf\\)\\'" show-font-mode) (sisu-mode auto-mode-alist "\\.ss[imt]\\'") (smalltalk-mode auto-mode-alist "\\.st\\'") +(smalltalk-mode auto-mode-alist "\\.star\\'" archive-mode) (sml-mode auto-mode-alist "\\.s\\(ml\\|ig\\)\\'") (sml-mode auto-mode-alist "\\.cm\\'" sml-cm-mode) (sml-mode auto-mode-alist "\\.grm\\'" sml-yacc-mode) @@ -77,6 +81,7 @@ (systemd auto-mode-alist "\\.swap\\'" systemd-swap-mode) (systemd auto-mode-alist "\\.timer\\'" systemd-timer-mode) (vcard auto-mode-alist "\\.[Vv][Cc][Ff]\\'" vcard-mode) +(vcl-mode auto-mode-alist "\\.vcl\\'") (wisi auto-mode-alist "\\.parse_table.*\\'" wisitoken-parse_table-mode) (wisitoken-grammar-mode auto-mode-alist "\\.wy\\'" simple-indent-mode) (wisitoken-grammar-mode auto-mode-alist "\\.wy\\'") @@ -107,6 +112,7 @@ (coffee-mode interpreter-mode-alist "coffee") (d-mode auto-mode-alist "\\.d[i]?\\'") (dart-mode auto-mode-alist "\\.dart\\'") +(dockerfile-mode auto-mode-alist "[/\\]\\(?:Containerfile\\|Dockerfile\\)\\(?:\\.[^/\\]*\\)?\\'") (dockerfile-mode auto-mode-alist "\\.dockerfile\\'") (drupal-mode auto-mode-alist "[^/]\\.\\(module\\|test\\|install\\|profile\\|tpl\\.php\\|theme\\|inc\\)\\'" php-mode) (drupal-mode auto-mode-alist "[^/]\\.info\\'" conf-windows-mode) @@ -121,6 +127,7 @@ (geiser-racket auto-mode-alist "\\.rkt\\'" scheme-mode) (gnu-apl-mode auto-mode-alist "\\.apl\\'") (gnu-apl-mode interpreter-mode-alist "apl") +(go-mode auto-mode-alist "\\.go\\'") (go-mode auto-mode-alist "go\\.mod\\'" go-dot-mod-mode) (go-mode auto-mode-alist "go\\.work\\'" go-dot-work-mode) (graphql-mode auto-mode-alist "\\.graphql\\'") @@ -137,6 +144,7 @@ (haskell-mode auto-mode-alist "\\.hsc\\'") (haskell-mode interpreter-mode-alist "runghc") (haskell-mode interpreter-mode-alist "runhaskell") +(haskell-tng-mode auto-mode-alist "\\.hs\\'") (j-mode auto-mode-alist "\\.ij[rsp]$") (j-mode auto-mode-alist "\\.ijt$" j-lab-mode) (jade-mode auto-mode-alist "\\.jade\\'") @@ -147,12 +155,15 @@ (julia-mode auto-mode-alist "\\.jl\\'") (lua-mode auto-mode-alist "\\.lua\\'") (lua-mode interpreter-mode-alist "lua") +(magit-section auto-mode-alist "/git-rebase-todo\\'" git-rebase-mode) +(magit auto-mode-alist "/git-rebase-todo\\'" git-rebase-mode) (markdown-mode auto-mode-alist "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'") (nginx-mode auto-mode-alist "nginx\\.conf\\'") (nginx-mode auto-mode-alist "/nginx/.+\\.conf\\'") (nix-mode auto-mode-alist "^/nix/store/.+\\.drv\\'" nix-drv-mode) (nix-mode auto-mode-alist "\\flake.lock\\'" js-mode) (nix-mode auto-mode-alist "\\.nix\\'") +(php-mode interpreter-mode-alist "php\\(?:-?[34578]\\(?:\\.[0-9]+\\)*\\)?") (php-mode auto-mode-alist "/\\.php_cs\\(?:\\.dist\\)?\\'") (php-mode auto-mode-alist "\\.\\(?:php\\.inc\\|stub\\)\\'") (php-mode auto-mode-alist "\\.\\(?:php[s345]?\\|phtml\\)\\'" php-mode-maybe) @@ -178,6 +189,9 @@ (subed auto-mode-alist "\\.vtt\\'" subed-vtt-mode) (swift-mode auto-mode-alist "\\.swift\\(interface\\)?\\'") (systemd auto-mode-alist "\\.nspawn\\'" systemd-mode) +(systemd auto-mode-alist "[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|mount\\|net\\(?:dev\\|work\\)\\|s\\(?:ervice\\|lice\\|ocket\\|wap\\)\\|t\\(?:arget\\|imer\\)\\)\\'" systemd-mode) +(systemd auto-mode-alist "\\.#\\(?:[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|mount\\|net\\(?:dev\\|work\\)\\|s\\(?:ervice\\|lice\\|ocket\\|wap\\)\\|t\\(?:arget\\|imer\\)\\)\\|override\\.conf\\)[[:xdigit:]]\\{16\\}\\'" systemd-mode) +(systemd auto-mode-alist "/systemd/[^z-a]+?\\.d/[^/]+?\\.conf\\'" systemd-mode) (tuareg auto-mode-alist "\\.ml[ip]?\\'" tuareg-mode) (tuareg auto-mode-alist "\\.eliomi?\\'" tuareg-mode) (tuareg interpreter-mode-alist "ocamlrun" tuareg-mode) From 6dea509613a5886cbc9cb197c33b19df383f6b75 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 9 Feb 2026 21:17:19 +0100 Subject: [PATCH 46/52] ; Remove test code from previous commit --- admin/scrape-elpa.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index f3e9d7f8d0f..f1bd0307b43 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -56,8 +56,6 @@ be comprehensive, but just to handle the kinds of expressions that (let ((ent (assq exp vars))) (if ent (cdr ent) (signal 'void-variable exp)))))) -(scrape-elpa--safe-eval '(cons "\\.go\\'" 'go-mode)) - (defun scrape-elpa (&rest directories) "Scrape autoload files in DIRECTORIES for package suggestions. This file will automatically update \"package-autosuggest.eld\", but not From ae5ee77f488c8387ed66d946f2a5eff295ed6af1 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 9 Feb 2026 21:22:37 +0100 Subject: [PATCH 47/52] Enable fewer minor modes in package suggestion buffers * lisp/emacs-lisp/package.el (package--autosugest-prompt): Do not enable 'enriched-mode' and 'variable-pitch-mode'. --- lisp/emacs-lisp/package.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 1315cd6fbed..44da3ab94e1 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4612,8 +4612,6 @@ so you have to select which to install!)" nl)) (fill-region (point-min) (point-max)) (special-mode) (button-mode t) - (enriched-mode t) - (variable-pitch-mode t) (let ((win (display-buffer-below-selected (current-buffer) '()))) (fit-window-to-buffer win) From 5bc7185afa4538853df5ea2a1dcd85d079d075ef Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 11 Feb 2026 20:44:20 +0100 Subject: [PATCH 48/52] Disable 'package-autosuggest-mode' by default * lisp/emacs-lisp/package-activate.el (package-autosuggest-mode): Do not set the :init-value when declaring the minor mode. --- lisp/emacs-lisp/package-activate.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 24d168c5d05..7981642a7e0 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -677,7 +677,7 @@ This function should be added to `after-change-major-mode-hook'." ;;;###autoload (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." - :global t :init-value t :group 'package + :global t :group 'package :initialize #'custom-initialize-delay (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook From 0afb026a997a4636658a635d4ff82f21467ca55d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 11 Feb 2026 20:47:26 +0100 Subject: [PATCH 49/52] Generalize 'scrape-elpa--safe-evil' * admin/scrape-elpa.el (scrape-elpa--safe-eval): Extend support from just 'cons' and 'concat' to any side-effect-free function. --- admin/scrape-elpa.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/admin/scrape-elpa.el b/admin/scrape-elpa.el index f1bd0307b43..e1072564db6 100644 --- a/admin/scrape-elpa.el +++ b/admin/scrape-elpa.el @@ -43,12 +43,9 @@ be comprehensive, but just to handle the kinds of expressions that (cons (if (eq (car-safe car) '\,) (scrape-elpa--safe-eval (cadr car) vars) car) (if (eq (car-safe cdr) '\,) (scrape-elpa--safe-eval (cadr cdr) vars) cdr))) - ;; supported functions - (`(cons ,car ,cdr) - (cons (scrape-elpa--safe-eval car vars) - (scrape-elpa--safe-eval cdr vars))) - (`(concat . ,args) - (apply #'concat (mapcar #'scrape-elpa--safe-eval args))) + ;; allow calling `side-effect-free' functions + (`(,(and (pred symbolp) (pred (get _ 'side-effect-free)) fn) . ,args) + (apply fn (mapcar #'scrape-elpa--safe-eval args))) ;; self-evaluating forms ((pred macroexp-const-p) exp) ;; variable evaluation From 92f1d0b5d55a9a60c2fea74f9dc81bd0ea09d2ad Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 12 Feb 2026 18:19:32 +0100 Subject: [PATCH 50/52] Simplify mode-line prompt for package suggestions * lisp/emacs-lisp/package-activate.el (package--autosugest-line-format): Just indicate that packages can be installed, don't mention which. --- lisp/emacs-lisp/package-activate.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 7981642a7e0..4a0a9b79fb5 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -637,11 +637,7 @@ The elements of the returned list will have the form described in ((eq package-autosuggest-style 'mode-line)) (avail (package--autosuggest-find-candidates))) (propertize - (format " Install %s?" - (mapconcat - #'symbol-name - (delete-dups (mapcar #'car avail)) - ", ")) + "[Upgrade?]" 'face 'mode-line-emphasis 'mouse-face 'mode-line-highlight 'help-echo "Click to install suggested package." From 02af0e93a0e63e6ff8354a778fe186ceedb11ebe Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 12 Feb 2026 18:20:15 +0100 Subject: [PATCH 51/52] ; Reset :initialize for 'package-autosuggest-mode' * lisp/emacs-lisp/package-activate.el (package-autosuggest-mode): We don't need a special initializer for the minor mode, if we are not enabling the option OOTB. --- lisp/emacs-lisp/package-activate.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el index 4a0a9b79fb5..1689d985c28 100644 --- a/lisp/emacs-lisp/package-activate.el +++ b/lisp/emacs-lisp/package-activate.el @@ -674,7 +674,7 @@ This function should be added to `after-change-major-mode-hook'." (define-minor-mode package-autosuggest-mode "Enable the automatic suggestion and installation of packages." :global t :group 'package - :initialize #'custom-initialize-delay + ;; :initialize #'custom-initialize-delay (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) 'after-change-major-mode-hook #'package--autosuggest-after-change-mode)) From 1b02bf1214f478c09283a2affbd66efbb9815752 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 12 Feb 2026 18:24:47 +0100 Subject: [PATCH 52/52] Ensure package contents for package suggestions * lisp/emacs-lisp/package.el (package--autosugest-prompt): Query archives if the package being described is not listed in package-archive-contents'. --- lisp/emacs-lisp/package.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 44da3ab94e1..e2d35f20eb5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4578,7 +4578,12 @@ so you have to select which to install!)" nl)) (package--autosuggest-install-and-enable (car sugs)) (quit-window))) - " (" (buttonize "about" #'describe-package pkg) + " (" + (buttonize "about" + (lambda (_) + (unless (assq pkg package-archive-contents) + (package-read-all-archive-contents)) + (describe-package pkg))) ", matches ") (dolist (sug sugs) (unless (eq (char-before) ?\s)