commit 4d21dff571477ca0308293815f3025897bc089a4 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sun Jul 7 19:43:31 2024 +0200 Adapt Tramp version * doc/misc/trampver.texi: * lisp/net/trampver.el (tramp-version): Adapt Tramp versions. diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index 521fe592e74..b17dde18656 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -7,7 +7,7 @@ @c In the Tramp GIT, the version number and the bug report address @c are auto-frobbed from configure.ac. -@set trampver 2.7.1 +@set trampver 2.7.2-pre @set trampurl https://www.gnu.org/software/tramp/ @set tramp-bug-report-address tramp-devel@@gnu.org @set emacsver 27.1 diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 8bbfddeaab3..8b2700a0d96 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.7.1 +;; Version: 2.7.2-pre ;; Package-Requires: ((emacs "27.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.7.1" +(defconst tramp-version "2.7.2-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -78,7 +78,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-version-lessp emacs-version "27.1")) "ok" - (format "Tramp 2.7.1 is not fit for %s" + (format "Tramp 2.7.2-pre is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) @@ -107,7 +107,7 @@ ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2") ("2.5.4" . "28.3") ("2.6.0.29.1" . "29.1") ("2.6.2.29.2" . "29.2") ("2.6.3-pre" . "29.3") ("2.6.3" . "29.4") - ("2.7.1" . "30.1"))) + ("2.7.1.30.1" . "30.1"))) (add-hook 'tramp-unload-hook (lambda () commit 4871ccd41670debd47238ec0d3bbdef064e517e6 Author: Stefan Kangas Date: Sun Jul 7 16:18:07 2024 +0200 Mark `browse-url-default-scheme` as :risky * lisp/net/browse-url.el (browse-url-default-scheme): Mark as risky file local variable. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index f22aa19f5e3..d3473e8877d 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -683,6 +683,7 @@ websites are increasingly rare, but they do still exist." :type '(choice (const :tag "HTTP" "http") (const :tag "HTTPS" "https") (string :tag "Something else" "https")) + :risky t :version "29.1") (defun browse-url-url-at-point () commit 44a3b21d7b8fad3b3ef42bf233ec882856b81177 Author: Stefan Kangas Date: Sun Jul 7 13:40:59 2024 +0200 Make `checkdoc-verb-check-experimental-flag` default to nil This user option leads to a very large amount of false positives in practice. In my personal experience, almost all occurrences that are flagged are false positives. Flipping the default to something less intrusive should hopefully encourage more use of checkdoc. * lisp/emacs-lisp/checkdoc.el (checkdoc-verb-check-experimental-flag): Switch the default to nil. diff --git a/etc/NEWS b/etc/NEWS index 0c9eb82518a..2718765fe16 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -95,6 +95,11 @@ backend. This affects calls to 'warn', 'lwarn', 'display-warning', and 'message-box'. +--- +*** The default of 'checkdoc-verb-check-experimental-flag' is now nil. +In most cases, having it enabled leads to a large amount of false +positives. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 6355569b16f..de6f0258e97 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -308,11 +308,12 @@ problem discovered. This is useful for adding additional checks.") (defvar checkdoc-diagnostic-buffer "*Style Warnings*" "Name of warning message buffer.") -(defcustom checkdoc-verb-check-experimental-flag t +(defcustom checkdoc-verb-check-experimental-flag nil "Non-nil means to attempt to check the voice of the doc string. This check keys off some words which are commonly misused. See the variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own." - :type 'boolean) + :type 'boolean + :version "31.1") ;;;###autoload(put 'checkdoc-verb-check-experimental-flag 'safe-local-variable #'booleanp) (defvar checkdoc-generate-compile-warnings-flag nil @@ -346,6 +347,7 @@ See Info node `(elisp) Documentation Tips' for background." ;; (setq checkdoc--argument-missing-flag nil) ; optional ;; (setq checkdoc--disambiguate-symbol-flag nil) ; optional ;; (setq checkdoc--interactive-docstring-flag nil) ; optional +;; (setq checkdoc-permit-comma-termination-flag t) ; optional ;; (setq checkdoc-verb-check-experimental-flag nil) ;; Then use `M-x find-dired' ("-name '*.el'") and `M-x checkdoc-dired' commit e738c387dac674092eab4b5b32efd9fb6726dee6 Author: Stefan Kangas Date: Sun Jul 7 13:37:55 2024 +0200 checkdoc: Flag formatting mistakes in warnings * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-next-string) (checkdoc-message-text-engine): Flag formatting mistakes in warnings. (checkdoc--warning-function-re): New variable. diff --git a/etc/NEWS b/etc/NEWS index ba58fa7b319..0c9eb82518a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -90,6 +90,11 @@ those versions can't install packages where that line is missing. This change affects both 'M-x checkdoc' and the corresponding flymake backend. +--- +*** Checkdoc will now flag incorrect formatting in warnings. +This affects calls to 'warn', 'lwarn', 'display-warning', and +'message-box'. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 6eb9fc058f6..6355569b16f 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2547,6 +2547,11 @@ The default boundary is the entire buffer." (setq e (checkdoc-message-text-engine type))) e)) +(defvar checkdoc--warning-function-re + (rx (or "display-warning" "org-display-warning" + "warn" "lwarn" + "message-box"))) + (defun checkdoc-message-text-next-string (end) "Move cursor to the next checkable message string after point. Return the message classification. @@ -2559,6 +2564,7 @@ Argument END is the maximum bounds to search in." (group (or (seq (* (or wordchar (syntax symbol))) "error") + (regexp checkdoc--warning-function-re) (seq (* (or wordchar (syntax symbol))) (or "y-or-n-p" "yes-or-no-p") (? "-with-timeout")) @@ -2566,8 +2572,13 @@ Argument END is the maximum bounds to search in." (+ (any "\n\t "))) end t)) (let* ((fn (match-string 1)) - (type (cond ((string-match "error" fn) - 'error) + (type (cond ((string-match "error" fn) + 'error) + ((string-match (rx bos + (regexp checkdoc--warning-function-re) + eos) + fn) + 'warning) (t 'y-or-n-p)))) (if (string-match "checkdoc-autofix-ask-replace" fn) (progn (forward-sexp 2) @@ -2645,6 +2656,10 @@ Argument TYPE specifies the type of question, such as `error' or `y-or-n-p'." (setq type (cond ((looking-at "(error") 'error) + ((looking-at + (rx "(" (regexp checkdoc--warning-function-re) + (syntax whitespace))) + 'warning) (t 'y-or-n-p))))) (let ((case-fold-search nil)) (or commit 1883603dfc52f71aa515c60103967938a6eec002 Author: Stefan Kangas Date: Sun Jul 7 12:58:39 2024 +0200 checkdoc: Minor code cleanups * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-search): Use 'while-let'. (checkdoc-message-text-engine): Use 'when' and 'unless'. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 43584b19181..6eb9fc058f6 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2540,11 +2540,10 @@ Code:, and others referenced in the style guide." "Search between BEG and END for a style error with message text. Optional arguments BEG and END represent the boundary of the check. The default boundary is the entire buffer." - (let ((e nil) - (type nil)) + (let ((e nil)) (if (not (or beg end)) (setq beg (point-min) end (point-max))) (goto-char beg) - (while (setq type (checkdoc-message-text-next-string end)) + (while-let ((type (checkdoc-message-text-next-string end))) (setq e (checkdoc-message-text-engine type))) e)) @@ -2638,30 +2637,29 @@ should not end with a period, and should start with a capital letter. The function `y-or-n-p' has similar constraints. Argument TYPE specifies the type of question, such as `error' or `y-or-n-p'." ;; If type is nil, then attempt to derive it. - (if (not type) - (save-excursion - (up-list -1) - (if (looking-at "(format") - (up-list -1)) - (setq type - (cond ((looking-at "(error") - 'error) - (t 'y-or-n-p))))) + (unless type + (save-excursion + (up-list -1) + (when (looking-at "(format") + (up-list -1)) + (setq type + (cond ((looking-at "(error") + 'error) + (t 'y-or-n-p))))) (let ((case-fold-search nil)) (or ;; From the documentation of the symbol `error': ;; In Emacs, the convention is that error messages start with a capital ;; letter but *do not* end with a period. Please follow this convention ;; for the sake of consistency. - (if (and (checkdoc--error-bad-format-p) - (not (checkdoc-autofix-ask-replace - (match-beginning 1) (match-end 1) - "Capitalize your message text?" - (capitalize (match-string 1)) - t))) - (checkdoc-create-error "Messages should start with a capital letter" - (match-beginning 1) (match-end 1)) - nil) + (when (and (checkdoc--error-bad-format-p) + (not (checkdoc-autofix-ask-replace + (match-beginning 1) (match-end 1) + "Capitalize your message text?" + (capitalize (match-string 1)) + t))) + (checkdoc-create-error "Messages should start with a capital letter" + (match-beginning 1) (match-end 1))) ;; In general, sentences should have two spaces after the period. (checkdoc-sentencespace-region-engine (point) (save-excursion (forward-sexp 1) @@ -2671,19 +2669,18 @@ Argument TYPE specifies the type of question, such as `error' or `y-or-n-p'." (save-excursion (forward-sexp 1) (point))) ;; Here are message type specific questions. - (if (and (eq type 'error) - (save-excursion (forward-sexp 1) - (forward-char -2) - (looking-at "\\.")) - (not (checkdoc-autofix-ask-replace (match-beginning 0) - (match-end 0) - "Remove period from error?" - "" - t))) - (checkdoc-create-error - "Error messages should *not* end with a period" - (match-beginning 0) (match-end 0)) - nil) + (when (and (eq type 'error) + (save-excursion (forward-sexp 1) + (forward-char -2) + (looking-at "\\.")) + (not (checkdoc-autofix-ask-replace (match-beginning 0) + (match-end 0) + "Remove period from error?" + "" + t))) + (checkdoc-create-error + "Error messages should *not* end with a period" + (match-beginning 0) (match-end 0))) ;; From `(elisp) Programming Tips': "A question asked in the ;; minibuffer with `yes-or-no-p' or `y-or-n-p' should start with ;; a capital letter and end with '?'." commit 3e999f70a4d0f1ebdb45da305207e2b45f88059f Author: Stefan Kangas Date: Sun Jul 7 12:52:56 2024 +0200 ; checkdoc: More interactive mode tagging diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index a329638ed1c..43584b19181 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1085,7 +1085,7 @@ Optional argument TAKE-NOTES causes all errors to be logged." Evaluation is done first so the form will be read before the documentation is checked. If there is a documentation error, then the display of what was evaluated will be overwritten by the diagnostic message." - (interactive) + (interactive nil emacs-lisp-mode) (call-interactively #'eval-defun) (checkdoc-defun)) @@ -1096,7 +1096,7 @@ Call `error' if the doc string has problems. If NO-ERROR is non-nil, then do not call error, but call `message' instead. If the doc string passes the test, then check the function for rogue white space at the end of each line." - (interactive) + (interactive nil emacs-lisp-mode) (save-excursion (beginning-of-defun) (when (checkdoc--next-docstring) @@ -2836,7 +2836,7 @@ function called to create the messages." ;;;###autoload (defun checkdoc-package-keywords () "Find package keywords that aren't in `finder-known-keywords'." - (interactive) + (interactive nil emacs-lisp-mode) (require 'finder) (let ((unrecognized-keys (cl-remove-if