diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-preloaded.el | 1 | ||||
-rw-r--r-- | lisp/emacs-lisp/comp.el | 41 | ||||
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 22 | ||||
-rw-r--r-- | lisp/emacs-lisp/loaddefs-gen.el | 138 | ||||
-rw-r--r-- | lisp/emacs-lisp/package-vc.el | 82 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 99 |
7 files changed, 214 insertions, 171 deletions
diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 9445093f143..5235be52996 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -176,6 +176,7 @@ supertypes from the most specific to least specific.") (i 0) (offset (if type 0 1))) (dolist (slot slots) + (put (car slot) 'slot-name t) (let* ((props (cl--plist-to-alist (cddr slot))) (typep (assq :type props)) (type (if (null typep) t diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 283c00103b5..e97832455b9 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1763,27 +1763,32 @@ Return value is the fall-through block name." (_ (signal 'native-ice "missing previous setimm while creating a switch")))) +(defun comp--func-arity (subr-name) + "Like `func-arity' but invariant against primitive redefinitions. +SUBR-NAME is the name of function." + (or (gethash subr-name comp-subr-arities-h) + (func-arity subr-name))) + (defun comp-emit-set-call-subr (subr-name sp-delta) "Emit a call for SUBR-NAME. SP-DELTA is the stack adjustment." - (let ((subr (symbol-function subr-name)) - (nargs (1+ (- sp-delta)))) - (let* ((arity (func-arity subr)) - (minarg (car arity)) - (maxarg (cdr arity))) - (when (eq maxarg 'unevalled) - (signal 'native-ice (list "subr contains unevalled args" subr-name))) - (if (eq maxarg 'many) - ;; callref case. - (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) - ;; Normal call. - (unless (and (>= maxarg nargs) (<= minarg nargs)) - (signal 'native-ice - (list "incoherent stack adjustment" nargs maxarg minarg))) - (let* ((subr-name subr-name) - (slots (cl-loop for i from 0 below maxarg - collect (comp-slot-n (+ i (comp-sp)))))) - (comp-emit-set-call (apply #'comp-call (cons subr-name slots)))))))) + (let* ((nargs (1+ (- sp-delta))) + (arity (comp--func-arity subr-name)) + (minarg (car arity)) + (maxarg (cdr arity))) + (when (eq maxarg 'unevalled) + (signal 'native-ice (list "subr contains unevalled args" subr-name))) + (if (eq maxarg 'many) + ;; callref case. + (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) + ;; Normal call. + (unless (and (>= maxarg nargs) (<= minarg nargs)) + (signal 'native-ice + (list "incoherent stack adjustment" nargs maxarg minarg))) + (let* ((subr-name subr-name) + (slots (cl-loop for i from 0 below maxarg + collect (comp-slot-n (+ i (comp-sp)))))) + (comp-emit-set-call (apply #'comp-call (cons subr-name slots))))))) (eval-when-compile (defun comp-op-to-fun (x) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 0f6711209a5..22ea12f0960 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -390,7 +390,7 @@ or call the function `%s'.")))) (not (equal ,last-message (current-message)))) (let ((local ,(if globalp "" " in current buffer"))) - (message ,(format "%s %%sabled%%s" pretty-name) + (message "%s %sabled%s" ,pretty-name (if ,getter "en" "dis") local))))) ,@(when after-hook `(,after-hook))) (force-mode-line-update) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index e3ed28f097a..b91d56cfb4f 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -92,12 +92,22 @@ report errors as appropriate for this kind of usage." (forward-sexp (- arg) interactive)) (defun mark-sexp (&optional arg allow-extend) - "Set mark ARG sexps from point. -The place mark goes is the same place \\[forward-sexp] would -move to with the same argument. -Interactively, if this command is repeated -or (in Transient Mark mode) if the mark is active, -it marks the next ARG sexps after the ones already marked. + "Set mark ARG sexps from point or move mark one sexp. +When called from Lisp with ALLOW-EXTEND ommitted or nil, mark is +set ARG sexps from point. +With ARG and ALLOW-EXTEND both non-nil (interactively, with prefix +argument), the place to which mark goes is the same place \\[forward-sexp] +would move to with the same argument; if the mark is active, it moves +ARG sexps from its current position, otherwise it is set ARG sexps +from point. +When invoked interactively without a prefix argument and no active +region, mark moves one sexp forward. +When invoked interactively without a prefix argument, and region +is active, mark moves one sexp away of point (i.e., forward +if mark is at or after point, back if mark is before point), thus +extending the region by one sexp. Since the direction of region +extension depends on the relative position of mark and point, you +can change the direction by \\[exchange-point-and-mark]. This command assumes point is not in a string or comment." (interactive "P\np") (cond ((and allow-extend diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 1007be62dd9..5db9af21508 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -597,73 +597,79 @@ instead of just updating them with the new/changed autoloads." defs)))))) (progress-reporter-done progress)) - ;; If we have no autoloads data, but we have EXTRA-DATA, then - ;; generate the (almost) empty file anyway. - (if (and (not defs) extra-data) + ;; First group per output file. + (dolist (fdefs (seq-group-by (lambda (x) (expand-file-name (car x))) + defs)) + (let ((loaddefs-file (car fdefs)) + hash) (with-temp-buffer - (insert (loaddefs-generate--rubric output-file nil t)) - (search-backward "\f") - (insert extra-data) - (ensure-empty-lines 1) - (write-region (point-min) (point-max) output-file nil 'silent)) - ;; We have some data, so generate the loaddef files. First - ;; group per output file. - (dolist (fdefs (seq-group-by (lambda (x) (expand-file-name (car x))) - defs)) - (let ((loaddefs-file (car fdefs)) - hash) - (with-temp-buffer - (if (and updating (file-exists-p loaddefs-file)) - (insert-file-contents loaddefs-file) - (insert (loaddefs-generate--rubric - loaddefs-file nil t include-package-version)) - (search-backward "\f") - (when extra-data - (insert extra-data) - (ensure-empty-lines 1))) - (setq hash (buffer-hash)) - ;; Then group by source file (and sort alphabetically). - (dolist (section (sort (seq-group-by #'cadr (cdr fdefs)) - (lambda (e1 e2) - (string< - (file-name-sans-extension - (file-name-nondirectory (car e1))) - (file-name-sans-extension - (file-name-nondirectory (car e2))))))) - (pop section) - (let* ((relfile (file-relative-name - (cadar section) - (file-name-directory loaddefs-file))) - (head (concat "\n\f\n;;; Generated autoloads from " - relfile "\n\n"))) - (when (file-exists-p loaddefs-file) - ;; If we're updating an old loaddefs file, then see if - ;; there's a section here for this file already. - (goto-char (point-min)) - (if (not (search-forward head nil t)) - ;; It's a new file; put the data at the end. - (progn - (goto-char (point-max)) - (search-backward "\f\n" nil t)) - ;; Delete the old version of the section. - (delete-region (match-beginning 0) - (and (search-forward "\n\f\n;;;") - (match-beginning 0))) - (forward-line -2))) - (insert head) - (dolist (def (reverse section)) - (setq def (caddr def)) - (if (stringp def) - (princ def (current-buffer)) - (loaddefs-generate--print-form def)) - (unless (bolp) - (insert "\n"))))) - ;; Only write the file if we actually made a change. - (unless (equal (buffer-hash) hash) - (write-region (point-min) (point-max) loaddefs-file nil 'silent) - (byte-compile-info - (file-relative-name loaddefs-file (car (ensure-list dir))) - t "GEN")))))))) + (if (and updating (file-exists-p loaddefs-file)) + (insert-file-contents loaddefs-file) + (insert (loaddefs-generate--rubric + loaddefs-file nil t include-package-version)) + (search-backward "\f") + (when extra-data + (insert extra-data) + (ensure-empty-lines 1))) + (setq hash (buffer-hash)) + ;; Then group by source file (and sort alphabetically). + (dolist (section (sort (seq-group-by #'cadr (cdr fdefs)) + (lambda (e1 e2) + (string< + (file-name-sans-extension + (file-name-nondirectory (car e1))) + (file-name-sans-extension + (file-name-nondirectory (car e2))))))) + (pop section) + (let* ((relfile (file-relative-name + (cadar section) + (file-name-directory loaddefs-file))) + (head (concat "\n\f\n;;; Generated autoloads from " + relfile "\n\n"))) + (when (file-exists-p loaddefs-file) + ;; If we're updating an old loaddefs file, then see if + ;; there's a section here for this file already. + (goto-char (point-min)) + (if (not (search-forward head nil t)) + ;; It's a new file; put the data at the end. + (progn + (goto-char (point-max)) + (search-backward "\f\n" nil t)) + ;; Delete the old version of the section. Strictly + ;; speaking this should search for "\n\f\n;;;", but + ;; there are loaddefs files in the wild that only + ;; have two ';;'. (Bug#63236) + (delete-region (match-beginning 0) + (and (search-forward "\n\f\n;;") + (match-beginning 0))) + (forward-line -2))) + (insert head) + (dolist (def (reverse section)) + (setq def (caddr def)) + (if (stringp def) + (princ def (current-buffer)) + (loaddefs-generate--print-form def)) + (unless (bolp) + (insert "\n"))))) + ;; Only write the file if we actually made a change. + (unless (equal (buffer-hash) hash) + (write-region (point-min) (point-max) loaddefs-file nil 'silent) + (byte-compile-info + (file-relative-name loaddefs-file (car (ensure-list dir))) + t "GEN"))))) + + ;; If processing files without any autoloads, the above loop will + ;; not generate any files. If the function was invoked with + ;; EXTRA-DATA, we want to ensure that even if no autoloads were + ;; found, that at least a file will have been generated containing + ;; the contents of EXTRA-DATA: + (when (and extra-data (not (file-exists-p output-file))) + (with-temp-buffer + (insert (loaddefs-generate--rubric output-file nil t)) + (search-backward "\f") + (insert extra-data) + (ensure-empty-lines 1) + (write-region (point-min) (point-max) output-file nil 'silent))))) (defun loaddefs-generate--print-form (def) "Print DEF in a format that makes sense for version control." diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 253b35f1f1a..85193dd7a30 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -24,7 +24,7 @@ ;; While packages managed by package.el use tarballs for distributing ;; the source code, this extension allows for packages to be fetched -;; and updated directly from a version control system. +;; and upgraded directly from a version control system. ;; ;; To install a package from source use `package-vc-install'. If you ;; aren't interested in activating a package, you can use @@ -41,9 +41,6 @@ ;; - Allow maintaining patches that are ported back onto regular ;; packages and maintained between versions. -;; -;; - Add a heuristic for guessing a `:lisp-dir' when cloning directly -;; from a URL. ;;; Code: @@ -58,7 +55,7 @@ (defgroup package-vc nil "Manage packages from VC checkouts." :group 'package - :link '(custom-manual "(emacs) Package from Source") + :link '(custom-manual "(emacs) Fetching Package Sources") :prefix "package-vc-" :version "29.1") @@ -145,32 +142,9 @@ is a symbol designating the package and SPEC is one of: - nil, if any package version can be installed; - a version string, if that specific revision is to be installed; -- a property list, describing a package specification. Valid - key/value pairs are - - `:url' (string) - The URL of the repository used to fetch the package source. - - `:branch' (string) - If given, the name of the branch to checkout after cloning the directory. - - `:lisp-dir' (string) - The repository-relative name of the directory to use for loading the Lisp - sources. If not given, the value defaults to the root directory - of the repository. - - `:main-file' (string) - The main file of the project, relevant to gather package metadata. - If not given, the assumed default is the package name with \".el\" - appended to it. - - `:vc-backend' (symbol) - A symbol of the VC backend to use for cloning the package. The - value ought to be a member of `vc-handled-backends'. If omitted, - `vc-clone' will fall back onto the archive default or on - `package-vc-default-backend'. - - All other keys are ignored. +- a property list, describing a package specification. For more + details, please consult the subsection \"Specifying Package + Sources\" in the Info node `(emacs)Fetching Package Sources'. This user option will be automatically updated to store package specifications for packages that are not specified in any @@ -184,10 +158,11 @@ archive." (:branch string) (:lisp-dir string) (:main-file string) + (:doc string) (:vc-backend symbol))))) :version "29.1") -(defvar package-vc--archive-spec-alist nil +(defvar package-vc--archive-spec-alists nil "List of package specifications for each archive. The list maps each package name, as a string, to a plist as specified in `package-vc-selected-packages'.") @@ -219,15 +194,15 @@ name for PKG-DESC." (not (alist-get name package-vc-selected-packages nil nil #'string=))) (alist-get (intern (package-desc-archive pkg-desc)) - package-vc--archive-spec-alist) + package-vc--archive-spec-alists) ;; Consult both our local list of package specifications, as well ;; as the lists provided by the archives. (apply #'append (cons package-vc-selected-packages - (mapcar #'cdr package-vc--archive-spec-alist)))) + (mapcar #'cdr package-vc--archive-spec-alists)))) '() nil #'string=)) (defun package-vc--read-archive-data (archive) - "Update `package-vc--archive-spec-alist' for ARCHIVE. + "Update `package-vc--archive-spec-alists' for ARCHIVE. This function is meant to be used as a hook for `package-read-archive-hook'." (let ((contents-file (expand-file-name (format "archives/%s/elpa-packages.eld" archive) @@ -244,7 +219,7 @@ This function is meant to be used as a hook for `package-read-archive-hook'." (let ((spec (read (current-buffer)))) (when (eq package-vc--elpa-packages-version (plist-get (cdr spec) :version)) - (setf (alist-get (intern archive) package-vc--archive-spec-alist) + (setf (alist-get (intern archive) package-vc--archive-spec-alists) (car spec))) (setf (alist-get (intern archive) package-vc--archive-data-alist) (cdr spec)) @@ -255,7 +230,7 @@ This function is meant to be used as a hook for `package-read-archive-hook'." (defun package-vc--download-and-read-archives (&optional async) "Download specifications of all `package-archives' and read them. -Populate `package-vc--archive-spec-alist' with the result. +Populate `package-vc--archive-spec-alists' with the result. If optional argument ASYNC is non-nil, perform the downloads asynchronously." @@ -596,7 +571,7 @@ Emacs Lisp files.") (defun package-vc--unpack (pkg-desc pkg-spec &optional rev) "Install the package described by PKG-DESC. PKG-SPEC is a package specification, a property list describing -how to fetch and build the package. See `package-vc--archive-spec-alist' +how to fetch and build the package. See `package-vc--archive-spec-alists' for details. The optional argument REV specifies a specific revision to checkout. This overrides the `:branch' attribute in PKG-SPEC." (unless (eq (package-desc-kind pkg-desc) 'vc) @@ -645,7 +620,8 @@ abort installation?" name)) (throw 'done (setq lisp-dir name))))) ;; Ensure we have a copy of the package specification - (unless (equal (alist-get name (mapcar #'cdr package-vc--archive-spec-alist)) pkg-spec) + (unless (seq-some (lambda (alist) (equal (alist-get name (cdr alist)) pkg-spec)) + package-vc--archive-spec-alists) (customize-save-variable 'package-vc-selected-packages (cons (cons name pkg-spec) @@ -685,19 +661,19 @@ installed package." #'string=))) ;;;###autoload -(defun package-vc-update-all () - "Attempt to update all installed VC packages." +(defun package-vc-upgrade-all () + "Attempt to upgrade all installed VC packages." (interactive) (dolist (package package-alist) (dolist (pkg-desc (cdr package)) (when (package-vc-p pkg-desc) - (package-vc-update pkg-desc)))) - (message "Done updating packages.")) + (package-vc-upgrade pkg-desc)))) + (message "Done upgrading packages.")) ;;;###autoload -(defun package-vc-update (pkg-desc) - "Attempt to update the package PKG-DESC." - (interactive (list (package-vc--read-package-desc "Update VC package: " t))) +(defun package-vc-upgrade (pkg-desc) + "Attempt to upgrade the package PKG-DESC." + (interactive (list (package-vc--read-package-desc "Upgrade VC package: " t))) ;; HACK: To run `package-vc--unpack-1' after checking out the new ;; revision, we insert a hook into `vc-post-command-functions', and ;; remove it right after it ran. To avoid running the hook multiple @@ -771,11 +747,13 @@ indicating the package name and SPEC is a plist as described in symbol whose name is the package name, and the URL for the package will be taken from the package's metadata. -By default, this function installs the last version of the package -available from its repository, but if REV is given and non-nil, it -specifies the revision to install. If REV has the special value -`:last-release' (interactively, the prefix argument), that stands -for the last released version of the package. +By default, this function installs the last revision of the +package available from its repository. If REV is a string, it +describes the revision to install, as interpreted by the VC +backend. The special value `:last-release' (interactively, the +prefix argument), will use the commit of the latest release, if +it exists. The last release is the latest revision which changed +the \"Version:\" header of the package's main Lisp file. Optional argument BACKEND specifies the VC backend to use for cloning the package's repository; this is only possible if NAME-OR-URL is a URL, @@ -895,7 +873,7 @@ Rebuilding an installation means scraping for new autoload cookies, re-compiling Emacs Lisp files, building and installing any documentation, downloading any missing dependencies. This command does not fetch new revisions from a remote server. That -is the responsibility of `package-vc-update'. Interactively, +is the responsibility of `package-vc-upgrade'. Interactively, prompt for the name of the package to rebuild." (interactive (list (package-vc--read-package-desc "Rebuild package: " t))) (package-vc--unpack-1 pkg-desc (package-desc-dir pkg-desc))) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f92afe56b76..c684840ab7e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -797,6 +797,21 @@ specifying the minimum acceptable version." (require 'finder-inf nil t) ; For `package--builtins'. (assq package package--builtins)))))) +(defun package--active-built-in-p (package) + "Return non-nil if the built-in version of PACKAGE is used. +If the built-in version of PACKAGE is used and PACKAGE is +also available for installation from an archive, it is an +indication that PACKAGE was never upgraded to any newer +version from the archive." + (and (not (assq (cond + ((package-desc-p package) + (package-desc-name package)) + ((stringp package) (intern package)) + ((symbolp package) package) + ((error "Unknown package format: %S" package))) + (package--alist))) + (package-built-in-p package))) + (defun package--autoloads-file-name (pkg-desc) "Return the absolute name of the autoloads file, sans extension. PKG-DESC is a `package-desc' object." @@ -2182,12 +2197,18 @@ using `package-compute-transaction'." (unless package-archive-contents (package-refresh-contents))) +(defcustom package-install-upgrade-built-in nil + "Non-nil means that built-in packages can be upgraded via a package archive. +If disabled, then `package-install' will not suggest to replace a +built-in package with a (possibly newer) version from a package archive." + :type 'boolean + :version "29.1") + ;;;###autoload (defun package-install (pkg &optional dont-select) "Install the package PKG. PKG can be a `package-desc' or a symbol naming one of the -available packages in an archive in `package-archives'. When -called interactively, prompt for the package name. +available packages in an archive in `package-archives'. Mark the installed package as selected by adding it to `package-selected-packages'. @@ -2197,7 +2218,11 @@ non-nil, install the package but do not add it to `package-selected-packages'. If PKG is a `package-desc' and it is already installed, don't try -to install it but still mark it as selected." +to install it but still mark it as selected. + +If the command is invoked with a prefix argument, it will allow +upgrading of built-in packages, as if `package-install-upgrade-built-in' +had been enabled." (interactive (progn ;; Initialize the package system to get the list of package @@ -2205,11 +2230,14 @@ to install it but still mark it as selected." (package--archives-initialize) (list (intern (completing-read "Install package: " - (delq nil - (mapcar (lambda (elt) - (unless (package-installed-p (car elt)) - (symbol-name (car elt)))) - package-archive-contents)) + (mapcan + (lambda (elt) + (and (or (and (or current-prefix-arg + package-install-upgrade-built-in) + (package--active-built-in-p (car elt))) + (not (package-installed-p (car elt)))) + (list (symbol-name (car elt))))) + package-archive-contents) nil t)) nil))) (package--archives-initialize) @@ -2220,6 +2248,9 @@ to install it but still mark it as selected." (unless (or dont-select (package--user-selected-p name)) (package--save-selected-packages (cons name package-selected-packages))) + (when (and (or current-prefix-arg package-install-upgrade-built-in) + (package--active-built-in-p pkg)) + (setq pkg (or (cadr (assq name package-archive-contents)) pkg))) (if-let* ((transaction (if (package-desc-p pkg) (unless (package-installed-p pkg) @@ -2232,24 +2263,29 @@ to install it but still mark it as selected." (message "Package `%s' installed." name)) (message "`%s' is already installed" name)))) -(declare-function package-vc-update "package-vc" (pkg)) +(declare-function package-vc-upgrade "package-vc" (pkg)) ;;;###autoload -(defun package-update (name) - "Update package NAME if a newer version exists." +(defun package-upgrade (name) + "Upgrade package NAME if a newer version exists. + +Currently, packages which are part of the Emacs distribution +cannot be upgraded that way. To enable upgrades of such a +package using this command, first upgrade the package to a +newer version from ELPA by using `\\<package-menu-mode-map>\\[package-menu-mark-install]' after `\\[list-packages]'." (interactive (list (completing-read - "Update package: " (package--updateable-packages) nil t))) + "Upgrade package: " (package--upgradeable-packages) nil t))) (let* ((package (if (symbolp name) name (intern name))) (pkg-desc (cadr (assq package package-alist)))) (if (package-vc-p pkg-desc) - (package-vc-update pkg-desc) - (package-delete pkg-desc 'force) + (package-vc-upgrade pkg-desc) + (package-delete pkg-desc 'force 'dont-unselect) (package-install package 'dont-select)))) -(defun package--updateable-packages () +(defun package--upgradeable-packages () ;; Initialize the package system to get the list of package ;; symbols for completion. (package--archives-initialize) @@ -2267,23 +2303,28 @@ to install it but still mark it as selected." package-alist))) ;;;###autoload -(defun package-update-all (&optional query) +(defun package-upgrade-all (&optional query) "Refresh package list and upgrade all packages. -If QUERY, ask the user before updating packages. When called -interactively, QUERY is always true." +If QUERY, ask the user before upgrading packages. When called +interactively, QUERY is always true. + +Currently, packages which are part of the Emacs distribution are +not upgraded by this command. To enable upgrading such a package +using this command, first upgrade the package to a newer version +from ELPA by using `\\<package-menu-mode-map>\\[package-menu-mark-install]' after `\\[list-packages]'." (interactive (list (not noninteractive))) (package-refresh-contents) - (let ((updateable (package--updateable-packages))) - (if (not updateable) - (message "No packages to update") + (let ((upgradeable (package--upgradeable-packages))) + (if (not upgradeable) + (message "No packages to upgrade") (when (and query (not (yes-or-no-p - (if (length= updateable 1) - "One package to update. Do it? " - (format "%s packages to update. Do it?" - (length updateable)))))) - (user-error "Updating aborted")) - (mapc #'package-update updateable)))) + (if (length= upgradeable 1) + "One package to upgrade. Do it? " + (format "%s packages to upgrade. Do it?" + (length upgradeable)))))) + (user-error "Upgrade aborted")) + (mapc #'package-upgrade upgradeable)))) (defun package--dependencies (pkg) "Return a list of all dependencies PKG has. @@ -3690,7 +3731,7 @@ corresponding to the newer version." ;; ENTRY is (PKG-DESC [NAME VERSION STATUS DOC]) (let ((pkg-desc (car entry)) (status (aref (cadr entry) 2))) - (cond ((member status '("installed" "dependency" "unsigned" "external")) + (cond ((member status '("installed" "dependency" "unsigned" "external" "built-in")) (push pkg-desc installed)) ((member status '("available" "new")) (setq available (package--append-to-alist pkg-desc available)))))) @@ -3701,6 +3742,8 @@ corresponding to the newer version." (and avail-pkg (version-list-< (package-desc-priority-version pkg-desc) (package-desc-priority-version avail-pkg)) + (xor (not package-install-upgrade-built-in) + (package--active-built-in-p pkg-desc)) (push (cons name avail-pkg) upgrades)))) upgrades)) |