From b93eb68cc30241059a339fbc697677f8f1d400ab Mon Sep 17 00:00:00 2001 From: Thuna Date: Tue, 14 Feb 2023 19:52:37 +0100 Subject: [PATCH 01/19] Use 'calendar-buffer' instead of fixed string * test/lisp/calendar/cal-julian-tests.el (with-cal-julian-test): Use 'calendar-buffer' instead of a literal fixed name. (Bug#61546) Copyright-paperwork-exempt: yes --- test/lisp/calendar/cal-julian-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/calendar/cal-julian-tests.el b/test/lisp/calendar/cal-julian-tests.el index e0d74e8a6cd..4207d1ee285 100644 --- a/test/lisp/calendar/cal-julian-tests.el +++ b/test/lisp/calendar/cal-julian-tests.el @@ -47,7 +47,7 @@ (progn (calendar) ,@body) - (kill-buffer "*Calendar*")))) + (kill-buffer calendar-buffer)))) (ert-deftest cal-julian-test-goto-date () (with-cal-julian-test From 57562c3fd0a5a7b640cc42c6daaad6842cd5b311 Mon Sep 17 00:00:00 2001 From: Thuna Date: Wed, 19 Apr 2023 23:43:22 +0200 Subject: [PATCH 02/19] Recognize defstruct slot names in various eieio functions * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Set each slot's name's 'slot-name' property so that 'eieio--known-slot-name-p' can recognize them. (Bug#62959) Copyright-paperwork-exempt: yes --- lisp/emacs-lisp/cl-preloaded.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 9445093f143..5235be52996 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -176,6 +176,7 @@ supertypes from the most specific to least specific.") (i 0) (offset (if type 0 1))) (dolist (slot slots) + (put (car slot) 'slot-name t) (let* ((props (cl--plist-to-alist (cddr slot))) (typep (assq :type props)) (type (if (null typep) t From 8d5aa8df4ad268c253712efe9ca3b3b158d19433 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 3 May 2023 20:02:01 +0800 Subject: [PATCH 03/19] Fix inserting selection data into Mozilla programs * lisp/select.el (xselect-convert-to-text-uri-list): Don't return any value when converting non-DND selections to this drag-and-drop target. Reported by Tobias Bading . --- lisp/select.el | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lisp/select.el b/lisp/select.el index 7f089c62dd5..09c678867d0 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -807,19 +807,24 @@ This function returns the string \"emacs\"." (defun xselect-convert-to-username (_selection _type _value) (user-real-login-name)) -(defun xselect-convert-to-text-uri-list (_selection _type value) - (let ((string - (if (stringp value) - (xselect--encode-string 'TEXT - (concat (url-encode-url value) "\n")) - (when (vectorp value) - (with-temp-buffer - (cl-loop for tem across value - do (progn - (insert (url-encode-url tem)) - (insert "\n"))) - (xselect--encode-string 'TEXT (buffer-string))))))) - (cons 'text/uri-list (cdr string)))) +(defun xselect-convert-to-text-uri-list (selection _type value) + ;; While `xselect-uri-list-available-p' ensures that this target + ;; will not be reported in the TARGETS of non-drag-and-drop + ;; selections, Firefox stupidly converts to it anyway. Check that + ;; the conversion request is being made for the correct selection. + (and (eq selection 'XdndSelection) + (let ((string + (if (stringp value) + (xselect--encode-string 'TEXT + (concat (url-encode-url value) "\n")) + (when (vectorp value) + (with-temp-buffer + (cl-loop for tem across value + do (progn + (insert (url-encode-url tem)) + (insert "\n"))) + (xselect--encode-string 'TEXT (buffer-string))))))) + (cons 'text/uri-list (cdr string))))) (defun xselect-convert-to-xm-file (selection _type value) (when (and (stringp value) From 21ec6c1d5cc7b6e1858f21de62a593e25d205383 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 3 May 2023 15:02:31 +0200 Subject: [PATCH 04/19] Update to Transient v0.3.7-219-g3ded15b --- lisp/transient.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/transient.el b/lisp/transient.el index 4affc414fa6..9785e218b19 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1071,7 +1071,8 @@ example, sets a variable, use `transient-define-infix' instead. (if (and desc (or (stringp desc) (symbolp desc))) desc (plist-get args :key))))))) - (setq args (plist-put args :command `(defalias ',sym ,cmd))))) + (setq args (plist-put args :command + `(defalias ',sym ,(macroexp-quote cmd)))))) ((or (stringp car) (and car (listp car))) (let ((arg pop)) From cc090294d77c5d4047607d3234c304aaa1b0489c Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 3 May 2023 23:58:27 +0300 Subject: [PATCH 05/19] (rng-complete-tag): Add the (ignored) argument to the :company-kind function * lisp/nxml/rng-nxml.el (rng-complete-tag): Add the (ignored) argument to the :company-kind function. Fixes the "Wrong number of arguments" error reported at https://github.com/company-mode/company-mode/issues/1386. --- lisp/nxml/rng-nxml.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el index 568cf24451b..fd1f4fb904e 100644 --- a/lisp/nxml/rng-nxml.el +++ b/lisp/nxml/rng-nxml.el @@ -180,7 +180,7 @@ Validation will be enabled if `rng-nxml-auto-validate-flag' is non-nil." (insert " ")))) ((member completion extra-strings) (insert ">")))) - :company-kind ,(lambda () 'property)))))) + :company-kind ,(lambda (_) 'property)))))) (defconst rng-in-end-tag-name-regex (replace-regexp-in-string From eaf25b9c6ae4020f76a810b6920b65613ca50e5d Mon Sep 17 00:00:00 2001 From: Randy Taylor Date: Wed, 26 Apr 2023 11:15:45 -0400 Subject: [PATCH 06/19] go-ts-mode: Use iota query only if supported (Bug#63086) iota query support was added on January 5, 2022. To support older versions of the tree-sitter-go grammar (like the latest tagged version, v0.19.1, which was released on March 3, 2021), check if the query is supported before trying to use it. * lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p): New function. (go-ts-mode--font-lock-settings): Use it. --- lisp/progmodes/go-ts-mode.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 77c97ffac11..f32a2d75775 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -105,6 +105,12 @@ ">>" "%=" ">>=" "--" "!" "..." "&^" "&^=" "~") "Go operators for tree-sitter font-locking.") +(defun go-ts-mode--iota-query-supported-p () + "Returns t if the iota query is supported by the current version of +the tree-sitter-go grammar." + (ignore-errors + (or (treesit-query-string "" '((iota) @font-lock-constant-face) 'go) t))) + (defvar go-ts-mode--font-lock-settings (treesit-font-lock-rules :language 'go @@ -117,7 +123,9 @@ :language 'go :feature 'constant - '([(false) (iota) (nil) (true)] @font-lock-constant-face + `([(false) (nil) (true)] @font-lock-constant-face + ,@(when (go-ts-mode--iota-query-supported-p) + '((iota) @font-lock-constant-face)) (const_declaration (const_spec name: (identifier) @font-lock-constant-face))) From eaad302bd6f1d30bed1fbdd02e5091d13ce0c7ba Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 4 May 2023 01:39:15 +0300 Subject: [PATCH 07/19] Rename eglot-update to eglot-upgrade * doc/misc/eglot.texi (Getting the latest version): Update the reference. * lisp/progmodes/eglot.el (eglot-upgrade): Rename from 'eglot-update', as discussed on emacs-devel, in line with 'package-upgrade'. --- doc/misc/eglot.texi | 2 +- lisp/progmodes/eglot.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 542a4259d66..8ac14372e36 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1307,7 +1307,7 @@ Eglot, use @kbd{M-x package-install}. Often, a newer Eglot version exists that has fixed a longstanding bug, has more LSP features, or just better supports a particular language server. Recent Eglot versions can self-update via the command -@kbd{M-x eglot-update}. This will replace any currently installed +@kbd{M-x eglot-upgrade}. This will replace any currently installed version with the newest one available from the ELPA archives configured in @code{package-archives}. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index f005c4858e7..6d1d010eb9a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1967,7 +1967,7 @@ If it is activated, also signal textDocument/didOpen." (interactive) (info "(eglot)")) ;;;###autoload -(defun eglot-update (&rest _) "Update Eglot." +(defun eglot-upgrade (&rest _) "Update Eglot." (interactive) (with-no-warnings (require 'package) From 2901a3443c7daa15cbe01947ace3e0980e419028 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 30 Apr 2023 20:21:04 +0200 Subject: [PATCH 08/19] Prevent unnecessary modifications of 'package-vc-selected-packages' * lisp/emacs-lisp/package-vc.el (package-vc--unpack): Handle the structure of correctly, not as an alist but a list of alists. (package-vc--archive-spec-alist, package-vc--archive-spec-alists, package-vc--desc->spec, package-vc--read-archive-data, package-vc--download-and-read-archives, package-vc--unpack): Rename 'package-vc--archive-spec-alist' to 'package-vc--archive-spec-alists'. --- lisp/emacs-lisp/package-vc.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index fa9fce24acc..8f62e7d65f3 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -162,7 +162,7 @@ archive." (:vc-backend symbol))))) :version "29.1") -(defvar package-vc--archive-spec-alist nil +(defvar package-vc--archive-spec-alists nil "List of package specifications for each archive. The list maps each package name, as a string, to a plist as specified in `package-vc-selected-packages'.") @@ -194,15 +194,15 @@ name for PKG-DESC." (not (alist-get name package-vc-selected-packages nil nil #'string=))) (alist-get (intern (package-desc-archive pkg-desc)) - package-vc--archive-spec-alist) + package-vc--archive-spec-alists) ;; Consult both our local list of package specifications, as well ;; as the lists provided by the archives. (apply #'append (cons package-vc-selected-packages - (mapcar #'cdr package-vc--archive-spec-alist)))) + (mapcar #'cdr package-vc--archive-spec-alists)))) '() nil #'string=)) (defun package-vc--read-archive-data (archive) - "Update `package-vc--archive-spec-alist' for ARCHIVE. + "Update `package-vc--archive-spec-alists' for ARCHIVE. This function is meant to be used as a hook for `package-read-archive-hook'." (let ((contents-file (expand-file-name (format "archives/%s/elpa-packages.eld" archive) @@ -219,7 +219,7 @@ This function is meant to be used as a hook for `package-read-archive-hook'." (let ((spec (read (current-buffer)))) (when (eq package-vc--elpa-packages-version (plist-get (cdr spec) :version)) - (setf (alist-get (intern archive) package-vc--archive-spec-alist) + (setf (alist-get (intern archive) package-vc--archive-spec-alists) (car spec))) (setf (alist-get (intern archive) package-vc--archive-data-alist) (cdr spec)) @@ -230,7 +230,7 @@ This function is meant to be used as a hook for `package-read-archive-hook'." (defun package-vc--download-and-read-archives (&optional async) "Download specifications of all `package-archives' and read them. -Populate `package-vc--archive-spec-alist' with the result. +Populate `package-vc--archive-spec-alists' with the result. If optional argument ASYNC is non-nil, perform the downloads asynchronously." @@ -571,7 +571,7 @@ Emacs Lisp files.") (defun package-vc--unpack (pkg-desc pkg-spec &optional rev) "Install the package described by PKG-DESC. PKG-SPEC is a package specification, a property list describing -how to fetch and build the package. See `package-vc--archive-spec-alist' +how to fetch and build the package. See `package-vc--archive-spec-alists' for details. The optional argument REV specifies a specific revision to checkout. This overrides the `:branch' attribute in PKG-SPEC." (unless (eq (package-desc-kind pkg-desc) 'vc) @@ -620,7 +620,8 @@ abort installation?" name)) (throw 'done (setq lisp-dir name))))) ;; Ensure we have a copy of the package specification - (unless (equal (alist-get name (mapcar #'cdr package-vc--archive-spec-alist)) pkg-spec) + (unless (seq-some (lambda (alist) (equal (alist-get name (cdr alist)) pkg-spec)) + package-vc--archive-spec-alists) (customize-save-variable 'package-vc-selected-packages (cons (cons name pkg-spec) From 8eb6e33691d1c8e95e25e086e1b04669ea4fffdb Mon Sep 17 00:00:00 2001 From: Thuna Date: Wed, 23 Nov 2022 04:14:36 +0100 Subject: [PATCH 09/19] Fix rcirc messages printing in the wrong place * lisp/net/rcirc.el (rcirc-send-message): Print the message before sending it to the server. (rcirc-print): Get the time with subsecond precision. * lisp/calendar/parse-time.el (parse-time-string parse-iso8601-time-string): Accept optional second FORM arguments, with the same meaning as in `decode-time'. Mention as such in the docstring. (Bug#59501) Copyright-paperwork-exempt: yes --- lisp/calendar/parse-time.el | 16 ++++++++++------ lisp/net/rcirc.el | 10 +++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 1b667a6852e..a62361121fc 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -147,7 +147,7 @@ letters, digits, plus or minus signs or colons." ;;;###autoload(put 'parse-time-rules 'risky-local-variable t) ;;;###autoload -(defun parse-time-string (string) +(defun parse-time-string (string &optional form) "Parse the time in STRING into (SEC MIN HOUR DAY MON YEAR DOW DST TZ). STRING should be an ISO 8601 time string, e.g., \"2020-01-15T16:12:21-08:00\", or something resembling an RFC 822 (or later) date-time, e.g., @@ -156,9 +156,11 @@ somewhat liberal in what format it accepts, and will attempt to return a \"likely\" value even for somewhat malformed strings. The values returned are identical to those of `decode-time', but any unknown values other than DST are returned as nil, and an -unknown DST value is returned as -1." +unknown DST value is returned as -1. + +See `decode-time' for the meaning of FORM." (condition-case () - (iso8601-parse string) + (iso8601-parse string form) (wrong-type-argument (let ((time (list nil nil nil nil nil nil nil -1 nil)) (temp (parse-time-tokenize (downcase string)))) @@ -199,12 +201,14 @@ unknown DST value is returned as -1." (setf (nth (pop slots) time) new-val)))))))) time)))) -(defun parse-iso8601-time-string (date-string) +(defun parse-iso8601-time-string (date-string &optional form) "Parse an ISO 8601 time string, such as \"2020-01-15T16:12:21-08:00\". Fall back on parsing something resembling an RFC 822 (or later) date-time. This function is like `parse-time-string' except that it returns -a Lisp timestamp when successful." - (when-let ((time (parse-time-string date-string))) +a Lisp timestamp when successful. + +See `decode-time' for the meaning of FORM." + (when-let ((time (parse-time-string date-string form))) (encode-time time))) (provide 'parse-time) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 97a314eb8ab..937f4046adb 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1233,9 +1233,9 @@ If SILENT is non-nil, do not print the message in any irc buffer." (let ((response (if noticep "NOTICE" "PRIVMSG"))) (rcirc-get-buffer-create process target) (dolist (msg (rcirc-split-message message)) - (rcirc-send-string process response target : msg) (unless silent - (rcirc-print process (rcirc-nick process) response target msg))))) + (rcirc-print process (rcirc-nick process) response target msg)) + (rcirc-send-string process response target : msg)))) (defvar-local rcirc-input-ring nil "Ring object for input.") @@ -2034,7 +2034,7 @@ connection." (not (string= sender (rcirc-nick process)))) (let* ((buffer (rcirc-target-buffer process sender response target text)) (time (if-let ((time (rcirc-get-tag "time"))) - (parse-iso8601-time-string time) + (parse-iso8601-time-string time t) (current-time))) (inhibit-read-only t)) (with-current-buffer buffer @@ -2204,7 +2204,7 @@ The message is logged in `rcirc-log', and is later written to disk. PROCESS is the process object for the current connection." (let ((filename (funcall rcirc-log-filename-function process target)) (time (and-let* ((time (rcirc-get-tag "time"))) - (parse-iso8601-time-string time)))) + (parse-iso8601-time-string time t)))) (unless (null filename) (let ((cell (assoc-string filename rcirc-log-alist)) (line (concat (format-time-string rcirc-time-format time) @@ -2996,7 +2996,7 @@ If ARG is given, opens the URL in a new browser window." "Insert a timestamp." (goto-char (point-min)) (let ((time (and-let* ((time (rcirc-get-tag "time"))) - (parse-iso8601-time-string time)))) + (parse-iso8601-time-string time t)))) (insert (rcirc-facify (format-time-string rcirc-time-format time) 'rcirc-timestamp)))) From ab44c8a6f9d7926a00dd1dfe49fa8ae07b5e7030 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 1 May 2023 13:53:52 +0200 Subject: [PATCH 10/19] Fix order of rcirc-connect arguments * lisp/net/rcirc.el (rcirc): Pass SERVER-ALIAS before CLIENT-CERT. (rcirc-connect): Take SERVER-ALIAS before CLIENT-CERT. This is necessary for the 'rcirc-reconnect' trick to work that applies the contents of 'rcirc-connection-info' to 'rcirc-connect', otherwise the server alias gets lost as certfp information. This addresses a change made in b79cb838a477ee5a5c3660e81264991ff833a82f. --- lisp/net/rcirc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 937f4046adb..cf1b952086a 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -584,7 +584,7 @@ If ARG is non-nil, instead prompt for connection parameters." (condition-case nil (let ((process (rcirc-connect server port nick user-name full-name channels password encryption - client-cert server-alias))) + server-alias client-cert))) (when rcirc-display-server-buffer (pop-to-buffer-same-window (process-buffer process)))) (quit (message "Quit connecting to %s" @@ -680,7 +680,7 @@ See `rcirc-connect' for more details on these variables.") ;;;###autoload (defun rcirc-connect (server &optional port nick user-name full-name startup-channels password encryption - certfp server-alias) + server-alias certfp) "Connect to SERVER. The arguments PORT, NICK, USER-NAME, FULL-NAME, PASSWORD, ENCRYPTION, CERTFP, SERVER-ALIAS are interpreted as in From b42ccb2e5c133070c03ba8691ed8a0c6807b0da9 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 4 May 2023 12:16:57 +0200 Subject: [PATCH 11/19] ; Minor grammar fix in treesit manual. --- doc/lispref/modes.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index deaed31aed0..00298d88f43 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -4154,7 +4154,7 @@ Other keywords are optional: @end multitable Lisp programs mark patterns in @var{query} with capture names (names -that starts with @code{@@}), and tree-sitter will return matched nodes +that start with @code{@@}), and tree-sitter will return matched nodes tagged with those same capture names. For the purpose of fontification, capture names in @var{query} should be face names like @code{font-lock-keyword-face}. The captured node will be fontified From aba41d2c4bb4a47e2953231044f5a998ab37d82e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 4 May 2023 16:37:39 +0300 Subject: [PATCH 12/19] ; Minor doc cleanups in go-ts-mode.el * lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p) (go-ts-mode--other-type-node-p, go-mod-ts-mode--in-directive-p): Doc fixes. --- lisp/progmodes/go-ts-mode.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index f32a2d75775..4233b115f19 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -106,8 +106,7 @@ "Go operators for tree-sitter font-locking.") (defun go-ts-mode--iota-query-supported-p () - "Returns t if the iota query is supported by the current version of -the tree-sitter-go grammar." + "Return t if the iota query is supported by the tree-sitter-go grammar." (ignore-errors (or (treesit-query-string "" '((iota) @font-lock-constant-face) 'go) t))) @@ -296,7 +295,7 @@ Return nil if there is no name or if NODE is not a defun node." (treesit-search-subtree node "type_alias" nil nil 1))) (defun go-ts-mode--other-type-node-p (node) - "Return t if NODE is a type, other than interface, struct or alias." + "Return t if NODE is a type other than interface, struct, or alias." (and (string-equal "type_declaration" (treesit-node-type node)) (not (go-ts-mode--interface-node-p node)) @@ -325,7 +324,7 @@ Return nil if there is no name or if NODE is not a defun node." "Tree-sitter indent rules for `go-mod-ts-mode'.") (defun go-mod-ts-mode--in-directive-p () - "Return non-nil if inside a directive. + "Return non-nil if point is inside a directive. When entering an empty directive or adding a new entry to one, no node will be present meaning none of the indentation rules will match, because there is no parent to match against. This function determines From 94e984e6700c805c3aaac6f8d9c56381a8d0673a Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 4 May 2023 14:07:08 +0200 Subject: [PATCH 13/19] Make loaddefs-generate slightly more tolerant There are packages in the wild, such as vlf-20191126.2250, which have entries that are not terminated by three ';', but by two. Tolerate such entries. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Search for two ';' as a delimiter, not three. (Bug#63236) --- lisp/emacs-lisp/loaddefs-gen.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index a966b1e9f40..2a46fb7a022 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -635,9 +635,12 @@ instead of just updating them with the new/changed autoloads." (progn (goto-char (point-max)) (search-backward "\f\n" nil t)) - ;; Delete the old version of the section. + ;; Delete the old version of the section. Strictly + ;; speaking this should search for "\n\f\n;;;", but + ;; there are loaddefs files in the wild that only + ;; have two ';;'. (Bug#63236) (delete-region (match-beginning 0) - (and (search-forward "\n\f\n;;;") + (and (search-forward "\n\f\n;;") (match-beginning 0))) (forward-line -2))) (insert head) From 2f3a514b6db5e0d0453c56a4f201088ea99d5139 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 4 May 2023 22:08:44 +0800 Subject: [PATCH 14/19] Clarify documentation wrt floating point division by zero and NaN * doc/lispref/numbers.texi (Float Basics) (Arithmetic Operations): Document what happens on a VAX. Tested on NetBSD 9.3. --- doc/lispref/numbers.texi | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 9bfb771fc07..3e45aa90fda 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi @@ -219,17 +219,25 @@ creates huge integers. @cindex @acronym{IEEE} floating point Floating-point numbers are useful for representing numbers that are -not integral. The range of floating-point numbers is -the same as the range of the C data type @code{double} on the machine -you are using. On all computers supported by Emacs, this is -@acronym{IEEE} binary64 floating point format, which is standardized by -@url{https://standards.ieee.org/standard/754-2019.html,,IEEE Std 754-2019} -and is discussed further in David Goldberg's paper +not integral. The range of floating-point numbers is the same as the +range of the C data type @code{double} on the machine you are using. +On almost all computers supported by Emacs, this is @acronym{IEEE} +binary64 floating point format, which is standardized by +@url{https://standards.ieee.org/standard/754-2019.html,,IEEE Std +754-2019} and is discussed further in David Goldberg's paper ``@url{https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html, -What Every Computer Scientist Should Know About Floating-Point Arithmetic}''. -On modern platforms, floating-point operations follow the IEEE-754 -standard closely; however, results are not always rounded correctly on -some obsolescent platforms, notably 32-bit x86. +What Every Computer Scientist Should Know About Floating-Point +Arithmetic}''. On modern platforms, floating-point operations follow +the IEEE-754 standard closely; however, results are not always rounded +correctly on some systems, notably 32-bit x86. + + On some old computer systems, Emacs may not use IEEE floating-point. +We know of one such system on which Emacs runs correctly, but does not +follow IEEE-754: the VAX running NetBSD using GCC 10.4.0, where the +VAX @samp{D_Floating} format is used instead. IBM System/370-derived +mainframes and their XL/C compiler are also capable of utilizing a +hexadecimal floating point format, but Emacs has not yet been built in +such a configuration. The read syntax for floating-point numbers requires either a decimal point, an exponent, or both. Optional signs (@samp{+} or @samp{-}) @@ -262,6 +270,10 @@ two NaNs as equal when their signs and significands agree. Significands of NaNs are machine-dependent, as are the digits in their string representation. + NaNs are not available on systems which do not use IEEE +floating-point arithmetic; if the read syntax for a NaN is used on a +VAX, for example, the reader signals an error. + When NaNs and signed zeros are involved, non-numeric functions like @code{eql}, @code{equal}, @code{sxhash-eql}, @code{sxhash-equal} and @code{gethash} determine whether values are indistinguishable, not @@ -742,9 +754,10 @@ by rounding the quotient towards zero after each division. @cindex @code{arith-error} in division If you divide an integer by the integer 0, Emacs signals an -@code{arith-error} error (@pxref{Errors}). Floating-point division of -a nonzero number by zero yields either positive or negative infinity -(@pxref{Float Basics}). +@code{arith-error} error (@pxref{Errors}). On systems using IEEE-754 +floating-point, floating-point division of a nonzero number by zero +yields either positive or negative infinity (@pxref{Float Basics}); +otherwise, an @code{arith-error} is signaled as usual. @end defun @defun % dividend divisor From a2d4cd06f455e815c0c01434458b810367a66c92 Mon Sep 17 00:00:00 2001 From: Cyril Arnould Date: Wed, 3 May 2023 19:40:18 +0000 Subject: [PATCH 15/19] Improve VHDL mode highlighting * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): Differentiate between ModelSim errors, warnings, and notes when highlighting them. Add a new entry for Xilinx Vivado. (Bug#63251) Copyright-paperwork-exempt: yes --- lisp/progmodes/vhdl-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 45fd17f65c4..ee0ec63b6bc 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -286,7 +286,7 @@ Overrides local variable `indent-tabs-mode'." ;; counter_rtl.vhd(29):Conditional signal assignment line__29 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1" nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim" - ("^\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\\[[0-9]+]\\| ([^)]+)\\)? \\([^ \t\n]+\\)(\\([0-9]+\\)):" 3 4 nil) + ("^\\(?:\\(?1:ERROR\\|\\*\\* Error\\)\\|\\(?2:WARNING\\|\\*\\* Warning\\)\\|\\(?3:NOTE\\|\\*\\* Note\\)\\)[^:]*:\\( *\\[[0-9]+]\\| ([^)]+)\\)? \\(?4:[^ \t\n]+\\)(\\(?5:[0-9]+\\)):" 4 5 nil (2 . 3)) ("" 0) ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" "\\1/_primary.dat" "\\1/body.dat" downcase)) @@ -385,6 +385,13 @@ Overrides local variable `indent-tabs-mode'." nil "mkdir \\1" "./" "work/" "Makefile" "xilinx" ("^ERROR:HDLParsers:[0-9]+ - \"\\([^ \t\n]+\\)\" Line \\([0-9]+\\)\\." 1 2 nil) ("" 0) nil) + ;; Xilinx Vivado: + ;; ERROR: [VRFC 10-1412] syntax error near o_idle [test.vhd:23] + ("Xilinx Vivado" "xvhdl" "" "make" "-f \\1" + nil "mkdir \\1" "./" "work" "Makefile" "vivado" + ("^\\(?:\\(?1:ERROR\\)\\|\\(?2:WARNING\\)\\|\\(?3:INFO\\)\\): \\(.+\\) \\[\\(?4:[^ \t\n]+\\):\\(?5:[0-9]+\\)\\]" 4 5 nil (2 . 3)) ("" 0) + ("\\1/entity" "\\2/\\1" "\\1/configuration" + "\\1/package" "\\1/body" downcase)) ) "List of available VHDL compilers and their properties. Each list entry specifies the following items for a compiler: From b1bda8228e5788391cefbb4721af24f5713a0e37 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 5 May 2023 14:13:37 +0800 Subject: [PATCH 16/19] More fixes for NetBSD/vax * src/sysdep.c (init_signals) [__vax__]: Treat SIGILL as a floating point error on VAXen. Otherwise, (log 0.0) crashes Emacs. --- src/sysdep.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sysdep.c b/src/sysdep.c index ce6a20f5302..7bac3d8935a 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2005,7 +2005,9 @@ init_signals (void) signal (SIGPIPE, SIG_IGN); sigaction (SIGQUIT, &process_fatal_action, 0); +#ifndef __vax__ sigaction (SIGILL, &thread_fatal_action, 0); +#endif /* __vax__ */ sigaction (SIGTRAP, &thread_fatal_action, 0); /* Typically SIGFPE is thread-specific and is fatal, like SIGILL. @@ -2018,6 +2020,11 @@ init_signals (void) { emacs_sigaction_init (&action, deliver_arith_signal); sigaction (SIGFPE, &action, 0); +#ifdef __vax__ + /* NetBSD/vax generates SIGILL upon some floating point errors, + such as taking the log of 0.0. */ + sigaction (SIGILL, &action, 0); +#endif /* __vax__ */ } #ifdef SIGUSR1 From b4e90070f965316ba647dde7a5d37821e4f4c793 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 5 May 2023 10:08:59 +0300 Subject: [PATCH 17/19] Fix arguments of xml.c functions as displayed in Help buffers * lisp/subr.el (libxml-parse-xml-region) (libxml-parse-html-region): Adjust advertised-calling-convention to the changes in commit cc33c6cf3a. (Bug#63291) --- lisp/subr.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index d4428aef765..54b92fc8607 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1848,8 +1848,8 @@ be a list of the form returned by `event-start' and `event-end'." (set-advertised-calling-convention 'unintern '(name obarray) "23.3") (set-advertised-calling-convention 'indirect-function '(object) "25.1") (set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3") -(set-advertised-calling-convention 'libxml-parse-xml-region '(start end &optional base-url) "27.1") -(set-advertised-calling-convention 'libxml-parse-html-region '(start end &optional base-url) "27.1") +(set-advertised-calling-convention 'libxml-parse-xml-region '(&optional start end base-url) "27.1") +(set-advertised-calling-convention 'libxml-parse-html-region '(&optional start end base-url) "27.1") (set-advertised-calling-convention 'time-convert '(time form) "29.1") ;;;; Obsolescence declarations for variables, and aliases. From c0ab4e9ca9326c472ff1d9d01a0e3966f20fda27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 5 May 2023 14:51:09 +0100 Subject: [PATCH 18/19] Eglot: re-rename eglot-upgrade to eglot-upgrade-eglot * doc/misc/eglot.texi (Getting the latest version): Mention eglot-upgrade-eglot. * etc/EGLOT-NEWS: Mention eglot-upgrade-eglot. * lisp/progmodes/eglot.el (eglot-upgrade-eglot): Rename from eglot-update. (eglot-update): New compatibility alias. --- doc/misc/eglot.texi | 4 ++-- etc/EGLOT-NEWS | 9 ++++++++- lisp/progmodes/eglot.el | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 8ac14372e36..962e6c914ce 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1307,8 +1307,8 @@ Eglot, use @kbd{M-x package-install}. Often, a newer Eglot version exists that has fixed a longstanding bug, has more LSP features, or just better supports a particular language server. Recent Eglot versions can self-update via the command -@kbd{M-x eglot-upgrade}. This will replace any currently installed -version with the newest one available from the ELPA archives +@kbd{M-x eglot-upgrade-eglot}. This will replace any currently +installed version with the newest one available from the ELPA archives configured in @code{package-archives}. You can also update Eglot through other methods, such as diff --git a/etc/EGLOT-NEWS b/etc/EGLOT-NEWS index d2d84c5ff9e..fd0d9a24568 100644 --- a/etc/EGLOT-NEWS +++ b/etc/EGLOT-NEWS @@ -18,7 +18,14 @@ That is, to look up issue github#1234, go to https://github.com/joaotavora/eglot/issues/1234. -* Changes in Eglot bundled with Emacs 29 +* Changes in Eglot 1.12.29 (Eglot bundled with Emacs 29.1) + +** Eglot can upgrade itself to the latest version. + +The new command 'eglot-upgrade-eglot' works around behaviour in the +existing 'package-install' command and the new 'package-upgrade' +command which would prevent the user from easily grabbing the latest +version as usual. ** LSP inlay hints are now supported. Inlay hints are small text annotations not unlike diagnostics, but diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 6d1d010eb9a..df8f5f64829 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1967,7 +1967,7 @@ If it is activated, also signal textDocument/didOpen." (interactive) (info "(eglot)")) ;;;###autoload -(defun eglot-upgrade (&rest _) "Update Eglot." +(defun eglot-upgrade-eglot (&rest _) "Update Eglot to latest version." (interactive) (with-no-warnings (require 'package) @@ -1976,6 +1976,9 @@ If it is activated, also signal textDocument/didOpen." (package-delete existing t)) (package-install (cadr (assoc 'eglot package-archive-contents))))) +;;;###autoload +(define-obsolete-function-alias 'eglot-update 'eglot-upgrade-eglot "29.1") + (easy-menu-define eglot-menu nil "Eglot" `("Eglot" ;; Commands for getting information and customization. From 79a886ba36837c0e13d83172ab33c1c2680c6e62 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 6 May 2023 03:32:08 +0300 Subject: [PATCH 19/19] (package-upgrade): Don't remove the package from 'package-selected-packages' * lisp/emacs-lisp/package.el (package-upgrade): Don't remove the package from 'package-selected-packages', fixing the problem described in https://debbugs.gnu.org/62720#718. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0919ce34448..bbe2b8bb4af 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2282,7 +2282,7 @@ newer version from ELPA by using `\\\\[package-menu-mark- (pkg-desc (cadr (assq package package-alist)))) (if (package-vc-p pkg-desc) (package-vc-upgrade pkg-desc) - (package-delete pkg-desc 'force) + (package-delete pkg-desc 'force 'dont-unselect) (package-install package 'dont-select)))) (defun package--upgradeable-packages ()