From b74ac4af9408230645f1edb56c410b7a80bb41d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Mon, 13 Jan 2025 12:24:40 +0100 Subject: [PATCH 1/6] ; cperl-mode.el: Allow bare $ in a signature (Bug#74245) * lisp/progmodes/cperl-mode.el (cperl--signature-rx): Allow bare sigils for unused parameters in signatures. (cperl-find-pods-heres): Avoid $) at the end of a signature being treated as the punctuation variable $) by treating this dollar as punctuation * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-signature-rx): Add ($first,$) as a valid signature, remove ($) from the list of invalid signatures. --- lisp/progmodes/cperl-mode.el | 26 +++++++++++++++++-------- test/lisp/progmodes/cperl-mode-tests.el | 3 +-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ed8527f0039..38015ed2acd 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1352,13 +1352,14 @@ prototypes from signatures.") (optional (sequence (0+ (sequence ,cperl--ws*-rx - ,cperl--basic-scalar-rx + (or ,cperl--basic-scalar-rx "$") ,cperl--ws*-rx ",")) ,cperl--ws*-rx (or ,cperl--basic-scalar-rx ,cperl--basic-array-rx - ,cperl--basic-hash-rx))) + ,cperl--basic-hash-rx + "$" "%" "@"))) (optional (sequence ,cperl--ws*-rx) "," ) ,cperl--ws*-rx ")") @@ -4355,8 +4356,8 @@ recursive calls in starting lines of here-documents." (opt (group (eval cperl--normal-identifier-rx))) ; #13 (eval cperl--ws*-rx) (group (or (group (eval cperl--prototype-rx)) ; #14,#15 - ;; (group (eval cperl--signature-rx)) ; #16 - (group unmatchable) ; #16 + (group (eval cperl--signature-rx)) ; #16 + ;; (group unmatchable) ; #16 (group (or anything buffer-end)))))) ; #17 "\\|" ;; -------- weird variables, capture group 18 @@ -5251,7 +5252,7 @@ recursive calls in starting lines of here-documents." ;; match-string 13: Name of the subroutine (optional) ;; match-string 14: Indicator for proto/attr/signature ;; match-string 15: Prototype - ;; match-string 16: unused + ;; match-string 16: Subroutine signature ;; match-string 17: Distinguish declaration/definition (setq b1 (match-beginning 13) e1 (match-end 13)) (if (memq (char-after (1- b)) @@ -5267,9 +5268,18 @@ recursive calls in starting lines of here-documents." (forward-comment (buffer-size)) (cperl-find-sub-attrs st-l b1 e1 b)) ;; treat attributes without prototype and incomplete stuff - (goto-char (match-beginning 17)) - (cperl-find-sub-attrs st-l b1 e1 b)))) - ;; 1+6+2+1+1+6+1=18 extra () before this: + (if (match-beginning 16) ; a complete subroutine signature + ;; A signature ending in "$)" must not be + ;; mistaken as the punctuation variable $) which + ;; messes up balance of parens (Bug#74245). + (progn + (when (= (char-after (- (match-end 16) 2)) ?$) + (put-text-property (- (match-end 16) 2) (1- (match-end 16)) + 'syntax-table cperl-st-punct)) + (goto-char (match-end 16))) + (goto-char (match-beginning 17)) + (cperl-find-sub-attrs st-l b1 e1 b))))) + ;; 1+6+2+1+1+6+1=18 extra () before this: ;; "\\(\\ Date: Thu, 7 Nov 2024 19:22:21 +0000 Subject: [PATCH 2/6] ; cperl-mode.el: Add a test for Bug#74245 * test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl: New test data. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-74245): Verify that a bare \"$\" can appear at the end of a subroutine signature. --- .../cperl-mode-resources/cperl-bug-74245.pl | 16 ++++++++++++++++ test/lisp/progmodes/cperl-mode-tests.el | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl new file mode 100644 index 00000000000..44d1e49bd36 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl @@ -0,0 +1,16 @@ +# This resource file can be run with cperl--run-testcases from +# cperl-tests.el and works with both perl-mode and cperl-mode. + +# -------- signature where last parameter is ignored: input ------- +package P { +use v5.36; +sub ignore ($first, $) {} +ignore(qw(first second)); +} +# -------- signature where last parameter is ignored: expected output ------- +package P { + use v5.36; + sub ignore ($first, $) {} + ignore(qw(first second)); +} +# -------- signature where last parameter is ignored: end ------- diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 958ffe38a8b..e54790256ab 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -1589,6 +1589,15 @@ and the slash, then we have a division." (should (equal (nth 8 (cperl-test-ppss code "/")) 9))) ) +(ert-deftest cperl-test-bug-74245 () + "Verify that a bare \"$\" can appear at the end of a subroutine signature. +It must not be mistaken for \"$)\"." + (cperl--run-test-cases + (ert-resource-file "cperl-bug-74245.pl") + (while (null (eobp)) + (cperl-indent-command) + (forward-line 1)))) + (ert-deftest test-indentation () (ert-test-erts-file (ert-resource-file "cperl-indents.erts"))) From 6a864ef8f39b8ec25c33479a8ac57b62fd10cfe7 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 14 Jan 2025 10:25:18 +0100 Subject: [PATCH 3/6] Add smtpmail cross-reference to 'auth-sources'. * doc/misc/smtpmail.texi (Authentication): Add cross-reference to 'auth-sources'. --- doc/misc/smtpmail.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi index 5f99acaf7d8..12b4ea41810 100644 --- a/doc/misc/smtpmail.texi +++ b/doc/misc/smtpmail.texi @@ -225,7 +225,8 @@ send mail via a server and the SMTP server reports back that it requires authentication, Emacs (version 24.1 and later) prompts you for the user name and password to use, and then offers to save the information. By default, Emacs stores authentication information in a -file @file{~/.authinfo}. +file @file{~/.authinfo}, but this can be changed by customizing +@code{auth-sources} (@pxref{Authentication, Persisting Authinfo,,emacs}). @vindex smtpmail-servers-requiring-authorization Some SMTP servers may bandwidth-limit (or deny) requests from clients From b981889e9ee0a37f1bc8e2c9b90a5d154c1d032e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Tue, 14 Jan 2025 12:17:47 +0100 Subject: [PATCH 4/6] ; cperl-mode-tests.el: Don't run the newest test in perl-mode * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-74245): Skip if not in cperl-mode --- test/lisp/progmodes/cperl-mode-tests.el | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index e54790256ab..dab4ad5ecf5 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -1592,6 +1592,7 @@ and the slash, then we have a division." (ert-deftest cperl-test-bug-74245 () "Verify that a bare \"$\" can appear at the end of a subroutine signature. It must not be mistaken for \"$)\"." + (skip-unless (eq cperl-test-mode #'cperl-mode)) (cperl--run-test-cases (ert-resource-file "cperl-bug-74245.pl") (while (null (eobp)) From 45ec5865aa78d098c8842e41f360947b1b030393 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 17 Jan 2025 17:22:45 +0100 Subject: [PATCH 5/6] ; * etc/NEWS: Tweak wording of NSM items. --- etc/NEWS | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 31a0c4938ad..ce5290171a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -172,17 +172,17 @@ the default one. It is reimplemented in native code, reducing GC churn. To undo this change, set 'fast-read-process-output' to nil. +++ -** The Network Security Manager now warns about 3DES by default. +** Network Security Manager now warns about 3DES by default. This cypher is no longer recommended owing to a major vulnerability disclosed in 2016, and its small 112 bit key size. Emacs now warns about its use also when 'network-security-level' is set to 'medium' (the default). See 'network-security-protocol-checks'. --- -** The Network Security Manager now warns about <2048 bits in DH key exchange. -Emacs used to warn for Diffie-Hellman key exchanges with prime numbers -smaller than 1024 bits. Since more servers now support it, this -number has been bumped to 2048 bits. +** Network Security Manager now warns about <2048 bits in DH key exchange. +Emacs used to warn for ephemeral Diffie-Hellman (DHE) key exchanges with +prime numbers smaller than 1024 bits. Since more servers now support +it, this number has been bumped to 2048 bits. +++ ** URL now never sends user email addresses in HTTP requests. From 853719c4c23a4ae0802a6eed3f855dc88381997f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 18 Jan 2025 12:56:48 +0200 Subject: [PATCH 6/6] ; * lisp/net/eww.el (eww-download): Doc fix (bug#75585) --- lisp/net/eww.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index f1585b0bb5a..c3e927b74a6 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2162,8 +2162,16 @@ Differences in #targets are ignored." (kill-new (plist-get eww-data :url))) (defun eww-download () - "Download URL to `eww-download-directory'. -Use link at point if there is one, else the current page's URL." + "Download a Web page to `eww-download-directory'. +Use link at point if there is one, else the current page's URL. +This command downloads the page to the download directory, under +a file name generated from the last portion of the page's URL, +after the last slash. (If URL ends in a slash, the page will be +saved under the name \"!\".) +If there's already a file by that name in the download directory, +this command will modify the name to make it unique. +The command shows in the echo-area the actual file name where the +page was saved." (interactive nil eww-mode) (let ((dir (if (stringp eww-download-directory) eww-download-directory