commit b730c4acfcff20047a5c574fbf36c5ef1271b902 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Oct 19 09:40:53 2024 +0300 Fix skeleton-related errors in sgml-mode.el * lisp/textmodes/sgml-mode.el (sgml-mode-facemenu-add-face-function) (sgml-attributes): Require 'skeleton before using its symbols. (Bug#53710) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index f126df8955a..ee585896946 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -533,6 +533,7 @@ an optional alist of possible values." "Add \"face\" tags with `facemenu-keymap' commands." (let ((tag-face (ensure-list (cdr (assq face sgml-face-tag-alist))))) (cond (tag-face + (require 'skeleton) (setq tag-face (funcall skeleton-transformation-function tag-face)) (setq facemenu-end-add-face (mapconcat (lambda (f) (concat "")) (reverse tag-face))) @@ -851,6 +852,7 @@ If QUIET, do not print a message when there are no attributes for TAG." (setq alist (cons '("class") alist))) (unless (assoc-string "id" alist) (setq alist (cons '("id") alist)))) + (require 'skeleton) (if (stringp (car alist)) (progn (insert (if (eq (preceding-char) ?\s) "" ?\s) commit 1854f2751e3f73e1e5f12f6de993b6357de1766b Author: F. Jason Park Date: Mon Oct 14 19:32:16 2024 -0700 Don't autoload erc-modules * doc/misc/erc.texi (Modules): Recommend using `describe-variable' instead of `customize-option' because the latter needs the symbol to be loaded. * lisp/erc/erc.el (erc-modules): Remove autoload cookie because it caused customizations for this option to load the main library. This reverts the thrust of bb894845 "Teach customize-option about erc-modules", which was added in ERC 5.6 and Emacs 30. The motivation for the original offending change was to allow new users to run M-x customize-option RET erc-modules RET immediately after startup instead of M-x customize-group RET, followed by an I-search. (Bug#73812) diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 939d93d6aa8..a3802c8c6bf 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -411,8 +411,9 @@ Kill current input line using @code{erc-bol} followed by @code{kill-line}. One way to add functionality to ERC is to customize which of its many modules are loaded. -There is a spiffy customize interface, which may be reached by typing -@kbd{M-x customize-option @key{RET} erc-modules @key{RET}}. When +You can do this by typing @kbd{C-h v erc-modules @key{RET}} and clicking +@samp{customize} near the bottom of the resulting help buffer, where it +says ``You can @emph{customize} this variable.'' When removing a module outside of Customize, you may wish to ensure it's disabled by invoking its associated minor-mode toggle with a nonpositive prefix argument, for example, @kbd{C-u - M-x diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 63aeaea9c46..426b29f8e80 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2267,8 +2267,6 @@ buffer rather than a server buffer.") (cl-pushnew mod (if (get mod 'erc--module) built-in third-party))) `(,@(sort built-in #'string-lessp) ,@(nreverse third-party)))) -;;;###autoload(custom-autoload 'erc-modules "erc") - (defcustom erc-modules '( autojoin button completion fill imenu irccontrols list match menu move-to-prompt netsplit networks readonly ring stamp track) commit be3318baddbcb3ff607c784a14c1f21a70e392de Author: F. Jason Park Date: Sun Oct 13 22:45:05 2024 -0700 Move experimental module querypoll to erc-notify * etc/ERC-NEWS: Announce migration of misplaced `querypoll' module from erc-goodies.el to erc-notify.el. * lisp/erc/erc-goodies.el: Move all definitions associated with experimental module `querypoll' to erc-notify. * lisp/erc/erc-notify.el (erc--querypoll-ring) (erc--querypoll-timer, erc-querypoll-exclude-regexp) (erc-querypoll-mode, erc-querypoll-enable, erc-querypoll-disable) (erc--queries-current-p, erc-querypoll-period-params) (erc--querypoll-compute-period, erc--querypoll-target-in-chan-p) (erc--querypoll-get-length, erc--querypoll-get-next) (erc--querypoll-subscribe, erc--querypoll-on-352) (erc--querypoll-send): Move here from erc-goodies. * test/lisp/erc/erc-goodies-tests.el (erc--querypoll-compute-period) (erc--querypoll-target-in-chan-p, erc--querypoll-get-length) (erc--querypoll-get-next): Move to new file erc-notify-tests.el. * test/lisp/erc/erc-notify-tests.el: New file. The `querypoll' module was first introduced as part of bug#70928 in ERC 5.6. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 39403c17486..3970f67d725 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -55,6 +55,13 @@ indicator stick with the most recent speaker's face, even when they're monologuing, instead of alternating between it and the highest ranked 'erc-track-faces-normal-list' member in a given message. +** Module 'querypoll' has left 'goodies' and moved in with 'notify'. +The 'querypoll' module was initially placed in 'erc-goodies' even though +a far more sensible home existed in 'erc-notify'. Given the similarity +of concerns and the newer module's "experimental" status, the migration +was deemed worth any potential disruption, despite this being a point +release. ERC appreciates your understanding in this matter. + * Changes in ERC 5.6 diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 38c2918af8f..93d0dc6fd0e 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -1150,195 +1150,6 @@ servers. If called from a program, PROC specifies the server process." (multi-occur (erc-buffer-list nil proc) string)) -;;;; querypoll - -(declare-function ring-empty-p "ring" (ring)) -(declare-function ring-insert "ring" (ring item)) -(declare-function ring-insert+extend "ring" (ring item)) -(declare-function ring-length "ring" (ring)) -(declare-function ring-member "ring" (ring item)) -(declare-function ring-ref "ring" (ring index)) -(declare-function ring-remove "ring" (ring &optional index)) - -(defvar-local erc--querypoll-ring nil) -(defvar-local erc--querypoll-timer nil) - -(defcustom erc-querypoll-exclude-regexp - (rx bot (or (: "*" (+ nonl)) (: (+ (in "A-Za-z")) "Serv")) eot) - "Pattern to skip polling for bots and services you regularly query." - :group 'erc - :package-version '(ERC . "5.6") - :type 'regexp) - -;;;###autoload(autoload 'erc-querypoll-mode "erc-goodies" nil t) -(define-erc-module querypoll nil - "Send periodic \"WHO\" requests for each query buffer. -Omit query participants who are currently present in some channel. -Instead of announcing arrivals and departures, rely on other modules, -like `nickbar', to provide UI feedback when changes occur. - -Once ERC implements the `monitor' extension, this module will serve as -an optional fallback for keeping query-participant rolls up to date on -servers that lack support or are stingy with their allotments. Until -such time, this module should be considered experimental. - -This is a local ERC module, so selectively polling only a subset of -query targets is possible but cumbersome. To do so, ensure -`erc-querypoll-mode' is enabled in the server buffer, and then toggle it -as appropriate in desired query buffers. To stop polling for the -current connection, toggle off the command \\[erc-querypoll-mode] from a -server buffer, or run \\`M-x C-u erc-querypoll-disable RET' from a -target buffer." - ((if erc--target - (if (erc-query-buffer-p) - (progn ; accommodate those who eschew `erc-modules' - (erc-with-server-buffer - (unless erc-querypoll-mode - (erc-querypoll-mode +1))) - (erc--querypoll-subscribe (current-buffer))) - (erc-querypoll-mode -1)) - (cl-assert (not erc--decouple-query-and-channel-membership-p)) - (setq-local erc--querypoll-ring (make-ring 5)) - (erc-with-all-buffers-of-server erc-server-process nil - (unless erc-querypoll-mode - (erc-querypoll-mode +1))))) - ((when erc--querypoll-timer - (cancel-timer erc--querypoll-timer)) - (if erc--target - (when-let (((erc-query-buffer-p)) - (ring (erc-with-server-buffer erc--querypoll-ring)) - (index (ring-member ring (current-buffer))) - ((not (erc--querypoll-target-in-chan-p (current-buffer))))) - (ring-remove ring index) - (unless (erc-current-nick-p (erc-target)) - (erc-remove-current-channel-member (erc-target)))) - (erc-with-all-buffers-of-server erc-server-process #'erc-query-buffer-p - (erc-querypoll-mode -1))) - (kill-local-variable 'erc--querypoll-ring) - (kill-local-variable 'erc--querypoll-timer)) - 'local) - -(cl-defmethod erc--queries-current-p (&context (erc-querypoll-mode (eql t))) t) - -(defvar erc-querypoll-period-params '(10 10 1) - "Parameters affecting the delay with respect to the number of buffers. -The elements represent some parameters of an exponential decay function, -a(e)^{-x/b}+c. The first number (a) affects the overall scaling. A -higher value means longer delays for all query buffers relative to queue -length. The second number (b) determines how quickly the delay -decreases as the queue length increases. Larger values make the delay -taper off more gradually. The last number (c) sets the minimum delay -between updates regardless of queue length.") - -(defun erc--querypoll-compute-period (queue-size) - "Calculate delay based on QUEUE-SIZE." - (let ((scale (nth 0 erc-querypoll-period-params)) - (rate (* 1.0 (nth 1 erc-querypoll-period-params))) - (min (nth 2 erc-querypoll-period-params))) - (+ (* scale (exp (/ (- queue-size) rate))) min))) - -(defun erc--querypoll-target-in-chan-p (buffer) - "Determine whether buffer's target, as a user, is joined to any channels." - (and-let* - ((target (erc--target-string (buffer-local-value 'erc--target buffer))) - (user (erc-get-server-user target)) - (buffers (erc-server-user-buffers user)) - ((seq-some #'erc-channel-p buffers))))) - -(defun erc--querypoll-get-length (ring) - "Return the effective length of RING, discounting chan members." - (let ((count 0)) - (dotimes (i (ring-length ring)) - (unless (erc--querypoll-target-in-chan-p (ring-ref ring i)) - (cl-incf count 1))) - count)) - -(defun erc--querypoll-get-next (ring) - (let ((n (ring-length ring))) - (catch 'found - (while (natnump (cl-decf n)) - (when-let ((buffer (ring-remove ring)) - ((buffer-live-p buffer))) - ;; Push back buffers for users joined to some chan. - (if (erc--querypoll-target-in-chan-p buffer) - (ring-insert ring buffer) - (throw 'found buffer))))))) - -(defun erc--querypoll-subscribe (query-buffer &optional penalty) - "Add QUERY-BUFFER to FIFO and ensure timer is running." - (when query-buffer - (cl-assert (erc-query-buffer-p query-buffer))) - (erc-with-server-buffer - (when (and query-buffer - (not (with-current-buffer query-buffer - (or (erc-current-nick-p (erc-target)) - (string-match erc-querypoll-exclude-regexp - (erc-target))))) - (not (ring-member erc--querypoll-ring query-buffer))) - (ring-insert+extend erc--querypoll-ring query-buffer)) - (unless erc--querypoll-timer - (setq erc--querypoll-timer - (let* ((length (erc--querypoll-get-length erc--querypoll-ring)) - (period (erc--querypoll-compute-period length))) - (run-at-time (+ (or penalty 0) period) - nil #'erc--querypoll-send (current-buffer))))))) - -(defun erc--querypoll-on-352 (target-nick args) - "Add or update `erc-server-users' data for TARGET-NICK from ARGS. -Then add user to participant rolls in any existing query buffers." - (pcase-let - ((`(,_ ,channel ,login ,host ,_server ,nick ,_flags, hop-real) args)) - (when (and (string= channel "*") (erc-nick-equal-p nick target-nick)) - (if-let ((user (erc-get-server-user nick))) - (erc-update-user user nick host login - (erc--extract-352-full-name hop-real)) - ;; Don't add unless target is already known. - (when (erc-get-buffer nick erc-server-process) - (erc-add-server-user - nick (make-erc-server-user - :nickname nick :login login :host host - :full-name (erc--extract-352-full-name hop-real))))) - (erc--ensure-query-member nick) - t))) - -;; This uses heuristics to associate replies to the initial request -;; because ERC does not yet support `labeled-response'. -(defun erc--querypoll-send (server-buffer) - "Send a captive \"WHO\" in SERVER-BUFFER." - (when (and (buffer-live-p server-buffer) - (buffer-local-value 'erc-server-connected server-buffer)) - (with-current-buffer server-buffer - (setq erc--querypoll-timer nil) - (if-let ((buffer (erc--querypoll-get-next erc--querypoll-ring))) - (letrec - ((target (erc--target-string - (buffer-local-value 'erc--target buffer))) - (penalty 0) - (here-fn (erc-once-with-server-event - "352" (lambda (_ parsed) - (erc--querypoll-on-352 - target (erc-response.command-args parsed))))) - (done-fn (erc-once-with-server-event - "315" - (lambda (_ parsed) - (if (memq here-fn erc-server-352-functions) - (erc-remove-user - (nth 1 (erc-response.command-args parsed))) - (remove-hook 'erc-server-352-functions here-fn t)) - (remove-hook 'erc-server-263-functions fail-fn t) - (remove-hook 'erc-server-315-functions done-fn t) - (erc--querypoll-subscribe buffer penalty) - t))) - (fail-fn (erc-once-with-server-event - "263" - (lambda (proc parsed) - (setq penalty 60) - (funcall done-fn proc parsed) - t)))) - (erc-server-send (concat "WHO " target))) - (unless (ring-empty-p erc--querypoll-ring) - (erc--querypoll-subscribe nil 30)))))) - (provide 'erc-goodies) ;;; erc-goodies.el ends here diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 45b0fb12c43..a32c8b46118 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -262,6 +262,202 @@ with args, toggle notify status of people." (notify-on . "Detected %n on IRC network %m") (notify-off . "%n has left IRC network %m")) + +;;;; Module `querypoll' + +;; This module is similar to `notify' in that it periodically tries to +;; discover whether certain users are online. Unlike that module, it's +;; not really configurable. Rather, it only selects users you've +;; corresponded with in a query buffer, and it keeps `erc-server-users' +;; entries for them updated. + +(declare-function ring-empty-p "ring" (ring)) +(declare-function ring-insert "ring" (ring item)) +(declare-function ring-insert+extend "ring" (ring item)) +(declare-function ring-length "ring" (ring)) +(declare-function ring-member "ring" (ring item)) +(declare-function ring-ref "ring" (ring index)) +(declare-function ring-remove "ring" (ring &optional index)) + +(defvar-local erc--querypoll-ring nil) +(defvar-local erc--querypoll-timer nil) + +(defcustom erc-querypoll-exclude-regexp + (rx bot (or (: "*" (+ nonl)) (: (+ (in "A-Za-z")) "Serv")) eot) + "Pattern to skip polling for bots and services you regularly query." + :group 'erc + :package-version '(ERC . "5.6") + :type 'regexp) + +;;;###autoload(autoload 'erc-querypoll-mode "erc-notify" nil t) +(define-erc-module querypoll nil + "Send periodic \"WHO\" requests for each query buffer. +Omit query participants who are currently present in some channel. +Instead of announcing arrivals and departures, rely on other modules, +like `nickbar', to provide UI feedback when changes occur. + +Once ERC implements the `monitor' extension, this module will serve as +an optional fallback for keeping query-participant rolls up to date on +servers that lack support or are stingy with their allotments. Until +such time, this module should be considered experimental. + +This is a local ERC module, so selectively polling only a subset of +query targets is possible but cumbersome. To do so, ensure +`erc-querypoll-mode' is enabled in the server buffer, and then toggle it +as appropriate in desired query buffers. To stop polling for the +current connection, toggle off the command \\[erc-querypoll-mode] from a +server buffer, or run \\`M-x C-u erc-querypoll-disable RET' from a +target buffer." + ((if erc--target + (if (erc-query-buffer-p) + (progn ; accommodate those who eschew `erc-modules' + (erc-with-server-buffer + (unless erc-querypoll-mode + (erc-querypoll-mode +1))) + (erc--querypoll-subscribe (current-buffer))) + (erc-querypoll-mode -1)) + (cl-assert (not erc--decouple-query-and-channel-membership-p)) + (setq-local erc--querypoll-ring (make-ring 5)) + (erc-with-all-buffers-of-server erc-server-process nil + (unless erc-querypoll-mode + (erc-querypoll-mode +1))))) + ((when erc--querypoll-timer + (cancel-timer erc--querypoll-timer)) + (if erc--target + (when-let (((erc-query-buffer-p)) + (ring (erc-with-server-buffer erc--querypoll-ring)) + (index (ring-member ring (current-buffer))) + ((not (erc--querypoll-target-in-chan-p (current-buffer))))) + (ring-remove ring index) + (unless (erc-current-nick-p (erc-target)) + (erc-remove-current-channel-member (erc-target)))) + (erc-with-all-buffers-of-server erc-server-process #'erc-query-buffer-p + (erc-querypoll-mode -1))) + (kill-local-variable 'erc--querypoll-ring) + (kill-local-variable 'erc--querypoll-timer)) + 'local) + +(cl-defmethod erc--queries-current-p (&context (erc-querypoll-mode (eql t))) t) + +(defvar erc-querypoll-period-params '(10 10 1) + "Parameters affecting the delay with respect to the number of buffers. +The elements represent some parameters of an exponential decay function, +a(e)^{-x/b}+c. The first number (a) affects the overall scaling. A +higher value means longer delays for all query buffers relative to queue +length. The second number (b) determines how quickly the delay +decreases as the queue length increases. Larger values make the delay +taper off more gradually. The last number (c) sets the minimum delay +between updates regardless of queue length.") + +(defun erc--querypoll-compute-period (queue-size) + "Calculate delay based on QUEUE-SIZE." + (let ((scale (nth 0 erc-querypoll-period-params)) + (rate (* 1.0 (nth 1 erc-querypoll-period-params))) + (min (nth 2 erc-querypoll-period-params))) + (+ (* scale (exp (/ (- queue-size) rate))) min))) + +(defun erc--querypoll-target-in-chan-p (buffer) + "Determine whether buffer's target, as a user, is joined to any channels." + (and-let* + ((target (erc--target-string (buffer-local-value 'erc--target buffer))) + (user (erc-get-server-user target)) + (buffers (erc-server-user-buffers user)) + ((seq-some #'erc-channel-p buffers))))) + +(defun erc--querypoll-get-length (ring) + "Return the effective length of RING, discounting chan members." + (let ((count 0)) + (dotimes (i (ring-length ring)) + (unless (erc--querypoll-target-in-chan-p (ring-ref ring i)) + (cl-incf count 1))) + count)) + +(defun erc--querypoll-get-next (ring) + (let ((n (ring-length ring))) + (catch 'found + (while (natnump (cl-decf n)) + (when-let ((buffer (ring-remove ring)) + ((buffer-live-p buffer))) + ;; Push back buffers for users joined to some chan. + (if (erc--querypoll-target-in-chan-p buffer) + (ring-insert ring buffer) + (throw 'found buffer))))))) + +(defun erc--querypoll-subscribe (query-buffer &optional penalty) + "Add QUERY-BUFFER to FIFO and ensure timer is running." + (when query-buffer + (cl-assert (erc-query-buffer-p query-buffer))) + (erc-with-server-buffer + (when (and query-buffer + (not (with-current-buffer query-buffer + (or (erc-current-nick-p (erc-target)) + (string-match erc-querypoll-exclude-regexp + (erc-target))))) + (not (ring-member erc--querypoll-ring query-buffer))) + (ring-insert+extend erc--querypoll-ring query-buffer)) + (unless erc--querypoll-timer + (setq erc--querypoll-timer + (let* ((length (erc--querypoll-get-length erc--querypoll-ring)) + (period (erc--querypoll-compute-period length))) + (run-at-time (+ (or penalty 0) period) + nil #'erc--querypoll-send (current-buffer))))))) + +(defun erc--querypoll-on-352 (target-nick args) + "Add or update `erc-server-users' data for TARGET-NICK from ARGS. +Then add user to participant rolls in any existing query buffers." + (pcase-let + ((`(,_ ,channel ,login ,host ,_server ,nick ,_flags, hop-real) args)) + (when (and (string= channel "*") (erc-nick-equal-p nick target-nick)) + (if-let ((user (erc-get-server-user nick))) + (erc-update-user user nick host login + (erc--extract-352-full-name hop-real)) + ;; Don't add unless target is already known. + (when (erc-get-buffer nick erc-server-process) + (erc-add-server-user + nick (make-erc-server-user + :nickname nick :login login :host host + :full-name (erc--extract-352-full-name hop-real))))) + (erc--ensure-query-member nick) + t))) + +;; This uses heuristics to associate replies to the initial request +;; because ERC does not yet support `labeled-response'. +(defun erc--querypoll-send (server-buffer) + "Send a captive \"WHO\" in SERVER-BUFFER." + (when (and (buffer-live-p server-buffer) + (buffer-local-value 'erc-server-connected server-buffer)) + (with-current-buffer server-buffer + (setq erc--querypoll-timer nil) + (if-let ((buffer (erc--querypoll-get-next erc--querypoll-ring))) + (letrec + ((target (erc--target-string + (buffer-local-value 'erc--target buffer))) + (penalty 0) + (here-fn (erc-once-with-server-event + "352" (lambda (_ parsed) + (erc--querypoll-on-352 + target (erc-response.command-args parsed))))) + (done-fn (erc-once-with-server-event + "315" + (lambda (_ parsed) + (if (memq here-fn erc-server-352-functions) + (erc-remove-user + (nth 1 (erc-response.command-args parsed))) + (remove-hook 'erc-server-352-functions here-fn t)) + (remove-hook 'erc-server-263-functions fail-fn t) + (remove-hook 'erc-server-315-functions done-fn t) + (erc--querypoll-subscribe buffer penalty) + t))) + (fail-fn (erc-once-with-server-event + "263" + (lambda (proc parsed) + (setq penalty 60) + (funcall done-fn proc parsed) + t)))) + (erc-server-send (concat "WHO " target))) + (unless (ring-empty-p erc--querypoll-ring) + (erc--querypoll-subscribe nil 30)))))) + (provide 'erc-notify) ;;; erc-notify.el ends here diff --git a/test/lisp/erc/erc-goodies-tests.el b/test/lisp/erc/erc-goodies-tests.el index 1d74025c5ce..9a805fb05a6 100644 --- a/test/lisp/erc/erc-goodies-tests.el +++ b/test/lisp/erc/erc-goodies-tests.el @@ -614,61 +614,4 @@ (should (equal '(3 . 11) (erc--get-inserted-msg-bounds arg)))))) -;;;; querypoll - -(ert-deftest erc--querypoll-compute-period () - (should (equal (mapcar (lambda (i) - (/ (round (* 100 (erc--querypoll-compute-period i))) - 100.0)) - (number-sequence 0 10)) - '(11.0 10.05 9.19 8.41 7.7 7.07 6.49 5.97 5.49 5.07 4.68)))) - -(declare-function ring-insert "ring" (ring item)) - -(ert-deftest erc--querypoll-target-in-chan-p () - (erc-tests-common-make-server-buf) - (with-current-buffer (erc--open-target "#chan") - (erc-update-current-channel-member "bob" "bob" 'addp)) - - (with-current-buffer (erc--open-target "bob") - (should (erc--querypoll-target-in-chan-p (current-buffer)))) - - (with-current-buffer (erc--open-target "alice") - (should-not (erc--querypoll-target-in-chan-p (current-buffer)))) - - (when noninteractive - (erc-tests-common-kill-buffers))) - -(ert-deftest erc--querypoll-get-length () - (erc-tests-common-make-server-buf) - (with-current-buffer (erc--open-target "#chan") - (erc-update-current-channel-member "bob" "bob" 'addp)) - - (let ((ring (make-ring 5))) - (ring-insert ring (with-current-buffer (erc--open-target "bob"))) - (should (= 0 (erc--querypoll-get-length ring))) - (ring-insert ring (with-current-buffer (erc--open-target "alice"))) - (should (= 1 (erc--querypoll-get-length ring)))) - - (when noninteractive - (erc-tests-common-kill-buffers))) - -(ert-deftest erc--querypoll-get-next () - (erc-tests-common-make-server-buf) - (with-current-buffer (erc--open-target "#chan") - (erc-update-current-channel-member "bob" "bob" 'addp) - (erc-update-current-channel-member "alice" "alice" 'addp)) - - (let ((ring (make-ring 5))) - (ring-insert ring (with-current-buffer (erc--open-target "bob"))) - (ring-insert ring (with-current-buffer (erc--open-target "dummy"))) - (ring-insert ring (with-current-buffer (erc--open-target "alice"))) - (ring-insert ring (with-current-buffer (erc--open-target "tester"))) - (kill-buffer (get-buffer "dummy")) - - (should (eq (get-buffer "tester") (erc--querypoll-get-next ring)))) - - (when noninteractive - (erc-tests-common-kill-buffers))) - ;;; erc-goodies-tests.el ends here diff --git a/test/lisp/erc/erc-notify-tests.el b/test/lisp/erc/erc-notify-tests.el new file mode 100644 index 00000000000..f8dafb0ea19 --- /dev/null +++ b/test/lisp/erc/erc-notify-tests.el @@ -0,0 +1,87 @@ +;;; erc-notify-tests.el --- Tests for erc-notify -*- lexical-binding:t -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published +;; by the Free Software Foundation, either version 3 of the License, +;; or (at your option) any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;;; Code: +(require 'erc-notify) + +(require 'ert-x) +(eval-and-compile + (let ((load-path (cons (ert-resource-directory) load-path))) + (require 'erc-tests-common))) + + +;;;; Module `querypoll' + +(ert-deftest erc--querypoll-compute-period () + (should (equal (mapcar (lambda (i) + (/ (round (* 100 (erc--querypoll-compute-period i))) + 100.0)) + (number-sequence 0 10)) + '(11.0 10.05 9.19 8.41 7.7 7.07 6.49 5.97 5.49 5.07 4.68)))) + +(declare-function ring-insert "ring" (ring item)) + +(ert-deftest erc--querypoll-target-in-chan-p () + (erc-tests-common-make-server-buf) + (with-current-buffer (erc--open-target "#chan") + (erc-update-current-channel-member "bob" "bob" 'addp)) + + (with-current-buffer (erc--open-target "bob") + (should (erc--querypoll-target-in-chan-p (current-buffer)))) + + (with-current-buffer (erc--open-target "alice") + (should-not (erc--querypoll-target-in-chan-p (current-buffer)))) + + (when noninteractive + (erc-tests-common-kill-buffers))) + +(ert-deftest erc--querypoll-get-length () + (erc-tests-common-make-server-buf) + (with-current-buffer (erc--open-target "#chan") + (erc-update-current-channel-member "bob" "bob" 'addp)) + + (let ((ring (make-ring 5))) + (ring-insert ring (with-current-buffer (erc--open-target "bob"))) + (should (= 0 (erc--querypoll-get-length ring))) + (ring-insert ring (with-current-buffer (erc--open-target "alice"))) + (should (= 1 (erc--querypoll-get-length ring)))) + + (when noninteractive + (erc-tests-common-kill-buffers))) + +(ert-deftest erc--querypoll-get-next () + (erc-tests-common-make-server-buf) + (with-current-buffer (erc--open-target "#chan") + (erc-update-current-channel-member "bob" "bob" 'addp) + (erc-update-current-channel-member "alice" "alice" 'addp)) + + (let ((ring (make-ring 5))) + (ring-insert ring (with-current-buffer (erc--open-target "bob"))) + (ring-insert ring (with-current-buffer (erc--open-target "dummy"))) + (ring-insert ring (with-current-buffer (erc--open-target "alice"))) + (ring-insert ring (with-current-buffer (erc--open-target "tester"))) + (kill-buffer (get-buffer "dummy")) + + (should (eq (get-buffer "tester") (erc--querypoll-get-next ring)))) + + (when noninteractive + (erc-tests-common-kill-buffers))) + +;;; erc-notify-tests.el ends here commit a5b2de8b54c3a2d7dcb84f7697e18b2257959dfc Author: F. Jason Park Date: Sat Oct 12 14:33:25 2024 -0700 Fix trailing args bug in erc-d-i--parse-message * test/lisp/erc/resources/erc-d/erc-d-i.el: Require `subr-x'. (erc-d-i--parse-message): Populate `contents' slot when lone trailing arg lacks a preceding colon. * test/lisp/erc/resources/erc-d/erc-d-tests.el (erc-d-i--parse-message): Fix expected result. (erc-d-i--parse-message/privmsg): New test. diff --git a/test/lisp/erc/resources/erc-d/erc-d-i.el b/test/lisp/erc/resources/erc-d/erc-d-i.el index 219ab6d63f0..97cd56408ce 100644 --- a/test/lisp/erc/resources/erc-d/erc-d-i.el +++ b/test/lisp/erc/resources/erc-d/erc-d-i.el @@ -22,6 +22,7 @@ ;;; Code: (require 'cl-lib) +(require 'subr-x) (cl-defstruct (erc-d-i-message (:conc-name erc-d-i-message.)) "Identical to `erc-response'. @@ -101,18 +102,19 @@ With DECODE, decode as UTF-8 text." (setq s (decode-coding-string s 'utf-8 t))) (let ((mes (make-erc-d-i-message :unparsed s :compat (not decode))) tokens) - (when-let* (((not (string-empty-p s))) - ((eq ?@ (aref s 0))) - (m (string-match " " s)) - (u (substring s 1 m))) + (when-let (((not (string-empty-p s))) + ((eq ?@ (aref s 0))) + (m (string-match " " s)) + (u (substring s 1 m))) (setf (erc-d-i-message.tags mes) (erc-d-i--validate-tags u) s (substring s (1+ m)))) - (if-let* ((m (string-match " :" s)) - (other-toks (split-string (substring s 0 m) " " t)) - (rest (substring s (+ 2 m)))) + (if-let ((m (string-search " :" s)) + (other-toks (split-string (substring s 0 m) " " t)) + (rest (substring s (+ 2 m)))) (setf (erc-d-i-message.contents mes) rest tokens (nconc other-toks (list rest))) - (setq tokens (split-string s " " t " "))) + (setf tokens (split-string s " " t " ") + (erc-d-i-message.contents mes) (car (last tokens)))) (when (and tokens (eq ?: (aref (car tokens) 0))) (setf (erc-d-i-message.sender mes) (substring (pop tokens) 1))) (setf (erc-d-i-message.command mes) (or (pop tokens) "") diff --git a/test/lisp/erc/resources/erc-d/erc-d-tests.el b/test/lisp/erc/resources/erc-d/erc-d-tests.el index 63d304907ea..a626ddd8edc 100644 --- a/test/lisp/erc/resources/erc-d/erc-d-tests.el +++ b/test/lisp/erc/resources/erc-d/erc-d-tests.el @@ -248,9 +248,37 @@ 'decode)) (should-not (erc-d-i-message.compat ours)) (should (equal (erc-d-i-message.command-args ours) '("#chàn"))) - (should (equal (erc-d-i-message.contents ours) "")) + (should (equal (erc-d-i-message.contents ours) "#chàn")) (should (equal (erc-d-i-message.tags ours) '((foo . "çedilla"))))))) +(ert-deftest erc-d-i--parse-message/privmsg () + (dolist (raw '(":Bob!~bob@gnu.org PRIVMSG #chan :one two" + ":Bob!~bob@gnu.org PRIVMSG #chan one" + ":Bob!~bob@gnu.org PRIVMSG #chan : " + ":Bob!~bob@gnu.org PRIVMSG #chan :" + "@account=bob :Bob!~bob@gnu.org PRIVMSG #chan one" + "@foo=bar;baz :Bob!~bob@gnu.org PRIVMSG #chan :one")) + (dolist (slot '(unparsed + sender + command + command-args + contents + tags)) + (let ((ours (erc-d-i--parse-message raw)) + (orig (erc-d-tests--parse-message-upstream raw))) + (ert-info ((format "slot: `%s', orig: %S, ours: %S" + slot orig ours)) + (if (eq slot 'tags) + (should (equal (erc-response.tags orig) + (mapcar (pcase-lambda (`(,key . ,value)) + (if value + (list (symbol-name key) value) + (list (symbol-name key)))) + (reverse (erc-d-i-message.tags ours))))) + (should + (equal (cl-struct-slot-value 'erc-d-i-message slot ours) + (cl-struct-slot-value 'erc-response slot orig))))))))) + (ert-deftest erc-d-i--unescape-tag-value () (should (equal (erc-d-i--unescape-tag-value "\\sabc\\sdef\\s\\sxyz\\s") commit b00f400d1d3f954e460ea979f07f38f6bb31630e Author: F. Jason Park Date: Fri Oct 11 18:12:16 2024 -0700 ; Undo erroneous change in ERC's sample configuration * doc/misc/erc.texi (Sample Configuration): Remove `erc-modules' from the `:custom' section of the `use-package' declaration for feature `erc' because its presence there depends on `:defer' being non-nil, and this configuration is supposed to be `:defer' agnostic. This reverts part of 3f1ce47f "; Add face customization to ERC's sample config". * etc/ERC-NEWS: Mention `erc-modules' no longer being autoloaded. * lisp/erc/erc-match.el (erc-text-matched-hooks): Explain expected format of non-NUH matches. * test/lisp/erc/erc-match-tests.el (test/lisp/erc/erc-match-tests.el): Inhibit messages when running non-interactively. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 9368c9ce070..939d93d6aa8 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -1324,11 +1324,14 @@ settings (@pxref{Sample configuration via Customize}). ;;; My ERC configuration -*- lexical-binding: t -*- (use-package erc - :custom + :config ;; Prefer SASL to NickServ, colorize nicknames, and show side panels - ;; with joined channels and members. - (erc-modules (append '(sasl nicks bufbar nickbar scrolltobottom) - erc-modules)) + ;; with joined channels and members + (setopt erc-modules + (seq-union '(sasl nicks bufbar nickbar scrolltobottom) + erc-modules)) + + :custom ;; Protect me from accidentally sending excess lines. (erc-inhibit-multiline-input t) (erc-send-whitespace-lines t) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index ea65a170b38..39403c17486 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -26,6 +26,13 @@ In fast-moving channels and in queries with long-winded bots, the on account of a rather stingy buffering threshold of 512 characters. Now configurable, its default has been relaxed eightfold to 4096. +** Option 'erc-modules' no longer autoloaded. +This cornerstone of ERC's configuration system was autoloaded globally +in 5.6 to allow users the freedom of running 'customize-option' without +first having to load the package. Unfortunately, this also had the side +effect of arranging for ERC to load on startup whenever someone +customized the variable. + ** Stray key binding removed from 'erc-fill-wrap-mode-map'. The command 'erc-fill-wrap-cycle-visual-movement' was mistakenly given the key binding "C-c a" in an inadvertent holdover from development. It diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index e28e7122cce..6dc18bf250e 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -240,10 +240,14 @@ for beeping to work." (defcustom erc-text-matched-hook '(erc-log-matches) "Abnormal hook for visiting text matching a predefined \"type\". -ERC calls members with the arguments (MATCH-TYPE NUH MESSAGE), -where MATCH-TYPE is one of the symbols `current-nick', `keyword', -`pal', `dangerous-host', `fool', and NUH is an `erc-response' -sender, like bob!~bob@example.org." +ERC calls members with the arguments (MATCH-TYPE NUH MESSAGE), where +MATCH-TYPE is a symbol among `current-nick', `keyword', `pal', +`dangerous-host', and `fool'; and NUH is an `erc-response' sender, like +\"bob!~bob@example.org\" or an IRC command prefixed with the string +\"Server:\", as in \"Server:353\". MESSAGE is the current incarnation +of the just-inserted message minus a leading speaker, like \" \". +For traditional reasons, MESSAGE always includes a leading +`erc-notice-prefix' and a trailing newline." :options '(erc-log-matches erc-hide-fools erc-beep-on-match) :type 'hook) diff --git a/test/lisp/erc/erc-match-tests.el b/test/lisp/erc/erc-match-tests.el index d22a945724b..fb92a153c95 100644 --- a/test/lisp/erc/erc-match-tests.el +++ b/test/lisp/erc/erc-match-tests.el @@ -569,7 +569,8 @@ (defun erc-match-tests--log-matches () (let ((erc-log-matches-flag t) - (erc-timestamp-format "[@@TS@@]")) + (erc-timestamp-format "[@@TS@@]") + (inhibit-message noninteractive)) (erc-match-tests--hl-type-keyword) (with-current-buffer "*scratch*" (ert-simulate-keys "\t\r" commit 1374f20491bbf0c37760cdb84f6020f80fe4eadd Author: Dmitry Gutov Date: Sat Oct 19 02:25:52 2024 +0100 Fix the regression in dired-backup-diff's diff-goto-source behavior * lisp/vc/diff-mode.el (diff-find-source-location): Undo part of the previous change, so that 'reverse' does not affect whether the "other file" is used (bug#62731). (diff-apply-hunk): Make that choice here. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index cfa90d380ad..2ed9a4553c8 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1970,7 +1970,7 @@ SWITCHED is non-nil if the patch is already applied." diff-context-mid-hunk-header-re nil t) (error "Can't find the hunk separator")) (match-string 1))))) - (file (or (diff-find-file-name (xor other reverse) noprompt) + (file (or (diff-find-file-name other noprompt) (error "Can't find the file"))) (revision (and other diff-vc-backend (if reverse (nth 1 diff-vc-revisions) @@ -2047,7 +2047,7 @@ With a prefix argument, REVERSE the hunk." ;; TODO: make it possible to ask explicitly for this behavior. ;; ;; This is duplicated in diff-test-hunk. - (diff-find-source-location deletion reverse))) + (diff-find-source-location (xor deletion reverse) reverse))) (cond ((null line-offset) (user-error "Can't find the text to patch")) commit 60e58be091bf075a03ac431444aa9c9b5832bb19 Author: john muhl Date: Tue Oct 8 12:24:27 2024 -0500 Fix naming of buffers for tags ending in Y in 'mpc' * lisp/mpc.el (mpc-tagbrowser-buf): Use 'mpc-tagbrowser-tag-name' to ensure buffers corresponding to tags that end in Y are correctly pluralized; e.g. the tag "Directory" should create a buffer named "*MPC Directories*" not "*MPC Directorys". diff --git a/lisp/mpc.el b/lisp/mpc.el index 4cc3d96d898..9905e3aa554 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -1572,9 +1572,10 @@ when constructing the set of constraints." (t (concat (symbol-name tag) "s")))) (defun mpc-tagbrowser-buf (tag) - (let ((buf (mpc-proc-buffer (mpc-proc) tag))) + (let ((buf (mpc-proc-buffer (mpc-proc) tag)) + (tag-name (mpc-tagbrowser-tag-name tag))) (if (buffer-live-p buf) buf - (setq buf (get-buffer-create (format "*MPC %ss*" tag))) + (setq buf (get-buffer-create (format "*MPC %s*" tag-name))) (mpc-proc-buffer (mpc-proc) tag buf) (with-current-buffer buf (let ((inhibit-read-only t)) @@ -1585,7 +1586,7 @@ when constructing the set of constraints." (insert mpc-tagbrowser-all-name "\n")) (forward-line -1) (setq mpc-tag tag) - (setq mpc-tag-name (mpc-tagbrowser-tag-name tag)) + (setq mpc-tag-name tag-name) (mpc-tagbrowser-all-select) (mpc-tagbrowser-refresh) buf)))) commit 0886ef01a8d7144771b5834c3ef6c3d44666ea76 Author: Stefan Monnier Date: Fri Oct 18 14:51:13 2024 -0400 (symbol-file): Fix `C-h v pcase` where `cl-struct` lacks file info * lisp/subr.el (symbol-file): Return an actual (and absolute) file name for the autoload case, as is done for other cases. diff --git a/lisp/subr.el b/lisp/subr.el index 2eaed682406..4771ac1fba2 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3067,7 +3067,8 @@ instead." (if (and (or (null type) (eq type 'defun)) (symbolp symbol) (autoloadp (symbol-function symbol))) - (nth 1 (symbol-function symbol)) + (locate-library + (nth 1 (symbol-function symbol))) (if (and native-p (or (null type) (eq type 'defun)) (symbolp symbol) (native-comp-available-p) commit e807d62cdd12b8086d360114c10085f0c0cf4116 Author: Stefan Monnier Date: Fri Oct 18 14:48:28 2024 -0400 (help-fns-short-filename): Fix bug#73766 * lisp/help-fns.el (help-fns--radix-trees): New var. (help-fns--filename, help-fns--radix-tree): New functions. (help-fns-short-filename): Use them. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 98231614d71..eb2c822aa30 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1045,17 +1045,41 @@ TYPE indicates the namespace and is `fun' or `var'." (fill-region-as-paragraph (point-min) (point-max)) (goto-char (point-max)))))) +(require 'radix-tree) + +(defconst help-fns--radix-trees + (make-hash-table :weakness 'key :test 'equal) + "Cache of radix-tree representation of `load-path'.") + +(defun help-fns--filename (file) + (let ((f (abbreviate-file-name (expand-file-name file)))) + (if (file-name-case-insensitive-p f) (downcase f) f))) + +(defun help-fns--radix-tree (dirs) + (with-memoization (gethash dirs help-fns--radix-trees) + (let ((rt radix-tree-empty)) + (dolist (d dirs) + (let ((d (help-fns--filename (file-name-as-directory d)))) + (setq rt (radix-tree-insert rt d t)))) + rt))) + (defun help-fns-short-filename (filename) - (let* ((abbrev (abbreviate-file-name filename)) - (short abbrev)) - (dolist (dir load-path) - (let ((rel (file-relative-name filename dir))) - (if (< (length rel) (length short)) - (setq short rel))) - (let ((rel (file-relative-name abbrev dir))) - (if (< (length rel) (length short)) - (setq short rel)))) - short)) + (let* ((short (help-fns--filename filename)) + (prefixes (radix-tree-prefixes (help-fns--radix-tree load-path) + (file-name-directory short)))) + (if (not prefixes) + ;; The file is not inside the `load-path'. + ;; FIXME: Here's the old code (too slow, bug#73766), + ;; which used to try and shorten it with "../" as well. + ;; (dolist (dir load-path) + ;; (let ((rel (file-relative-name filename dir))) + ;; (if (< (length rel) (length short)) + ;; (setq short rel))) + ;; (let ((rel (file-relative-name abbrev dir))) + ;; (if (< (length rel) (length short)) + ;; (setq short rel)))) + short + (file-relative-name short (caar prefixes))))) (defun help-fns--analyze-function (function) ;; FIXME: Document/explain the differences between FUNCTION, commit c437d7110b388a97ff6b67b2bc3138d05fbe3576 Author: Michael Albinus Date: Fri Oct 18 18:33:48 2024 +0200 * admin/notes/git-workflow: Use emacs-30 in examples. diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index d873cac4269..8e7d597db17 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -16,14 +16,14 @@ Initial setup Then we want to clone the repository. We normally want to have both the current master and (if there is one) the active release branch -(eg emacs-29). +(eg emacs-30). mkdir ~/emacs cd ~/emacs git clone @git.sv.gnu.org:/srv/git/emacs.git master cd master git config push.default current -git worktree add ../emacs-29 emacs-29 +git worktree add ../emacs-30 emacs-30 You now have both branches conveniently accessible, and you can do "git pull" in them once in a while to keep updated. @@ -67,7 +67,7 @@ which will look like commit 958b768a6534ae6e77a8547a56fc31b46b63710b -cd ~/emacs/emacs-29 +cd ~/emacs/emacs-30 git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b and add "Backport:" to the commit string. Then @@ -109,7 +109,7 @@ up-to-date by doing a pull. Then start Emacs with emacs -l admin/gitmerge.el -f gitmerge You'll be asked for the branch to merge, which will default to -(eg) 'origin/emacs-29', which you should accept. Merging a local tracking +(eg) 'origin/emacs-30', which you should accept. Merging a local tracking branch is discouraged, since it might not be up-to-date, or worse, contain commits from you which are not yet pushed upstream. commit cf01f8776a4488ac7e13d003502267b12f5a4de1 Merge: 01eb03d8072 7dbbd58d6c9 Author: Michael Albinus Date: Fri Oct 18 17:56:15 2024 +0200 Merge from origin/emacs-30 7dbbd58d6c9 Locate password icon in global-mode-string 19049efd30f ; Fix last documentation change 2c640e63a8a Explain tty-color-mode frame parameter more. e5d600006e2 ; * src/doc.c (Ftext_quoting_style): Make doc string agre... 90c6880a922 (track-changes--after): Fix problem found in bug#73041 commit 01eb03d8072c2481c10ded12e03a4347adbcd11f Merge: 674ad2ba7fc d3c94102266 Author: Michael Albinus Date: Fri Oct 18 17:56:12 2024 +0200 ; Merge from origin/emacs-30 The following commit was skipped: d3c94102266 Fix Eshell's evaluation of empty 'progn' forms commit 674ad2ba7fc2ce21eff823ee3c6bfbc42da59520 Merge: 5c59ab56e67 78e6328fafd Author: Michael Albinus Date: Fri Oct 18 17:56:08 2024 +0200 Merge from origin/emacs-30 78e6328fafd ; (select-safe-coding-system-interactively): Say "safely ... c5eba443ae7 ; * lisp/icomplete.el (icomplete-in-buffer): Doc fix (bug... 569186c36e3 ; * doc/lispref/display.texi (Face Attributes): Fix typo ... d5723fc4f03 * lisp/progmodes/c-ts-mode.el (treesit-node-eq): Declare ... 0085e48f917 * admin/notes/emba: Docker builds do not run in a worktree. 3d30905b022 * lisp/calc/calc-ext.el (math-approx-sqrt-e): Doc fix (bu... 94d0e9c4018 : Revert a mistaken change 4d90a1d8209 ; * doc/emacs/search.texi (Word Search): Spelling fixes. c154047c46a Fix c-ts-mode--anchor-prev-sibling (bug#73661) b87fda63dd4 Fix formatting of long keyboard macros by 'list-keyboard-... ae75ea62324 ; * src/fileio.c (Ffile_newer_than_file_p): Fix wording (... b1203978685 Merge branch 'emacs-30' of git.sv.gnu.org:/srv/git/emacs ... de54d922b5c * doc/emacs/mini.texi (Passwords): Mention password visib... 0f8f0773183 ; * doc/emacs/search.texi (Word Search): Document 'dictio... fb155bcfb6f ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Doc fix. 6dbe4e99ac4 ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Improve... d664227f81a ; More accurate documentation of 'file-newer-than-file-p' e49b479f869 Fix c-ts-mode indentation for initializer lists (bug#73661) f520008744b Avoid segfaults in Rmail-MIME 6a5c2edd84f Eglot: use :immediate t when resolving completions (bug#7... cd36e070c24 Eglot: minor changes to doc and docstrings 1ea0d9b891b Revert "Set treesit-primary-parser for tree-sitter modes" 52746ceb625 Remove duplicate indent rules in elixir-ts-mode ed57faafc74 Set treesit-primary-parser for tree-sitter modes 37a6c859b04 ; * lisp/emacs-lisp/cl-macs.el (cl-once-only): Fix capita... 2d4d6dc43a4 Delete XIE X extension from TODO b68b9f291cc ; * lisp/progmodes/csharp-mode.el (treesit-query-compile)... 688201ef18d ; * lisp/window.el (switch-to-prev-buffer-skip-regexp): D... ba44fc9a447 Restore comment/string check for 'electric-layout-mode' 5a462948e13 Update Arni Magnusson's email address 6b1271b169a Fix python-ts-mode-map docstring aaaafddc945 Normalize "Commentary" section in eudc.el d656be9794d Expand email abbrevs in X-Debbugs-Cc header. e9dcf0c57dd Fix 'list-tags' when invoked from a non-file buffer 51ef05f684c count-windows: Fix reference to walk-windows 5eaf0c784bf * lisp/info-look.el (mapc): Add use-package manual's index. 705a5a1a9e6 ; * ChangeLog.4: Fix attribution of one change. bf26ff0dc8d Update csharp-ts-mode font-lock (bug#73369) 4c866abab96 ; * doc/lispref/variables.texi (Creating Buffer-Local): F... d42d7d474fe ; * lisp/doc-view.el (doc-view-svg-face): Copy-edit docst... f46f476bb8f ; * admin/MAINTAINERS: Take VC subsystem, add note about ... d68e6d2689d ; rcirc-update-activity-string: Justify some existing beh... e6a37869c8d Fix inconsistency in value of rcirc-activity-string 108b3179bd4 Revert "; Minor clarification in variables.texi" 44156c21407 ; Minor clarification in variables.texi 63058e1153a Tag interactive commands in 'lua-ts-mode' 84bea20eba2 ; * lisp/info-look.el: Add two more links. 96b87ad5363 Mention LSP acronym in eglot defgroup docstring 9c904e8ceae Change :group of 'eglot' defgroup to 'tools' fd1a1b07805 Remove out-of-date documentation from python.el 11e3e0cadd4 Fix executing commands in Eshell using "env" with no loca... c0ef8a9a1b3 Fix a typo in the calendar manual 36ff7138feb ; Fix a thinko in sieve-manage.el 7abecbcd633 ; * nt/INSTALL: Update MinGW notes URL. (Bug#73528) e2b01d164cd ; Fix last changes in php-ts-mode.el e8830015b07 Require ert-x for use by 'ert-font-lock-deftest-file' a1841b4d8e7 ; * admin/authors.el (authors-aliases): Don't ignore "one... 69d8f9d1b70 Fix php-ts-mode font-lock for latest PHP grammar (bug#73516) 68f53e43488 eieio.texi: Fix bug#73505 53c887fdf6d ; cperl-mode.el: Fix an invalid face specification f5cd5585f46 ; Recommend GNU Find for 'find-dired' 65e589698e6 ; * lisp/filesets.el (filesets-homepage): Fix URL. 1f243a97806 Delete duplicated line in Viper refcard commit 7dbbd58d6c9cafde2136b83ff149aa608203e207 Author: Michael Albinus Date: Fri Oct 18 17:47:43 2024 +0200 Locate password icon in global-mode-string * doc/emacs/mini.texi (Passwords): Precise the location of the password icon. * doc/lispref/minibuf.texi (Reading a Password): The password icon is added to global-mode-string. * lisp/auth-source.el (read-passwd--mode-line-buffer): Remove. (read-passwd--hide-password): Fix docstring. (read-passwd-toggle-visibility): Don't use `read-passwd--mode-line-buffer'. Check for `read-passwd-mode'. Force update in all mode lines. (read-passwd-mode): Set `read-passwd--mode-line-icon' in `global-mode-string'. (Bug#73768) diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 3be9b76ad88..b1361695211 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -975,8 +975,8 @@ password. You may type either @key{RET} or @key{ESC} to submit the password. Any other self-inserting character key inserts the associated character into the password, and all other input is ignored. - There is also an icon at the front of the mode line indicating the -password visibility. Clicking @kbd{mouse-1} on it toggles the password + There is also an icon in the mode line indicating the password +visibility. Clicking @kbd{mouse-1} on it toggles the password visibility as well. @node Yes or No Prompts diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index f0b7fef30c7..c5b9176d628 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2562,9 +2562,9 @@ This function uses @code{read-passwd-mode}, a minor mode. It binds two keys in the minbuffer: @kbd{C-u} (@code{delete-minibuffer-contents}) deletes the password, and @kbd{TAB} (@code{read-passwd--toggle-visibility}) toggles the visibility of the -password. There is also an additional icon in the mode-line. Clicking -on this icon with @key{mouse-1} toggles the visibility of the password -as well. +password. There is also an additional icon in the mode-line's +@code{global-mode-string}. Clicking on this icon with @key{mouse-1} +toggles the visibility of the password as well. @end defun @node Minibuffer Commands diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 90b58f560c0..557d360bc6a 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2467,14 +2467,11 @@ point is moved into the passwords (see `authinfo-hide-elements'). :version "30.1" :help-echo "mouse-1: Toggle password visibility") -(defvar read-passwd--mode-line-buffer nil - "Buffer to modify `mode-line-format' for showing/hiding passwords.") - (defvar read-passwd--mode-line-icon nil "Propertized mode line icon for showing/hiding passwords.") (defvar read-passwd--hide-password t - "Toggle whether password should be hidden in minubuffer.") + "Toggle whether password should be hidden in minibuffer.") (defun read-passwd--hide-password () "Make password in minibuffer hidden or visible." @@ -2497,8 +2494,8 @@ Adapt also mode line." ;; FIXME: In case of a recursive minibuffer, this may select the wrong ;; mini-buffer. (with-current-buffer (window-buffer win) - (setq read-passwd--hide-password (not read-passwd--hide-password)) - (with-current-buffer read-passwd--mode-line-buffer + (when (memq 'read-passwd-mode local-minor-modes) + (setq read-passwd--hide-password (not read-passwd--hide-password)) (setq read-passwd--mode-line-icon `(:propertize ,(if icon-preference @@ -2514,8 +2511,8 @@ Adapt also mode line." (define-key map [mode-line mouse-1] #'read-passwd-toggle-visibility) map)))) - (force-mode-line-update)) - (read-passwd--hide-password)))) + (force-mode-line-update 'all) + (read-passwd--hide-password))))) (defvar read-passwd-map ;; BEWARE: `defconst' would purecopy it, breaking the sharing with @@ -2534,25 +2531,18 @@ Adapt also mode line." :keymap read-passwd-map :version "30.1" - (setq read-passwd--hide-password nil - ;; Stolen from `eldoc-minibuffer-message'. - read-passwd--mode-line-buffer - (window-buffer - (or (window-in-direction 'above (minibuffer-window)) - (minibuffer-selected-window) - (get-largest-window)))) + (setq read-passwd--hide-password nil) + (or global-mode-string (setq global-mode-string '(""))) - (if read-passwd-mode - (with-current-buffer read-passwd--mode-line-buffer + (let ((mode-string '(:eval read-passwd--mode-line-icon))) + (if read-passwd-mode ;; Add `read-passwd--mode-line-icon'. - (when (listp mode-line-format) - (setq mode-line-format - (cons '(:eval read-passwd--mode-line-icon) - mode-line-format)))) - (with-current-buffer read-passwd--mode-line-buffer + (or (member mode-string global-mode-string) + (setq global-mode-string + (append global-mode-string (list mode-string)))) ;; Remove `read-passwd--mode-line-icon'. - (when (listp mode-line-format) - (setq mode-line-format (cdr mode-line-format))))) + (setq global-mode-string + (delete mode-string global-mode-string)))) (when read-passwd-mode (read-passwd-toggle-visibility))) commit 19049efd30f5476baa4b69c4b79af15674c2650b Author: Eli Zaretskii Date: Fri Oct 18 15:46:17 2024 +0300 ; Fix last documentation change * doc/misc/efaq.texi (Colors on a TTY): * doc/lispref/frames.texi (Font and Color Parameters): * doc/emacs/cmdargs.texi (Colors X): More accurate documentation of TTY color modes and 'tty-color-mode' frame parameter. (Bug#73813) diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 9b72b883628..08e67c891a5 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -1027,10 +1027,20 @@ there is no mode that supports @var{num} colors, Emacs acts as if @var{num} were 0, i.e., it uses the terminal's default color support mode. @end table -If @var{mode} is omitted, it defaults to @var{ansi8}. This support is -dynamic: the current mode is available via the @code{tty-color-mode} -frame parameter, and it can be changed by modifying that frame parameter. -This means you can also specify the initial value via + +This option has no effect on MS-Windows and MS-DOS. + +@cindex colors on character terminal, changing during session +@cindex character terminal, change color mode +@vindex tty-color-mode@r{, frame parameter} +If @var{mode} is omitted, it defaults to @var{ansi8}. + +The color mode can be changed dynamically during a running Emacs +session: the current mode is available via the @code{tty-color-mode} +frame parameter, and it can be changed by modifying that frame +parameter.@footnote{ +This does not work on MS-Windows and MS-DOS text-mode terminals. +} This means you can also specify the initial value via @code{default-frame-alist} instead of the command-line option. @end table diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 694f33af8ee..fccc40d4ccc 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -2447,7 +2447,8 @@ off color support. If the parameter's value is a symbol, it specifies a number through the value of @code{tty-color-mode-alist}, and the associated number is -used instead. This parameter supports dynamic changes. +used instead. This parameter supports dynamic changes during a running +Emacs session (but not on MS-Windows and MS-DOS). @vindex screen-gamma@r{, a frame parameter} @item screen-gamma diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 8a7a11071da..1fe006c1249 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1889,12 +1889,17 @@ putting the following in your init file: (push '(tty-color-mode . no) default-frame-alist) @end lisp -To disable tty color support in the @emph{current} frame you can run: +@noindent +To disable tty color support in the @emph{current} frame you can +evaluate: @lisp (set-frame-parameter nil 'tty-color-mode 'no) @end lisp +Note that this currently doesn't work on MS-Windows and MS-DOS, whose +text-mode terminals always use the fixed number of 16 text colors. + The command @kbd{M-x list-colors-display} pops up a window which exhibits all the colors Emacs knows about on the current display. commit 2c640e63a8a6ea9f2fbbb55ff44d7a8a0ec0f4b4 Author: Robert Pluim Date: Fri Oct 18 11:22:52 2024 +0200 Explain tty-color-mode frame parameter more. * doc/emacs/cmdargs.texi (Colors X): Explain that tty color support is dynamic. * doc/lispref/frames.texi (Font and Color Parameters): Explain that 'tty-color-mode' can be changed on the fly. * doc/misc/efaq.texi (Colors on a TTY): Explain how to disable 'tty-color-mode', either at startup or dynamically. diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index ba4b45d272b..9b72b883628 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -1027,7 +1027,11 @@ there is no mode that supports @var{num} colors, Emacs acts as if @var{num} were 0, i.e., it uses the terminal's default color support mode. @end table -If @var{mode} is omitted, it defaults to @var{ansi8}. +If @var{mode} is omitted, it defaults to @var{ansi8}. This support is +dynamic: the current mode is available via the @code{tty-color-mode} +frame parameter, and it can be changed by modifying that frame parameter. +This means you can also specify the initial value via +@code{default-frame-alist} instead of the command-line option. @end table For example, to use a coral mouse cursor and a slate blue text cursor, diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 8744687a531..694f33af8ee 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -2447,7 +2447,7 @@ off color support. If the parameter's value is a symbol, it specifies a number through the value of @code{tty-color-mode-alist}, and the associated number is -used instead. +used instead. This parameter supports dynamic changes. @vindex screen-gamma@r{, a frame parameter} @item screen-gamma diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 8c3b81a5fe5..8a7a11071da 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1880,6 +1880,21 @@ think that your terminal supports colors, but Emacs won't use them, check the @code{termcap} entry for your display type for color-related capabilities. +If by contrast you wish to @emph{disable} tty color support, either +start emacs with the @samp{--color=no} command-line option, or ensure +that the frame parameter @code{tty-color-mode} is @code{no}, e.g. by +putting the following in your init file: + +@lisp +(push '(tty-color-mode . no) default-frame-alist) +@end lisp + +To disable tty color support in the @emph{current} frame you can run: + +@lisp +(set-frame-parameter nil 'tty-color-mode 'no) +@end lisp + The command @kbd{M-x list-colors-display} pops up a window which exhibits all the colors Emacs knows about on the current display. commit 5c59ab56e67d1880bdec98a4319d6b4be45acf9b Author: Sean Whitton Date: Fri Oct 18 17:08:53 2024 +0800 Replace my recent change to vc-start-logentry * lisp/vc/vc-dispatcher.el (vc-start-logentry): Restore previous logic for determining the parent buffer from before my recent change to this function. If the attempt to determine the parent buffer fails, signal an error immediately. (vc-dispatcher-browsing): Consider derived modes of log-view-mode, too, as indicating that we are in a directory browser. diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 892e4df9a6c..36456fdb2e2 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -741,11 +741,12 @@ MODE, defaulting to `log-edit-mode' if MODE is nil. AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'. BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer. PATCH-STRING is a patch to check in." - (let ((parent (or (and (not (vc-dispatcher-browsing)) - (length= files 1) - (not (file-directory-p (car files))) - (get-file-buffer (car files))) - (current-buffer)))) + (let ((parent (if (and (length= files 1) + (not (vc-dispatcher-browsing))) + (get-file-buffer (car files)) + (current-buffer)))) + (unless parent + (error "Unable to determine VC parent buffer")) (if (and comment (not initial-contents)) (set-buffer (get-buffer-create logbuf)) (pop-to-buffer (get-buffer-create logbuf))) @@ -824,7 +825,8 @@ the buffer contents as a comment." "Are we in a directory browser buffer?" (or (derived-mode-p 'vc-dir-mode) (derived-mode-p 'dired-mode) - (derived-mode-p 'diff-mode))) + (derived-mode-p 'diff-mode) + (derived-mode-p 'log-view-mode))) ;; These are unused. ;; (defun vc-dispatcher-in-fileset-p (fileset) commit e5d600006e2b283923044d2c139b29dd69f5ac30 Author: Mattias Engdegård Date: Thu Oct 17 14:06:20 2024 +0200 ; * src/doc.c (Ftext_quoting_style): Make doc string agree with code. diff --git a/src/doc.c b/src/doc.c index 7bff8bd8edb..fdb61be2097 100644 --- a/src/doc.c +++ b/src/doc.c @@ -669,7 +669,7 @@ If the variable `text-quoting-style' is `grave', `straight' or `curve', just return that value. If it is nil (the default), return `grave' if curved quotes cannot be displayed (for instance, on a terminal with no support for these characters), otherwise return -`quote'. Any other value is treated as `grave'. +`curve'. Any other value is treated as `curve'. Note that in contrast to the variable `text-quoting-style', this function will never return nil. */) commit 90c6880a922029ba6e57adb2afe00a6fa57ef7fe Author: Stefan Monnier Date: Thu Oct 17 11:39:19 2024 -0400 (track-changes--after): Fix problem found in bug#73041 When calling `track-changes--before` (e.g. because of a missing b-f-c or for some other reason), it sets `track-changes--before-end` to the right value so we shouldn't increment it right after. Also, we should update `track-changes--buffer-size` before calling `track-changes--before` so it doesn't risk signaling a spurious inconsistency. * lisp/emacs-lisp/track-changes.el (track-changes--after): Update `track-changes--buffer-size` earlier, and don't increment `track-changes--before-end` when we call `track-changes--before`. diff --git a/lisp/emacs-lisp/track-changes.el b/lisp/emacs-lisp/track-changes.el index 92d14959763..1d5c5e9917a 100644 --- a/lisp/emacs-lisp/track-changes.el +++ b/lisp/emacs-lisp/track-changes.el @@ -555,16 +555,16 @@ Details logged to `track-changes--error-log'") (defun track-changes--after (beg end len) (cl-assert track-changes--state) - (and (eq track-changes--before-clean 'unset) - (not track-changes--before-no) - ;; This can be a sign that a `before-change-functions' went missing, - ;; or that we called `track-changes--clean-state' between - ;; a `before-change-functions' and `after-change-functions'. - (track-changes--before beg end)) - (setq track-changes--before-clean nil) (let ((offset (- (- end beg) len))) - (cl-incf track-changes--before-end offset) (cl-incf track-changes--buffer-size offset) + (if (and (eq track-changes--before-clean 'unset) + (not track-changes--before-no)) + ;; This can be a sign that a `before-change-functions' went missing, + ;; or that we called `track-changes--clean-state' between + ;; a `before-change-functions' and `after-change-functions'. + (track-changes--before beg end) + (cl-incf track-changes--before-end offset)) + (setq track-changes--before-clean nil) (if (not (or track-changes--before-no (save-restriction (widen) commit d3c94102266fa1fe167f699a92b9064c02b63d4f Author: Jim Porter Date: Wed Oct 16 10:44:35 2024 -0700 Fix Eshell's evaluation of empty 'progn' forms Do not merge to master. * lisp/eshell/esh-cmd.el (eshell-do-eval): Make sure we evaluate to 'nil' for 'progn' forms with no body (bug#73722). diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index e97e4f6d067..528c7f95594 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -1266,7 +1266,7 @@ have been replaced by constants." (setq args (cdr args))))) (cond ((eq (car form) 'progn) - (car (last form))) + (car (last (cdr form)))) ((eq (car form) 'prog1) (cadr form)) (t commit 78e6328fafddd4f39ed06d6ac4cecfb2f88d2fa4 Author: Eli Zaretskii Date: Wed Oct 16 09:04:02 2024 +0300 ; (select-safe-coding-system-interactively): Say "safely encode". diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 7d784ef3b1b..42b4f0034f1 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -737,7 +737,7 @@ DEFAULT is the coding system to use by default in the query." (format "string \"%s\"." from) (format-message "buffer `%s'." bufname))) (insert - "These default coding systems were tried to encode" + "These default coding systems were tried to safely encode" (if (stringp from) (concat " \"" (if (> (length from) 10) (concat (substring from 0 10) "...\"") @@ -758,9 +758,9 @@ e.g., for sending an email message.\n ") (insert (if rejected "The other coding systems" "However, each of them") (substitute-command-keys - " encountered characters it couldn't encode:\n")) + " encountered characters it couldn't encode safely:\n")) (dolist (coding unsafe) - (insert (format " %s cannot encode these:" (car coding))) + (insert (format " %s cannot safely encode these:" (car coding))) (let ((i 0) (func1 (lambda (bufname pos) commit c5eba443ae72b94024574d56a0dfdf11f339c1aa Author: Eli Zaretskii Date: Wed Oct 16 08:32:02 2024 +0300 ; * lisp/icomplete.el (icomplete-in-buffer): Doc fix (bug#73820). diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 2ea5e36fa88..f3569789e64 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -139,9 +139,17 @@ See `icomplete-delay-completions-threshold'." :type 'integer) (defcustom icomplete-in-buffer nil - "If non-nil, also use Icomplete when completing in non-mini buffers. + "If non-nil, use Icomplete when completing in buffers other than minibuffer. This affects commands like `completion-in-region', but not commands -that use their own completions setup." +that use their own completions setup. + +If you would prefer to see only Icomplete's in-buffer display, but do +not want the \"*Completions*\" buffer to pop up in those cases, add +this advice to your init file: + + (advice-add \\='completion-at-point + :after #\\='minibuffer-hide-completions) +" :type 'boolean) (defcustom icomplete-minibuffer-setup-hook nil commit 569186c36e3bce06e69c8c037553789ee21d722b Author: Eli Zaretskii Date: Wed Oct 16 07:59:59 2024 +0300 ; * doc/lispref/display.texi (Face Attributes): Fix typo (bug#73824). diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9075ff678e0..1d5ba98f062 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2767,7 +2767,7 @@ Draw a box with lines of width 1, in the foreground color. Draw a box with lines of width 1, in color @var{color}. @item @code{(:line-width (@var{vwidth} . @var{hwidth}) :color @var{color} :style @var{style})} -You can explicitly specify all aspects of the box with a plist on this +You can explicitly specify all aspects of the box with a plist of this form. Any element in this plist can be omitted. The values of @var{vwidth} and @var{hwidth} specify respectively the commit d5723fc4f03924cabc504ab6f0a537efc8cd9479 Author: Andrea Corallo Date: Tue Oct 15 21:27:47 2024 +0200 * lisp/progmodes/c-ts-mode.el (treesit-node-eq): Declare to silence warning. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 12003ff4727..73ec3f2bb2d 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -82,6 +82,7 @@ (declare-function treesit-node-prev-sibling "treesit.c") (declare-function treesit-node-first-child-for-pos "treesit.c") (declare-function treesit-node-next-sibling "treesit.c") +(declare-function treesit-node-eq "treesit.c") (declare-function treesit-query-compile "treesit.c") ;;; Custom variables commit 0085e48f917b4ddd0c698ecea1b30684b904b666 Author: Michael Albinus Date: Tue Oct 15 17:36:56 2024 +0200 * admin/notes/emba: Docker builds do not run in a worktree. diff --git a/admin/notes/emba b/admin/notes/emba index 2e61ec49ae5..59cbe687f95 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -89,7 +89,7 @@ As usual in GitLab, the tests run in containers, which could be applied also locally. Unfortunately, the Emba container registry, emba.gnu.org:5050, is not accessible publicly. Instead, the container images must be build locally. Change the current directory to a -recent Emacs branch, and apply the command +recent Emacs branch (not a worktree), and apply the command docker build --target emacs-inotify --tag emacs-inotify \ -f test/infra/Dockerfile.emba . commit 3d30905b0223f07cba74297ba032d71b8fe2632c Author: Ulrich Müller Date: Tue Oct 15 14:06:49 2024 +0200 * lisp/calc/calc-ext.el (math-approx-sqrt-e): Doc fix (bug#73817). diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 191149892a8..25d2492b277 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -2069,7 +2069,7 @@ calc-kill calc-kill-region calc-yank)))) (defconst math-approx-sqrt-e (math-read-number-simple "1.648721270700128146849") - "An approximation for sqrt(3).") + "An approximation for sqrt(e).") (math-defcache math-sqrt-e math-approx-sqrt-e (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) commit 94d0e9c4018cf948bd1ebabb118c02699c77c037 Author: Eli Zaretskii Date: Tue Oct 15 15:39:11 2024 +0300 : Revert a mistaken change * lisp/net/dictionary.el (dictionary-word-definition-face): Revert a mistakenly installed change. diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 3343d29da0f..f17dc160997 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -320,11 +320,7 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer." :version "30.1") (defface dictionary-word-definition-face - ;; w32 first, because 'supports' doesn't really tell whether the font - ;; family exists, and MS-Windows selects an ugly font as result. - '((((type w32)) - (:font "Sans Serif")) - (((supports (:family "DejaVu Serif"))) + '((((supports (:family "DejaVu Serif"))) (:family "DejaVu Serif")) (((type x)) (:font "Sans Serif")) @@ -332,7 +328,7 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer." (:font "default"))) "The face that is used for displaying the definition of the word." :group 'dictionary -:version "31.1") +:version "28.1") (defface dictionary-word-entry-face '((((type x)) commit 4d90a1d820916985e5e135254926f5554ddd3e46 Author: Robert Pluim Date: Tue Oct 15 10:16:22 2024 +0200 ; * doc/emacs/search.texi (Word Search): Spelling fixes. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index f23dc1fdb51..af069bbe194 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -807,21 +807,21 @@ look up, using the word at point as the default, then asks the @sc{dict} server to provide the definitions of that word in one or more dictionaries. By default, the command first tries to connect to the @sc{dict} server installed on the local host, and if that fails, it -tries @file{dict.org} after your confirmation; customize the variable +tries @file{dict.org} after asking for confirmation; customize the variable @code{dictionary-server} to specify, as a string, the URL of a single server to use (use @samp{localhost} if you want to query only the local server). Normally, @code{dictionary-search} tells the server to look up the word in all the dictionaries available to the server, but if you invoke the command with a prefix argument, it will prompt for a single -dictionary to look. The list of dictionaries available to a server can +dictionary to use. The list of dictionaries available to a server can be displayed by pressing the @samp{Select dictionary} button shown in the @file{*Dictionary*} buffer, described below. - First time you use @code{dictionary-search}, it creates a new + The first time you use @code{dictionary-search}, it creates a new @file{*Dictionary*} buffer and turns on a special mode in it. The buffer shows buttons for selecting a dictionary, searching a definition of another word, etc. Subsequent @code{dictionary-search} commands -reuse this buffer. To create another such buffer (e.g., too look up +reuse this buffer. To create another such buffer (e.g., to look up other words, perhaps in another dictionary), type @w{@kbd{M-x dictionary @key{RET}}}. commit c154047c46ae833a114e84d72e62269d12c3249d Author: Yuan Fu Date: Mon Oct 14 19:31:12 2024 -0700 Fix c-ts-mode--anchor-prev-sibling (bug#73661) * lisp/progmodes/c-ts-mode.el: (c-ts-mode--anchor-prev-sibling): Fix parentheses and use a slightly more efficient function. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: Replace the tab in the test code with spaces. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 576d715510d..12003ff4727 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -321,16 +321,17 @@ characters of the current line." ((or "#elif" "#else") (setq prev-sibling (treesit-node-prev-sibling (treesit-node-parent prev-sibling) t))) - ;; If the start of the previous sibling isn't at the - ;; beginning of a line, something's probably not quite - ;; right, go a step further. (E.g., comment after a - ;; statement.) If the previous sibling is the first named - ;; node then anchor to that, e.g. when returning an aggregate - ;; and starting the items on the same line as {. + ;; If the start of the previous sibling isn't at the beginning + ;; of a line, something's probably not quite right, go a step + ;; further. (E.g., comment after a statement.) If the + ;; previous sibling is the first named node, then anchor to + ;; that, e.g. when returning an aggregate and starting the + ;; items on the same line as {. (_ (goto-char (treesit-node-start prev-sibling)) (if (or (looking-back (rx bol (* whitespace)) - (line-beginning-position))) - (null (treesit-node-prev-sibling prev-sibling t)) + (line-beginning-position)) + (treesit-node-eq (treesit-node-child parent 0 t) + prev-sibling)) (setq continue nil) (setq prev-sibling (treesit-node-prev-sibling prev-sibling))))))) diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index a13a74cf8b3..f97ceac61f5 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -214,7 +214,7 @@ Name: Return Compund Literal struct pair { int fst, snd; }; struct pair make_pair(int long_identifier_a[], int long_identifier_b[], - int offset_a, int offset_b) + int offset_a, int offset_b) { int base_offset = 10; return (struct pair) { long_identifier_a[base_offset + offset_b], commit b87fda63dd4a29c3c28e235904405f2d6709239e Author: Earl Hyatt Date: Sun Oct 13 13:44:18 2024 -0400 Fix formatting of long keyboard macros by 'list-keyboard-macros'. * lisp/kmacro.el (kmacro-menu--refresh): Include the second argument of 'format-kbd-macro' so that the formatted keyboard macro is on a single line. (Bug#73797) diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 50ff875de52..6d43a3f680c 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -1576,7 +1576,7 @@ To customize possible responses, change the \"bindings\" in ,(format "%d" cnt) ,fmt ,(format fmt cnt) - ,(format-kbd-macro (kmacro--keys km))]))) + ,(format-kbd-macro (kmacro--keys km) 1)]))) (kmacro-menu--kmacros)) kmacro-menu--deletion-flags nil kmacro-menu--marks nil) commit ae75ea62324598654b32ed28bf644ec2bc4c04b2 Author: Eli Zaretskii Date: Sun Oct 13 18:29:34 2024 +0300 ; * src/fileio.c (Ffile_newer_than_file_p): Fix wording (bug#73709). diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index f17dc160997..3343d29da0f 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -320,7 +320,11 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer." :version "30.1") (defface dictionary-word-definition-face - '((((supports (:family "DejaVu Serif"))) + ;; w32 first, because 'supports' doesn't really tell whether the font + ;; family exists, and MS-Windows selects an ugly font as result. + '((((type w32)) + (:font "Sans Serif")) + (((supports (:family "DejaVu Serif"))) (:family "DejaVu Serif")) (((type x)) (:font "Sans Serif")) @@ -328,7 +332,7 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer." (:font "default"))) "The face that is used for displaying the definition of the word." :group 'dictionary -:version "28.1") +:version "31.1") (defface dictionary-word-entry-face '((((type x)) diff --git a/src/fileio.c b/src/fileio.c index 2db2760916b..1b1060d899f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3787,8 +3787,8 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "", DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0, doc: /* Return t if file FILE1 is newer than file FILE2. -If FILE1 does not exist, the answer is nil; -otherwise, if FILE2 does not exist, the answer is t. +If FILE1 does not exist, the return value is nil; +if FILE2 does not exist, the return value is t. For existing files, this compares their last-modified times. */) (Lisp_Object file1, Lisp_Object file2) { commit b120397868502e8e4ffc09fdeea6ef4c65662cd1 Merge: de54d922b5c 0f8f0773183 Author: Michael Albinus Date: Sun Oct 13 16:03:07 2024 +0200 Merge branch 'emacs-30' of git.sv.gnu.org:/srv/git/emacs into emacs-30 commit de54d922b5c239a474adb41c84ea316b266f1838 Author: Michael Albinus Date: Sun Oct 13 16:01:38 2024 +0200 * doc/emacs/mini.texi (Passwords): Mention password visibility. diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index a6d2a17ed50..3be9b76ad88 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -970,10 +970,14 @@ action with Emacs until you have submitted the password. backwards, removing the last character entered. @kbd{C-u} deletes everything you have typed so far. @kbd{C-g} quits the password prompt (@pxref{Quitting}). @kbd{C-y} inserts the current kill into the -password (@pxref{Killing}). You may type either @key{RET} or -@key{ESC} to submit the password. Any other self-inserting character -key inserts the associated character into the password, and all other -input is ignored. +password (@pxref{Killing}). @key{TAB} toggles the visibility of the +password. You may type either @key{RET} or @key{ESC} to submit the +password. Any other self-inserting character key inserts the associated +character into the password, and all other input is ignored. + + There is also an icon at the front of the mode line indicating the +password visibility. Clicking @kbd{mouse-1} on it toggles the password +visibility as well. @node Yes or No Prompts @section Yes or No Prompts