diff options
| author | Philip Kaludercic | 2024-11-07 12:44:50 +0100 |
|---|---|---|
| committer | Philip Kaludercic | 2024-11-07 12:44:50 +0100 |
| commit | 48eefe094f3cfdd7135b1fb2a98f0699a4fb777e (patch) | |
| tree | 520a4441863c9e90a6091b0797ab28ec6f9af685 | |
| parent | d9c581ead4da3764817939a7ff67ac3ecebab765 (diff) | |
| download | emacs-48eefe094f3cfdd7135b1fb2a98f0699a4fb777e.tar.gz emacs-48eefe094f3cfdd7135b1fb2a98f0699a4fb777e.zip | |
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.
| -rw-r--r-- | doc/emacs/package.texi | 6 | ||||
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | 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! | |||
| 410 | 410 | ||
| 411 | @cindex suggestions | 411 | @cindex suggestions |
| 412 | @findex package-autosuggest | 412 | @findex package-autosuggest |
| 413 | @findex package-autosuggest-mode | ||
| 413 | Emacs has a built-in database of suggested packages for certain file | 414 | Emacs has a built-in database of suggested packages for certain file |
| 414 | types. If Emacs opens a file with no specific mode, you can use the | 415 | types. If Emacs opens a file with no specific mode, you can use the |
| 415 | @code{package-autosuggest} command to install the recommended packages | 416 | @code{package-autosuggest} command to install the recommended packages |
| 416 | from ELPA. By default, Emacs will display a clickable hint in the | 417 | from ELPA. After enabling @code{package-autosuggest-mode}, Emacs will |
| 417 | mode-line if it there is a suggested package. | 418 | display a clickable hint in the mode-line if it there is a suggested |
| 419 | package. | ||
| 418 | 420 | ||
| 419 | @anchor{Package Signing} | 421 | @anchor{Package Signing} |
| 420 | @cindex package security | 422 | @cindex package security |
| @@ -666,6 +666,12 @@ the directory into which the repository was cloned. | |||
| 666 | Using a built-in database of package suggestions from ELPA, this command | 666 | Using a built-in database of package suggestions from ELPA, this command |
| 667 | will install viable packages if no specific major mode is available. | 667 | will install viable packages if no specific major mode is available. |
| 668 | 668 | ||
| 669 | +++ | ||
| 670 | *** New minor mode 'package-autosuggest-mode' | ||
| 671 | When enabled, this displays a hint in the mode line indicating the | ||
| 672 | availability of a suggested package. You can customise the presentation | ||
| 673 | of these hints using 'package-autosuggest-style'. | ||
| 674 | |||
| 669 | 675 | ||
| 670 | * New Modes and Packages in Emacs 31.1 | 676 | * New Modes and Packages in Emacs 31.1 |
| 671 | 677 | ||
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." | |||
| 4567 | (const :tag "Prompt only once" once) | 4567 | (const :tag "Prompt only once" once) |
| 4568 | (const :tag "Indicate with message" message))) | 4568 | (const :tag "Indicate with message" message))) |
| 4569 | 4569 | ||
| 4570 | ;;;###autoload | ||
| 4570 | (define-minor-mode package-autosuggest-mode | 4571 | (define-minor-mode package-autosuggest-mode |
| 4571 | "Enable the automatic suggestion and installation of packages." | 4572 | "Enable the automatic suggestion and installation of packages." |
| 4572 | :init-value t :global t | 4573 | :global t |
| 4573 | (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) | 4574 | (funcall (if package-autosuggest-mode #'add-hook #'remove-hook) |
| 4574 | 'after-change-major-mode-hook | 4575 | 'after-change-major-mode-hook |
| 4575 | #'package--autosuggest-after-change-mode)) | 4576 | #'package--autosuggest-after-change-mode)) |