From 1910800f93cdc5fd9bc657e7f65e9db9c8e94de0 Mon Sep 17 00:00:00 2001 From: dickmao Date: Wed, 4 Aug 2021 10:50:38 +0200 Subject: Package archive location needs to be absolute filename * lisp/emacs-lisp/package.el (package--with-response-buffer-1): Actually check that URL is absolute (bug#49788). --- lisp/emacs-lisp/package.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f1daa8d124a..37dcbe36c8b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1366,11 +1366,9 @@ errors signaled by ERROR-FORM or by BODY). (kill-buffer buffer) (goto-char (point-min)))))) (package--unless-error body - (let ((url (expand-file-name file url))) - (unless (file-name-absolute-p url) - (error "Location %s is not a url nor an absolute file name" - url)) - (insert-file-contents-literally url))))) + (unless (file-name-absolute-p url) + (error "Location %s is not a url nor an absolute file name" url)) + (insert-file-contents-literally (expand-file-name file url))))) (define-error 'bad-signature "Failed to verify signature") -- cgit v1.2.3 From e1ce9904aa5511468d295cac3221cb77de994331 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 7 Aug 2021 13:02:01 +0200 Subject: Fix prin1 problem in package-quickstart-refresh * lisp/emacs-lisp/package.el (package-quickstart-refresh): Bind print-length/print-level before using prin1-to-string (bug#49924). --- lisp/emacs-lisp/package.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 37dcbe36c8b..dfd2148aa6b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4169,7 +4169,9 @@ activations need to be changed, such as when `package-load-list' is modified." ;; Prefer uncompiled files (and don't accept .so files). (let ((load-suffixes '(".el" ".elc"))) (locate-library (package--autoloads-file-name pkg)))) - (pfile (prin1-to-string file))) + (pfile (let ((print-length nil) + (print-level nil)) + (prin1-to-string file)))) (insert "(let ((load-true-file-name " pfile ")\ (load-file-name " pfile "))\n") (insert-file-contents file) -- cgit v1.2.3 From fbd3207bb2d73eacda336d48d7b0509f9ebcbb1c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 9 Aug 2021 14:47:01 +0200 Subject: Further fixes for package-quickstart-refresh printing * lisp/emacs-lisp/package.el (package-quickstart-refresh): Really ensure that the structures aren't shortened (bug#49924). --- lisp/emacs-lisp/package.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index dfd2148aa6b..82ea9e73658 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4152,6 +4152,10 @@ activations need to be changed, such as when `package-load-list' is modified." (package-activated-list ()) ;; Make sure we can load this file without load-source-file-function. (coding-system-for-write 'emacs-internal) + ;; Ensure that `pp' and `prin1-to-string' calls further down + ;; aren't truncated. + (print-length nil) + (print-level nil) (Info-directory-list '(""))) (dolist (elt package-alist) (condition-case err @@ -4169,9 +4173,7 @@ activations need to be changed, such as when `package-load-list' is modified." ;; Prefer uncompiled files (and don't accept .so files). (let ((load-suffixes '(".el" ".elc"))) (locate-library (package--autoloads-file-name pkg)))) - (pfile (let ((print-length nil) - (print-level nil)) - (prin1-to-string file)))) + (pfile (prin1-to-string file))) (insert "(let ((load-true-file-name " pfile ")\ (load-file-name " pfile "))\n") (insert-file-contents file) -- cgit v1.2.3 From 4e6f98cd505ed56e7928fcdb5ab88c09d0e74d89 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 9 Aug 2021 12:05:22 -0400 Subject: * lisp/emacs-lisp/package.el (package-buffer-info): Use lm-maintainers Avoid the now obsolete `lm-maintainer`. --- lisp/emacs-lisp/package.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 82ea9e73658..dac412c98b6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1120,7 +1120,7 @@ is wrapped around any parts requiring it." (declare-function lm-header-multiline "lisp-mnt" (header)) (declare-function lm-homepage "lisp-mnt" (&optional file)) (declare-function lm-keywords-list "lisp-mnt" (&optional file)) -(declare-function lm-maintainer "lisp-mnt" (&optional file)) +(declare-function lm-maintainers "lisp-mnt" (&optional file)) (declare-function lm-authors "lisp-mnt" (&optional file)) (defun package-buffer-info () @@ -1166,7 +1166,10 @@ boundaries." :kind 'single :url homepage :keywords keywords - :maintainer (lm-maintainer) + :maintainer + ;; For backward compatibility, use a single string if there's only + ;; one maintainer (the most common case). + (let ((maints (lm-maintainers))) (if (cdr maints) maints (cat maints))) :authors (lm-authors))))) (defun package--read-pkg-desc (kind) -- cgit v1.2.3 From 0509f3921b52feb6b1916e4ba64c91a603991bfe Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 9 Aug 2021 18:55:25 -0400 Subject: * lisp/emacs-lisp/package.el (package-buffer-info): Fix typo --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index dac412c98b6..617e941dba5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1169,7 +1169,7 @@ boundaries." :maintainer ;; For backward compatibility, use a single string if there's only ;; one maintainer (the most common case). - (let ((maints (lm-maintainers))) (if (cdr maints) maints (cat maints))) + (let ((maints (lm-maintainers))) (if (cdr maints) maints (car maints))) :authors (lm-authors))))) (defun package--read-pkg-desc (kind) -- cgit v1.2.3 From 08540a29e30775092cf3dc7fc25f845bd34b913b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 13 Sep 2021 10:35:17 +0200 Subject: package-menu-execute doc string clarification * lisp/emacs-lisp/package.el (package-menu-execute): Say what happens to upgrade-marked packages (bug#50551). --- lisp/emacs-lisp/package.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 617e941dba5..c6cb8f058bc 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -3601,8 +3601,10 @@ packages list, respectively." (defun package-menu-execute (&optional noquery) "Perform marked Package Menu actions. -Packages marked for installation are downloaded and installed; -packages marked for deletion are removed. +Packages marked for installation are downloaded and installed, +packages marked for deletion are removed, +and packages marked for upgrading are downloaded and upgraded. + Optional argument NOQUERY non-nil means do not ask the user to confirm." (interactive nil package-menu-mode) (package--ensure-package-menu-mode) -- cgit v1.2.3 From bcf59b99f43be4f40be1ff85d0281d660a8dd731 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 16 Sep 2021 15:33:35 +0200 Subject: Prefer "website" to "homepage" These days, a "home page" is understood to be only "the main web page of a website" or "landing page", whereas a "website" is "a collection of web pages and related content" (Wikipedia). * doc/emacs/emacs.texi (Top): * doc/emacs/package.texi (Package Menu): * doc/lispintro/emacs-lisp-intro.texi (Top): * doc/lispref/elisp.texi (Top): * doc/lispref/tips.texi (Documentation Tips): * doc/misc/ede.texi (ede-project): * doc/misc/efaq-w32.texi (More information): * doc/misc/gnus-faq.texi (FAQ 5-7): * doc/misc/gnus.texi (About mairix): * doc/misc/mairix-el.texi (About): * doc/misc/reftex.texi (AUCTeX, Imprint): * lisp/cedet/ede/base.el (ede-project): * lisp/cedet/ede/system.el (ede-web-browse-home): * lisp/emacs-lisp/package.el (package-menu-mode-menu) (package-browse-url): * lisp/erc/erc-button.el (erc-emacswiki-url): * lisp/filesets.el (filesets-goto-homepage): * lisp/net/mairix.el: * lisp/net/webjump.el (webjump-sample-sites): * lisp/obsolete/vc-arch.el: * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave, idlwave-mode): * lisp/textmodes/reftex-vars.el (reftex): Prefer "website" to "home page". * doc/lispref/tips.texi (Documentation Tips): Sort the "URL" header comment before "Homepage". * lisp/emacs-lisp/lisp-mnt.el (lm-website): Rename from 'lm-homepage'. (lm-homepage): Make into alias for 'lm-website'. --- doc/emacs/emacs.texi | 2 +- doc/emacs/package.texi | 2 +- doc/lispintro/emacs-lisp-intro.texi | 2 +- doc/lispref/elisp.texi | 2 +- doc/lispref/tips.texi | 8 ++++---- doc/misc/ede.texi | 2 +- doc/misc/efaq-w32.texi | 2 +- doc/misc/gnus-faq.texi | 2 +- doc/misc/gnus.texi | 2 +- doc/misc/mairix-el.texi | 2 +- doc/misc/reftex.texi | 4 ++-- lisp/cedet/ede/base.el | 4 ++-- lisp/cedet/ede/system.el | 2 +- lisp/emacs-lisp/lisp-mnt.el | 7 ++++--- lisp/emacs-lisp/package.el | 8 ++++---- lisp/erc/erc-button.el | 2 +- lisp/filesets.el | 2 +- lisp/net/mairix.el | 2 +- lisp/net/webjump.el | 4 ++-- lisp/obsolete/vc-arch.el | 2 +- lisp/progmodes/idlw-shell.el | 4 ++-- lisp/progmodes/idlwave.el | 4 ++-- lisp/textmodes/reftex-vars.el | 2 +- 23 files changed, 37 insertions(+), 36 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index d2011ebf974..2fafb43e9fb 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -116,7 +116,7 @@ ways to customize it; it corresponds to GNU Emacs version @value{EMACSVER}. @c See 'manual-html-mono' and 'manual-html-node' in admin/admin.el. @ifset WWW_GNU_ORG @html -The homepage for GNU Emacs is at +The GNU Emacs website is at https://www.gnu.org/software/emacs/.
To view this manual in other formats, click here.
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index d419a4e24b5..570afd5be2b 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -129,7 +129,7 @@ entails. @item w @kindex w @r{(Package Menu)} @findex package-browse-url -Open the home page of the package on the current line in a browser +Open the package website on the current line in a browser (@code{package-browse-url}). @code{browse-url} is used to open the browser. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 7933ebe58c2..7c7005b3483 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -238,7 +238,7 @@ supports it in developing GNU and promoting software freedom.'' @ifset WWW_GNU_ORG @html -

The homepage for GNU Emacs is at +

The GNU Emacs website is at https://www.gnu.org/software/emacs/.
To view this manual in other formats, click here. diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 55bcf399d81..e9e306fa0de 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -161,7 +161,7 @@ Cover art by Etienne Suvasa. @ifset WWW_GNU_ORG @html -

The homepage for GNU Emacs is at +

The GNU Emacs website is at https://www.gnu.org/software/emacs/.
For information on using Emacs, refer to the Emacs Manual.
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 1611b983ea2..a72ab88cef6 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -767,7 +767,7 @@ Finally, to create a hyperlink to URLs, write the single-quoted URL, preceded by @samp{URL}. For example, @smallexample -The home page for the GNU project has more information (see URL +The GNU project wesite has more information (see URL `https://www.gnu.org/'). @end smallexample @@ -1100,9 +1100,9 @@ The name of this field is unfortunate, since people often assume it is the place to write arbitrary keywords that describe their package, rather than just the relevant Finder keywords. -@item Homepage -@itemx URL -These lines state the homepage of the library. +@item URL +@itemx Homepage +These lines state the website of the library. @item Package-Version If @samp{Version} is not suitable for use by the package manager, then diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index a0f316f8480..5e9c3d7eef6 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -1556,7 +1556,7 @@ You can also use TRAMP for use with rcp & scp. @item :web-site-file @* -A file which contains the home page for this project. +A file which contains the website for this project. This file can be relative to slot @code{web-site-directory}. This can be a local file, use ange-ftp, EFS, or TRAMP. diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index 6eff88b76e3..ba1077d0acd 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -2278,7 +2278,7 @@ In Emacs, you can browse the manual using Info by typing @kbd{C-h r}, and you can view the FAQ by typing @kbd{C-h C-f}. Other resources include: @itemize -@item @uref{https://www.gnu.org/software/emacs/, The Emacs homepage} +@item @uref{https://www.gnu.org/software/emacs/, The Emacs website} @item @uref{https://www.gnu.org/software/emacs/manual/, Other Emacs manuals} @item @uref{https://www.emacswiki.org/, Emacs Wiki} @end itemize diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index eac5f0861ff..36c402ab35a 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1443,7 +1443,7 @@ details. However, what you really want is the Insidious Big Brother Database bbdb. Get it from -@uref{http://bbdb.sourceforge.net/, bbdb's homepage}. +@uref{http://bbdb.sourceforge.net/, bbdb's website}. Now place the following in @file{~/.gnus.el}, to activate bbdb for Gnus: @example diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 4559ae8e31e..5eeffbdecaa 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -21898,7 +21898,7 @@ bound to mairix searches and are automatically updated. Mairix is a tool for indexing and searching words in locally stored mail. It was written by Richard Curnow and is licensed under the GPL@. Mairix comes with most popular GNU/Linux distributions, but it also -runs under Windows (with cygwin), macOS and Solaris. The homepage can +runs under Windows (with cygwin), macOS and Solaris. The website can be found at @uref{http://www.rpcurnow.force9.co.uk/mairix/index.html} diff --git a/doc/misc/mairix-el.texi b/doc/misc/mairix-el.texi index a571c744870..d0ec552145e 100644 --- a/doc/misc/mairix-el.texi +++ b/doc/misc/mairix-el.texi @@ -68,7 +68,7 @@ database. Mairix is a tool for indexing and searching words in locally stored mail. It was written by Richard Curnow and is licensed under the GPL@. Mairix comes with most popular GNU/Linux distributions, but it also -runs under Windows (with cygwin), macOS and Solaris. The homepage can +runs under Windows (with cygwin), macOS and Solaris. The website can be found at @uref{http://www.rpcurnow.force9.co.uk/mairix/index.html} diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 88ca4450d59..8ca5fcca5ba 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -3192,7 +3192,7 @@ with the @kbd{g} key. To get this behavior, use instead @AUCTeX{} is without doubt the best major mode for editing @TeX{} and @LaTeX{} files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). -You can get it from its home page at @value{AUCTEXSITE}, but since +You can get it from its website at @value{AUCTEXSITE}, but since it is available from GNU ELPA, you can simply install it from @kbd{M-x list-packages}. @@ -3565,7 +3565,7 @@ With @i{Viper} mode prior to Vipers version 3.01, you need to protect @cindex Acknowledgments @cindex Thanks @cindex Bug reports -@cindex @code{http}, @RefTeX{} home page +@cindex @code{http}, @RefTeX{} website @cindex @code{ftp}, @RefTeX{} site @c dominik@@science.uva.nl diff --git a/lisp/cedet/ede/base.el b/lisp/cedet/ede/base.el index 103a37045cc..004da6b95de 100644 --- a/lisp/cedet/ede/base.el +++ b/lisp/cedet/ede/base.el @@ -212,7 +212,7 @@ You can also use TRAMP for use with rcp & scp.") :label "Web Page File" :group name :documentation - "A file which contains the home page for this project. + "A file which contains the website for this project. This file can be relative to slot `web-site-directory'. This can be a local file, use ange-ftp, EFS, or TRAMP.") (ftp-site :initarg :ftp-site @@ -267,7 +267,7 @@ and target specific elements such as build variables.") '( [ "Update Version" ede-update-version ede-object ] [ "Version Control Status" ede-vc-project-directory ede-object ] - [ "Edit Project Homepage" ede-edit-web-page + [ "Edit Project Website" ede-edit-web-page (and ede-object (oref (ede-toplevel) web-site-file)) ] [ "Browse Project URL" ede-web-browse-home (and ede-object diff --git a/lisp/cedet/ede/system.el b/lisp/cedet/ede/system.el index 8ef38f0d33e..1300ba9011e 100644 --- a/lisp/cedet/ede/system.el +++ b/lisp/cedet/ede/system.el @@ -34,7 +34,7 @@ ;;;###autoload (defun ede-web-browse-home () - "Browse the home page of the current project." + "Browse the website of the current project." (interactive) (if (not (ede-toplevel)) (error "No project")) diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index df14a5cd499..b27c7e78a88 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -498,13 +498,14 @@ absent, return nil." "" (buffer-substring-no-properties start (lm-commentary-end)))))))) -(defun lm-homepage (&optional file) - "Return the homepage in file FILE, or current buffer if FILE is nil." +(defun lm-website (&optional file) + "Return the website in file FILE, or current buffer if FILE is nil." (let ((page (lm-with-file file - (lm-header "\\(?:x-\\)?\\(?:homepage\\|url\\)")))) + (lm-header "\\(?:x-\\)?\\(?:url\\|homepage\\)")))) (if (and page (string-match "^<.+>$" page)) (substring page 1 -1) page))) +(defalias 'lm-homepage 'lm-website) ; for backwards-compatibility ;;; Verification and synopses diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c6cb8f058bc..7418b580e80 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2807,8 +2807,8 @@ either a full name or nil, and EMAIL is a valid email address." "Menu for `package-menu-mode'." '("Package" ["Describe Package" package-menu-describe-package :help "Display information about this package"] - ["Open Package Homepage" package-browse-url - :help "Open the homepage of this package"] + ["Open Package Website" package-browse-url + :help "Open the website of this package"] ["Help" package-menu-quick-help :help "Show short key binding help for package-menu-mode"] "--" ["Refresh Package List" revert-buffer @@ -4230,7 +4230,7 @@ beginning of the line." (package-desc-summary package-desc)))) (defun package-browse-url (desc &optional secondary) - "Open the home page of the package under point in a browser. + "Open the website of the package under point in a browser. `browse-url' is used to determine the browser to be used. If SECONDARY (interactively, the prefix), use the secondary browser." (interactive (list (tabulated-list-get-id) @@ -4240,7 +4240,7 @@ If SECONDARY (interactively, the prefix), use the secondary browser." (user-error "No package here")) (let ((url (cdr (assoc :url (package-desc-extras desc))))) (unless url - (user-error "No home page for %s" (package-desc-name desc))) + (user-error "No website for %s" (package-desc-name desc))) (if secondary (funcall browse-url-secondary-browser-function url) (browse-url url)))) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 5953471ae8e..fc72f324eb9 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -195,7 +195,7 @@ PAR is a number of a regexp grouping whose text will be passed to (integer :tag "Regexp section number"))))) (defcustom erc-emacswiki-url "https://www.emacswiki.org/cgi-bin/wiki.pl?" - "URL of the EmacsWiki Homepage." + "URL of the EmacsWiki website." :type 'string) (defcustom erc-emacswiki-lisp-url "https://www.emacswiki.org/elisp/" diff --git a/lisp/filesets.el b/lisp/filesets.el index 8e9fae80f69..d138675066c 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1848,7 +1848,7 @@ User will be queried, if no fileset name is provided." (filesets-goto-homepage))) (defun filesets-goto-homepage () - "Show filesets's homepage." + "Show filesets's website." (interactive) (browse-url filesets-homepage)) diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el index 727aa55de58..3feb089ad05 100644 --- a/lisp/net/mairix.el +++ b/lisp/net/mairix.el @@ -24,7 +24,7 @@ ;; This is an interface to the mairix mail search engine. Mairix is ;; written by Richard Curnow and is licensed under the GPL. See the -;; home page for details: +;; Mairix website for details: ;; ;; http://www.rpcurnow.force9.co.uk/mairix/ ;; diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 4baa657c0a5..d14d382aac3 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -79,10 +79,10 @@ ;; GNU FTP Mirror List from https://www.gnu.org/order/ftp.html [mirrors "https://ftp.gnu.org/pub/gnu/" "https://ftpmirror.gnu.org"]) - ("GNU Project Home Page" . "www.gnu.org") + ("GNU Project Website" . "www.gnu.org") ;; Emacs. - ("Emacs Home Page" . + ("Emacs Website" . "www.gnu.org/software/emacs/emacs.html") ("Savannah Emacs page" . "savannah.gnu.org/projects/emacs") diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index cfbf981d3c8..fbbd2d4ecfe 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el @@ -24,7 +24,7 @@ ;;; Commentary: -;; The home page of the Arch version control system is at +;; The Arch version control system website is at ;; ;; https://www.gnu.org/software/gnu-arch/ ;; diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index eb88f25dfd6..f2bfbf3e379 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -878,8 +878,8 @@ IDL has currently stepped.") ------------------------------- Info documentation for this package is available. Use \\[idlwave-info] to display (complain to your sysadmin if that does not work). - For PostScript and HTML versions of the documentation, check IDLWAVE's - homepage at URL `https://github.com/jdtsmith/idlwave'. + For PostScript and HTML versions of the documentation, see IDLWAVE's + website at URL `https://github.com/jdtsmith/idlwave'. IDLWAVE has customize support - see the group `idlwave'. 8. Keybindings diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 55e712dd77d..91be4016232 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -163,7 +163,7 @@ (defgroup idlwave nil "Major mode for editing IDL .pro files." :tag "IDLWAVE" - :link '(url-link :tag "Home Page" + :link '(url-link :tag "Website" "https://github.com/jdtsmith/idlwave") :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el" "idlw-shell.el") @@ -1821,7 +1821,7 @@ The main features of this mode are Info documentation for this package is available. Use \\[idlwave-info] to display (complain to your sysadmin if that does not work). For Postscript, PDF, and HTML versions of the - documentation, check IDLWAVE's homepage at URL + documentation, check IDLWAVE's website at URL `https://github.com/jdtsmith/idlwave'. IDLWAVE has customize support - see the group `idlwave'. diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index cfdf256f70a..19b40e6ce2f 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -263,7 +263,7 @@ distribution. Mixed-case symbols are convenience aliases.") (defgroup reftex nil "LaTeX label and citation support." :tag "RefTeX" - :link '(url-link :tag "Home Page" + :link '(url-link :tag "Website" "https://www.gnu.org/software/auctex/reftex.html") :link '(emacs-commentary-link :tag "Commentary in reftex.el" "reftex.el") :link '(custom-manual "(reftex)Top") -- cgit v1.2.3 From bbb9e97537233ae051e14dead31352d3bc0f32b6 Mon Sep 17 00:00:00 2001 From: 王滋涵 Zephyr Wang Date: Sun, 19 Sep 2021 17:39:26 +0200 Subject: ; Fix typo in package.el doc string * lisp/emacs-lisp/package.el (package-archive-column-width): Fix copy-paste in doc string (bug#50678). Copyright-paperwork-exempt: yes --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7418b580e80..a0829f118d8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -426,7 +426,7 @@ synchronously." :version "28.1") (defcustom package-archive-column-width 8 - "Column width for the Package status in the package menu." + "Column width for the Package archive in the package menu." :type 'number :version "28.1") -- cgit v1.2.3 From 85e9e5f616fb0fd0819a04006d6d2a0fb6d93ad7 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 21 Sep 2021 22:11:43 +0200 Subject: Don't quote nil and t in doc strings and comments * test/src/minibuf-tests.el (test-try-completion-ignore-case): * test/lisp/url/url-auth-tests.el (url-auth-test-digest-auth-retrieve-cache): * test/lisp/subr-tests.el (subr-tests-add-hook-depth): * test/lisp/so-long-tests/so-long-tests.el (so-long-tests-invisible-buffer-function): * test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort): * src/xfaces.c: * src/process.c (Finterrupt_process): (syms_of_process): * src/minibuf.c (Fread_from_minibuffer): (Fcompleting_read): (syms_of_minibuf): * src/dispnew.c (syms_of_display): * src/data.c: * lisp/so-long.el (so-long--hack-local-variables): * lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): (elisp--xref-find-definitions): * lisp/org/ox-html.el (org-html-htmlize-output-type): * lisp/org/org-agenda.el (org-agenda-do-in-region): * lisp/net/tramp.el: * lisp/minibuffer.el (set-minibuffer-message): * lisp/isearch.el (isearch-wrap-pause): (isearch-repeat-on-direction-change): * lisp/emacs-lisp/timer.el (timer): * lisp/emacs-lisp/package.el (package-read-archive-contents): * lisp/emacs-lisp/faceup.el (faceup-next-property-change): * lisp/emacs-lisp/comp.el (comp-func): * lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p): * lisp/emacs-lisp/cl-macs.el (cl-do): (cl-do*): (cl--self-tco): * lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions): (byte-compile-cond-jump-table): Don't quote t and nil. --- lisp/emacs-lisp/bytecomp.el | 6 +++--- lisp/emacs-lisp/cl-macs.el | 6 +++--- lisp/emacs-lisp/comp-cstr.el | 2 +- lisp/emacs-lisp/comp.el | 4 ++-- lisp/emacs-lisp/faceup.el | 2 +- lisp/emacs-lisp/package.el | 2 +- lisp/emacs-lisp/timer.el | 2 +- lisp/isearch.el | 8 ++++---- lisp/minibuffer.el | 2 +- lisp/net/tramp.el | 2 +- lisp/org/org-agenda.el | 2 +- lisp/org/ox-html.el | 2 +- lisp/progmodes/elisp-mode.el | 4 ++-- lisp/so-long.el | 2 +- src/data.c | 2 +- src/dispnew.c | 2 +- src/minibuf.c | 9 ++++----- src/process.c | 4 ++-- src/xfaces.c | 4 ++-- test/lisp/emacs-lisp/tabulated-list-test.el | 2 +- test/lisp/so-long-tests/so-long-tests.el | 2 +- test/lisp/subr-tests.el | 4 ++-- test/lisp/url/url-auth-tests.el | 2 +- test/src/minibuf-tests.el | 2 +- 24 files changed, 39 insertions(+), 40 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 614aa856f6a..be74195778b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -551,7 +551,7 @@ has the form (autoload . FILENAME).") "Alist of undefined functions to which calls have been compiled. Each element in the list has the form (FUNCTION POSITION . CALLS) where CALLS is a list whose elements are integers (indicating the -number of arguments passed in the function call) or the constant `t' +number of arguments passed in the function call) or the constant t if the function is called indirectly. This variable is only significant whilst compiling an entire buffer. Used for warnings when a function is not known to be defined or is later @@ -4417,7 +4417,7 @@ Return (TAIL VAR TEST CASES), where: (cases (nth 2 switch)) jump-table test-objects body tag default-tag) ;; TODO: Once :linear-search is implemented for `make-hash-table' - ;; set it to `t' for cond forms with a small number of cases. + ;; set it to t for cond forms with a small number of cases. (let ((nvalues (apply #'+ (mapcar (lambda (case) (length (car case))) cases)))) (setq jump-table (make-hash-table @@ -4446,7 +4446,7 @@ Return (TAIL VAR TEST CASES), where: (byte-compile-out 'byte-switch) ;; When the opcode argument is `byte-goto', `byte-compile-goto' sets - ;; `byte-compile-depth' to `nil'. However, we need `byte-compile-depth' + ;; `byte-compile-depth' to nil. However, we need `byte-compile-depth' ;; to be non-nil for generating tags for all cases. Since ;; `byte-compile-depth' will increase by at most 1 after compiling ;; all of the clause (which is further enforced by cl-assert below) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 16308b3a595..6d6482c3497 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1762,7 +1762,7 @@ Once the END-TEST becomes true, the RESULT forms are evaluated (with the VARs still bound to their values) to produce the result returned by `cl-do'. -Note that the entire loop is enclosed in an implicit `nil' block, so +Note that the entire loop is enclosed in an implicit nil block, so that you can use `cl-return' to exit at any time. Also note that END-TEST is checked before evaluating BODY. If END-TEST @@ -1791,7 +1791,7 @@ Once the END-TEST becomes true, the RESULT forms are evaluated (with the VARs still bound to their values) to produce the result returned by `cl-do*'. -Note that the entire loop is enclosed in an implicit `nil' block, so +Note that the entire loop is enclosed in an implicit nil block, so that you can use `cl-return' to exit at any time. Also note that END-TEST is checked before evaluating BODY. If END-TEST @@ -2071,7 +2071,7 @@ Like `cl-flet' but the definitions can refer to previous ones. ;; even handle mutually recursive functions. (letrec ((done nil) ;; Non-nil if some TCO happened. - ;; This var always holds the value `nil' until (just before) we + ;; This var always holds the value nil until (just before) we ;; exit the loop. (retvar (make-symbol "retval")) (ofargs (mapcar (lambda (s) (if (memq s cl--lambda-list-keywords) s diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 6a3f6046d1c..5518cdb4c90 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -134,7 +134,7 @@ Integer values are handled in the `range' slot.") :neg (neg cstr)))) (defsubst comp-cstr-empty-p (cstr) - "Return t if CSTR is equivalent to the `nil' type specifier or nil otherwise." + "Return t if CSTR is equivalent to the nil type specifier or nil otherwise." (with-comp-cstr-accessors (and (null (typeset cstr)) (null (valset cstr)) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 31cae734ccc..4060fc97d04 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -901,8 +901,8 @@ non local exit (ends with an `unreachable' insn).")) (lap () :type list :documentation "LAP assembly representation.") (ssa-status nil :type symbol - :documentation "SSA status either: 'nil', 'dirty' or 't'. -Once in SSA form this *must* be set to 'dirty' every time the topology of the + :documentation "SSA status either: nil, `dirty' or t. +Once in SSA form this *must* be set to `dirty' every time the topology of the CFG is mutated by a pass.") (frame-size nil :type integer) (vframe-size 0 :type integer) diff --git a/lisp/emacs-lisp/faceup.el b/lisp/emacs-lisp/faceup.el index 162c39634ed..629029aabc5 100644 --- a/lisp/emacs-lisp/faceup.el +++ b/lisp/emacs-lisp/faceup.el @@ -795,7 +795,7 @@ See `faceup-properties' for a list of tracked properties." nil (if (and (null pos) (faceup-has-any-text-property (point-min))) - ;; `pos' is `nil' and the character at `point-min' contains a + ;; `pos' is nil and the character at `point-min' contains a ;; tracked property, return `point-min'. (point-min) (unless pos diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index a0829f118d8..a204966644e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1586,7 +1586,7 @@ If the archive version is too new, signal an error." (if package (package--add-to-archive-contents package archive) (lwarn '(package refresh) :warning - "Ignoring `nil' package on `%s' package archive" archive)))))) + "Ignoring nil package on `%s' package archive" archive)))))) (defvar package--old-archive-priorities nil "Store currently used `package-archive-priorities'. diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 44d70cde6bc..382f6bb1fa3 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -49,7 +49,7 @@ function args ;What to do when triggered. idle-delay ;If non-nil, this is an idle-timer. psecs - ;; A timer may be created with `t' as the TIME, which means that we + ;; A timer may be created with t as the TIME, which means that we ;; want to run at specific integral multiples of `repeat-delay'. We ;; then have to recompute this (because the machine may have gone to ;; sleep, etc). diff --git a/lisp/isearch.el b/lisp/isearch.el index af6217b7ca9..952caa7ac22 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -176,11 +176,11 @@ command history." (defcustom isearch-wrap-pause t "Define the behavior of wrapping when there are no more matches. -When `t' (by default), signal an error when no more matches are found. +When t (by default), signal an error when no more matches are found. Then after repeating the search, wrap with `isearch-wrap-function'. When `no', wrap immediately after reaching the last match. When `no-ding', wrap immediately without flashing the screen. -When `nil', never wrap, just stop at the last match." +When nil, never wrap, just stop at the last match." :type '(choice (const :tag "Pause before wrapping" t) (const :tag "No pause before wrapping" no) (const :tag "No pause and no flashing" no-ding) @@ -189,9 +189,9 @@ When `nil', never wrap, just stop at the last match." (defcustom isearch-repeat-on-direction-change nil "Whether a direction change should move to another match. -When `nil', the default, a direction change moves point to the other +When nil, the default, a direction change moves point to the other end of the current search match. -When `t', a direction change moves to another search match, if there +When t, a direction change moves to another search match, if there is one." :type '(choice (const :tag "Remain on the same match" nil) (const :tag "Move to another match" t)) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 7b82e120f19..1e1a6f852e8 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -848,7 +848,7 @@ via `set-message-function'." (run-with-timer minibuffer-message-clear-timeout nil #'clear-minibuffer-message))) - ;; Return `t' telling the caller that the message + ;; Return t telling the caller that the message ;; was handled specially by this function. t)))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 22ddfdb8e8f..2804b4d37d0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -183,7 +183,7 @@ See the variable `tramp-encoding-shell' for more information." :version "24.1" :type '(choice (const nil) string)) -;; Since Emacs 26.1, `system-name' can return `nil' at build time if +;; Since Emacs 26.1, `system-name' can return nil at build time if ;; Emacs is compiled with "--no-build-details". We do expect it to be ;; a string. (Bug#44481) (defconst tramp-system-name (or (system-name) "") diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 489e6c7f3e9..23c62809a2b 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -8842,7 +8842,7 @@ Point is in the buffer where the item originated.") (defun org-agenda-do-in-region (beg end cmd &optional arg force-arg delete) "Between region BEG and END, call agenda command CMD. -When optional argument ARG is non-nil or FORCE-ARG is `t', pass +When optional argument ARG is non-nil or FORCE-ARG is t, pass ARG to CMD. When optional argument DELETE is non-nil, assume CMD deletes the agenda entry and don't move to the next entry." (save-excursion diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index 03145e35c53..d8932996ebe 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el @@ -874,7 +874,7 @@ link's path." (defcustom org-html-htmlize-output-type 'inline-css "Output type to be used by htmlize when formatting code snippets. Choices are `css' to export the CSS selectors only,`inline-css' -to export the CSS attribute values inline in the HTML or `nil' to +to export the CSS attribute values inline in the HTML or nil to export plain text. We use as default `inline-css', in order to make the resulting HTML self-containing. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index d082db5f02f..ce45de7f6cf 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -990,7 +990,7 @@ namespace but with lower confidence." ;; First call to find-lisp-object-file-name for an object ;; defined in C; the doc strings from the C source have ;; not been loaded yet. Second call will return "src/*.c" - ;; in file; handled by 't' case below. + ;; in file; handled by t case below. (push (elisp--xref-make-xref nil symbol (help-C-file-name (symbol-function symbol) 'subr)) xrefs)) ((and (setq doc (documentation symbol t)) @@ -1034,7 +1034,7 @@ namespace but with lower confidence." specializers)) (file (find-lisp-object-file-name met-name 'cl-defmethod))) (dolist (item specializers) - ;; default method has all 't' in specializers + ;; Default method has all t in specializers. (setq non-default (or non-default (not (equal t item))))) (when (and file diff --git a/lisp/so-long.el b/lisp/so-long.el index e271ff6be3c..65570bf253d 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -1686,7 +1686,7 @@ File-local header comments are currently an exception, and are processed by `so-long--check-header-modes' (see which for details)." ;; The first arg to `hack-local-variables' is HANDLE-MODE since Emacs 26.1, ;; and MODE-ONLY in earlier versions. In either case we are interested in - ;; whether it has the value `t'. + ;; whether it has the value t. (let ((retval (apply orig-fun handle-mode args))) (and (eq handle-mode t) retval ; A file-local mode was set. diff --git a/src/data.c b/src/data.c index 27b642df286..0d3376f0903 100644 --- a/src/data.c +++ b/src/data.c @@ -681,7 +681,7 @@ global value outside of any lexical scope. */) /* It has been previously suggested to make this function an alias for symbol-function, but upon discussion at Bug#23957, there is a risk breaking backward compatibility, as some users of fboundp may - expect `t' in particular, rather than any true value. */ + expect t in particular, rather than any true value. */ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0, doc: /* Return t if SYMBOL's function definition is not void. */) (Lisp_Object symbol) diff --git a/src/dispnew.c b/src/dispnew.c index 0c313199173..69c2023fdf3 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6704,7 +6704,7 @@ See `buffer-display-table' for more information. */); DEFVAR_LISP ("tab-bar-position", Vtab_bar_position, doc: /* Specify on which side from the tool bar the tab bar shall be. -Possible values are `t' (below the tool bar), `nil' (above the tool bar). +Possible values are t (below the tool bar), nil (above the tool bar). This option affects only builds where the tool bar is not external. */); pdumper_do_now_and_after_load (syms_of_display_for_pdumper); diff --git a/src/minibuf.c b/src/minibuf.c index a4219d2a63f..4b72d3e896b 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1292,8 +1292,8 @@ Fifth arg HIST, if non-nil, specifies a history list and optionally HISTPOS is the initial position for use by the minibuffer history commands. For consistency, you should also specify that element of the history as the value of INITIAL-CONTENTS. Positions are counted - starting from 1 at the beginning of the list. If HIST is the symbol - `t', history is not recorded. + starting from 1 at the beginning of the list. If HIST is t, history + is not recorded. If `history-add-new-input' is non-nil (the default), the result will be added to the history list using `add-to-history'. @@ -2037,8 +2037,7 @@ HIST, if non-nil, specifies a history list and optionally the initial (This is the only case in which you should use INITIAL-INPUT instead of DEF.) Positions are counted starting from 1 at the beginning of the list. The variable `history-length' controls the maximum length - of a history list. If HIST is the symbol `t', history is not - recorded. + of a history list. If HIST is t, history is not recorded. DEF, if non-nil, is the default value or the list of default values. @@ -2486,7 +2485,7 @@ is added with (set minibuffer-history-variable (cons STRING (symbol-value minibuffer-history-variable))) - If the variable is the symbol `t', no history is recorded. */); + If the variable is t, no history is recorded. */); XSETFASTINT (Vminibuffer_history_variable, 0); DEFVAR_LISP ("minibuffer-history-position", Vminibuffer_history_position, diff --git a/src/process.c b/src/process.c index bfca165fcad..58347a154a3 100644 --- a/src/process.c +++ b/src/process.c @@ -6887,7 +6887,7 @@ If CURRENT-GROUP is `lambda', and if the shell owns the terminal, don't send the signal. This function calls the functions of `interrupt-process-functions' in -the order of the list, until one of them returns non-`nil'. */) +the order of the list, until one of them returns non-nil. */) (Lisp_Object process, Lisp_Object current_group) { return CALLN (Frun_hook_with_args_until_success, Qinterrupt_process_functions, @@ -8514,7 +8514,7 @@ thus favoring processes with lower descriptors. */); doc: /* List of functions to be called for `interrupt-process'. The arguments of the functions are the same as for `interrupt-process'. These functions are called in the order of the list, until one of them -returns non-`nil'. */); +returns non-nil. */); Vinterrupt_process_functions = list1 (Qinternal_default_interrupt_process); DEFVAR_LISP ("internal--daemon-sockname", Vinternal__daemon_sockname, diff --git a/src/xfaces.c b/src/xfaces.c index c5b7a568aeb..5e63e87d751 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2420,11 +2420,11 @@ evaluate_face_filter (Lisp_Object filter, struct window *w, /* Determine whether FACE_REF is a "filter" face specification (case #4 in merge_face_ref). If it is, evaluate the filter, and if the filter matches, return the filtered face spec. If the filter does - not match, return `nil'. If FACE_REF is not a filtered face + not match, return nil. If FACE_REF is not a filtered face specification, return FACE_REF. On error, set *OK to false, having logged an error message if - ERR_MSGS is true, and return `nil'. Otherwise, *OK is not touched. + ERR_MSGS is true, and return nil. Otherwise, *OK is not touched. W is either NULL or a window used to evaluate filters. If W is NULL, no window-based face specification filter matches. diff --git a/test/lisp/emacs-lisp/tabulated-list-test.el b/test/lisp/emacs-lisp/tabulated-list-test.el index db1ce312586..679afda3948 100644 --- a/test/lisp/emacs-lisp/tabulated-list-test.el +++ b/test/lisp/emacs-lisp/tabulated-list-test.el @@ -96,7 +96,7 @@ (should (equal (get-text-property (point) 'tabulated-list-column-name) "name-2")) (tabulated-list-sort) - ;; Check a `t' as the sorting predicate. + ;; Check a t as the sorting predicate. (should (string= text (buffer-substring-no-properties (point-min) (point-max)))) ;; Invert. (tabulated-list-sort 1) diff --git a/test/lisp/so-long-tests/so-long-tests.el b/test/lisp/so-long-tests/so-long-tests.el index 8e4597c946c..7eee345aadd 100644 --- a/test/lisp/so-long-tests/so-long-tests.el +++ b/test/lisp/so-long-tests/so-long-tests.el @@ -229,7 +229,7 @@ ((obsolete run-window-configuration-change-hook)) (run-window-configuration-change-hook))))) (so-long-tests-assert-and-revert 'so-long-mode)) - ;; `so-long-invisible-buffer-function' is `nil'. + ;; `so-long-invisible-buffer-function' is nil. (with-temp-buffer (insert "#!emacs\n") (normal-mode) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 0c3661a296f..695da10408e 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -492,11 +492,11 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should (equal subr-tests--hook '(f5 f2 f1 f4 f3))) (add-hook 'subr-tests--hook 'f6) (should (equal subr-tests--hook '(f5 f6 f2 f1 f4 f3))) - ;; Make sure `t' is equivalent to 90. + ;; Make sure t is equivalent to 90. (add-hook 'subr-tests--hook 'f7 90) (add-hook 'subr-tests--hook 'f8 t) (should (equal subr-tests--hook '(f5 f6 f2 f1 f4 f3 f7 f8))) - ;; Make sure `nil' is equivalent to 0. + ;; Make sure nil is equivalent to 0. (add-hook 'subr-tests--hook 'f9 0) (add-hook 'subr-tests--hook 'f10) (should (equal subr-tests--hook '(f5 f10 f9 f6 f2 f1 f4 f3 f7 f8))) diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el index ff30f100250..05ccfc0d12a 100644 --- a/test/lisp/url/url-auth-tests.el +++ b/test/lisp/url/url-auth-tests.el @@ -154,7 +154,7 @@ Essential is how realms and paths are matched." auth) (dolist (row (list - ;; If :expected-user is `nil' it indicates + ;; If :expected-user is nil it indicates ;; authentication information shouldn't be found. ;; non-existent server diff --git a/test/src/minibuf-tests.el b/test/src/minibuf-tests.el index c55611eb84b..feea1c112bf 100644 --- a/test/src/minibuf-tests.el +++ b/test/src/minibuf-tests.el @@ -406,7 +406,7 @@ (should (equal (try-completion "bar" '("bArfoo" "barbaz")) (try-completion "bar" '("barbaz" "bArfoo")))) ;; bug#11339 - (should (equal (try-completion "baz" '("baz" "bAz")) "baz")) ;And not `t'! + (should (equal (try-completion "baz" '("baz" "bAz")) "baz")) ;And not t! (should (equal (try-completion "baz" '("bAz" "baz")) (try-completion "baz" '("baz" "bAz")))))) -- cgit v1.2.3 From 0da8118dcbf3c54dd6ecc9c0e3314a56ca82ec51 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 24 Sep 2021 20:59:32 +0200 Subject: Use command substitution instead of raw keys in more places * admin/authors.el (authors): * lisp/abbrev.el (abbrev-suggest-show-report): * lisp/calc/calc.el (calc-display-trail, calc): * lisp/completion.el (completion-locate-db-error): * lisp/dired-x.el (dired-extra-startup): * lisp/emacs-lisp/package.el (package-install-selected-packages): * lisp/emulation/viper.el (viper-mode): * lisp/facemenu.el (list-colors-display): * lisp/mail/emacsbug.el (report-emacs-bug-hook): * lisp/mail/sendmail.el (mail): * lisp/menu-bar.el (menu-bar-mode): * lisp/org/org.el (org-revert-all-org-buffers): * lisp/progmodes/antlr-mode.el (antlr-help-rules-intro) (antlr-insert-makefile-rules): * lisp/progmodes/gdb-mi.el (gdb--check-interpreter): * lisp/progmodes/xscheme.el (xscheme-process-sentinel): * lisp/ps-print.el (ps-font-info-database): * lisp/recentf.el (recentf-edit-list, recentf-open-files): * lisp/vc/ediff-util.el (ediff-suspend): * lisp/vc/pcvs.el (cvs-mode): * lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Use command substitution. --- admin/authors.el | 3 ++- lisp/abbrev.el | 4 ++-- lisp/calc/calc.el | 6 ++++-- lisp/completion.el | 3 ++- lisp/dired-x.el | 2 +- lisp/emacs-lisp/package.el | 4 +++- lisp/emulation/viper.el | 2 +- lisp/facemenu.el | 7 ++++--- lisp/mail/emacsbug.el | 2 +- lisp/mail/sendmail.el | 3 ++- lisp/menu-bar.el | 4 +++- lisp/org/org.el | 4 ++-- lisp/progmodes/antlr-mode.el | 5 +++-- lisp/progmodes/gdb-mi.el | 4 +++- lisp/progmodes/xscheme.el | 4 ++-- lisp/ps-print.el | 2 +- lisp/recentf.el | 8 +++++--- lisp/vc/ediff-util.el | 4 ++-- lisp/vc/pcvs.el | 3 ++- lisp/vc/vc-bzr.el | 3 ++- 20 files changed, 47 insertions(+), 30 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/admin/authors.el b/admin/authors.el index 3dec23c1916..fd46dabaa3a 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -1610,7 +1610,8 @@ and a buffer *Authors Errors* containing references to unknown files." ;; the versioned ChangeLog.N rather than the unversioned ChangeLog. (zerop (call-process "make" nil nil nil "-C" root "change-history-nocommit")) - (error "Problem updating ChangeLog, try \"C-u M-x authors RET\"")) + (error (substitute-command-keys + "Problem updating ChangeLog, try \"\\[universal-argument] \\[authors]\""))) (let ((logs (process-lines find-program root "-name" "ChangeLog*")) (table (make-hash-table :test 'equal)) (buffer-name "*Authors*") diff --git a/lisp/abbrev.el b/lisp/abbrev.el index f370bd3ea6a..b0e8a4fa99c 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -973,11 +973,11 @@ full text instead of the abbrevs that expand into that text." (buf (get-buffer-create "*abbrev-suggest*"))) (set-buffer buf) (erase-buffer) - (insert "** Abbrev expansion usage ** + (insert (substitute-command-keys "** Abbrev expansion usage ** Below is a list of expansions for which abbrevs are defined, and the number of times the expansion was typed manually. To display -and edit all abbrevs, type `M-x edit-abbrevs RET'\n\n") +and edit all abbrevs, type \\[edit-abbrevs].\n\n")) (dolist (expansion totals) (insert (format " %s: %d\n" (car expansion) (cdr expansion)))) (display-buffer buf))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 45a4d56a371..b9bdc0fd8dc 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -731,7 +731,7 @@ If nil, symbolic math routines make no assumptions about variables.") "Initial height of Calculator window.") (defcalcmodevar calc-display-trail t - "If non-nil, M-x calc creates a window to display Calculator trail.") + "If non-nil, \\[calc] creates a window to display Calculator trail.") (defcalcmodevar calc-show-selections t "If non-nil, selected sub-formulas are shown by obscuring rest of formula. @@ -1468,7 +1468,9 @@ See `window-dedicated-p' for what that means." (with-current-buffer (calc-trail-buffer) (and calc-display-trail (calc-trail-display 1 t))) - (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") + (message (substitute-command-keys + (concat "Welcome to the GNU Emacs Calculator! \\" + "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit"))) (run-hooks 'calc-start-hook) (and (windowp full-display) (window-point full-display) diff --git a/lisp/completion.el b/lisp/completion.el index e36c7228416..643f2da0d21 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -1088,7 +1088,8 @@ Must be called after `find-exact-completion'." #'completion-locate-db-error "27.1") (defun completion-locate-db-error () ;; recursive error: really scrod - (error "Completion database corrupted. Try M-x clear-all-completions. Send bug report")) + (error (substitute-command-keys + "Completion database corrupted. Try \\[clear-all-completions]. Send bug report"))) ;; WRITES (defun add-completion-to-tail-if-new (string) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index cf257c8169d..7c6f49f2ae4 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -293,7 +293,7 @@ files"] \\[dired-omit-mode]\t-- toggle omitting of files \\[dired-mark-sexp]\t-- mark by Lisp expression -To see the options you can set, use M-x customize-group RET dired-x RET. +To see the options you can set, use \\[customize-group] RET dired-x RET. See also the functions: `dired-flag-extension' `dired-virtual' diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index a204966644e..a0bfcbb24fa 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2268,7 +2268,9 @@ confirmation to install packages." (mapconcat #'symbol-name available " ")))) (mapc (lambda (p) (package-install p 'dont-select)) available))) ((> difference 0) - (message "Packages that are not available: %d (the rest is already installed), maybe you need to `M-x package-refresh-contents'" + (message (substitute-command-keys + "Packages that are not available: %d (the rest is already \ +installed), maybe you need to \\[package-refresh-contents]") difference)) (t (message "All your packages are already installed")))))) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 6ba265f8abf..e9c0fb5e24b 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -577,7 +577,7 @@ For more information on Viper: To submit a bug report or to contact the author, type :submitReport in Vi command mode. To shoo Viper away and return to pure Emacs (horror!), type: - M-x viper-go-away + \\[viper-go-away] This startup message appears whenever you load Viper, unless you type `y' now." )) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 7229d6163df..7417bb12030 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -541,10 +541,11 @@ If the optional argument LIST is non-nil, it should be a list of colors to display. Otherwise, this command computes a list of colors that the current display can handle. Customize `list-colors-sort' to change the order in which colors are shown. -Type `g' or \\[revert-buffer] after customizing `list-colors-sort' -to redisplay colors in the new order. +Type \\\\[revert-buffer] after customizing \ +`list-colors-sort' to redisplay colors in +the new order. -If the optional argument BUFFER-NAME is nil, it defaults to *Colors*. +If the optional argument BUFFER-NAME is nil, it defaults to \"*Colors*\". If the optional argument CALLBACK is non-nil, it should be a function to call each time the user types RET or clicks on a diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 3da1e8b25e9..7c3f6ba5e6d 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -426,7 +426,7 @@ usually do not have translators for other languages.\n\n"))) (with-output-to-temp-buffer "*Bug Help*" (princ (substitute-command-keys (format "\ -You invoked the command M-x report-emacs-bug, +You invoked the command \\[report-emacs-bug], but you decided not to mail the bug report to the Emacs maintainers. If you want to mail it to someone else instead, diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 312805f6d8f..d0aff093dfe 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -1950,7 +1950,8 @@ The seventh argument ACTIONS is a list of actions to take (setq initialized t))) (if (and buffer-auto-save-file-name (file-exists-p buffer-auto-save-file-name)) - (message "Auto save file for draft message exists; consider M-x mail-recover")) + (message (substitute-command-keys + "Auto save file for draft message exists; consider \\[mail-recover]"))) initialized)) (declare-function dired-view-file "dired" ()) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index ede81867825..b2577c085fc 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2490,7 +2490,9 @@ created in the future." ;; after this function returns, overwriting any message we do here. (when (and (called-interactively-p 'interactive) (not menu-bar-mode)) (run-with-idle-timer 0 nil 'message - "Menu Bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))) + (substitute-command-keys + "Menu Bar mode disabled. \ +Use \\[menu-bar-mode] to make the menu bar appear.")))) ;;;###autoload ;; (This does not work right unless it comes after the above definition.) diff --git a/lisp/org/org.el b/lisp/org/org.el index d03676e3fb9..4a74eda8427 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -15215,9 +15215,9 @@ This function is useful in a setup where one tracks Org files with a version control system, to revert on one machine after pulling changes from another. I believe the procedure must be like this: -1. M-x org-save-all-org-buffers +1. \\[org-save-all-org-buffers] 2. Pull changes from the other machine, resolve conflicts -3. M-x org-revert-all-org-buffers" +3. \\[org-revert-all-org-buffers]" (interactive) (unless (yes-or-no-p "Revert all Org buffers from their files? ") (user-error "Abort")) diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index a74ca1ed239..0b7945430d3 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -570,7 +570,7 @@ See \\[antlr-show-makefile-rules] and `antlr-unknown-file-formats'.") "The following Makefile rules define the dependencies for all (non- expanded) grammars in directory \"%s\".\n They are stored in the kill-ring, i.e., you can insert them with C-y -into your Makefile. You can also invoke M-x antlr-show-makefile-rules +into your Makefile. You can also invoke \\[antlr-show-makefile-rules] from within a Makefile to insert them directly.\n\n\n" "Introduction to use with \\[antlr-show-makefile-rules]. It is a format string and used with substitution DIRECTORY/%s where @@ -2167,7 +2167,8 @@ command `antlr-show-makefile-rules' for detail." (unless in-makefile (copy-region-as-kill (point-min) (point-max)) (goto-char (point-min)) - (insert (format antlr-help-rules-intro dirname))))) + (insert (format (substitute-command-keys antlr-help-rules-intro) + dirname))))) ;;;###autoload (defun antlr-show-makefile-rules () diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 3e5b8e2f32b..fa54f511608 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -766,7 +766,9 @@ NOARG must be t when this macro is used outside `gud-def'." ;; Apparently we're not running with -i=mi (or we're, for ;; instance, debugging something inside a Docker instance with ;; Emacs on the outside). - (let ((msg "Error: Either -i=mi wasn't specified on the GDB command line, or the extra socket couldn't be established. Consider using `M-x gud-gdb' instead.")) + (let ((msg (substitute-command-keys + "Error: Either -i=mi wasn't specified on the GDB command line,\ + or the extra socket couldn't be established. Consider using \\[gud-gdb] instead."))) (message msg) (setq string (concat (propertize msg 'font-lock-face 'error) "\n" string))) diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 70763319840..1874f2698ae 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -908,8 +908,8 @@ the remaining input.") xscheme-signal-death-message) (progn (beep) - (message -"The Scheme process has died! Do M-x reset-scheme to restart it")))))) + (message (substitute-command-keys +"The Scheme process has died! Type \\[reset-scheme] to restart it"))))))) (defun xscheme-process-filter-initialize (running-p) (setq xscheme-process-filter-state 'idle) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 38671b58e2b..1f4ed4e44d7 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -2788,7 +2788,7 @@ Each element comprises: font family (the key), name, bold, italic, bold-italic, reference size, line height, space width, average character width. To get the info for another specific font (say Helvetica), do the following: - create a new buffer -- generate the PostScript image to a file (C-u M-x ps-print-buffer) +- generate the PostScript image to a file (\\[universal-argument] \\[ps-print-buffer]) - open this file and delete the leading `%' (which is the PostScript comment character) from the line `% 3 cm 20 cm moveto 10/Courier ReportFontInfo showpage' diff --git a/lisp/recentf.el b/lisp/recentf.el index 9ae059a70dd..57cbaf0debb 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1122,8 +1122,9 @@ IGNORE arguments." (setq-local recentf-edit-list nil) (widget-insert (format-message - "Click on OK to delete selected files from the recent list. -Click on Cancel or type `q' to cancel.\n")) + (substitute-command-keys + "Click on OK to delete selected files from the recent list. +Click on Cancel or type \\[recentf-cancel-dialog] to cancel.\n"))) ;; Insert the list of files as checkboxes (dolist (item recentf-list) (widget-create 'checkbox @@ -1221,7 +1222,8 @@ use for the dialog. It defaults to \"*`recentf-menu-title'*\"." ", or type the corresponding digit key," "") " to open it.\n" - (format-message "Click on Cancel or type `q' to cancel.\n")) + (substitute-command-keys + "Click on Cancel or type \\[recentf-cancel-dialog] to cancel.\n")) ;; Use a L&F that looks like the recentf menu. (tree-widget-set-theme "folder") (apply #'widget-create diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 5646fd3d42a..9016d1df5c4 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -2777,8 +2777,8 @@ up an appropriate window config." (interactive) (ediff-barf-if-not-control-buffer) (run-hooks 'ediff-suspend-hook) - (message - "To resume, type M-x eregistry and select the desired Ediff session")) + (message (substitute-command-keys + "To resume, type \\[eregistry] and select the desired Ediff session"))) ;; ediff-barf-if-not-control-buffer ensures only called from ediff. (declare-function ediff-version "ediff" ()) diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 726fe4e2837..bbc81ef195d 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -1144,7 +1144,8 @@ Full documentation is in the Texinfo file." ("->" cvs-secondary-branch-prefix)))) " " cvs-mode-line-process)) (if buffer-file-name - (error "Use M-x cvs-quickdir to get a *cvs* buffer")) + (error (substitute-command-keys + "Use \\[cvs-quickdir] to get a *cvs* buffer"))) (buffer-disable-undo) ;;(setq-local goal-column cvs-cursor-column) (setq-local revert-buffer-function 'cvs-mode-revert-buffer) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index bfe3293e45a..48fedeca5a8 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -1054,7 +1054,8 @@ stream. Standard error output is discarded." (vc-bzr-command "info" t 0 dir) (buffer-string))) (shelve (vc-bzr-shelve-list)) - (shelve-help-echo "Use M-x vc-bzr-shelve to create shelves") + (shelve-help-echo (substitute-command-keys + "Use \\[vc-bzr-shelve] to create shelves")) (root-dir (vc-bzr-root dir)) (pending-merge ;; FIXME: looking for .bzr/checkout/merge-hashes is not a -- cgit v1.2.3 From 8ea1765fea35e68189ba5edca74d61660950ee8b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 26 Sep 2021 14:29:41 +0200 Subject: Prefer https for other domains than gnu.org in package URL * lisp/emacs-lisp/package.el (describe-package-1): Prefer https for some other common domains in the package URL. --- lisp/emacs-lisp/package.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index a0bfcbb24fa..94087d172c9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2620,12 +2620,17 @@ Helper function for `describe-package'." (package-desc-name pkg)))) (insert "\n"))) (when homepage - ;; Prefer https for the homepage of packages on gnu.org. - (if (string-match-p "^http://\\(elpa\\|www\\)\\.gnu\\.org/" homepage) - (let ((gnu (cdr (assoc "gnu" package-archives)))) - (and gnu (string-match-p "^https" gnu) - (setq homepage - (replace-regexp-in-string "^http" "https" homepage))))) + ;; Prefer https for the homepage of packages on common domains. + (when (string-match-p (rx bol "http://" (or "elpa." "www." "git." "") + (or "nongnu.org" "gnu.org" "sr.ht" + "emacswiki.org" "gitlab.com" "github.com") + "/") + homepage) + ;; But only if the user has "https" in `package-archives'. + (let ((gnu (cdr (assoc "gnu" package-archives)))) + (and gnu (string-match-p "^https" gnu) + (setq homepage + (replace-regexp-in-string "^http" "https" homepage))))) (package--print-help-section "Homepage") (help-insert-xref-button homepage 'help-url homepage) (insert "\n")) -- cgit v1.2.3 From 3bab1476f63075671b6c40c4ad13d758a0064caa Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 26 Sep 2021 14:32:58 +0200 Subject: Rename "Homepage" field to "Website" in package description * lisp/emacs-lisp/package.el (describe-package-1): Rename "Homepage" field to "Website". * test/lisp/emacs-lisp/package-tests.el (package-test-describe-package) (package-test-describe-installed-multi-file-package) (package-test-describe-non-installed-package) (package-test-describe-non-installed-multi-file-package): Update tests. --- lisp/emacs-lisp/package.el | 24 ++++++++++++------------ test/lisp/emacs-lisp/package-tests.el | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 94087d172c9..62f5fc73417 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1118,7 +1118,7 @@ is wrapped around any parts requiring it." (declare-function lm-header "lisp-mnt" (header)) (declare-function lm-header-multiline "lisp-mnt" (header)) -(declare-function lm-homepage "lisp-mnt" (&optional file)) +(declare-function lm-website "lisp-mnt" (&optional file)) (declare-function lm-keywords-list "lisp-mnt" (&optional file)) (declare-function lm-maintainers "lisp-mnt" (&optional file)) (declare-function lm-authors "lisp-mnt" (&optional file)) @@ -1153,7 +1153,7 @@ boundaries." (or (lm-header "package-version") (lm-header "version"))) (pkg-version (package-strip-rcs-id version-info)) (keywords (lm-keywords-list)) - (homepage (lm-homepage))) + (website (lm-website))) (unless pkg-version (if version-info (error "Unrecognized package version: %s" version-info) @@ -1164,7 +1164,7 @@ boundaries." (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " ")))) :kind 'single - :url homepage + :url website :keywords keywords :maintainer ;; For backward compatibility, use a single string if there's only @@ -2170,7 +2170,7 @@ Otherwise return nil." ;; to make sure we use a "canonical name"! (if l (package-version-join l))))) -(declare-function lm-homepage "lisp-mnt" (&optional file)) +(declare-function lm-website "lisp-mnt" (&optional file)) ;;;###autoload (defun package-install-from-buffer () @@ -2506,7 +2506,7 @@ Helper function for `describe-package'." (version (if desc (package-desc-version desc))) (archive (if desc (package-desc-archive desc))) (extras (and desc (package-desc-extras desc))) - (homepage (cdr (assoc :url extras))) + (website (cdr (assoc :url extras))) (commit (cdr (assoc :commit extras))) (keywords (if desc (package-desc--keywords desc))) (built-in (eq pkg-dir 'builtin)) @@ -2619,20 +2619,20 @@ Helper function for `describe-package'." (help-insert-xref-button text 'help-package (package-desc-name pkg)))) (insert "\n"))) - (when homepage - ;; Prefer https for the homepage of packages on common domains. + (when website + ;; Prefer https for the website of packages on common domains. (when (string-match-p (rx bol "http://" (or "elpa." "www." "git." "") (or "nongnu.org" "gnu.org" "sr.ht" "emacswiki.org" "gitlab.com" "github.com") "/") - homepage) + website) ;; But only if the user has "https" in `package-archives'. (let ((gnu (cdr (assoc "gnu" package-archives)))) (and gnu (string-match-p "^https" gnu) - (setq homepage - (replace-regexp-in-string "^http" "https" homepage))))) - (package--print-help-section "Homepage") - (help-insert-xref-button homepage 'help-url homepage) + (setq website + (replace-regexp-in-string "^http" "https" website))))) + (package--print-help-section "Website") + (help-insert-xref-button website 'help-url website) (insert "\n")) (when keywords (package--print-help-section "Keywords") diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 29435799555..77bc8117cf2 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -636,7 +636,7 @@ but with a different end of line convention (bug#48137)." (save-excursion (should (re-search-forward "Status: Installed in ['`‘]simple-single-1.3/['’] (unsigned)." nil t))) (save-excursion (should (search-forward "Version: 1.3" nil t))) (save-excursion (should (search-forward "Summary: A single-file package with no dependencies" nil t))) - (save-excursion (should (search-forward "Homepage: http://doodles.au" nil t))) + (save-excursion (should (search-forward "Website: http://doodles.au" nil t))) (save-excursion (should (re-search-forward "Keywords: \\[?frobnicate\\]?" nil t))) (save-excursion (should (search-forward "This package provides a minor mode to frobnicate" nil t))) @@ -652,7 +652,7 @@ but with a different end of line convention (bug#48137)." (with-fake-help-buffer (describe-package 'multi-file) (goto-char (point-min)) - (should (search-forward "Homepage: http://puddles.li" nil t)) + (should (search-forward "Website: http://puddles.li" nil t)) (should (search-forward "This is a bare-bones readme file for the multi-file" nil t))))) @@ -665,7 +665,7 @@ but with a different end of line convention (bug#48137)." (with-fake-help-buffer (describe-package 'simple-single) (goto-char (point-min)) - (should (search-forward "Homepage: http://doodles.au" nil t)) + (should (search-forward "Website: http://doodles.au" nil t)) (should (search-forward "This package provides a minor mode to frobnicate" nil t))))) @@ -678,7 +678,7 @@ but with a different end of line convention (bug#48137)." (with-fake-help-buffer (describe-package 'multi-file) (goto-char (point-min)) - (should (search-forward "Homepage: http://puddles.li" nil t)) + (should (search-forward "Website: http://puddles.li" nil t)) (should (search-forward "This is a bare-bones readme file for the multi-file" nil t))))) -- cgit v1.2.3 From d86b2e59c746966e1ae023937b2a6b3b8c16d18b Mon Sep 17 00:00:00 2001 From: Stephen Gildea Date: Tue, 5 Oct 2021 09:15:57 -0700 Subject: native-comp-available-p is the definitive test * doc/lispref/compile.texi (Native Compilation): Document native-comp-available-p as the way to test for native compilation. * lisp/emacs-lisp/package.el (package--native-compile-async): * test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines): Test for native compilation with native-comp-available-p. Thank you to Andrea Corallo for reviewing this patch. --- doc/lispref/compile.texi | 3 +-- lisp/emacs-lisp/package.el | 3 +-- test/lisp/mh-e/mh-utils-tests.el | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index 15d1f4ce53a..523758c10f5 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -811,8 +811,7 @@ for you to be able to native-compile Lisp code. @vindex native-compile@r{, a Lisp feature} To determine whether the current Emacs process can produce and load -natively-compiled Lisp code, test whether the @code{native-compile} -feature is available (@pxref{Named Features}). Alternatively, call +natively-compiled Lisp code, call @code{native-comp-available-p} (@pxref{Native-Compilation Functions}). Unlike byte-compiled code, natively-compiled Lisp code is executed diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 62f5fc73417..5445fa970f8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1081,8 +1081,7 @@ This assumes that `pkg-desc' has already been activated with "Native compile installed package PKG-DESC asynchronously. This assumes that `pkg-desc' has already been activated with `package-activate-1'." - (when (and (featurep 'native-compile) - (native-comp-available-p)) + (when (native-comp-available-p) (let ((warning-minimum-level :error)) (native-compile-async (package-desc-dir pkg-desc) t)))) diff --git a/test/lisp/mh-e/mh-utils-tests.el b/test/lisp/mh-e/mh-utils-tests.el index 82afbab6474..f1282ab44a6 100644 --- a/test/lisp/mh-e/mh-utils-tests.el +++ b/test/lisp/mh-e/mh-utils-tests.el @@ -113,7 +113,7 @@ As `call-process'' and `file-directory-p' will be redefined, the native compiler will invoke `call-process' to compile the respective trampolines. To avoid interferences with the `call-process' mocking we build these AOT." - (when (featurep 'native-compile) + (when (native-comp-available-p) (mapc #'comp-subr-trampoline-install '(call-process file-directory-p)))) (defun mh-test-utils-setup-with-mocks () -- cgit v1.2.3 From 43f59b91aa2bc5e1771ed68e9a3a84b4aef26ef4 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 13 Oct 2021 21:21:23 +0200 Subject: Mark all def* functions that should indent as `defun' * lisp/abbrev.el (define-abbrev): (define-abbrev-table): Mark all functions that have names that start with "def" that should indent according to the current heuristics (bug#43329). * lisp/autoinsert.el (define-auto-insert): * lisp/button.el (define-button-type): * lisp/subr.el (define-key-after): (define-mail-user-agent): (define-keymap): * lisp/widget.el (define-widget): * lisp/emacs-lisp/package.el (define-package): * lisp/international/mule-cmds.el (define-char-code-property): * lisp/international/mule.el (define-charset): (define-coding-system): (define-translation-table): (define-translation-hash-table): --- lisp/abbrev.el | 3 ++- lisp/autoinsert.el | 1 + lisp/button.el | 1 + lisp/emacs-lisp/package.el | 1 + lisp/international/mule-cmds.el | 1 + lisp/international/mule.el | 4 ++++ lisp/subr.el | 3 +++ lisp/widget.el | 2 +- 8 files changed, 14 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/abbrev.el b/lisp/abbrev.el index b0e8a4fa99c..d3daf637cc6 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -583,6 +583,7 @@ PROPS is a property list. The following properties are special: An obsolete but still supported calling form is: \(define-abbrev TABLE NAME EXPANSION &optional HOOK COUNT SYSTEM)." + (declare (indent defun)) (when (and (consp props) (or (null (car props)) (numberp (car props)))) ;; Old-style calling convention. (setq props `(:count ,(car props) @@ -1139,7 +1140,7 @@ Properties with special meaning: - `:enable-function' can be set to a function of no argument which returns non-nil if and only if the abbrevs in this table should be used for this instance of `expand-abbrev'." - (declare (doc-string 3)) + (declare (doc-string 3) (indent defun)) ;; We used to manually add the docstring, but we also want to record this ;; location as the definition of the variable (in load-history), so we may ;; as well just use `defvar'. diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 063d0a14d63..b448c0f8da9 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -415,6 +415,7 @@ Matches the visited file name against the elements of `auto-insert-alist'." "Associate CONDITION with (additional) ACTION in `auto-insert-alist'. Optional AFTER means to insert action after all existing actions for CONDITION, or if CONDITION had no actions, after all other CONDITIONs." + (declare (indent defun)) (let ((elt (assoc condition auto-insert-alist))) (if elt (setcdr elt diff --git a/lisp/button.el b/lisp/button.el index aedd07b762d..acf76464332 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -130,6 +130,7 @@ In addition, the keyword argument :supertype may be used to specify a `button-type' from which NAME inherits its default property values (however, the inheritance happens only when NAME is defined; subsequent changes to a supertype are not reflected in its subtypes)." + (declare (indent defun)) (let ((catsym (make-symbol (concat (symbol-name name) "-button"))) (super-catsym (button-category-symbol diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 5445fa970f8..40318dcb65a 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -714,6 +714,7 @@ REQUIREMENTS is a list of dependencies on other packages. where OTHER-VERSION is a string. EXTRA-PROPERTIES is currently unused." + (declare (indent defun)) ;; FIXME: Placeholder! Should we keep it? (error "Don't call me!")) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index a0a6557c95c..94d2f82e8c8 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2927,6 +2927,7 @@ Optional 3rd argument DOCSTRING is a documentation string of the property. See also the documentation of `get-char-code-property' and `put-char-code-property'." + (declare (indent defun)) (or (symbolp name) (error "Not a symbol: %s" name)) (if (char-table-p table) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 5022a17db5a..3e45a64dc9a 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -218,6 +218,7 @@ corresponding Unicode character code. If it is a string, it is a name of file that contains the above information. The file format is the same as what described for `:map' attribute." + (declare (indent defun)) (when (vectorp (car props)) ;; Old style code: ;; (define-charset CHARSET-ID CHARSET-SYMBOL INFO-VECTOR) @@ -890,6 +891,7 @@ non-nil. VALUE non-nil means Emacs prefers UTF-8 on code detection for non-ASCII files. This attribute is meaningful only when `:coding-type' is `undecided'." + (declare (indent defun)) (let* ((common-attrs (mapcar 'list '(:mnemonic :coding-type @@ -2320,6 +2322,7 @@ This function sets properties `translation-table' and `translation-table-id' of SYMBOL to the created table itself and the identification number of the table respectively. It also registers the table in `translation-table-vector'." + (declare (indent defun)) (let ((table (if (and (char-table-p (car args)) (eq (char-table-subtype (car args)) 'translation-table)) @@ -2394,6 +2397,7 @@ Value is what BODY returns." Analogous to `define-translation-table', but updates `translation-hash-table-vector' and the table is for use in the CCL `lookup-integer' and `lookup-character' functions." + (declare (indent defun)) (unless (and (symbolp symbol) (hash-table-p table)) (error "Bad args to define-translation-hash-table")) diff --git a/lisp/subr.el b/lisp/subr.el index 805c14eae3b..46cd4c127dc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1000,6 +1000,7 @@ Bindings are always added before any inherited map. The order of bindings in a keymap matters only when it is used as a menu, so this function is not useful for non-menu keymaps." + (declare (indent defun)) (unless after (setq after t)) (or (keymapp keymap) (signal 'wrong-type-argument (list 'keymapp keymap))) @@ -5572,6 +5573,7 @@ If HOOKVAR is nil, `mail-send-hook' is used. The properties used on SYMBOL are `composefunc', `sendfunc', `abortfunc', and `hookvar'." + (declare (indent defun)) (put symbol 'composefunc composefunc) (put symbol 'sendfunc sendfunc) (put symbol 'abortfunc (or abortfunc #'kill-buffer)) @@ -6491,6 +6493,7 @@ also be the special symbol `:menu', in which case DEFINITION should be a MENU form as accepted by `easy-menu-define'. \(fn &key FULL PARENT SUPPRESS NAME PREFIX KEYMAP &rest [KEY DEFINITION]...)" + (declare (indent defun)) (define-keymap--define definitions)) (defun define-keymap--define (definitions) diff --git a/lisp/widget.el b/lisp/widget.el index 393fe6c21b3..0d1977164b3 100644 --- a/lisp/widget.el +++ b/lisp/widget.el @@ -83,7 +83,7 @@ create identical widgets: * (apply #\\='widget-create CLASS ARGS) The third argument DOC is a documentation string for the widget." - (declare (doc-string 3)) + (declare (doc-string 3) (indent defun)) ;; (unless (or (null doc) (stringp doc)) (error "Widget documentation must be nil or a string")) -- cgit v1.2.3 From 241574375df80a136624ea622d76b426e1437617 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 23 Oct 2021 05:25:37 +0200 Subject: Add links to commentary reached with finder-list-keywords * lisp/finder.el (finder-goto-xref): Move from here... * lisp/emacs-lisp/package.el (package--finder-goto-xref): ...to here. Make the old name into an obsolete function alias. (package--finder-xref): New button type. (package--describe-add-library-links): Factor out new function... * lisp/finder.el (finder-commentary): ...from here. (describe-package-1): Call above new function. This fixes an issue where commentaries reached via 'finder-list-keywords' did not have links. (Bug#10814) --- lisp/emacs-lisp/package.el | 21 +++++++++++++++++++++ lisp/finder.el | 22 +++++++--------------- 2 files changed, 28 insertions(+), 15 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 40318dcb65a..fcbcdc79d8e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2488,6 +2488,15 @@ The description is read from the installed package files." (format "%s.el" (package-desc-name desc)) srcdir)) ""))) +(defun package--describe-add-library-links () + "Add links to library names in package description." + (while (re-search-forward "\\<\\([-[:alnum:]]+\\.el\\)\\>" nil t) + (if (locate-library (match-string 1)) + (make-text-button (match-beginning 1) (match-end 1) + 'xref (match-string-no-properties 1) + 'help-echo "Read this file's commentary" + :type 'package--finder-xref)))) + (defun describe-package-1 (pkg) "Insert the package description for PKG. Helper function for `describe-package'." @@ -2714,6 +2723,9 @@ Helper function for `describe-package'." t) (insert (or readme-string "This package does not provide a description."))))) + ;; Make library descriptions into links. + (goto-char start-of-description) + (package--describe-add-library-links) ;; Make URLs in the description into links. (goto-char start-of-description) (browse-url-add-buttons)))) @@ -2759,6 +2771,15 @@ function is a convenience wrapper used by `describe-package-1'." (apply #'insert-text-button button-text 'face button-face 'follow-link t properties))) +(defun package--finder-goto-xref (button) + "Jump to a Lisp file for the BUTTON at point." + (let* ((file (button-get button 'xref)) + (lib (locate-library file))) + (if lib (finder-commentary lib) + (message "Unable to locate `%s'" file)))) + +(define-button-type 'package--finder-xref 'action #'package--finder-goto-xref) + (defun package--print-email-button (recipient) "Insert a button whose action will send an email to RECIPIENT. NAME should have the form (FULLNAME . EMAIL) where FULLNAME is diff --git a/lisp/finder.el b/lisp/finder.el index c2b9a6d0ef9..00f321b8028 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -362,19 +362,13 @@ not `finder-known-keywords'." (let ((package-list-unversioned t)) (package-show-package-list packages)))) -(define-button-type 'finder-xref 'action #'finder-goto-xref) - -(defun finder-goto-xref (button) - "Jump to a Lisp file for the BUTTON at point." - (let* ((file (button-get button 'xref)) - (lib (locate-library file))) - (if lib (finder-commentary lib) - (message "Unable to locate `%s'" file)))) - ;;;###autoload (defun finder-commentary (file) "Display FILE's commentary section. FILE should be in a form suitable for passing to `locate-library'." + ;; FIXME: Merge this function into `describe-package', which is + ;; strictly better as it has links to URL's and is in a proper help + ;; buffer with navigation forward and backward, etc. (interactive (list (completing-read "Library name: " @@ -391,12 +385,7 @@ FILE should be in a form suitable for passing to `locate-library'." (erase-buffer) (insert str) (goto-char (point-min)) - (while (re-search-forward "\\<\\([-[:alnum:]]+\\.el\\)\\>" nil t) - (if (locate-library (match-string 1)) - (make-text-button (match-beginning 1) (match-end 1) - 'xref (match-string-no-properties 1) - 'help-echo "Read this file's commentary" - :type 'finder-xref))) + (package--describe-add-library-links) (goto-char (point-min)) (setq buffer-read-only t) (set-buffer-modified-p nil) @@ -469,6 +458,9 @@ Quit the window and kill all Finder-related buffers." ;; continue standard unloading nil) +(define-obsolete-function-alias 'finder-goto-xref + #'package--finder-goto-xref "29.1") + (provide 'finder) -- cgit v1.2.3 From 9dfd945a2c2055b1af869a685eb2a667daf4daca Mon Sep 17 00:00:00 2001 From: dickmao Date: Sun, 7 Nov 2021 01:28:47 +0100 Subject: Fix byte compilation of package built-ins * lisp/emacs-lisp/package.el (package--activate-autoloads-and-load-path): (package--load-files-for-activation): Remove. (package--library-stem): New function, because file-name-sans-extension is insufficient. (package--reload-previously-loaded): New function. (package-activate-1): Reload directly. (package--files-load-history): (package--list-of-conflicts): (package--list-loaded-files): Remove (package-unpack): Adjust call. * test/lisp/emacs-lisp/package-tests.el (macro-builtin-func): Test. (macro-builtin-10-and-90): Test. (package-test-macro-compilation): Test. (package-test-macro-compilation-gz): Test (bug#49708). --- lisp/emacs-lisp/package.el | 120 +++++++-------------- .../macro-builtin-package-1.0/macro-builtin-aux.el | 12 +++ .../macro-builtin-package-1.0/macro-builtin.el | 21 ++++ .../macro-builtin-package-2.0/macro-builtin-aux.el | 16 +++ .../macro-builtin-package-2.0/macro-builtin.el | 30 ++++++ test/lisp/emacs-lisp/package-tests.el | 32 +++++- 6 files changed, 151 insertions(+), 80 deletions(-) create mode 100644 test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin-aux.el create mode 100644 test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin.el create mode 100644 test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin-aux.el create mode 100644 test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin.el (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fcbcdc79d8e..4761a3d82ba 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -758,47 +758,47 @@ PKG-DESC is a `package-desc' object." (format "%s-autoloads" (package-desc-name pkg-desc)) (package-desc-dir pkg-desc))) -(defun package--activate-autoloads-and-load-path (pkg-desc) - "Load the autoloads file and add package dir to `load-path'. -PKG-DESC is a `package-desc' object." - (let* ((old-lp load-path) - (pkg-dir (package-desc-dir pkg-desc)) - (pkg-dir-dir (file-name-as-directory pkg-dir))) - (with-demoted-errors "Error loading autoloads: %s" - (load (package--autoloads-file-name pkg-desc) nil t)) - (when (and (eq old-lp load-path) - (not (or (member pkg-dir load-path) - (member pkg-dir-dir load-path)))) - ;; Old packages don't add themselves to the `load-path', so we have to - ;; do it ourselves. - (push pkg-dir load-path)))) - (defvar Info-directory-list) (declare-function info-initialize "info" ()) (defvar package--quickstart-pkgs t "If set to a list, we're computing the set of pkgs to activate.") -(defun package--load-files-for-activation (pkg-desc reload) - "Load files for activating a package given by PKG-DESC. -Load the autoloads file, and ensure `load-path' is setup. If -RELOAD is non-nil, also load all files in the package that -correspond to previously loaded files." - (let* ((loaded-files-list - (when reload - (package--list-loaded-files (package-desc-dir pkg-desc))))) - ;; Add to load path, add autoloads, and activate the package. - (package--activate-autoloads-and-load-path pkg-desc) - ;; Call `load' on all files in `package-desc-dir' already present in - ;; `load-history'. This is done so that macros in these files are updated - ;; to their new definitions. If another package is being installed which - ;; depends on this new definition, not doing this update would cause - ;; compilation errors and break the installation. - (with-demoted-errors "Error in package--load-files-for-activation: %s" - (mapc (lambda (feature) (load feature nil t)) - ;; Skip autoloads file since we already evaluated it above. - (remove (file-truename (package--autoloads-file-name pkg-desc)) - loaded-files-list))))) +(defsubst package--library-stem (file) + (catch 'done + (let (result) + (dolist (suffix (get-load-suffixes) file) + (setq result (string-trim file nil suffix)) + (unless (equal file result) + (throw 'done result)))))) + +(defun package--reload-previously-loaded (pkg-desc) + "Force reimportation of files in PKG-DESC already present in `load-history'. +New editions of files contain macro definitions and +redefinitions, the overlooking of which would cause +byte-compilation of the new package to fail." + (with-demoted-errors "Error in package--load-files-for-activation: %s" + (let* (result + (dir (package-desc-dir pkg-desc)) + (load-path-sans-dir + (cl-remove-if (apply-partially #'string= dir) + (or (bound-and-true-p find-function-source-path) + load-path))) + (files (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")) + (history (mapcar #'file-truename + (cl-remove-if-not #'stringp + (mapcar #'car load-history))))) + (dolist (file files) + (when-let ((library (package--library-stem + (file-relative-name file dir))) + (canonical (locate-library library nil load-path-sans-dir)) + (found (member (file-truename canonical) history)) + (recent-index (length found))) + (unless (equal (file-name-base library) + (format "%s-autoloads" (package-desc-name pkg-desc))) + (push (cons (expand-file-name library dir) recent-index) result)))) + (mapc (lambda (c) (load (car c) nil t)) + (sort result (lambda (x y) (< (cdr x) (cdr y)))))))) (defun package-activate-1 (pkg-desc &optional reload deps) "Activate package given by PKG-DESC, even if it was already active. @@ -825,7 +825,11 @@ correspond to previously loaded files (those returned by (if (listp package--quickstart-pkgs) ;; We're only collecting the set of packages to activate! (push pkg-desc package--quickstart-pkgs) - (package--load-files-for-activation pkg-desc reload)) + (when reload + (package--reload-previously-loaded pkg-desc)) + (with-demoted-errors "Error loading autoloads: %s" + (load (package--autoloads-file-name pkg-desc) nil t)) + (add-to-list 'load-path (directory-file-name pkg-dir))) ;; Add info node. (when (file-exists-p (expand-file-name "dir" pkg-dir)) ;; FIXME: not the friendliest, but simple. @@ -836,48 +840,6 @@ correspond to previously loaded files (those returned by ;; Don't return nil. t))) -(defun package--files-load-history () - (delq nil - (mapcar (lambda (x) - (let ((f (car x))) - (and (stringp f) - (file-name-sans-extension (file-truename f))))) - load-history))) - -(defun package--list-of-conflicts (dir history) - (require 'find-func) - (declare-function find-library-name "find-func" (library)) - (delq - nil - (mapcar - (lambda (x) (let* ((file (file-relative-name x dir)) - ;; Previously loaded file, if any. - (previous - (ignore-error file-error ;"Can't find library" - (file-name-sans-extension - (file-truename (find-library-name file))))) - (pos (when previous (member previous history)))) - ;; Return (RELATIVE-FILENAME . HISTORY-POSITION) - (when pos - (cons (file-name-sans-extension file) (length pos))))) - (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")))) - -(defun package--list-loaded-files (dir) - "Recursively list all files in DIR which correspond to loaded features. -Returns the `file-name-sans-extension' of each file, relative to -DIR, sorted by most recently loaded last." - (let* ((history (package--files-load-history)) - (dir (file-truename dir)) - ;; List all files that have already been loaded. - (list-of-conflicts (package--list-of-conflicts dir history))) - ;; Turn the list of (FILENAME . POS) back into a list of features. Files in - ;; subdirectories are returned relative to DIR (so not actually features). - (let ((default-directory (file-name-as-directory dir))) - (mapcar (lambda (x) (file-truename (car x))) - (sort list-of-conflicts - ;; Sort the files by ascending HISTORY-POSITION. - (lambda (x y) (< (cdr x) (cdr y)))))))) - ;;;; `package-activate' (defun package--get-activatable-pkg (pkg-name) @@ -996,7 +958,7 @@ untar into a directory named DIR; otherwise, signal an error." (package--native-compile-async new-desc)) ;; After compilation, load again any files loaded by ;; `activate-1', so that we use the byte-compiled definitions. - (package--load-files-for-activation new-desc :reload))) + (package--reload-previously-loaded new-desc))) pkg-dir)) (defun package-generate-description-file (pkg-desc pkg-file) diff --git a/test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin-aux.el b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin-aux.el new file mode 100644 index 00000000000..724f88ec9ea --- /dev/null +++ b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin-aux.el @@ -0,0 +1,12 @@ +;;; macro-builtin-aux.el --- laksd -*- lexical-binding: t; -*- + +;; Author: Artur Malabarba + +;;; Code: + +(defun macro-builtin-aux-1 ( &rest forms) + "Description" + `(progn ,@forms)) + +(provide 'macro-builtin-aux) +;;; macro-builtin-aux.el ends here diff --git a/test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin.el b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin.el new file mode 100644 index 00000000000..828968a0576 --- /dev/null +++ b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-1.0/macro-builtin.el @@ -0,0 +1,21 @@ +;;; macro-builtin.el --- laksd -*- lexical-binding: t; -*- + +;; Author: Artur Malabarba +;; Keywords: tools +;; Version: 1.0 + +;;; Code: + +(require 'macro-builtin-aux) + +(defmacro macro-builtin-1 ( &rest forms) + "Description" + `(progn ,@forms)) + +(defun macro-builtin-func () + "" + (macro-builtin-1 'a 'b) + (macro-builtin-aux-1 'a 'b)) + +(provide 'macro-builtin) +;;; macro-builtin.el ends here diff --git a/test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin-aux.el b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin-aux.el new file mode 100644 index 00000000000..9f257d9d22c --- /dev/null +++ b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin-aux.el @@ -0,0 +1,16 @@ +;;; macro-builtin-aux.el --- laksd -*- lexical-binding: t; -*- + +;; Author: Artur Malabarba + +;;; Code: + +(defmacro macro-builtin-aux-1 ( &rest forms) + "Description" + `(progn ,@forms)) + +(defmacro macro-builtin-aux-3 ( &rest _) + "Description" + 90) + +(provide 'macro-builtin-aux) +;;; macro-builtin-aux.el ends here diff --git a/test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin.el b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin.el new file mode 100644 index 00000000000..5d241c082d0 --- /dev/null +++ b/test/lisp/emacs-lisp/package-resources/macro-builtin-package-2.0/macro-builtin.el @@ -0,0 +1,30 @@ +;;; macro-builtin.el --- laksd -*- lexical-binding: t; -*- + +;; Author: Artur Malabarba +;; Keywords: tools +;; Version: 2.0 + +;;; Code: + +(require 'macro-builtin-aux) + +(defmacro macro-builtin-1 ( &rest forms) + "Description" + `(progn ,(cadr (car forms)))) + + +(defun macro-builtin-func () + "" + (list (macro-builtin-1 '1 'b) + (macro-builtin-aux-1 'a 'b))) + +(defmacro macro-builtin-3 (&rest _) + "Description" + 10) + +(defun macro-builtin-10-and-90 () + "" + (list (macro-builtin-3 haha) (macro-builtin-aux-3 hehe))) + +(provide 'macro-builtin) +;;; macro-builtin.el ends here diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 1fd93bc1be7..c038c91e6a9 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -342,9 +342,13 @@ but with a different end of line convention (bug#48137)." (declare-function macro-problem-func "macro-problem" ()) (declare-function macro-problem-10-and-90 "macro-problem" ()) +(declare-function macro-builtin-func "macro-builtin" ()) +(declare-function macro-builtin-10-and-90 "macro-builtin" ()) (ert-deftest package-test-macro-compilation () - "Install a package which includes a dependency." + "\"Activation has to be done before compilation, so that if we're + upgrading and macros have changed we load the new definitions + before compiling.\" -- package.el" (with-package-test (:basedir (ert-resource-directory)) (package-install-file (expand-file-name "macro-problem-package-1.0/")) (require 'macro-problem) @@ -357,6 +361,32 @@ but with a different end of line convention (bug#48137)." ;; `macro-problem-10-and-90' depends on an entirely new macro from `macro-aux'. (should (equal (macro-problem-10-and-90) '(10 90))))) +(ert-deftest package-test-macro-compilation-gz () + "Built-in's can be superseded as well." + (with-package-test (:basedir (ert-resource-directory)) + (let ((dir (expand-file-name "macro-builtin-package-1.0"))) + (unwind-protect + (let ((load-path load-path)) + (add-to-list 'load-path (directory-file-name dir)) + (byte-recompile-directory dir 0 t) + (mapc (lambda (f) (rename-file f (concat f ".gz"))) + (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")) + (require 'macro-builtin) + (should (member (expand-file-name "macro-builtin-aux.elc" dir) + (mapcar #'car load-history))) + ;; `macro-builtin-func' uses a macro from `macro-aux'. + (should (equal (macro-builtin-func) '(progn a b))) + (package-install-file (expand-file-name "macro-builtin-package-2.0/")) + ;; After upgrading, `macro-builtin-func' depends on a new version + ;; of the macro from `macro-builtin-aux'. + (should (equal (macro-builtin-func) '(1 b))) + ;; `macro-builtin-10-and-90' depends on an entirely new macro from `macro-aux'. + (should (equal (macro-builtin-10-and-90) '(10 90)))) + (mapc #'delete-file + (directory-files-recursively dir "\\`[^\\.].*\\.elc\\'")) + (mapc (lambda (f) (rename-file f (file-name-sans-extension f))) + (directory-files-recursively dir "\\`[^\\.].*\\.el.gz\\'")))))) + (ert-deftest package-test-install-two-dependencies () "Install a package which includes a dependency." (with-package-test () -- cgit v1.2.3 From 1e7720d39afa9b86c5c1bf4bfded994fa6e48aff Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 10 Nov 2021 14:49:44 +0100 Subject: Avoid spurious byte-compiler warnings in package-quickstart.el * lisp/emacs-lisp/package.el (package-quickstart-refresh): Disable the "`make-variable-buffer-local' not called at toplevel" byte-compiler warnings. Given that we wrap it all in a let-form, these are mostly false positives and not helpful. --- lisp/emacs-lisp/package.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4761a3d82ba..55378ef8bd6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4195,6 +4195,7 @@ activations need to be changed, such as when `package-load-list' is modified." ;; Local\sVariables: ;; version-control: never ;; no-update-autoloads: t +;; byte-compile-warnings: (not make-local) ;; End: ")) ;; FIXME: Do it asynchronously in an Emacs subprocess, and -- cgit v1.2.3 From 810fa21d26453f898de9747ece7205dfe6de9d08 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 10 Nov 2021 15:15:09 +0100 Subject: Avoid another byte-compiler warning in package-quickstart.el * lisp/emacs-lisp/package.el (package-quickstart-refresh): Avoid byte-compiler warning "assignment to free variable" in package-quickstart.el. --- lisp/emacs-lisp/package.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 55378ef8bd6..27eaa484f9a 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4178,6 +4178,7 @@ activations need to be changed, such as when `package-load-list' is modified." (replace-match (if (match-end 1) "" pfile) t t))) (unless (bolp) (insert "\n")) (insert ")\n"))) + (pp `(defvar package-activated-list) (current-buffer)) (pp `(setq package-activated-list (append ',(mapcar #'package-desc-name package--quickstart-pkgs) package-activated-list)) -- cgit v1.2.3