summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-05-02 08:50:09 -0400
committerEli Zaretskii <eliz@gnu.org>2023-05-02 08:50:09 -0400
commitdaf602a5c8ec9e5d94f5e1e412182760a02c2505 (patch)
tree84b0c694f5ed9a911011078e8b0f1df18bc9ca71 /lisp/emacs-lisp
parent4f44c56c867b99bc7b813d8b104b9939479f86f2 (diff)
parent46392c1623bc3f9764b8c7df293a89fcd47ab0ad (diff)
downloademacs-daf602a5c8ec9e5d94f5e1e412182760a02c2505.tar.gz
Merge from origin/emacs-29
46392c1623b Fix vertical-motion when tab-line is displayed in a window 0e52beeacea Update to Org 9.6.5-3-g2993f4 dd21003878d Prevent generating empty autoload files 2bcf11d0efe * lisp/org/org-macs.el (org--inhibit-version-check): Fix ... ca43435816b Fix redisplay of mode line after its format changes from nil 610a7657e0a Fix c-ts-mode--emacs-c-range-query 7f94558b775 Improve documentation of warnings 5a3f0e2c558 ; Doc fix in c-ts-mode.el 21361d05635 Fix FOR_EACH_TAIL fontification (bug#62951) d0df3404fde ; * etc/EGLOT-NEWS: chsharp-le -> csharp-ls c229e83c3ce ; * etc/EGLOT-NEWS (https): Elglot -> Eglot. b4f2f499783 Fix documentation of libxml-parse-* functions 5dd784961d1 ; * src/treesit.c (syms_of_treesit): Fix error messages. ddfa0d8da9a ; Remove some leftover text
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/loaddefs-gen.el122
-rw-r--r--lisp/emacs-lisp/package.el5
2 files changed, 57 insertions, 70 deletions
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 1007be62dd9..a966b1e9f40 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -597,73 +597,63 @@ 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.
+ (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")))))))
(defun loaddefs-generate--print-form (def)
"Print DEF in a format that makes sense for version control."
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6cb78801d7f..16b2218da26 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2307,10 +2307,7 @@ 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]'.
-
- Use `i' after `M-x list-packages' to
-upgrade to an ELPA version first."
+from ELPA by using `\\<package-menu-mode-map>\\[package-menu-mark-install]' after `\\[list-packages]'."
(interactive (list (not noninteractive)))
(package-refresh-contents)
(let ((upgradeable (package--upgradeable-packages)))