commit 14504fca8b5589c5c80a69dcab6e02681b196fa1 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Mon Dec 18 13:32:56 2023 +0800 Fix typo in earlier changes * src/sfnt.c (sfnt_poly_edges_exact): Don't overwrite the remainder of an ascending edge with its covered height. (main): Adjust tests. diff --git a/src/sfnt.c b/src/sfnt.c index 7d43f06b748..8bc37c1b978 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -5270,9 +5270,9 @@ #define TRIANGLE_AREA(width, height) \ /* Fill the remainder of the scanline with height-derived coverage. */ - if (x_pixel_max < width) - APPEND_STEP (x_pixel_max, ((y_top - y_bot) - * a->winding - last)); + if (x_pixel_max + 1 < width) + APPEND_STEP (x_pixel_max + 1, ((y_top - y_bot) + * a->winding - last)); } else /* if (x_bot > x_top) */ { @@ -20508,8 +20508,8 @@ main (int argc, char **argv) return 1; } -#define FANCY_PPEM 30 -#define EASY_PPEM 30 +#define FANCY_PPEM 12 +#define EASY_PPEM 12 interpreter = NULL; head = sfnt_read_head_table (fd, font); commit 8e06f224a9e275776d422ce3dbc30defdb563867 Author: F. Jason Park Date: Mon Dec 11 20:24:17 2023 -0800 Add erc-track integration to erc-nicks * lisp/erc/erc-button.el (erc-button--nick): Add `face-cache' slot. (erc-button-add-nickname-buttons): Pass `erc-button--nick' object, if created', as the boolean NICK-P parameter when calling `erc-button-add-button'. Keeping the latter function ignorant of `erc-button--nick' is of course preferable, but some coordination is now required to convey and use the "face cache". We can introduce an abstraction, like a local variable, if this becomes an issue. (erc-button-add-button): Use `erc--merge-prop' instead of `erc-button-add-face' to apply button faces. Hold off on deprecating the latter because it provides unique functionality for nesting faces. Also, consult NICK-P if it's an `erc-button--nick' object for the various overriding faces it knows about. * lisp/erc/erc-nicks.el (erc-nicks-track-faces): New option. (erc-nicks--get-face): Make generated face `:inherit' from `erc-nicks-backing-face'. (erc-nicks--highlight): Just return the generated face instead of combining it with `erc-nicks-backing-face'. (erc-nicks--highlight-button): Set the `face-cache' slot of the `erc-button--nick' object when `track' is loaded and initialized. (erc-nicks-mode, erc-nicks-enable, erc-nicks-disable): Add and remove `track' integration. (erc-nicks--reject-uninterned-faces): New function to remove faces created by `nicks' from buttonized speakers and mentions. Conform to `erc-track--face-reject-function' interface. (erc-nicks--ourps, erc-nicks--check-normals): New function and helper for `erc-track--alt-normals-function' interface. (erc-nicks--setup-track-integration): New function. (erc-nicks--remember-face-for-track): New function to cache nick faces owned by this module. * lisp/erc/erc.el (erc--merge-prop): Add new optional parameter `cache-fn', and when non-nil, call it, assigning the returned value to that of the merged property. * test/lisp/erc/erc-nicks-tests.el (erc-nicks-list-faces): Skip the "Inherit: " button. (Bug#67767) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 0af6911aaf4..d27aa299df2 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -372,7 +372,8 @@ erc-button--nick ( nickname-face erc-button-nickname-face :type symbol :documentation "Temp `erc-button-nickname-face' while buttonizing.") ( mouse-face erc-button-mouse-face :type symbol - :documentation "Temp `erc-button-mouse-face' while buttonizing.")) + :documentation "Function to return possibly cached face.") + ( face-cache nil :type (or null function))) ;; This variable is intended to serve as a "core" to be wrapped by ;; (built-in) modules during setup. It's unclear whether @@ -479,8 +480,7 @@ erc-button-add-nickname-buttons (erc-bounds-of-word-at-point))) (word (buffer-substring-no-properties (car bounds) (cdr bounds))) (down (erc-downcase word))) - (let* ((erc-button-mouse-face erc-button-mouse-face) - (erc-button-nickname-face erc-button-nickname-face) + (let* ((nick-obj t) (cuser (and erc-channel-users (or (gethash down erc-channel-users) (funcall erc-button--fallback-cmem-function @@ -489,19 +489,15 @@ erc-button-add-nickname-buttons (and erc-server-users (gethash down erc-server-users)))) (data (list word))) (when (or (not (functionp form)) - (and-let* ((user) - (obj (funcall form (make-erc-button--nick - :bounds bounds :data data - :downcased down :user user - :cuser (cdr cuser))))) - (setq erc-button-mouse-face ; might be null - (erc-button--nick-mouse-face obj) - erc-button-nickname-face ; might be null - (erc-button--nick-nickname-face obj) - data (erc-button--nick-data obj) - bounds (erc-button--nick-bounds obj)))) + (and user + (setq nick-obj (funcall form (make-erc-button--nick + :bounds bounds :data data + :downcased down :user user + :cuser (cdr cuser))) + data (erc-button--nick-data nick-obj) + bounds (erc-button--nick-bounds nick-obj)))) (erc-button-add-button (car bounds) (cdr bounds) (nth 3 entry) - 'nickp data)))))) + nick-obj data)))))) (defun erc-button-add-buttons-1 (regexp entry) "Search through the buffer for matches to ENTRY and add buttons." @@ -560,13 +556,20 @@ erc-button-add-button (move-marker pos (point)))))) (if nick-p (when erc-button-nickname-face - (erc-button-add-face from to erc-button-nickname-face)) + (erc--merge-prop from to 'font-lock-face + (or (and (erc-button--nick-p nick-p) + (erc-button--nick-nickname-face nick-p)) + erc-button-nickname-face) + nil (and (erc-button--nick-p nick-p) + (erc-button--nick-face-cache nick-p)))) (when erc-button-face - (erc-button-add-face from to erc-button-face))) + (erc--merge-prop from to 'font-lock-face erc-button-face))) (add-text-properties from to - (nconc (and erc-button-mouse-face - (list 'mouse-face erc-button-mouse-face)) + (nconc (and-let* ((face (or (and (erc-button--nick-p nick-p) + (erc-button--nick-mouse-face nick-p)) + erc-button-mouse-face))) + (list 'mouse-face face)) (list 'erc-callback fun) (list 'keymap erc-button-keymap) (list 'rear-nonsticky t) diff --git a/lisp/erc/erc-nicks.el b/lisp/erc/erc-nicks.el index fcd3afdbbc4..b46c5d43cd7 100644 --- a/lisp/erc/erc-nicks.el +++ b/lisp/erc/erc-nicks.el @@ -173,6 +173,20 @@ erc-nicks-key-suffix-format like \"@%-012n\"." :type 'string) +(defcustom erc-nicks-track-faces 'prioritize + "Show nick faces in the `track' module's portion of the mode line. +A value of nil means don't show nick faces at all. A value of +`defer' means have `track' consider nick faces only after those +ranked faces in `erc-track-faces-normal-list'. This has the +effect of \"alternating\" between a ranked \"normal\" and a nick. +The value `prioritize' means have `track' consider nick faces to +be \"normal\" unless the current speaker is the same as the +previous one, in which case pretend the value is `defer'. Like +most options in this module, updating the value mid-session is +not officially supported, although cycling \\[erc-nicks-mode] may +be worth a shot." + :type '(choice (const nil) (const defer) (const prioritize))) + (defvar erc-nicks--max-skip-search 3 ; make this an option? "Max number of faces to visit when testing `erc-nicks-skip-faces'.") @@ -195,6 +209,7 @@ erc-nicks--fg-rgb (defvar help-xref-stack) (defvar help-xref-stack-item) +(defvar erc-track--normal-faces) ;; https://stackoverflow.com/questions/596216#answer-56678483 (defun erc-nicks--get-luminance (color) @@ -454,7 +469,9 @@ erc-nicks--get-face (put new-face 'erc-nicks--nick nick) (put new-face 'erc-nicks--netid erc-networks--id) (put new-face 'erc-nicks--key key) - (face-spec-set new-face `((t :foreground ,color)) 'face-defface-spec) + (face-spec-set new-face `((t :foreground ,color + :inherit ,erc-nicks-backing-face)) + 'face-defface-spec) (set-face-documentation new-face (format "Internal face for %s on %s." nick (erc-network))) (puthash nick new-face table))))) @@ -503,12 +520,8 @@ erc-nicks--highlight ((not (and base-face (erc-nicks--skip-p base-face erc-nicks-skip-faces erc-nicks--max-skip-search)))) - (key (erc-nicks--gen-key-from-format-spec trimmed)) - (out (erc-nicks--get-face trimmed key))) - (if (or (null erc-nicks-backing-face) - (eq base-face erc-nicks-backing-face)) - out - (cons out (erc-list erc-nicks-backing-face))))) + (key (erc-nicks--gen-key-from-format-spec trimmed))) + (erc-nicks--get-face trimmed key))) (defun erc-nicks--highlight-button (nick-object) "Possibly add face to `erc-button--nick-user' NICK-OBJECT." @@ -518,7 +531,12 @@ erc-nicks--highlight-button 'font-lock-face)) (nick (erc-server-user-nickname (erc-button--nick-user nick-object))) (out (erc-nicks--highlight nick face))) - (setf (erc-button--nick-nickname-face nick-object) out)) + (setf (erc-button--nick-nickname-face nick-object) out + ;; + (erc-button--nick-face-cache nick-object) + (and erc-nicks-track-faces + (bound-and-true-p erc-track--normal-faces) + #'erc-nicks--remember-face-for-track))) nick-object) (define-erc-module nicks nil @@ -561,6 +579,8 @@ nicks erc-nicks--face-table (make-hash-table :test #'equal))) (setf (alist-get "Edit face" erc-button--nick-popup-alist nil nil #'equal) #'erc-nicks-customize-face) + (erc-nicks--setup-track-integration) + (add-hook 'erc-track-mode #'erc-nicks--setup-track-integration 50 t) (advice-add 'widget-create-child-and-convert :filter-args #'erc-nicks--redirect-face-widget-link)) ((kill-local-variable 'erc-nicks--face-table) @@ -572,8 +592,12 @@ nicks (kill-local-variable 'erc-nicks--downcased-skip-nicks) (when (fboundp 'erc-button--phantom-users-mode) (erc-button--phantom-users-mode -1)) + (remove-function (local 'erc-track--face-reject-function) + #'erc-nicks--reject-uninterned-faces) (remove-function (local 'erc-button--modify-nick-function) #'erc-nicks--highlight-button) + (remove-function (local 'erc-track--alt-normals-function) + #'erc-nicks--check-normals) (setf (alist-get "Edit face" erc-button--nick-popup-alist nil 'remove #'equal) nil) @@ -693,6 +717,58 @@ erc-nicks--colors-from-faces (color (face-foreground face))) (push color out))))) +(defun erc-nicks--reject-uninterned-faces (candidate) + "Remove own faces from CANDIDATE if it's a combination of faces." + (while-let ((next (car-safe candidate)) + ((facep next)) + ((not (intern-soft next)))) + (setq candidate (cdr candidate))) + (if (and (consp candidate) (not (cdr candidate))) (car candidate) candidate)) + +(define-inline erc-nicks--oursp (face) + (inline-quote + (and-let* ((sym (car-safe ,face)) + ((symbolp sym)) + ((get sym 'erc-nicks--key))) + sym))) + +(defun erc-nicks--check-normals (current contender contenders normals) + "Return a viable `nicks'-owned face from NORMALS in CONTENDERS. +But only do so if the CURRENT face is also one of ours and in +NORMALS and if the highest ranked CONTENDER among new faces is +`erc-default-face', the lowest ranking default priority face." + (and-let* (((eq contender 'erc-default-face)) + ((or (null current) (gethash current normals))) + (spkr (or (null current) (erc-nicks--oursp current)))) + (catch 'contender + (dolist (candidate (cdr contenders) contender) + (when-let (((not (equal candidate current))) + ((gethash candidate normals)) + (s (erc-nicks--oursp candidate)) + ((not (eq s spkr)))) + (throw 'contender candidate)))))) + +(defun erc-nicks--setup-track-integration () + "Restore traditional \"alternating normal\" face functionality to mode-line." + (when (bound-and-true-p erc-track-mode) + (pcase erc-nicks-track-faces + ;; Variant `defer' is handled elsewhere. + ('prioritize + (add-function :override (local 'erc-track--alt-normals-function) + #'erc-nicks--check-normals)) + ('nil + (add-function :override (local 'erc-track--face-reject-function) + #'erc-nicks--reject-uninterned-faces))))) + +(defun erc-nicks--remember-face-for-track (face) + "Add FACE to local hash table maintained by `track' module." + (or (gethash face erc-track--normal-faces) + (if-let ((sym (or (car-safe face) face)) + ((symbolp sym)) + ((get sym 'erc-nicks--key))) + (puthash face face erc-track--normal-faces) + face))) + (provide 'erc-nicks) ;;; erc-nicks.el ends here diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index d2452c5ca24..faa2cbefd1b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3413,12 +3413,14 @@ erc--merge-text-properties-p ;; values and optionally dispense archetypal constants in their place ;; in order to ensure all occurrences of some list (a b) across all ;; text-properties in all ERC buffers are actually the same object. -(defun erc--merge-prop (from to prop val &optional object) +(defun erc--merge-prop (from to prop val &optional object cache-fn) "Combine existing PROP values with VAL between FROM and TO in OBJECT. For spans where PROP is non-nil, cons VAL onto the existing value, ensuring a proper list. Otherwise, just set PROP to VAL. When VAL is itself a list, prepend its members onto an existing -value. See also `erc-button-add-face'." +value. Call CACHE-FN, when given, with the new value for prop. +It must return a suitable replacement or the same value. See +also `erc-button-add-face'." (let ((old (get-text-property from prop object)) (pos from) (end (next-single-property-change from prop object to)) @@ -3432,6 +3434,8 @@ erc--merge-prop (append val (ensure-list old)) (cons val (ensure-list old)))) val)) + (when cache-fn + (setq new (funcall cache-fn new))) (put-text-property pos end prop new object) (setq pos end old (get-text-property pos prop object) diff --git a/test/lisp/erc/erc-nicks-tests.el b/test/lisp/erc/erc-nicks-tests.el index 35264a23caa..54882278139 100644 --- a/test/lisp/erc/erc-nicks-tests.el +++ b/test/lisp/erc/erc-nicks-tests.el @@ -409,7 +409,7 @@ erc-nicks-list-faces (push-button) (should (search-forward-regexp (rx "Foreground: #" (group (+ xdigit)) eol))) - (forward-button 1) + (forward-button 2) ; skip Inherit:... (push-button)) (ert-info ("First entry's sample is rendered correctly") commit 0f058244ab7c4c2e5cb3fa5e4775c0f3cbe78e19 Author: F. Jason Park Date: Mon Jun 13 00:26:22 2022 -0700 Cache shortened channel names in erc-track * lisp/erc/erc-track.el (erc-track--shortened-names): New variable to stash both the latest inputs and most recent result of `erc-track-shorten-function'. (erc-track--shortened-names-current-hash, erc-track--shortened-names-set, erc-track--shortened-names-get): New pair of generalized-variable functions and helper variable for accessing and mutating `erc-track--shorten-prefixes'. (erc-modified-channels-display): Avoid redundant calls to `erc-track-shorten-function'. Mainly for use during batch processing. * test/lisp/erc/erc-track-tests.el (erc-track--shortened-names): New test. (Bug#67767) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index b704575ebca..27f20d5c503 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -378,6 +378,37 @@ erc-track-add-to-mode-line ;;; Shortening of names +(defvar erc-track--shortened-names nil + "A cons of the last novel name-shortening params and the result. +The CAR is a hash of environmental inputs such as options and +parameters passed to `erc-track-shorten-function'. Its effect is +only really noticeable during batch processing.") + +(defvar erc-track--shortened-names-current-hash nil) + +(defun erc-track--shortened-names-set (_ shortened) + "Remember SHORTENED names with hash of contextual params." + (cl-assert erc-track--shortened-names-current-hash) + (setq erc-track--shortened-names + (cons erc-track--shortened-names-current-hash shortened))) + +(defun erc-track--shortened-names-get (channel-names) + "Cache CHANNEL-NAMES with various contextual parameters. +For now, omit relevant options like `erc-track-shorten-start' and +friends, even though they do affect the outcome, because they +likely change too infrequently to matter over sub-second +intervals and are unlikely to be let-bound or set locally." + (when-let ((hash (setq erc-track--shortened-names-current-hash + (sxhash-equal (list channel-names + (buffer-list) + erc-track-shorten-function)))) + (erc-track--shortened-names) + ((= hash (car erc-track--shortened-names)))) + (cdr erc-track--shortened-names))) + +(gv-define-simple-setter erc-track--shortened-names-get + erc-track--shortened-names-set) + (defun erc-track-shorten-names (channel-names) "Call `erc-unique-channel-names' with the correct parameters. This function is a good value for `erc-track-shorten-function'. @@ -793,10 +824,13 @@ erc-modified-channels-display (or (buffer-name buf) "")) buffers)) - (short-names (if (functionp erc-track-shorten-function) - (funcall erc-track-shorten-function - long-names) - long-names)) + (erc-track--shortened-names-current-hash nil) + (short-names + (if (functionp erc-track-shorten-function) + (with-memoization + (erc-track--shortened-names-get long-names) + (funcall erc-track-shorten-function long-names)) + long-names)) strings) (while buffers (when (car short-names) diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el index 4477727be8a..ed3d190928f 100644 --- a/test/lisp/erc/erc-track-tests.el +++ b/test/lisp/erc/erc-track-tests.el @@ -104,6 +104,42 @@ erc-track--shorten-aggressive-max '("#emacs" "#vi")) '("#e" "#v"))) )) +(ert-deftest erc-track--shortened-names () + (let (erc-track--shortened-names + erc-track--shortened-names-current-hash + results) + + (with-memoization (erc-track--shortened-names-get + '("apple" "banana" "cherries")) + '("a" "b" "c")) + (should (integerp (car erc-track--shortened-names))) + (should (equal (cdr erc-track--shortened-names) '("a" "b" "c"))) + (push erc-track--shortened-names results) + + ;; Redundant call doesn't run. + (with-memoization (erc-track--shortened-names-get + '("apple" "banana" "cherries")) + (should-not 'run) + '("a" "b" "c")) + (should (equal erc-track--shortened-names (car results))) + + ;; Change in environment or context forces run. + (with-temp-buffer + (with-memoization (erc-track--shortened-names-get + '("apple" "banana" "cherries")) + '("x" "y" "z"))) + (should (and (integerp (car erc-track--shortened-names)) + (/= (car erc-track--shortened-names) (caar results)))) + (should (equal (cdr erc-track--shortened-names) '("x" "y" "z"))) + (push erc-track--shortened-names results) + + (with-memoization (erc-track--shortened-names-get + '("apple" "banana" "cherries")) + '("1" "2" "3")) + (should (and (integerp (car erc-track--shortened-names)) + (/= (car erc-track--shortened-names) (caar results)))) + (should (equal (cdr erc-track--shortened-names) '("1" "2" "3"))))) + (ert-deftest erc-track--erc-faces-in () "`erc-faces-in' should pick up both 'face and 'font-lock-face properties." (let ((str0 (copy-sequence "is bold")) commit 9d889af0d68a73aa45d112cbad9577f897b6e3c3 Author: F. Jason Park Date: Sun Dec 10 05:33:48 2023 -0800 Promote "normal" faces in erc-track * etc/ERC-NEWS: Add entry for new behavior involving the option `erc-track-faces-normal-list'. * lisp/erc/erc-button.el (erc-button-nick-default-face): New face to serve as default for `erc-button-nickname-face'. (erc-button-nickname-face): Change default value to `erc-button-nick-default-face'. * lisp/erc/erc-track.el (erc-track--massage-nick-button-faces): New function to serve as Custom :set function for priority and "normal" face-list options. (erc-track-faces-normal-list): Fix Custom :type by loading `erc-button' during validation so Customize chooses the correct UI instead of a generic form field with "(mismatch)" printed alongside the "STATE" button. (erc-track-faces-priority-list, erc-track-faces-normal-list): Remove values for "buttonized" `match' module faces that, if retained, would need updating to feature `erc-button-nick-default-face' instead of `erc-nick-default-face'. However, as noted in the NEWS entry, this ordering of button face atop match face is not possible. Use :set function to massage saved user values. (erc-track-ignore-normal-contenders-p): New compatibility switch to access pre-5.6 behavior, in which faces in `erc-track-faces-normal-list' were only considered for promotion to the mode line if the current face occupying that pole position wasn't present. (erc-track-mode, erc-track-enable, erc-track-disable): Add comments regarding perceived futility of hooking on `erc-server-001-functions' and likely unneeded hook removal. Run common buffer-local setup and teardown. (erc-track--normal-faces): New local variable, a snapshot of `erc-track-faces-normal-list'. (erc-track--setup): New function to stash `erc-track-faces-normal-list' on init. (erc-track-select-mode-line-face): Offer alternate explanation of certain particulars in doc string. (erc-track--alt-normals-function): New function-valued variable to allow other modules to intervene in deciding whether to pursue and promote a "normal" contending face. (erc-track--select-mode-line-face): New function similar to its public namesake except that it considers other viable candidates among the "normal" alternatives. (erc-track-modified-channels): Only run face selection portion when faces are actually found. Use `erc-track--select-mode-line-face' instead of `erc-track-select-mode-line-face'. * test/lisp/erc/erc-track-tests.el (erc-track-select-mode-line-face): New test. (erc-track-tests--select-mode-line-face): New fixture function. (erc-track--select-mode-line-face): New test. (Bug#67767) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 1311df3c21a..c883f575c15 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -163,6 +163,19 @@ options, like 'erc-command-indicator', have moved to the 'erc-goodies' library, although their Custom groups remain the same. Add 'command-indicator' to 'erc-modules' to get started. +** Option 'erc-track-faces-normal-list' slightly more influential. +This option has always been a source of confusion for users, mainly +because its influence rode heavily on the makeup of faces in a given +message. Historically, when a buffer's current mode-line face was a +member of this option's value, ERC would only swap it out for a fellow +"normal" if it was absent from the message being processed. Beginning +with this release, ERC now looks to other ranked and, if necessary, +unranked "normals" instead of sustaining the same face between +messages. This was done to better honor the stated purpose of the +option, which is to provide consistent visual feedback when buffer +activity occurs. If you experience problems with this development, +see the compatibility flag 'erc-track-ignore-normal-contenders-p'. + ** 'erc-button-alist' and 'erc-nick-popup-alist' have evolved slightly. It's no secret that the 'buttons' module treats potential nicknames specially. This is perhaps most evident in its treatment of the @@ -177,6 +190,23 @@ s-expressions, which ERC will continue to honor. Although the default lineup remains functionally equivalent, its members have all been updated accordingly. +** 'erc-track-faces-priority-list' and 'erc-track-faces-normal-list' slimmed. +These options have been purged of certain 'button'-related face +combinations. Originally added in ERC 5.3, these combinations +described the effect of "buttonizing" atop faces added by the 'match' +module, like '(erc-nick-default-face erc-pal-face)'. However, since +at least Emacs 27, 'match' has run before 'button' in +'erc-insert-modify-hook', meaning such permutations aren't possible. + +More importantly, users who've customized either of these options +should update them with the new default value of the option +'erc-button-nickname-face'. Like 'erc-nick-default-face', which it +replaces, the new 'erc-button-nick-default-face' is also a "real" +face. Its sole reason for existing is to make it easier for users and +modules to distinguish between basic buttonized faces and +'erc-nick-default-face', which is now reserved to mean the base +"speaker" face. + ** Option 'erc-query-on-unjoined-chan-privmsg' restored and renamed. This option was accidentally removed from the default client in ERC 5.5 and was thus prevented from influencing PRIVMSG routing. It's now @@ -329,6 +359,15 @@ from 't' to the more useful 'erc-prompt', although the property of the same name has been retained and now has a value of 'hidden' when disconnected. +*** Lists of faces in buttonized text are no longer nested. +Previously, when "buttonizing" a new region, ERC would combine faces +by blindly consing the new onto the existing. In theory, this kept a +nice record of all modifications to a given region. However, it also +complicated life for other modules wanting to analyze and operate on +these regions. Beginning with this release, ERC now merges combined +faces together when creating buttons, although the odd nested list may +still crop up here and there. + *** Members of insert- and send-related hooks have been reordered. As anyone reading this is no doubt aware, both built-in and third-party modules rely on certain hooks for adjusting incoming and diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 8e013c3a0d7..0af6911aaf4 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -70,6 +70,11 @@ erc-button "ERC button face." :group 'erc-faces) +(defface erc-button-nick-default-face '((t :inherit erc-nick-default-face)) + "Default face for a buttonized nickname." + :package-version '(ERC . "5.6") + :group 'erc-faces) + (defcustom erc-button-face 'erc-button "Face used for highlighting buttons in ERC buffers. @@ -78,8 +83,9 @@ erc-button-face :type 'face :group 'erc-faces) -(defcustom erc-button-nickname-face 'erc-nick-default-face +(defcustom erc-button-nickname-face 'erc-button-nick-default-face "Face used for ERC nickname buttons." + :package-version '(ERC . "5.6") :type 'face :group 'erc-faces) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 7dc4fe754cd..b704575ebca 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -161,23 +161,39 @@ erc-track-use-faces \(e.g. `erc-pal-face' is used if a pal sent a message to that channel.)" :type 'boolean) +(defun erc-track--massage-nick-button-faces (sym val &optional set-fn) + "Transform VAL of face-list option SYM to have new defaults. +Use `set'-compatible SET-FN when given. If an update was +performed, set the symbol property `erc-track--obsolete-faces' of +SYM to t." + (let* ((changedp nil) + (new (mapcar + (lambda (f) + (if (and (eq (car-safe f) 'erc-nick-default-face) + (equal f '(erc-nick-default-face erc-default-face))) + (progn + (setq changedp t) + (put sym 'erc-track--obsolete-faces t) + (cons 'erc-button-nick-default-face (cdr f))) + f)) + val))) + (if set-fn + (funcall set-fn sym (if changedp new val)) + (set-default sym (if changedp new val))))) + (defcustom erc-track-faces-priority-list '(erc-error-face - (erc-nick-default-face erc-current-nick-face) erc-current-nick-face erc-keyword-face - (erc-nick-default-face erc-pal-face) erc-pal-face erc-nick-msg-face erc-direct-msg-face (erc-button erc-default-face) - (erc-nick-default-face erc-dangerous-host-face) erc-dangerous-host-face erc-nick-default-face - (erc-nick-default-face erc-default-face) + (erc-button-nick-default-face erc-default-face) erc-default-face erc-action-face - (erc-nick-default-face erc-fool-face) erc-fool-face erc-notice-face erc-input-face @@ -188,6 +204,8 @@ erc-track-faces-priority-list Note that ERC prioritizes certain faces reserved for critical messages regardless of this option's value." + :package-version '(ERC . "5.6") + :set #'erc-track--massage-nick-button-faces :type (erc--with-dependent-type-match (repeat (choice face (repeat :tag "Combination" face))) erc-button)) @@ -209,10 +227,9 @@ erc-track-priority-faces-only (defcustom erc-track-faces-normal-list '((erc-button erc-default-face) - (erc-nick-default-face erc-dangerous-host-face) erc-dangerous-host-face erc-nick-default-face - (erc-nick-default-face erc-default-face) + (erc-button-nick-default-face erc-default-face) erc-default-face erc-action-face) "A list of faces considered to be part of normal conversations. @@ -224,9 +241,26 @@ erc-track-faces-normal-list message. This gives a rough indication that active conversations are occurring in these channels. +Note that ERC makes a copy of this option when initializing the +module. To see your changes reflected mid-session, cycle +\\[erc-track-mode]. + The effect may be disabled by setting this variable to nil." - :type '(repeat (choice face - (repeat :tag "Combination" face)))) + :package-version '(ERC . "5.6") + :set #'erc-track--massage-nick-button-faces + :type (erc--with-dependent-type-match + (repeat (choice face (repeat :tag "Combination" face))) + erc-button)) + +(defvar erc-track-ignore-normal-contenders-p nil + "Compatibility flag to promote only exclusively new \"normal\" faces. +When non-nil, revert to pre-5.6 behavior in which only a current +mode-line face that both outranks and is absent from the current +message is eligible for replacement by a fellow face from +`erc-track-faces-normal-list' that does appear in the message. +By extension, when enabled, never replace the current, reigning +mode-line face if it's present in the current message. May be +incompatible with modules introduced after ERC 5.5.") (defcustom erc-track-position-in-mode-line 'before-modes "Where to show modified channel information in the mode-line. @@ -518,6 +552,9 @@ track (progn (add-hook 'window-configuration-change-hook #'erc-user-is-active) (add-hook 'erc-send-completed-hook #'erc-user-is-active) + ;; FIXME find out why this uses `erc-server-001-functions'. + ;; `erc-user-is-active' runs when `erc-server-connected' is + ;; non-nil. But this hook usually only runs when it's nil. (add-hook 'erc-server-001-functions #'erc-user-is-active)) (erc-track-add-to-mode-line erc-track-position-in-mode-line) (erc-update-mode-line) @@ -528,6 +565,8 @@ track ;; enable the tracking keybindings (add-hook 'erc-connect-pre-hook #'erc-track-minor-mode-maybe) (erc-track-minor-mode-maybe)) + (add-hook 'erc-mode-hook #'erc-track--setup) + (unless erc--updating-modules-p (erc-buffer-do #'erc-track--setup)) (add-hook 'erc-networks--copy-server-buffer-functions #'erc-track--replace-killed-buffer)) ;; Disable: @@ -539,6 +578,7 @@ track #'erc-user-is-active) (remove-hook 'erc-send-completed-hook #'erc-user-is-active) (remove-hook 'erc-server-001-functions #'erc-user-is-active) + ;; FIXME remove this if unused. (remove-hook 'erc-timer-hook #'erc-user-is-active)) (remove-hook 'window-configuration-change-hook #'erc-window-configuration-change) @@ -548,9 +588,12 @@ track (remove-hook 'erc-connect-pre-hook #'erc-track-minor-mode-maybe) (when erc-track-minor-mode (erc-track-minor-mode -1))) + (remove-hook 'erc-mode-hook #'erc-track--setup) + (erc-buffer-do #'erc-track--setup) (remove-hook 'erc-networks--copy-server-buffer-functions #'erc-track--replace-killed-buffer))) +;; FIXME move this above the module definition. (defcustom erc-track-when-inactive nil "Enable channel tracking even for visible buffers, if you are inactive." :type 'boolean @@ -562,6 +605,51 @@ erc-track-when-inactive (erc-track-enable)) (set sym val)))) +(defvar-local erc-track--normal-faces nil + "Local copy of `erc-track-faces-normal-list' as a hash table.") + +(defun erc-track--setup () + "Initialize a buffer for use with the `track' module. +If this is a server buffer or `erc-track-faces-normal-list' is +locally bound, create a new `erc-track--normal-faces' for the +current buffer. Otherwise, set the local value to the server +buffer's." + (if erc-track-mode + (let ((existing (erc-with-server-buffer erc-track--normal-faces)) + (localp (and erc--target + (local-variable-p 'erc-track-faces-normal-list))) + (opts '(erc-track-faces-normal-list erc-track-faces-priority-list)) + warnp table) + ;; Don't bother warning users who've disabled `button'. + (unless (or erc--target (not (or (bound-and-true-p erc-button-mode) + (memq 'button erc-modules)))) + (when (or localp (local-variable-p 'erc-track-faces-priority-list)) + (dolist (opt opts) + (erc-track--massage-nick-button-faces opt (symbol-value opt) + #'set))) + (dolist (opt opts) + (when (get opt 'erc-track--obsolete-faces) + (push opt warnp) + (put opt 'erc-track--obsolete-faces nil))) + (when warnp + (erc--warn-once-before-connect 'erc-track-mode + (if (cdr warnp) "Options " "Option ") + (mapconcat (lambda (o) (format "`%S'" o)) warnp " and ") + (if (cdr warnp) " contain" " contains") + " an obsolete item, %S, intended to match buttonized nicknames." + " ERC has changed it to %S for the current session." + " Please save the current value to silence this message." + '(erc-nick-default-face erc-default-face) + '(erc-button-nick-default-face erc-default-face)))) + (when (or (null existing) localp) + (setq table (map-into (mapcar (lambda (f) (cons f f)) + erc-track-faces-normal-list) + '(hash-table :test equal :weakness value)))) + (setq erc-track--normal-faces (or table existing)) + (unless (or localp existing) + (erc-with-server-buffer (setq erc-track--normal-faces table)))) + (kill-local-variable 'erc-track--normal-faces))) + ;;; Visibility (defvar erc-buffer-activity nil @@ -766,7 +854,12 @@ erc-track-select-mode-line-face face, if a member of `erc-track-faces-normal-list', to be replaced with another with lower priority face from NEW-FACES, if that face with highest priority in NEW-FACES is also a member of -`erc-track-faces-normal-list'." +`erc-track-faces-normal-list'. + +To put it another way, when CUR-FACE outranks all NEW-FACES and +doesn't appear among them, it's eligible to be replaced with a +fellow \"normal\" from NEW-FACES. But if it does appear among +them, it can't be replaced." (let ((choice (catch 'face (dolist (candidate erc-track-faces-priority-list) (when (or (equal candidate cur-face) @@ -785,6 +878,53 @@ erc-track-select-mode-line-face choice)) choice)))) +(defvar erc-track--alt-normals-function nil + "A function to possibly elect a \"normal\" face. +Called with the current incumbent and the worthiest new contender +followed by all new contending faces and so-called \"normal\" +faces. See `erc-track--select-mode-line-face' for their meanings +and expected types. This function should return a face or nil.") + +(defun erc-track--select-mode-line-face (cur-face new-faces ranks normals) + "Return CUR-FACE or a replacement for displaying in the mode-line, or nil. +Expect RANKS to be a list of faces and both NORMALS and the car +of NEW-FACES to be hash tables mapping faces to non-nil values. +Assume the latter's makeup and that of RANKS to resemble +`erc-track-face-normal-list' and `erc-track-faces-priority-list'. +If NEW-FACES has a cdr, expect it to be its car's contents +ordered from most recently seen (later in the buffer) to +earliest. In general, act like `erc-track-select-mode-line-face' +except appeal to `erc-track--alt-normals-function' if it's +non-nil, falling back on reconsidering NEW-FACES when CUR-FACE +outranks all its members. That is, choose the first among RANKS +in NEW-FACES not equal to CUR-FACE. Failing that, choose the +first face in NEW-FACES that's also in NORMALS, assuming +NEW-FACES has a cdr." + (cl-check-type erc-track-ignore-normal-contenders-p null) + (cl-check-type new-faces cons) + (when-let ((choice (catch 'face + (dolist (candidate ranks) + (when (or (equal candidate cur-face) + (gethash candidate (car new-faces))) + (throw 'face candidate)))))) + (or (and erc-track--alt-normals-function + (funcall erc-track--alt-normals-function + cur-face choice new-faces normals)) + (and (equal choice cur-face) + (gethash choice normals) + (catch 'face + (progn + (dolist (candidate ranks) + (when (and (not (equal candidate choice)) + (gethash candidate (car new-faces)) + (gethash choice normals)) + (throw 'face candidate))) + (dolist (candidate (cdr new-faces)) + (when (and (not (equal candidate choice)) + (gethash candidate normals)) + (throw 'face candidate)))))) + choice))) + (defvar erc-track--skipped-msgs '(datestamp) "Values of `erc--msg' text prop to ignore.") @@ -819,31 +959,43 @@ erc-track-modified-channels ;; (in the car), change its face attribute (in the cddr) if ;; necessary. See `erc-modified-channels-alist' for the ;; exact data structure used. - (let ((faces (erc-faces-in (buffer-string))) - (erc-track-faces-priority-list - `(,@erc-track--attn-faces ,@erc-track-faces-priority-list))) - (unless (and - (or (eq erc-track-priority-faces-only 'all) - (member this-channel erc-track-priority-faces-only)) - (not (catch 'found - (dolist (f faces) - (when (member f erc-track-faces-priority-list) - (throw 'found t)))))) + (when-let + ((faces (if erc-track-ignore-normal-contenders-p + (erc-faces-in (buffer-string)) + (erc-track--get-faces-in-current-message))) + (normals erc-track--normal-faces) + (erc-track-faces-priority-list + `(,@erc-track--attn-faces ,@erc-track-faces-priority-list)) + (ranks erc-track-faces-priority-list) + ((not (and + (or (eq erc-track-priority-faces-only 'all) + (member this-channel erc-track-priority-faces-only)) + (not (catch 'found + (dolist (f ranks) + (when (gethash f (or (car-safe faces) faces)) + (throw 'found t))))))))) + (progn ; FIXME remove `progn' on next major edit (if (not (assq (current-buffer) erc-modified-channels-alist)) ;; Add buffer, faces and counts (setq erc-modified-channels-alist (cons (cons (current-buffer) (cons - 1 (erc-track-select-mode-line-face - nil faces))) + 1 (if erc-track-ignore-normal-contenders-p + (erc-track-select-mode-line-face + nil faces) + (erc-track--select-mode-line-face + nil faces ranks normals)))) erc-modified-channels-alist)) ;; Else modify the face for the buffer, if necessary. (when faces (let* ((cell (assq (current-buffer) erc-modified-channels-alist)) (old-face (cddr cell)) - (new-face (erc-track-select-mode-line-face - old-face faces))) + (new-face (if erc-track-ignore-normal-contenders-p + (erc-track-select-mode-line-face + old-face faces) + (erc-track--select-mode-line-face + old-face faces ranks normals)))) (setcdr cell (cons (1+ (cadr cell)) new-face))))) ;; And display it (erc-modified-channels-display))) @@ -872,6 +1024,30 @@ erc-faces-in (push cur faces))) faces)) +(defvar erc-track--face-reject-function nil + "Function called with face in current buffer to massage or reject.") + +(defun erc-track--get-faces-in-current-message () + "Collect all faces in the narrowed buffer. +Return a cons of a hash table and a list ordered from most +recently seen to earliest seen." + (let ((i (text-property-not-all (point-min) (point-max) 'font-lock-face nil)) + (seen (make-hash-table :test #'equal)) + ;; + (rfaces ()) + (faces (make-hash-table :test #'equal))) + (while-let ((i) + (cur (get-text-property i 'face))) + (unless (gethash cur seen) + (puthash cur t seen) + (when erc-track--face-reject-function + (setq cur (funcall erc-track--face-reject-function cur))) + (when cur + (push cur rfaces) + (puthash cur t faces))) + (setq i (next-single-property-change i 'font-lock-face))) + (cons faces rfaces))) + ;;; Buffer switching (defvar erc-track-last-non-erc-buffer nil diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el index ab8d708b721..4477727be8a 100644 --- a/test/lisp/erc/erc-track-tests.el +++ b/test/lisp/erc/erc-track-tests.el @@ -120,4 +120,134 @@ erc-track--erc-faces-in (should (erc-faces-in str0)) (should (erc-faces-in str1)) )) +;; This simulates an alternating bold/non-bold [#c] in the mode-line, +;; i.e., an `erc-modified-channels-alist' that vacillates between +;; +;; ((# 42 . erc-default-face)) +;; +;; and +;; +;; ((# 42 erc-nick-default-face erc-default-face)) +;; +;; This is a fairly typical scenario where consecutive messages +;; feature speaker and addressee button highlighting and otherwise +;; plain message bodies. This mapping of phony to real faces +;; describes the picture in 5.6: +;; +;; `1': (erc-button erc-default-face) ; URL +;; `2': (erc-nick-default-face erc-default-face) ; mention +;; `3': erc-default-face ; body +;; `_': (erc-nick-default-face erc-nick-default-face) ; speaker +;; +;; The `_' represents a commonly occurring face (a ) that's +;; not present in either option's default (standard) value. It's a +;; no-op from the POV of `erc-track-select-mode-line-face'. + +(ert-deftest erc-track-select-mode-line-face () + + ;; Observed (see key above). + (let ((erc-track-faces-priority-list '(1 2 3)) + (erc-track-faces-normal-list '(1 2 3))) + + (should (equal 2 (erc-track-select-mode-line-face 3 '(2 _ 3)))) + (should (equal 2 (erc-track-select-mode-line-face 2 '(2 _ 3)))) + (should (equal 3 (erc-track-select-mode-line-face 2 '(_ 3)))) + (should (equal 2 (erc-track-select-mode-line-face 3 '(2 3)))) + (should (equal 3 (erc-track-select-mode-line-face 2 '(3)))) + + (should (equal 1 (erc-track-select-mode-line-face 1 '(2 1 3)))) + (should (equal 1 (erc-track-select-mode-line-face 1 '(1 3)))) + (should (equal 1 (erc-track-select-mode-line-face 1 '(1 3 2)))) + (should (equal 1 (erc-track-select-mode-line-face 1 '(3 1))))) + + ;; When the current face outranks all new faces and doesn't appear + ;; among them, it's eligible to be replaced with a fellow "normal" + ;; from those new faces. But if it does appear among them, it's + ;; never replaced. + (let ((erc-track-faces-priority-list '(a b)) + (erc-track-faces-normal-list '(a b))) + + (should (equal 'a (erc-track-select-mode-line-face 'a '(b a)))) + (should (equal 'a (erc-track-select-mode-line-face 'a '(a b)))) + (should (equal 'a (erc-track-select-mode-line-face 'b '(b a)))) + (should (equal 'a (erc-track-select-mode-line-face 'b '(a b)))) + + (should (equal 'a (erc-track-select-mode-line-face 'b '(a)))) + (should (equal 'b (erc-track-select-mode-line-face 'a '(b))))) + + ;; The ordering of the "normal" list doesn't matter. + (let ((erc-track-faces-priority-list '(a b)) + (erc-track-faces-normal-list '(b a))) + + (should (equal 'a (erc-track-select-mode-line-face 'a '(b a)))) + (should (equal 'a (erc-track-select-mode-line-face 'a '(a b)))) + (should (equal 'a (erc-track-select-mode-line-face 'b '(b a)))) + (should (equal 'a (erc-track-select-mode-line-face 'b '(a b)))))) + +(defun erc-track-tests--select-mode-line-face (ranked normals cases) + (setq normals (map-into (mapcar (lambda (f) (cons f t)) normals) + '(hash-table :test equal))) + (pcase-dolist (`(,want ,cur-face ,new-faces) cases) + + (ert-info ((format "Observed: {cur: %S, new: %S, want: %S}" + cur-face new-faces want)) + (setq new-faces (cons (map-into + (mapcar (lambda (f) (cons f t)) new-faces) + '(hash-table :test equal)) + (reverse new-faces))) + (should (equal want (funcall #'erc-track--select-mode-line-face + cur-face new-faces ranked normals)))))) + +;; The main difference between these variants is that with the above, +;; when given alternating lines like +;; +;; CUR NEW CHOICE +;; text (mention $speaker text) => mention +;; mention ($speaker text) => text +;; +;; we see the effect of alternating faces in the indicator. But when +;; given consecutive lines with a similar composition, like +;; +;; text (mention $speaker text) => mention +;; text (mention $speaker text) => mention +;; +;; we lose the effect. With the variant below, we get +;; +;; text (mention $speaker text) => mention +;; text (mention $speaker text) => text +;; + +(ert-deftest erc-track--select-mode-line-face () + (should-not erc-track-ignore-normal-contenders-p) + + ;; These are the same test cases from the previous test. The syntax + ;; is (expected cur-face new-faces). + (erc-track-tests--select-mode-line-face + '(1 2 3) '(1 2 3) + '((2 3 (2 _ 3)) + (3 2 (2 _ 3)) + (3 2 (_ 3)) + (2 3 (2 3)) + (3 2 (3)) + (2 1 (2 1 3)) + (3 1 (1 3)) + (2 1 (1 3 2)) + (3 1 (3 1)))) + + (erc-track-tests--select-mode-line-face + '(a b) '(a b) + '((b a (b a)) + (b a (a b)) + (a b (b a)) + (a b (a b)) + (a b (a)) + (b a (b)))) + + (erc-track-tests--select-mode-line-face + '(a b) '(b a) + '((b a (b a)) + (b a (a b)) + (a b (b a)) + (a b (a b))))) + ;;; erc-track-tests.el ends here commit 741bce84890013e0452a4d8d70579ec731ba1cb5 Author: F. Jason Park Date: Tue Dec 12 19:06:52 2023 -0800 Forgo excess nick buttonizing on JOINs and QUITs * etc/ERC-NEWS: Mention nick-button deduping. * lisp/erc/erc-button.el (erc-button-highlight-nick-once): New variable to specify commands and numerics for messages that ERC should forgo redundant buttonizing atop, assuming the presence of a "userhost". (erc-button--fallback-cmem-function): Change default value to `erc-button--get-user-from-spkr-prop'. (erc-button--get-user-from-spkr-prop): New function to derive user object from `erc--spkr' "msg prop". The point is to allow `erc-speaker-from-channel-member-function' to return a display name that differs from the speaker's actual nick as recorded by its `erc-server-user' object. (erc-button--get-phantom-cmem): Add `count' parameter. (erc-button-add-nickname-buttons): Stop after first turn if the current command appears in `erc-button-highlight-nick-once'. Pass iteration count to `erc-button--fallback-cmem-function'. (Bug#67677) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index bd8e95fa4ac..1311df3c21a 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -212,6 +212,13 @@ currently most prominent in "/ME" messages, where 'erc-action-face' sits beneath 'erc-input-face', as well as 'erc-my-nick-face' in the speaker portion. +** Fewer nick buttons in QUIT, JOIN, and PART messages. +Common messages that show a nickname followed by a "userhost" often +end up with redundant buttons because the nick reappears in or is the +same as the "~user" portion. ERC now tamps down on this to make +ing around more convenient. To opt out, see the new variable +'erc-button-highlight-nick-once'. + ** Improved interplay between buffer truncation and message logging. While most of these improvements are subtle, some affect everyday use. For example, users of the 'truncate' module may notice that truncation diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index e1c10be53f6..8e013c3a0d7 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -216,6 +216,9 @@ erc-emacswiki-lisp-url "URL of the EmacsWiki ELisp area." :type 'string) +(defvar erc-button-highlight-nick-once '(QUIT PART JOIN) + "Messages for which to buttonize only the first nick occurrence.") + (defvar erc-button-keymap (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") #'erc-button-press-button) @@ -382,11 +385,22 @@ erc-button--modify-nick-function (defvar-local erc-button--phantom-cmems nil) -(defvar erc-button--fallback-cmem-function #'ignore +(defvar erc-button--fallback-cmem-function + #'erc-button--get-user-from-spkr-prop "Function to determine channel member if not found in the usual places. -Called with DOWNCASED-NICK, NICK, and NICK-BOUNDS when +Called with DOWNCASED-NICK, NICK, NICK-BOUNDS, and COUNT when `erc-button-add-nickname-buttons' cannot find a user object for -DOWNCASED-NICK in `erc-channel-users' or `erc-server-users'.") +DOWNCASED-NICK in `erc-channel-users' or `erc-server-users'. +NICK-BOUNDS is a cons of buffer positions, and COUNT is a number +incremented with each visit, starting at 1.") + +(defun erc-button--get-user-from-spkr-prop (_ _ _ count) + "Attempt to obtain an `erc-channel-user' from current \"msg props\". +But only do so when COUNT is 1, meaning this is the first button +candidate in the just-inserted message." + (and-let* (((= 1 count)) + (nick (erc--check-msg-prop 'erc--spkr))) + (gethash nick erc-channel-users))) ;; Historical or fictitious users. As long as these two structs ;; remain superficial "subclasses" with the same slots and defaults, @@ -408,7 +422,7 @@ erc-button--add-phantom-speaker (puthash downcased (cons user cuser) erc-button--phantom-cmems) (cons user cuser))) -(defun erc-button--get-phantom-cmem (down _word _bounds) +(defun erc-button--get-phantom-cmem (down _word _bounds _count) (gethash down erc-button--phantom-cmems)) (define-minor-mode erc-button--phantom-users-mode @@ -446,10 +460,15 @@ erc-button-add-nickname-buttons (and erc-button-buttonize-nicks erc-button--modify-nick-function))) (erc-button--extract-form form))) + (oncep (if-let ((erc-button-highlight-nick-once) + (c (erc--check-msg-prop 'erc--cmd)) + ((memq c erc-button-highlight-nick-once))) + 1 0)) (seen 0)) (goto-char (point-min)) (while-let - (((erc-forward-word)) + (((or (zerop seen) (zerop oncep))) + ((erc-forward-word)) (bounds (or (and (= 1 (cl-incf seen)) (erc--get-speaker-bounds)) (erc-bounds-of-word-at-point))) (word (buffer-substring-no-properties (car bounds) (cdr bounds))) @@ -459,7 +478,7 @@ erc-button-add-nickname-buttons (cuser (and erc-channel-users (or (gethash down erc-channel-users) (funcall erc-button--fallback-cmem-function - down word bounds)))) + down word bounds seen)))) (user (or (and cuser (car cuser)) (and erc-server-users (gethash down erc-server-users)))) (data (list word))) commit 08ec3e89793646787698cb5edd1681f498c266cf Author: F. Jason Park Date: Sun Apr 30 08:09:29 2023 -0700 Rename erc-channel-users to erc-channel-members * etc/ERC-NEWS: Mention name change. * lisp/erc/erc-backend.el (erc-process-sentinel): Don't create an empty `erc-channel-users' hash table in server buffers. This is arguably a bug fix as well as a minor breaking change. * lisp/erc/erc-common.el (erc-get-channel-user, erc-get-channel-member): Rename and alias former to latter. * lisp/erc/erc.el (erc-channel-users, erc-channel-members): Rename former to latter. The old name invited much confusion because the table's values are not mere `erc-channel-user' instances but cons cells that include them and their corresponding server users. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 9609be7206e..bd8e95fa4ac 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -460,6 +460,16 @@ like "+" (for "voice"), and to avoid confusion with user modes, like "+i" (for "invisible"). Additionally, its lone parameter is now overloaded to accept an 'erc-channel-user' object as well as a string. +*** Channel-membership table 'erc-channel-users' renamed. +Distinguishing between 'erc-channel-user' objects and values of the +'erc-channel-users' (plural) hash-table has been a constant source of +confusion, even within ERC's own code base. The hash-table's values +are cons cells whose CDR slot is an 'erc-channel-user'. To help keep +things sane, 'erc-channel-users' (plural) is now officially being +redubbed 'erc-channel-members'. Similarly, the utility function +'erc-get-channel-user' has been renamed to 'erc-get-channel-member'. +Expect deprecations of the old names to follow in a future release. + *** The 'erc-channel-user' struct has a changed internally. The five boolean slots for membership prefixes have been folded ("encoded") into a single integer slot. However, the old 'setf'-able diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 1aee8cff345..0c336540483 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -104,7 +104,7 @@ (defvar erc--display-context) (defvar erc--target) (defvar erc-channel-list) -(defvar erc-channel-users) +(defvar erc-channel-members) (defvar erc-default-nicks) (defvar erc-default-recipients) (defvar erc-ensure-target-buffer-on-privmsg) @@ -1108,11 +1108,10 @@ erc-process-sentinel (setq erc-server-ping-handler nil))) (run-hook-with-args 'erc-disconnected-hook (erc-current-nick) (system-name) "") - (dolist (buf (erc-buffer-filter (lambda () (boundp 'erc-channel-users)) cproc)) - (with-current-buffer buf - (when (erc--target-channel-p erc--target) - (setf (erc--target-channel-joined-p erc--target) nil)) - (setq erc-channel-users (make-hash-table :test 'equal)))) + (erc-with-all-buffers-of-server cproc (lambda () erc-channel-members) + (when (erc--target-channel-p erc--target) + (setf (erc--target-channel-joined-p erc--target) nil)) + (clrhash erc-channel-members)) ;; Hide the prompt (erc--hide-prompt cproc) ;; Decide what to do with the buffer diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index a45bdd833e8..64312e51f41 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -523,9 +523,10 @@ erc-downcase (_ erc--casemapping-rfc1459)) (downcase string))) -(define-inline erc-get-channel-user (nick) - "Find NICK in the current buffer's `erc-channel-users' hash table." +(define-inline erc-get-channel-member (nick) + "Find NICK in the current buffer's `erc-channel-members' hash table." (inline-quote (gethash (erc-downcase ,nick) erc-channel-users))) +(defalias 'erc-get-channel-user #'erc-get-channel-member) (define-inline erc-get-server-user (nick) "Find NICK in the current server's `erc-server-users' hash table." diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 556682b729f..d2452c5ca24 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -474,13 +474,14 @@ erc-connect-pre-hook :group 'erc-hooks :type 'hook) - -(defvar-local erc-channel-users nil +(defvaralias 'erc-channel-users 'erc-channel-members) +(defvar-local erc-channel-members nil "Hash table of members in the current channel. -It associates nicknames with cons cells of the form: -\(USER . MEMBER-DATA) where USER is a pointer to an -erc-server-user struct, and MEMBER-DATA is a pointer to an -erc-channel-user struct.") +It associates nicknames with cons cells of the form +\(SERVER-USER . MEMBER-DATA), where SERVER-USER is a +`erc-server-user' object and MEMBER-DATA is a `erc-channel-user' +object. Convenient abbreviations for these two components are +`susr' and `cusr', along with `cmem' for the pair.") (defvar-local erc-server-users nil "Hash table of users on the current server. commit 6e4417eaa7e8554ce54960180e938e3f5ac560dc Author: F. Jason Park Date: Sun Apr 30 07:45:01 2023 -0700 Consolidate status-prefix slots of erc-channel-user * etc/ERC-NEWS: Mention change even though the API remains undisturbed. * lisp/erc/erc-common.el (erc-channel-user): "Encode" status prefix slots `voice', `halfop', `op', `admin', and `owner' as single `status' slot. Add backward-compatible constructor. Although the old layout was overly sparse, since the vast majority of users have no membership status at all, the point here is not to trade time for space but rather to improve human readability of ERC buffer substrings containing text props that reference `erc-channel-user' objects. * lisp/erc/erc.el (erc--define-channel-user-status-compat-getter): Helper macro for declaring compat-oriented "getters" for status-prefix slots of `erc-channel-user'. (erc-channel-user-voice, erc-channel-user-halfop, erc-channel-user-op, erc-channel-user-admin, erc-channel-user-owner): Add compat getters. These are not new functions. They were previously defined by the `erc-channel-user' `cl-defstruct' in erc-common.el. (erc--update-cusr-status-if-changed): New helper macro to make `erc-update-current-channel-member' more readable. (erc-update-current-channel-member): Collapse some overly verbose "unrolled" forms using helper macro and more compact expressions. * test/lisp/erc/erc-tests.el (erc-channel-user): New test. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index b38ebfe208c..9609be7206e 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -460,6 +460,15 @@ like "+" (for "voice"), and to avoid confusion with user modes, like "+i" (for "invisible"). Additionally, its lone parameter is now overloaded to accept an 'erc-channel-user' object as well as a string. +*** The 'erc-channel-user' struct has a changed internally. +The five boolean slots for membership prefixes have been folded +("encoded") into a single integer slot. However, the old 'setf'-able +accessors remain available, and the constructor's signature remains +unchanged. Since third-party code must be recompiled when upgrading +ERC anyway, users shouldn't experience any churn. The only caveat is +that third-party code using the literal read-syntax of these objects, +for example, in unit tests, will have to be updated. + *** Hidden messages contain a preceding rather than trailing newline. ERC has traditionally only offered to hide messages involving fools, but plans are to make hiding more powerful. Anyone depending on the diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 0b865387671..a45bdd833e8 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -68,8 +68,23 @@ erc-input ;; Buffers (buffers nil)) -(cl-defstruct (erc-channel-user (:type vector) :named) - voice halfop op admin owner +(cl-defstruct (erc-channel-user (:type vector) + (:constructor + erc-channel-user--make + (&key (status 0) (last-message-time nil))) + (:constructor + make-erc-channel-user + ( &key voice halfop op admin owner + last-message-time + &aux (status (+ (if voice 1 0) + (if halfop 2 0) + (if op 4 0) + (if admin 8 0) + (if owner 16 0))))) + :named) + "Object containing channel-specific data for a single user." + ;; voice halfop op admin owner + (status 0 :type integer) ;; Last message time (in the form of the return value of ;; (current-time) ;; diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 759907b7618..556682b729f 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -597,6 +597,29 @@ erc-remove-channel-users erc-channel-users) (clrhash erc-channel-users))) +(defmacro erc--define-channel-user-status-compat-getter (name n) + "Define a gv getter for historical `erc-channel-user' status slot NAME. +Expect NAME to be a string and N to be its associated power-of-2 +\"enumerated flag\" integer." + `(defun ,(intern (concat "erc-channel-user-" name)) (u) + ,(format "Get equivalent of pre-5.6 `%s' slot for `erc-channel-user'." + name) + (declare (gv-setter (lambda (v) + (macroexp-let2 nil v v + (,'\`(let ((val (erc-channel-user-status ,',u))) + (setf (erc-channel-user-status ,',u) + (if ,',v + (logior val ,n) + (logand val ,(lognot n)))) + ,',v)))))) + (= ,n (logand ,n (erc-channel-user-status u))))) + +(erc--define-channel-user-status-compat-getter "voice" 1) +(erc--define-channel-user-status-compat-getter "halfop" 2) +(erc--define-channel-user-status-compat-getter "op" 4) +(erc--define-channel-user-status-compat-getter "admin" 8) +(erc--define-channel-user-status-compat-getter "owner" 16) + (defun erc-channel-user-owner-p (nick) "Return non-nil if NICK is an owner of the current channel." (and nick @@ -6764,6 +6787,19 @@ erc-update-user (run-hooks 'erc-channel-members-changed-hook)))))) changed)) +;; This exists solely to make `erc-update-current-channel-member' more +;; readable. Having to resort to it is admittedly not ideal. While +;; it would seem at first glance that we could go further and encode +;; the combined status in one go, we can't without gating the entire +;; operation on the parameters `admin', `halfop', etc. being non-nil. +(defmacro erc--update-cusr-status-if-changed (cuser changed-var status-var) + "Maybe update STATUS-VAR slot of `erc-channel-user' CUSER, and CHANGED-VAR." + (let ((accessor (intern (format "erc-channel-user-%s" status-var)))) + `(when (and ,status-var (not (eq (,accessor ,cuser) ,status-var))) + (setf (,accessor ,cuser) (and (not (eq ,status-var 'off)) + (and ,status-var t)) + ,changed-var t)))) + (defun erc-update-current-channel-member (nick new-nick &optional add voice halfop op admin owner host login full-name info update-message-time) @@ -6791,41 +6827,11 @@ erc-update-current-channel-member (if cuser (progn (erc-log (format "update-member: user = %S, cuser = %S" user cuser)) - (when (and voice - (not (eq (erc-channel-user-voice cuser) voice))) - (setq changed t) - (setf (erc-channel-user-voice cuser) - (cond ((eq voice 'on) t) - ((eq voice 'off) nil) - (t voice)))) - (when (and halfop - (not (eq (erc-channel-user-halfop cuser) halfop))) - (setq changed t) - (setf (erc-channel-user-halfop cuser) - (cond ((eq halfop 'on) t) - ((eq halfop 'off) nil) - (t halfop)))) - (when (and op - (not (eq (erc-channel-user-op cuser) op))) - (setq changed t) - (setf (erc-channel-user-op cuser) - (cond ((eq op 'on) t) - ((eq op 'off) nil) - (t op)))) - (when (and admin - (not (eq (erc-channel-user-admin cuser) admin))) - (setq changed t) - (setf (erc-channel-user-admin cuser) - (cond ((eq admin 'on) t) - ((eq admin 'off) nil) - (t admin)))) - (when (and owner - (not (eq (erc-channel-user-owner cuser) owner))) - (setq changed t) - (setf (erc-channel-user-owner cuser) - (cond ((eq owner 'on) t) - ((eq owner 'off) nil) - (t owner)))) + (erc--update-cusr-status-if-changed cuser changed voice) + (erc--update-cusr-status-if-changed cuser changed halfop) + (erc--update-cusr-status-if-changed cuser changed op) + (erc--update-cusr-status-if-changed cuser changed admin) + (erc--update-cusr-status-if-changed cuser changed owner) (when update-message-time (setf (erc-channel-user-last-message-time cuser) (current-time))) (setq user-changed @@ -6846,21 +6852,11 @@ erc-update-current-channel-member (cons (current-buffer) (erc-server-user-buffers user)))) (setq cuser (make-erc-channel-user - :voice (cond ((eq voice 'on) t) - ((eq voice 'off) nil) - (t voice)) - :halfop (cond ((eq halfop 'on) t) - ((eq halfop 'off) nil) - (t halfop)) - :op (cond ((eq op 'on) t) - ((eq op 'off) nil) - (t op)) - :admin (cond ((eq admin 'on) t) - ((eq admin 'off) nil) - (t admin)) - :owner (cond ((eq owner 'on) t) - ((eq owner 'off) nil) - (t owner)) + :voice (and (not (eq voice 'off)) (and voice t)) + :halfop (and (not (eq halfop 'off)) (and halfop t)) + :op (and (not (eq op 'off)) (and op t)) + :admin (and (not (eq admin 'off)) (and admin t)) + :owner (and (not (eq owner 'off)) (and owner t)) :last-message-time (if update-message-time (current-time)))) (puthash (erc-downcase nick) (cons user cuser) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index b7e0cdcaa21..45cf4ea489f 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -3046,6 +3046,57 @@ erc-handle-irc-url (kill-buffer "baznet") (kill-buffer "#chan"))) +(ert-deftest erc-channel-user () + ;; Traditional and alternate constructor swapped for compatibility. + (should (= 0 (erc-channel-user-status (erc-channel-user--make)))) + (should-not (erc-channel-user-last-message-time (erc-channel-user--make))) + + (should (= 42 (erc-channel-user-last-message-time + (make-erc-channel-user :last-message-time 42)))) + + (should (zerop (erc-channel-user-status (make-erc-channel-user)))) + + (let ((u (make-erc-channel-user))) + + (ert-info ("Add voice status to user") + (should (= 0 (erc-channel-user-status u))) + (should-not (erc-channel-user-voice u)) + (should (eq t (setf (erc-channel-user-voice u) t))) + (should (eq t (erc-channel-user-voice u)))) + + (ert-info ("Add op status to user") + (should (= 1 (erc-channel-user-status u))) + (should-not (erc-channel-user-op u)) + (should (eq t (setf (erc-channel-user-op u) t))) + (should (eq t (erc-channel-user-op u)))) + + (ert-info ("Add owner status to user") + (should (= 5 (erc-channel-user-status u))) + (should-not (erc-channel-user-owner u)) + (should (eq t (setf (erc-channel-user-owner u) t))) + (should (eq t (erc-channel-user-owner u)))) + + (ert-info ("Remove owner status from user") + (should (= 21 (erc-channel-user-status u))) + (should-not (setf (erc-channel-user-owner u) nil)) + (should-not (erc-channel-user-owner u))) + + (ert-info ("Remove op status from user") + (should (= 5 (erc-channel-user-status u))) + (should-not (setf (erc-channel-user-op u) nil)) + (should-not (erc-channel-user-op u))) + + (ert-info ("Remove voice status from user") + (should (= 1 (erc-channel-user-status u))) + (should-not (setf (erc-channel-user-voice u) nil)) + (should-not (erc-channel-user-voice u))) + + (ert-info ("Remove voice status from zeroed user") + (should (= 0 (erc-channel-user-status u))) + (should-not (setf (erc-channel-user-voice u) nil)) + (should-not (erc-channel-user-voice u)) + (should (= 0 (erc-channel-user-status u)))))) + (defconst erc-tests--modules '( autoaway autojoin bufbar button capab-identify command-indicator completion dcc fill identd commit 9d961b31070cf34bf63c7dde9f54864b11ef80ea Author: F. Jason Park Date: Wed Dec 13 22:45:06 2023 -0800 Demote erc-fill-line-spacing to a normal variable * etc/ERC-NEWS: Remove section from 5.6 announcing user option `erc-fill-line-spacing'. * lisp/erc/erc-fill.el (erc-fill-line-spacing): Change from an option to a variable and note unfortunate UX hiccups. (erc-fill-wrap-merge, erc-fill-wrap-merge-indicator, fill-wrap): Remove mention of the option, now variable, `erc-fill-line-spacing'. (Bug#60936) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index ed3634614a0..b38ebfe208c 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -131,13 +131,6 @@ connectivity before attempting to reconnect in earnest. See option 'erc-server-reconnect-function' and new local module 'services-regain' (also experimental) to get started. -** Module 'fill' can add a bit of space between messages. -On graphical displays, it's now possible to add some breathing room -around certain messages via the new option 'erc-fill-line-spacing'. -This is especially handy when using the option 'erc-fill-wrap-merge' -to omit repeated speaker tags, which can make message boundaries less -detectable by tired eyes. - ** Modules rather than their libraries set major-mode keybindings. To put it another way, simply loading a built-in module's library no longer modifies 'erc-mode-map'. Instead, modifications occur during diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index b17f571d3c0..16ae5bae8d5 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -144,12 +144,14 @@ erc-fill-wrap-align-prompt :package-version '(ERC . "5.6") :type 'boolean) -(defcustom erc-fill-line-spacing nil +(defvar erc-fill-line-spacing nil "Extra space between messages on graphical displays. -Its value should be larger than that of the variable -`line-spacing', if set. When unsure, start with 0.5." - :package-version '(ERC . "5.6") - :type '(choice (const nil) number)) +Its value should probably be larger than that of the variable +`line-spacing', if non-nil. When unsure, start with 1.0. Note +that as of ERC 5.6, this feature doesn't combine well with the +`scrolltobottom' module, which is de facto required when using +the `fill-wrap' filling style. Users should therefore regard +this variable as experimental for the time being.") (defvar-local erc-fill--function nil "Internal copy of `erc-fill-function'. @@ -261,9 +263,7 @@ erc-fill-wrap-merge "Whether to consolidate consecutive messages from the same speaker. When non-nil, ERC omits redundant speaker labels for subsequent messages less than a day apart. To help distinguish between -merged messages, see related options `erc-fill-line-spacing', for -graphical displays, and `erc-fill-wrap-merge-indicator' for text -terminals." +merged messages, see option `erc-fill-wrap-merge-indicator'." :package-version '(ERC . "5.6") :type 'boolean) @@ -281,19 +281,25 @@ erc-fill-wrap-merge-indicator If the first element is the symbol `pre', ERC uses this option to generate a replacement for the speaker's name tag. If the first element is `post', ERC affixes a short string to the end of the -previous message. (Note that the latter variant nullifies any -intervening padding supplied by `erc-fill-line-spacing' and is -meant to supplant that option in text terminals.) In either -case, the second element should be a character, like ?>, and the -last element a valid face. In special cases, you may also -specify a cons of `pre'/`post' and a string, which tells ERC you -know what you're doing and not to manage the process for you. If -unsure, try either of the first two presets, both of which -replace a continued speaker's name with a dot-product-like glyph -in `shadow' face. Note that this option is still experimental, -and changing its value mid-session is not yet supported (though, -if you must, make sure to run \\[erc-fill-wrap-refill-buffer] -afterward)." +previous message. In either case, the second element should be a +character, like ?>, and the last element a valid face. In +special cases, you may also specify a cons of either +aforementioned symbol and a string, which tells ERC not to manage +the process for you. If unsure, try either of the first two +presets, both of which replace a continued speaker's name with a +dot-product-like character in a `shadow'-like face. + +Note that as of ERC 5.6, this option is still experimental, and +changing its value mid-session is not yet supported (though, if +you must, make sure to run \\[erc-fill-wrap-refill-buffer] +afterward). Also note that users on versions of Emacs older than +29.2 may experience a \"glitching\" effect when point resides on +a \"merged\" message occupying the first or last line in a +window. If that happens, try replacing `top' with the integer 1 +in the option `recenter-positions' while also maybe adjusting +`scroll-margin' and/or `scroll-preserve-screen-position' to avoid +\"dragging\" point when issuing a `scroll-up' or `scroll-down' +command." :package-version '(ERC . "5.6") :type '(choice (const nil) @@ -468,12 +474,12 @@ fill-wrap movement. Similarly, use \\[erc-fill-wrap-refill-buffer] to fix alignment problems after running certain commands, like `text-scale-adjust'. Also see related stylistic options -`erc-fill-line-spacing', `erc-fill-wrap-merge', and -`erc-fill-wrap-merge-indicator'. Hint: in narrow windows, where -is space tight, try setting `erc-fill-static-center' to 1. And -if you also use the option `erc-fill-wrap-merge-indicator', set -that to value-menu item \"Leading MIDDLE DOT (U+00B7) sans gap\" -or one of the various \"trailing\" items. +`erc-fill-wrap-merge', and `erc-fill-wrap-merge-indicator'. +\(Hint: in narrow windows, where is space tight, try setting +`erc-fill-static-center' to 1. And if you also use the option +`erc-fill-wrap-merge-indicator', set that to value-menu item +\"Leading MIDDLE DOT sans gap\" or one of the various +\"trailing\" items.) This module imposes various restrictions on the appearance of timestamps. Most notably, it insists on displaying them in the commit 49bfea4386fd8d1a0885ebfd1f81cc8fee6ef136 Author: F. Jason Park Date: Sun Nov 26 18:24:48 2023 -0800 Use templates for formatting chat messages in ERC * doc/misc/erc.texi: Replace option `erc-format-nick-function' with `erc-show-speaker-membership-status'. * etc/ERC-NEWS: Mention shift to template-based speaker formatting. Also mention in-buffer STATUSMSG support and various name changes and new formatting-related options. * lisp/erc/erc-backend.el (erc-format-privmessage): Remove forward declaration. (erc--determine-speaker-message-format-args): Add forward declaration. (erc--statusmsg-target): New utility function for detecting whether the current target is status-prefixed. (erc-current-message-catalog): Move here from lisp/erc/erc.el. (erc--message-speaker-catalog): New variable. (erc--speaker-status-prefix-wanted-p): New variable specifically for the function `erc-format-@nick' to signal it wants status-prefixes prepended to the displayed nick. (erc-server-PRIVMSG): Initialize `let'-bound value of `erc--msg-prop-overrides' to a dummy `erc--tmp' property with a null value that `erc-display-message' will "strip" before calling its hooks. Move away from the rather blunt symbol `msg' as a useful value for `erc--msg'. Instead, allow `erc-display-message' to assign the most appropriate value based on context. Also, bind the variable `erc-current-message-catalog' to whatever the buffer's `erc--message-speaker-catalog' happens to be. Future internal modules can set this to alternative catalogs as needed. Additionally, detect STATUSMSG prefixes on targets and inform the formatting logic of the verdict. Lastly, and most importantly, use the function `erc--determine-speaker-message-format-args' instead of `erc-format-privmessage' for message formatting. Pass along the returned "catalog key" and spec parameters to `erc-display-message'. However, for NOTICEs, continue to render the string, as before, for the two "echo notice" hooks. * lisp/erc/erc-common.el (erc--ctcp-response): New "subsclass" of `erc-response' for smuggling extra information to CTCP query handlers in a mostly backwards-compatible way. The same approach could be taken with the "echo notice" hooks mentioned above. * lisp/erc/erc-dcc.el (erc-dcc-chat-filter): Add `erc--spkr' and `erc--speaker' properties even though these chat buffers are not `erc-mode' buffers. * lisp/erc/erc-fill.el (erc-fill--wrap-last-msg, erc-fill--wrap-max-lull): Add doc strings. (erc-fill--wrap-continued-message-p): Rework to look for `erc--spkr'- `erc--msg' combinations as indicators of speaker continuity. (erc-fill--wrap-rejigger-region): Remove reference to the no longer relevant `erc-stamp-type'. Instead, use the `erc--msg' property combined with the `erc-timestamp' field to detect date stamps because all are currently left-sided. * lisp/erc/erc-stamp.el (erc-stamp--propertize-left-date-stamp): Don't add superfluous `erc-stamp-type' property. * lisp/erc/erc.el (erc--msg-props): Revise purpose and meaning of `erc--msg' by removing possible value `msg', which was previously meant to indicate that a message had a "speaker". Instead, rely on the separate `erc--spkr' property to convey this information, with `erc--msg' now expressing a "type" or "role". (erc--use-language-catalog-for-ctcp-action-p): New variable, a compatibility switch to help transition from the `ACTION' entry of the language catalog to the `ctcp-action' family of entries in the new `-speaker' catalog. (erc--ensure-spkr-prop): Update to include any passed-in environmental overrides. (erc--send-action-display): Restore pre-5.6 behavior when compatibility flag enabled. Otherwise, use new `-speaker' catalog for formatting inserted message. (erc--send-message-external): Overhaul to behave more faithfully in mimicking a line submitted at the prompt of the current target buffer. (erc--own-property-names): Remove `erc-stamp-type'. (erc-ensure-target-buffer-on-privmsg): Add new choice variant for old default behavior and change meaning of default to mean "except for STATUSMSGs". This option is newly revived for ERC 5.6. (erc--message-speaker-statusmsg, erc--message-speaker-statusmsg-input, erc--message-speaker-input, erc--message-speaker-input-chan-privmsg, erc--message-speaker-input-chan-notice, erc--message-speaker-input-query-privmsg, erc--message-speaker-input-query-notice, erc--message-speaker-chan-privmsg, erc--message-speaker-query-privmsg, erc--message-speaker-chan-notice, erc--message-speaker-query-notice, erc--message-speaker-ctcp-action, erc--message-speaker-ctcp-action-input, erc--message-speaker-ctcp-action-statusmsg, erc--message-speaker-ctcp-action-statusmsg-input): New variables for new `speaker' format-template catalog. (erc--speakerize-nick): New helper function. (erc--determine-speaker-message-format-args): New function to find the appropriate format key from various contextual parameters. Could become the default of a function-valued variable for internal use. (erc-show-speaker-membership-status): New option. (erc-format-nick-function, erc-speaker-from-channel-member-function): Declare former as an obsolete alias for the latter, and redefine purpose slightly. (erc-format-nick-function, erc-determine-speaker-from-user): Rename former to latter and obsolete the old name. (erc-format-nick, erc-determine-speaker-from-user): Rename former to latter and obsolete old name. (erc-format-@nick): Deprecate and adapt for use with new template-based formatting paradigm. (erc-format-my-nick): Move `erc-speaker' text prop toward head of list, meaning it will end up beneath `font-lock-face' in the final output. (erc--format-speaker-input-message): New function to replace `erc-format-my-nick' in-tree. (erc-process-ctcp-query): Don't bind `erc--msg' to `msg'. Instead, rely on `erc-display-message' to set it to the current template key. (erc-ctcp-query-ACTION): Prefer using formatting template, but attempt to simulate pre-5.6 behavior when compatibility flag enabled. (erc-display-msg): Use `erc--format-speaker-input-message' instead of `erc-format-my-nick'. Ignore `erc--msg-prop-overrides' with null values. (erc-current-message-catalog): Move to erc-backend.el. * test/lisp/erc/erc-scenarios-base-statusmsg.el: New file. * test/lisp/erc/erc-scenarios-stamp.el (erc-scenarios-stamp--left/display-margin-mode): Expect format catalog key instead of unhelpful `msg' as value of `erc--msg' prop. * test/lisp/erc/erc-tests.el (erc-message): Render format template in mock function and expect string in assertions. (erc-tests--format-privmessage): New function, a helper for the following test. (erc-format-privmessage, erc--determine-speaker-message-format-args): Rename former to latter and suppress deprecation warning. (erc--determine-speaker-message-format-args/queries, erc--determine-speaker-message-format-args/queries-as-channel): New tests. (erc-tests--format-my-nick): New helper function for the following test. (erc--format-speaker-input-message): New test. * test/lisp/erc/resources/base/display-message/statusmsg.eld: New file. (Bug#67677) ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld: ; Update. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld: ; Update. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 94081b79099..131e02555d1 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -918,16 +918,11 @@ Connecting other nicks are tried in the list order. @end defopt -@defopt erc-format-nick-function -A function to format a nickname for message display - -You can set this to @code{erc-format-@@nick} to display user mode prefix +@defopt erc-show-speaker-membership-status +A boolean for including a channel member's @dfn{status prefix} in +their display name when they speak. @end defopt -@example -(setq erc-format-nick-function 'erc-format-@@nick) -@end example - @defopt erc-nick-uniquifier The string to append to the nick if it is already in use. @end defopt diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 146f6690c5e..ed3634614a0 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -275,6 +275,26 @@ buffers. In channels, it's grown to include all letters and their possibly truncated arguments, with the exception of stateful list modes, like "b". +** In-buffer "status messages" are now a thing. +The ancient option 'erc-ensure-target-buffer-on-privmsg' has been +repurposed slightly to express a third state denoted by the symbol +'status'. It tells ERC to revert to the old default behavior in which +separate, "pseudo" target buffers for status-prefixed conversing +co-existed alongside actual target buffers. Instead of this awkward +arrangement, ERC now acts like other clients by default and inserts +so-called "status messages" in situ, right between other messages. +Similar insertion-routing behavior now also applies to CTCP ACTIONs +directed at status-prefixed channels. Unfortunately, outgoing "/msg +@#chan hi" messages aren't yet shown in the same fashion, but the +groundwork has been laid, making such an addition almost trivial. + +** An easier way to see channel-membership prefixes on speakers. +The option 'erc-format-@nick' has been deprecated in favor of the new +boolean option 'erc-show-speaker-membership-status', a simple switch +to enable the displaying of status prefixes on the speaker nicks of +incoming chat messages. Prefixes on your speaker nick for outgoing +chat messages continue to always be present. + ** Miscellaneous UX changes. Some minor quality-of-life niceties have finally made their way to ERC. For example, fool visibility has become togglable with the new @@ -533,6 +553,38 @@ The functions 'erc-define-catalog-entry' and 'erc-define-catalog' have been deprecated in favor of 'erc-define-message-format-catalog', a new macro for defining template "catalogs" at the top level of libraries. +*** Interface for determining display names renamed. +The option 'erc-format-nick-function' has been renamed to +'erc-speaker-from-channel-member-function' to better reflect its +actual role. So too has the related function 'erc-format-nick', which +is now 'erc-determine-speaker-from user'. + +*** A template-based approach to formatting inserted chat messages. +Predicting and influencing how ERC formats messages containing a +leading "" has never been straightforward. The characters +bracketing the speaker and the faces used for each component have +always been hard-coded, with 'erc-format-query-as-channel-p' being the +only knob of any consequence. With this release, ERC begins its +transition to a unified formatting paradigm that builds upon the +already familiar "language catalog" templating system. Using a +separate "speaker catalog" keyed by contextual symbols, like +'query-privmsg', ERC (and eventually everyone) will more easily be +able to influence how inserted messages take shape in buffers. + +*** New format templates for inserted CTCP ACTION messages. +In 5.5 and earlier, ERC displayed outgoing CTCP ACTION messages in +'erc-input-face' alone (before buttonizing). Incoming ACTION messages +mirrored this, except with 'erc-action-face' throughout. Going +forward, inserted outgoing "/ME" messages will also incorporate +'erc-action-face', only underneath 'erc-input-face', with +'erc-my-nick-face' sitting atop both in the leading "speaker" nickname +portion (again, pre-buttonizing). This new behavior sidesteps the +traditional format template 'erc-message-english-ACTION' from the +default "language catalog" in favor of an entry from the new internal +"speaker catalog". Users needing to access the old behavior can do so +by toggling a provided compatibility switch. See source code around +the function 'erc-send-action' for details. + *** Miscellaneous changes Two helper macros from GNU ELPA's Compat library are now available to third-party modules as 'erc-compat-call' and 'erc-compat-function'. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 0f6f7e2d4c3..1aee8cff345 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -142,7 +142,6 @@ erc-verbose-server-ping (declare-function erc-display-server-message "erc" (_proc parsed)) (declare-function erc-emacs-time-to-erc-time "erc" (&optional specified-time)) (declare-function erc-format-message "erc" (msg &rest args)) -(declare-function erc-format-privmessage "erc" (nick msg privp msgp)) (declare-function erc-get-buffer "erc" (target &optional proc)) (declare-function erc-handle-login "erc" nil) (declare-function erc-handle-user-status-change "erc" (type nlh &optional l)) @@ -173,6 +172,9 @@ erc-verbose-server-ping (declare-function erc-update-mode-line-buffer "erc" (buffer)) (declare-function erc-wash-quit-reason "erc" (reason nick login host)) +(declare-function erc--determine-speaker-message-format-args "erc" + (nick target message queryp privmsgp statusmsgp inputp + &optional prefix disp-nick)) (declare-function erc-display-message "erc" (parsed type buffer msg &rest args)) (declare-function erc-get-buffer-create "erc" @@ -1906,6 +1908,66 @@ erc--server-determine-join-display-context ?s (if (/= erc-server-lag 1) "s" ""))) (erc-update-mode-line)))) +(defun erc--statusmsg-target (target) + "Return actual target from given TARGET if it has a leading prefix char." + (and-let* ((erc-ensure-target-buffer-on-privmsg) + ((not (eq erc-ensure-target-buffer-on-privmsg 'status))) + ((not (erc-channel-p target))) + (chars (erc--get-isupport-entry 'STATUSMSG 'single)) + ((string-search (string (aref target 0)) chars)) + (trimmed (substring target 1)) + ((erc-channel-p trimmed))) + trimmed)) + +;; Moved to this file from erc.el in ERC 5.6. +(defvar-local erc-current-message-catalog 'english + "Current language or context catalog for formatting inserted messages. +See `erc-format-message'.") + +;; This variable can be made public if the current design proves +;; sufficient. +(defvar erc--message-speaker-catalog '-speaker + "The \"speaker\" catalog symbol used to format PRIVMSGs and NOTICEs. + +This symbol defines a \"catalog\" of variables and functions +whose names reflect their membership via a corresponding CATALOG +component, as in \"erc-message-CATALOG-KEY\". Here, KEY refers +to a common set of interface members (variables or functions), +that an implementer must define: + +- `statusmsg' and `statusmsg-input': PRIVMSGs whose target is a + status-prefixed channel; the latter is the \"echoed\" version + +- `chan-privmsg', `query-privmsg', `chan-notice', `query-notice': + standard chat messages traditionally prefixed by a + indicating the message's \"speaker\" + +- `input-chan-privmsg', `input-query-privmsg', `input-query-notice', + `input-chan-notice': \"echoed\" versions of the above + +- `ctcp-action', `ctcp-action-input', `ctcp-action-statusmsg', + `ctcp-action-statusmsg-input': \"CTCP ACTION\" versions of the + above + +The other part of this interface is the per-key collection of +`format-spec' parameters members must support. For simplicity, +this catalog currently defines a common set for all keys, some of +which may be assigned the empty string when not applicable: + + %n - nickname + %m - message body + %p - nickname's status prefix (when applicable) + %s - current target's STATUSMSG prefix (when applicable) + +As an added means of communicating with various modules, if this +catalog's symbol has the property `erc--msg-prop-overrides', +consumers calling `erc-display-message' will see the value added +to the `erc--msg-props' \"environment\" in modification hooks, +like `erc-insert-modify-hook'.") + +(defvar erc--speaker-status-prefix-wanted-p (gensym "erc-") + "Sentinel to detect whether `erc-format-@nick' has just run.") + (define-erc-response-handler (PRIVMSG NOTICE) "Handle private messages, including messages in channels." nil (let ((sender-spec (erc-response.sender parsed)) @@ -1927,12 +1989,15 @@ erc--server-determine-join-display-context (msgp (string= cmd "PRIVMSG")) (noticep (string= cmd "NOTICE")) ;; S.B. downcase *both* tgt and current nick - (privp (erc-current-nick-p tgt)) + (medown (erc-downcase (erc-current-nick))) + (inputp (string= medown (erc-downcase nick))) + (privp (string= (erc-downcase tgt) medown)) (erc--display-context `((erc-buffer-display . ,(intern cmd)) ,@erc--display-context)) - (erc--msg-prop-overrides `((erc--msg . msg) - ,@erc--msg-prop-overrides)) - s buffer + (erc--msg-prop-overrides `((erc--tmp) ,@erc--msg-prop-overrides)) + (erc--speaker-status-prefix-wanted-p nil) + (erc-current-message-catalog erc--message-speaker-catalog) + s buffer statusmsg cmem-prefix fnick) (setq buffer (erc-get-buffer (if privp nick tgt) proc)) ;; Even worth checking for empty target here? (invalid anyway) @@ -1950,9 +2015,14 @@ erc--server-determine-join-display-context (push `(erc-receive-query-display . ,(intern cmd)) erc--display-context) (setq buffer (erc--open-target nick))) - ;; A channel buffer has been killed but is still joined. - (when erc-ensure-target-buffer-on-privmsg - (setq buffer (erc--open-target tgt))))) + (cond + ;; Target is a channel and contains leading @+ chars. + ((and-let* ((trimmed(erc--statusmsg-target tgt))) + (setq buffer (erc-get-buffer trimmed proc) + statusmsg (and buffer (substring tgt 0 1))))) + ;; A channel buffer has been killed but is still joined. + (erc-ensure-target-buffer-on-privmsg + (setq buffer (erc--open-target tgt)))))) (when buffer (with-current-buffer buffer (when privp (erc--unhide-prompt)) @@ -1963,36 +2033,46 @@ erc--server-determine-join-display-context privp nil nil nil nil nil host login nil nil t) (defvar erc--cmem-from-nick-function) (defvar erc-format-nick-function) + (defvar erc-show-speaker-membership-status) + (defvar erc-speaker-from-channel-member-function) (let ((cdata (funcall erc--cmem-from-nick-function (erc-downcase nick) sndr parsed))) - (setq fnick (funcall erc-format-nick-function - (car cdata) (cdr cdata)))))) + (setq fnick (funcall erc-speaker-from-channel-member-function + (car cdata) (cdr cdata)) + cmem-prefix (and (or erc--speaker-status-prefix-wanted-p + erc-show-speaker-membership-status + inputp) + (cdr cdata)))))) (cond ((erc-is-message-ctcp-p msg) - (setq s (if msgp + ;; FIXME explain undefined return values being assigned to `s'. + (setq s (if-let ((parsed + (erc--ctcp-response-from-parsed + :parsed parsed :buffer buffer :statusmsg statusmsg + :prefix cmem-prefix :dispname fnick)) + (msgp)) (erc-process-ctcp-query proc parsed nick login host) (erc-process-ctcp-reply proc parsed nick login host (match-string 1 msg))))) (t (setq erc-server-last-peers (cons nick (cdr erc-server-last-peers))) - (defvar erc-format-query-as-channel-p) - (setq s (erc-format-privmessage - (or fnick nick) msg - ;; If buffer is a query buffer, - ;; format the nick as for a channel. - (and (not (and buffer - (erc-query-buffer-p buffer) - erc-format-query-as-channel-p)) - privp) - msgp)))) + (with-current-buffer (or buffer (current-buffer)) + ;; Re-bind in case either buffer has a local value. + (let ((erc-current-message-catalog erc--message-speaker-catalog)) + (setq s (erc--determine-speaker-message-format-args + nick msg privp msgp inputp statusmsg + cmem-prefix fnick)))))) (when s (if (and noticep privp) (progn + (push (cons 'erc--msg (car s)) erc--msg-prop-overrides) + (setq s (apply #'erc-format-message s)) (run-hook-with-args 'erc-echo-notice-always-hook s parsed buffer nick) (run-hook-with-args-until-success 'erc-echo-notice-hook s parsed buffer nick)) - (erc-display-message parsed nil buffer s))))))) + (apply #'erc-display-message parsed nil buffer + (ensure-list s)))))))) (define-erc-response-handler (QUIT) "Another user has quit IRC." nil diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 90112ab9126..0b865387671 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -100,6 +100,23 @@ erc--target (contents "" :type string) (tags '() :type list)) +(cl-defstruct (erc--ctcp-response + (:include erc-response) + (:constructor + erc--ctcp-response-from-parsed + (&key parsed buffer statusmsg prefix dispname + &aux (unparsed (erc-response.unparsed parsed)) + (sender (erc-response.sender parsed)) + (command (erc-response.command parsed)) + (command-args (erc-response.command-args parsed)) + (contents (erc-response.contents parsed)) + (tags (erc-response.tags parsed))))) + "Data for a processed CTCP query or reply." + (buffer nil :type (or buffer null)) + (statusmsg nil :type (or null string)) + (prefix nil :type (or erc-channel-user null)) + (dispname nil :type (or string null))) + (cl-defstruct erc--isupport-data "Abstract \"class\" for parsed ISUPPORT data. For use with the macro `erc--with-isupport-data'." diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index ac7fc817cb9..d12ebd33a86 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -1251,14 +1251,16 @@ erc-dcc-chat-filter (defun erc-dcc-chat-parse-output (proc str) (save-match-data (let ((posn 0) + (erc--msg-prop-overrides `((erc--spkr . ,erc-dcc-from))) + (nick (propertize (erc--speakerize-nick erc-dcc-from) + 'font-lock-face 'erc-nick-default-face)) line) (while (string-match "\n" str posn) (setq line (substring str posn (match-beginning 0))) (setq posn (match-end 0)) (erc-display-message nil nil proc - 'dcc-chat-privmsg ?n (propertize erc-dcc-from 'font-lock-face - 'erc-nick-default-face) ?m line)) + 'dcc-chat-privmsg ?n nick ?m line)) (setq erc-dcc-unprocessed-output (substring str posn))))) (defun erc-dcc-chat-buffer-killed () diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 0c2be4b5bc9..b17f571d3c0 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -546,42 +546,38 @@ erc-fill--wrap-length-function variable can be converted to a public one if needed by third parties.") -(defvar-local erc-fill--wrap-last-msg nil) -(defvar erc-fill--wrap-max-lull (* 24 60 60)) +(defvar-local erc-fill--wrap-last-msg nil "Marker for merging speakers.") +(defvar erc-fill--wrap-max-lull (* 24 60 60) "Max secs for merging speakers.") (defun erc-fill--wrap-continued-message-p () "Return non-nil when the current speaker hasn't changed. -That is, indicate whether the text just inserted is from the same -sender as that of the previous \"PRIVMSG\". As a side effect, -advance `erc-fill--wrap-last-msg' unless the message has been -marked as being ephemeral." - (and - (not (erc--check-msg-prop 'erc--ephemeral)) - (progn ; preserve blame for now, unprogn on next major change - (prog1 - (and-let* - ((m (or erc-fill--wrap-last-msg - (setq erc-fill--wrap-last-msg (point-min-marker)) - nil)) - ((< (1+ (point-min)) (- (point) 2))) - (props (save-restriction - (widen) - (and-let* - ((speaker (get-text-property m 'erc--spkr)) - ((not (eq (get-text-property m 'erc--ctcp) - 'ACTION))) - ((not (invisible-p m)))) - (cons (get-text-property m 'erc--ts) speaker)))) - (ts (pop props)) - (props) - ((not (time-less-p (erc-stamp--current-time) ts))) - ((time-less-p (time-subtract (erc-stamp--current-time) ts) - erc-fill--wrap-max-lull)) - ;; Assume presence of leading angle bracket or hyphen. - (nick (erc--check-msg-prop 'erc--spkr)) - ((not (erc--check-msg-prop 'erc--ctcp 'ACTION))) - ((erc-nick-equal-p props nick)))) - (set-marker erc-fill--wrap-last-msg (point-min)))))) +But only if the `erc--msg' text property also hasn't. That is, +indicate whether the chat message just inserted is from the same +person as the prior one and is formatted in the same manner. As +a side effect, advance `erc-fill--wrap-last-msg' unless the +message has been marked `erc--ephemeral'." + (and-let* + (((not (erc--check-msg-prop 'erc--ephemeral))) + ;; Always set/move `erc-fill--wrap-last-msg' from here on down. + (m (or (and erc-fill--wrap-last-msg + (prog1 (marker-position erc-fill--wrap-last-msg) + (set-marker erc-fill--wrap-last-msg (point-min)))) + (ignore (setq erc-fill--wrap-last-msg (point-min-marker))))) + ((>= (point) 4)) ; skip the first message + (props (save-restriction + (widen) + (and-let* ((speaker (get-text-property m 'erc--spkr)) + (type (get-text-property m 'erc--msg)) + ((not (invisible-p m)))) + (list (get-text-property m 'erc--ts) type speaker)))) + (ts (nth 0 props)) + (type (nth 1 props)) + (speaker (nth 2 props)) + ((not (time-less-p (erc-stamp--current-time) ts))) + ((time-less-p (time-subtract (erc-stamp--current-time) ts) + erc-fill--wrap-max-lull)) + ((erc--check-msg-prop 'erc--msg type)) + ((erc-nick-equal-p speaker (erc--check-msg-prop 'erc--spkr)))))) (defun erc-fill--wrap-measure (beg end) "Return display spec width for inserted region between BEG and END. @@ -747,8 +743,11 @@ erc-fill--wrap-rejigger-region ((equal "" dval))) (remove-text-properties dbeg (text-property-not-all dbeg end 'display dval) '(display))) - (let* ((pos (if (eq 'date-left (get-text-property beg 'erc-stamp-type)) - (field-beginning beg) + ;; This "should" work w/o `front-sticky' and `rear-nonsticky'. + (let* ((pos (if-let (((eq 'erc-timestamp (field-at-pos beg))) + (b (field-beginning beg)) + ((eq 'datestamp (get-text-property b 'erc--msg)))) + b beg)) (erc--msg-props (map-into (text-properties-at pos) 'hash-table)) (erc-stamp--current-time (gethash 'erc--ts erc--msg-props))) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index a6efa3b5151..9ca3ea320a0 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -660,8 +660,7 @@ erc-stamp--date-format-end value of t means the option's value doesn't require trimming.") (defun erc-stamp--propertize-left-date-stamp () - (add-text-properties (point-min) (1- (point-max)) - '(field erc-timestamp erc-stamp-type date-left)) + (add-text-properties (point-min) (1- (point-max)) '(field erc-timestamp)) (erc--hide-message 'timestamp) (run-hooks 'erc-stamp--insert-date-hook)) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 57194ed439e..759907b7618 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -154,11 +154,10 @@ erc--msg-props their markers accordingly. The following properties have meaning as of ERC 5.6: - - `erc--msg': a symbol, guaranteed present; values include: - `msg', signifying a `PRIVMSG' or an incoming `NOTICE'; - `unknown', a fallback for `erc-display-message'; a catalog - key, such as `s401' or `finished'; an `erc-display-message' - TYPE parameter, like `notice' + - `erc--msg': a symbol, guaranteed present; possible values + include `unknown', a fallback used by `erc-display-message'; a + catalog key, such as `s401' or `finished'; an + `erc-display-message' TYPE parameter, like `notice' - `erc--cmd': a message's associated IRC command, as read by `erc--get-eq-comparable-cmd'; currently either a symbol, like @@ -3017,20 +3016,34 @@ erc--send-action-perform-ctcp "Send STRING to TARGET, possibly immediately, with FORCE." (erc-send-ctcp-message target (format "ACTION %s" string) force)) +(defvar erc--use-language-catalog-for-ctcp-action-p nil + "When non-nil, use `ACTION' entry from language catalog for /ME's. +Otherwise, use `ctcp-action' or `ctcp-action-input' from the +internal `-speaker' catalog. This is an escape hatch to restore +pre-5.6 behavior for the `font-lock-face' property of incoming +and outgoing \"CTCP ACTION\" messages, whose pre-buttonized state +was a single interval of `erc-input-face' or `erc-action-face'. +Newer modules, like `fill-wrap' and `nicks', are incompatible with +this format style. If you use this, please ask ERC to expose it +as a public variable via \\[erc-bug] or similar.") + (defun erc--send-action-display (string) - "Display STRING as an outgoing \"CTCP ACTION\" message." + "Display STRING as an outgoing \"CTCP ACTION\" message. +Propertize the message according to the compatibility flag +`erc--use-language-catalog-for-ctcp-action-p'." ;; Allow hooks acting on inserted PRIVMSG and NOTICES to process us. - (defvar erc--merge-prop-behind-p) - (let* ((nick (erc-current-nick)) - (erc--msg-prop-overrides `((erc--msg . msg) - (erc--ctcp . ACTION) - (erc--spkr . ,nick) - ,@erc--msg-prop-overrides)) - (erc--merge-prop-behind-p t)) - (setq nick (propertize nick 'erc--speaker nick - 'font-lock-face 'erc-my-nick-face)) - (erc-display-message nil '(t input action) (current-buffer) - 'ACTION ?n nick ?a string ?u "" ?h ""))) + (let ((erc--msg-prop-overrides `((erc--ctcp . ACTION) + ,@erc--msg-prop-overrides)) + (nick (erc-current-nick))) + (if erc--use-language-catalog-for-ctcp-action-p + (progn (erc--ensure-spkr-prop nick) + (erc-display-message nil 'input (current-buffer) 'ACTION + ?n (propertize nick 'erc--speaker nick) + ?a string ?u "" ?h "")) + (let ((erc-current-message-catalog erc--message-speaker-catalog)) + (erc-display-message nil nil (current-buffer) 'ctcp-action-input + ?p (erc-get-channel-membership-prefix nick) + ?n (erc--speakerize-nick nick) ?m string))))) (defun erc--send-action (target string force) "Display STRING, then send to TARGET as a \"CTCP ACTION\" message." @@ -3039,11 +3052,20 @@ erc--send-action ;; Display interface -(defun erc--ensure-spkr-prop (nick) - "Maybe add NICK to `erc--msg-props' or `erc--msg-prop-overrides'." - (cond (erc--msg-props (puthash 'erc--spkr nick erc--msg-props)) +(defun erc--ensure-spkr-prop (nick &optional overrides) + "Add NICK as `erc--spkr' to the current \"msg props\" environment. +Prefer `erc--msg-props' over `erc--msg-prop-overrides' when both +are available. Also include any members of the alist OVERRIDES, +when present. Assume NICK itself to be free of any text props, +and return it." + (cond (erc--msg-props + (puthash 'erc--spkr nick erc--msg-props) + (dolist (entry overrides) + (puthash (car entry) (cdr entry) erc--msg-props))) (erc--msg-prop-overrides - (push (cons 'erc--spkr nick) erc--msg-prop-overrides)))) + (setq erc--msg-prop-overrides + `((erc--spkr . ,nick) ,@overrides ,@erc--msg-prop-overrides)))) + nick) (defun erc-string-invisible-p (string) "Check whether STRING is invisible or not. @@ -4659,15 +4681,26 @@ erc-send-message (funcall erc--send-message-nested-function line force) (erc--send-message-external line force))) -;; FIXME fully simulate `erc-display-msg'. This doesn't currently add -;; the correct text properties. For example, the LINE should have -;; `erc-default-face'. (defun erc--send-message-external (line force) - (erc-message "PRIVMSG" (concat (erc-default-target) " " line) force) - (erc-display-line - (concat (erc-format-my-nick) line) - (current-buffer)) + "Send a \"PRIVMSG\" to the default target with optional FORCE. +Expect caller to bind `erc-default-recipients' if needing to +specify a status-prefixed target." + ;; Almost like an echoed message, but without the `erc--cmd'. + (let* ((erc-current-message-catalog erc--message-speaker-catalog) + (target (erc-default-target)) + (erc--msg-prop-overrides `((erc--tmp) ,@erc--msg-prop-overrides)) + ;; This util sets the `erc--spkr' property in ^. + (trimmed (erc--statusmsg-target target)) + (stmsgindc (and trimmed (substring target 0 1))) + (queryp (and erc--target (not (erc--target-channel-p erc--target)))) + (args (erc--determine-speaker-message-format-args + (erc-current-nick) line queryp 'privmsgp 'inputp + stmsgindc 'prefix))) + (erc-message "PRIVMSG" (concat target " " line) force) + (push (cons 'erc--msg (car args)) erc--msg-prop-overrides) + (apply #'erc-display-message nil nil (current-buffer) args)) ;; FIXME - treat multiline, run hooks, or remove me? + ;; FIXME explain this ^ in more detail or remove. t) (defun erc--send-message-nested (input-line force) @@ -5282,7 +5315,6 @@ erc--own-property-names rear-nonsticky erc-prompt field front-sticky read-only ;; stamp cursor-intangible cursor-sensor-functions isearch-open-invisible - erc-stamp-type ;; match invisible intangible ;; button @@ -5626,7 +5658,9 @@ erc-ensure-target-buffer-on-privmsg :package-version '(ERC . "5.6") ; revived :group 'erc-buffers :group 'erc-query - :type 'boolean) + :type '(choice boolean + (choice :tag "Create pseudo queries for STATUSMSGs" + status))) (defcustom erc-format-query-as-channel-p t "If non-nil, format text from others in a query buffer like in a channel. @@ -5803,14 +5837,210 @@ erc-format-privmessage 'font-lock-face msg-face str) str)) -(defcustom erc-format-nick-function 'erc-format-nick - "Function to format a nickname for message display." +;; The format strings in the following `-speaker' catalog shouldn't +;; contain any non-protocol words, so they make sense in any language. + +(defvar erc--message-speaker-statusmsg + #("(%p%n%s) %m" + 0 1 (font-lock-face erc-default-face) + 1 3 (font-lock-face erc-nick-prefix-face) + 3 5 (font-lock-face erc-nick-default-face) + 5 7 (font-lock-face erc-notice-face) + 7 11 (font-lock-face erc-default-face)) + "Message template for in-channel status messages.") + +(defvar erc--message-speaker-statusmsg-input + #("(%p%n%s) %m" + 0 1 (font-lock-face erc-default-face) + 1 3 (font-lock-face erc-my-nick-prefix-face) + 3 5 (font-lock-face erc-my-nick-face) + 5 7 (font-lock-face erc-notice-face) + 7 8 (font-lock-face erc-default-face) + 8 11 (font-lock-face erc-input-face)) + "Message template for echoed status messages.") + +(defvar erc--message-speaker-input-chan-privmsg + #("<%p%n> %m" + 0 1 (font-lock-face erc-default-face) + 1 3 (font-lock-face erc-my-nick-prefix-face) + 3 5 (font-lock-face erc-my-nick-face) + 5 7 (font-lock-face erc-default-face) + 7 9 (font-lock-face erc-input-face)) + "Message template for prompt input or echoed PRIVMSG from own nick.") + +(defvar erc--message-speaker-input-query-privmsg + #("*%n* %m" + 0 1 (font-lock-face erc-direct-msg-face) + 1 3 (font-lock-face erc-my-nick-face) + 3 5 (font-lock-face erc-direct-msg-face) + 5 7 (font-lock-face erc-input-face)) + "Message template for prompt input or echoed PRIVMSG query from own nick.") + +(defvar erc--message-speaker-input-query-notice + #("-%n- %m" + 0 1 (font-lock-face erc-direct-msg-face) + 1 3 (font-lock-face erc-my-nick-face) + 3 5 (font-lock-face erc-direct-msg-face) + 5 7 (font-lock-face erc-input-face)) + "Message template for echoed or spoofed query NOTICE from own nick.") + +(defvar erc--message-speaker-input-chan-notice + #("-%p%n- %m" + 0 1 (font-lock-face erc-default-face) + 1 3 (font-lock-face erc-my-nick-prefix-face) + 3 5 (font-lock-face erc-my-nick-face) + 5 7 (font-lock-face erc-default-face) + 7 9 (font-lock-face erc-input-face)) + "Message template for prompt input or echoed NOTICE from own nick.") + +(defvar erc--message-speaker-chan-privmsg + #("<%p%n> %m" + 0 1 (font-lock-face erc-default-face) + 1 3 (font-lock-face erc-nick-prefix-face) + 3 5 (font-lock-face erc-nick-default-face) + 5 9 (font-lock-face erc-default-face)) + "Message template for a PRIVMSG in a channel.") + +(defvar erc--message-speaker-query-privmsg + #("*%n* %m" + 0 1 (font-lock-face erc-direct-msg-face) + 1 3 (font-lock-face erc-nick-msg-face) + 3 7 (font-lock-face erc-direct-msg-face)) + "Message template for a PRIVMSG in query buffer.") + +(defvar erc--message-speaker-chan-notice + #("-%p%n- %m" + 0 1 (font-lock-face erc-default-face) + 1 3 (font-lock-face erc-nick-prefix-face) + 3 5 (font-lock-face erc-nick-default-face) + 5 9 (font-lock-face erc-default-face)) + "Message template for a NOTICE in a channel.") + +(defvar erc--message-speaker-query-notice + #("-%n- %m" + 0 1 (font-lock-face erc-direct-msg-face) + 1 3 (font-lock-face erc-nick-msg-face) + 3 7 (font-lock-face erc-direct-msg-face)) + "Message template for a NOTICE in a query buffer.") + +(defvar erc--message-speaker-ctcp-action + #("* %p%n %m" + 0 2 (font-lock-face erc-action-face) + 2 4 (font-lock-face (erc-nick-prefix-face erc-action-face)) + 4 9 (font-lock-face erc-action-face)) + "Message template for a CTCP ACTION from another user.") + +(defvar erc--message-speaker-ctcp-action-input + #("* %p%n %m" + 0 2 (font-lock-face #1=(erc-input-face erc-action-face)) + 2 4 (font-lock-face (erc-my-nick-prefix-face . #1#)) + 4 6 (font-lock-face (erc-my-nick-face . #1#)) + 6 9 (font-lock-face #1#)) + "Message template for a CTCP ACTION from current client.") + +(defvar erc--message-speaker-ctcp-action-statusmsg + #("* (%p%n%s) %m" + 0 3 (font-lock-face erc-action-face) + 3 5 (font-lock-face (erc-nick-prefix-face erc-action-face)) + 5 7 (font-lock-face erc-action-face) + 7 9 (font-lock-face (erc-notice-face erc-action-face)) + 9 13 (font-lock-face erc-action-face)) + "Template for a CTCP ACTION status message from another chan op.") + +(defvar erc--message-speaker-ctcp-action-statusmsg-input + #("* (%p%n%s) %m" + 0 3 (font-lock-face #1=(erc-input-face erc-action-face)) + 3 5 (font-lock-face (erc-my-nick-prefix-face . #1#)) + 5 7 (font-lock-face (erc-my-nick-face . #1#)) + 7 9 (font-lock-face (erc-notice-face . #1#)) + 9 13 (font-lock-face #1#)) + "Template for a CTCP ACTION status message from current client.") + +(defun erc--speakerize-nick (nick &optional disp) + "Propertize NICK with `erc--speaker' if not already present. +Do so to DISP instead if it's non-nil. In either case, assign +NICK, sans properties, as the `erc--speaker' value. As a side +effect, pair the latter string (the same `eq'-able object) with +the symbol `erc--spkr' in the \"msg prop\" environment for any +imminent `erc-display-message' invocations. While doing so, +include any overrides defined in `erc--message-speaker-catalog'." + (let ((plain-nick (substring-no-properties nick))) + (erc--ensure-spkr-prop plain-nick (get erc--message-speaker-catalog + 'erc--msg-prop-overrides)) + (if (text-property-not-all 0 (length (or disp nick)) + 'erc--speaker nil (or disp nick)) + (or disp nick) + (propertize (or disp nick) 'erc--speaker plain-nick)))) + +(defun erc--determine-speaker-message-format-args + (nick message queryp privmsgp inputp &optional statusmsg prefix disp-nick) + "Return a list consisting of a \"speaker\"-template key and spec args. +Consider the three flags QUERYP, PRIVMSGP, and INPUTP, as well as +the possibly null STATUSMSG string. (Combined, these describe +the context of a newly arrived \"PRIVMSG\" or, when PRIVMSGP is +nil, a \"NOTICE\"). Interpret QUERYP to mean that MESSAGE is +directed at the ERC client itself (a direct message), and INPUTP +to mean MESSAGE is an outgoing or echoed message originating from +or meant to simulate prompt input. Interpret a non-nil STATUSMSG +to mean MESSAGE should be formatted as a special channel message +intended for privileged members of the same or greater status. + +After deciding on the template key for the current \"speaker\" +catalog, use the remaining arguments, possibly along with +STATUSMSG, to construct the appropriate spec-args plist forming +the returned list's tail. In this plist, pair the char ?n with +NICK, the nickname of the speaker and ?m with MESSAGE, the +message body. When non-nil, assume DISP-NICK to be a possibly +phony display name to take the place of NICK for ?n. When PREFIX +is non-nil, look up NICK's channel-membership status, possibly +using PREFIX itself if it's an `erc-channel-user' object, which +it must be when called outside of a channel buffer. Pair the +result with the ?p specifier. When STATUSMSG is non-nil, pair it +with the ?s specifier. Ensure unused spec values are the empty +string rather than nil." + (when prefix + (setq prefix (erc-get-channel-membership-prefix + (if (erc-channel-user-p prefix) prefix nick)))) + (when (and queryp erc--target erc-format-query-as-channel-p + (not (erc--target-channel-p erc--target))) + (setq queryp nil)) + (list (cond (statusmsg (if inputp 'statusmsg-input 'statusmsg)) + (privmsgp (if queryp + (if inputp 'input-query-privmsg 'query-privmsg) + (if inputp 'input-chan-privmsg 'chan-privmsg))) + (t (if queryp + (if inputp 'input-query-notice 'query-notice) + (if inputp 'input-chan-notice 'chan-notice)))) + ?p (or prefix "") ?n (erc--speakerize-nick nick disp-nick) + ?s (or statusmsg "") ?m message)) + +(defcustom erc-show-speaker-membership-status nil + "Whether to prefix speakers with their channel status. +For example, when this option is non-nil and some nick \"Alice\" +has operator status in the current channel, ERC displays their +leading \"speaker\" label as <@Alice> instead of ." + :package-version '(ERC . "5.6") + :group 'erc-display + :type 'boolean) + +(define-obsolete-variable-alias 'erc-format-nick-function + 'erc-speaker-from-channel-member-function "30.1") +(defcustom erc-speaker-from-channel-member-function + #'erc-determine-speaker-from-user + "Function to determine a message's displayed \"speaker\" label. +Called with an `erc-server-user' object and an `erc-channel-user' +object, both possibly nil. Use this option to do things like +provide localized display names. To ask ERC to prepend +channel-membership \"status\" prefixes, like \"@\", to the +returned name, see `erc-show-speaker-membership-status'." + :package-version '(ERC . "5.6") :group 'erc-display - :type 'function) + :type '(choice (function-item erc-determine-speaker-from-user) function)) -(defun erc-format-nick (&optional user _channel-data) - "Return the nickname of USER. -See also `erc-format-nick-function'." +(define-obsolete-function-alias 'erc-format-nick + #'erc-determine-speaker-from-user "30.1") +(defun erc-determine-speaker-from-user (&optional user _channel-data) + "Return nickname slot of `erc-server-user' USER, when non-nil." (when user (erc-server-user-nickname user))) (define-obsolete-function-alias 'erc-get-user-mode-prefix @@ -5841,14 +6071,17 @@ erc-format-@nick "Format the nickname of USER showing if USER has a voice, is an operator, half-op, admin or owner. Owners have \"~\", admins have \"&\", operators have \"@\" and users with voice have \"+\" as a -prefix. Use CHANNEL-DATA to determine op and voice status. See -also `erc-format-nick-function'." +prefix. Use CHANNEL-DATA to determine op and voice status." + (declare (obsolete "see option `erc-show-speaker-membership-status'" "30.1")) (when user (let ((nick (erc-server-user-nickname user))) - (concat (propertize - (erc-get-channel-membership-prefix channel-data) - 'font-lock-face 'erc-nick-prefix-face) - nick)))) + (if (not erc--speaker-status-prefix-wanted-p) + (prog1 nick + (setq erc--speaker-status-prefix-wanted-p 'erc-format-@nick)) + (concat (propertize + (erc-get-channel-membership-prefix channel-data) + 'font-lock-face 'erc-nick-prefix-face) + nick))))) (defun erc-format-my-nick () "Return the beginning of this user's message, correctly propertized." @@ -5861,11 +6094,37 @@ erc-format-my-nick (concat (propertize open 'font-lock-face 'erc-default-face) (propertize mode 'font-lock-face 'erc-my-nick-prefix-face) - (propertize nick 'font-lock-face 'erc-my-nick-face 'erc--speaker nick) + (propertize nick 'erc--speaker nick 'font-lock-face 'erc-my-nick-face) (propertize close 'font-lock-face 'erc-default-face))) (let ((prefix "> ")) (propertize prefix 'font-lock-face 'erc-default-face)))) +(defun erc--format-speaker-input-message (message) + "Assemble outgoing MESSAGE entered at the prompt for insertion. +Intend \"input\" to refer to interactive prompt input as well as +the group of associated message-format templates from the +\"speaker\" catalog. Format the speaker portion in a manner +similar to that performed by `erc-format-my-nick', but use either +`erc--message-speaker-input-chan-privmsg' or +`erc--message-speaker-input-query-privmsg' as a formatting +template, with MESSAGE being the actual message body. Return a +copy with possibly shared text-property values." + (if-let ((erc-show-my-nick) + (nick (erc-current-nick)) + (pfx (erc-get-channel-membership-prefix nick)) + (erc-current-message-catalog erc--message-speaker-catalog) + (key (if (or erc-format-query-as-channel-p + (erc--target-channel-p erc--target)) + 'input-chan-privmsg + 'input-query-privmsg))) + (progn + (cond (erc--msg-props (puthash 'erc--msg key erc--msg-props)) + (erc--msg-prop-overrides (push (cons 'erc--msg key) + erc--msg-prop-overrides))) + (erc-format-message key ?p pfx ?n (erc--speakerize-nick nick) + ?m message)) + (propertize (concat "> " message) 'font-lock-face 'erc-input-face))) + (defun erc-echo-notice-in-default-buffer (s parsed buffer _sender) "Echo a private notice in the default buffer, namely the target buffer specified by BUFFER, or there is no target buffer, @@ -6105,8 +6364,7 @@ erc-process-ctcp-query (while queries (let* ((type (upcase (car (split-string (car queries))))) (hook (intern-soft (concat "erc-ctcp-query-" type "-hook"))) - (erc--msg-prop-overrides `((erc--msg . msg) - (erc--ctcp . ,(intern type)) + (erc--msg-prop-overrides `((erc--ctcp . ,(intern type)) ,@erc--msg-prop-overrides))) (if (and hook (boundp hook)) (if (string-equal type "ACTION") @@ -6141,12 +6399,31 @@ erc-ctcp-query-ACTION (let ((s (match-string 1 msg)) (buf (or (erc-get-buffer to proc) (erc-get-buffer nick proc) - (process-buffer proc)))) - (erc--ensure-spkr-prop nick) - (setq nick (propertize nick 'erc--speaker nick)) - (erc-display-message - parsed 'action buf - 'ACTION ?n nick ?u login ?h host ?a s)))) + (process-buffer proc))) + (selfp (erc-current-nick-p nick))) + (if erc--use-language-catalog-for-ctcp-action-p + (progn + (erc--ensure-spkr-prop nick) + (setq nick (propertize nick 'erc--speaker nick)) + (erc-display-message parsed (if selfp 'input 'action) buf + 'ACTION ?n nick ?u login ?h host ?a s)) + (let* ((obj (and (erc--ctcp-response-p parsed) parsed)) + (buffer (and obj (erc--ctcp-response-buffer obj))) + (stsmsg (and obj (erc--ctcp-response-statusmsg obj))) + (prefix (and obj (erc--ctcp-response-prefix obj))) + (dispnm (and obj (erc--ctcp-response-dispname obj))) + (erc-current-message-catalog erc--message-speaker-catalog)) + (erc-display-message + parsed nil (or buffer buf) + (if selfp + (if stsmsg 'ctcp-action-statusmsg-input 'ctcp-action-input) + (if stsmsg 'ctcp-action-statusmsg 'ctcp-action)) + ?s (or stsmsg to) + ?p (or (and (erc-channel-user-p prefix) + (erc-get-channel-membership-prefix prefix)) + "") + ?n (erc--speakerize-nick nick dispnm) + ?m s)))))) (defvar erc-ctcp-query-CLIENTINFO-hook '(erc-ctcp-query-CLIENTINFO)) @@ -7582,15 +7859,11 @@ erc-display-msg (erc--assert-input-bounds) (let ((insert-position (marker-position (goto-char erc-insert-marker))) (erc--msg-props (or erc--msg-props - (let ((ovs erc--msg-prop-overrides)) + (let ((ovs (seq-filter + #'cdr erc--msg-prop-overrides))) (map-into `((erc--msg . msg) ,@(reverse ovs)) - 'hash-table)))) - beg) - (insert (erc-format-my-nick)) - (setq beg (point)) - (insert line) - (erc-put-text-property beg (point) 'font-lock-face 'erc-input-face) - (insert "\n") + 'hash-table))))) + (insert (erc--format-speaker-input-message line) "\n") (save-restriction (narrow-to-region insert-position (point)) (run-hooks 'erc-send-modify-hook) @@ -8945,9 +9218,6 @@ erc-message-english-PART (string-replace "%" "%%" reason)) ""))))) - -(defvar-local erc-current-message-catalog 'english) - (defun erc-retrieve-catalog-entry (key &optional catalog) "Retrieve `format-spec' entry for symbol KEY in CATALOG. Without symbol CATALOG, use `erc-current-message-catalog'. If diff --git a/test/lisp/erc/erc-scenarios-base-statusmsg.el b/test/lisp/erc/erc-scenarios-base-statusmsg.el new file mode 100644 index 00000000000..80582e0cf80 --- /dev/null +++ b/test/lisp/erc/erc-scenarios-base-statusmsg.el @@ -0,0 +1,103 @@ +;;; erc-scenarios-base-statusmsg.el --- statusmsg tests -*- lexical-binding: t -*- + +;; Copyright (C) 2023 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 . + +;;; Code: + +(require 'ert-x) +(eval-and-compile + (let ((load-path (cons (ert-resource-directory) load-path))) + (require 'erc-scenarios-common))) + +(ert-deftest erc-scenarios-base-statusmsg () + + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "base/display-message") + (dumb-server (erc-d-run "localhost" t 'statusmsg)) + (erc-autojoin-channels-alist '((foonet "#mine"))) + (erc-modules (cons 'fill-wrap erc-modules)) + (port (process-contact dumb-server :service)) + (erc-show-speaker-membership-status nil) + (erc-server-flood-penalty 0.1) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :user "tester" + :full-name "tester") + (funcall expect 5 "This server is in debug mode"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#mine")) + + (ert-info ("Receive status messages unprefixed") + (funcall expect 5 "+dummy") + (funcall expect 5 "(dummy+) hello") + (should (eq 'statusmsg (erc--get-inserted-msg-prop 'erc--msg))) + (should (equal "dummy" (erc--get-inserted-msg-prop 'erc--spkr))) + (should (eq (get-text-property (1- (point)) 'font-lock-face) + 'erc-default-face)) + (funcall expect 5 "(dummy+) there") + (should (equal "" (get-text-property (pos-bol) 'display))) + + ;; CTCP ACTION + (funcall expect 5 "* (dummy+) sad") + (should (eq 'ctcp-action-statusmsg + (erc--get-inserted-msg-prop 'erc--msg))) + (should (eq (get-text-property (1- (point)) 'font-lock-face) + 'erc-action-face)) + (funcall expect 5 "* (dummy+) glad") + (should (equal "" (get-text-property (pos-bol) 'display)))) + + (ert-info ("Send status messages") + ;; We don't have `echo-message' yet, so ERC doesn't currently + ;; insert commands like "/msg +#mine foo". + (let ((erc-default-recipients '("+#mine"))) + (erc-send-message "howdy")) + (funcall expect 5 "(@tester+) howdy") + (should (eq 'statusmsg-input (erc--get-inserted-msg-prop 'erc--msg))) + (should (equal "tester" (erc--get-inserted-msg-prop 'erc--spkr))) + (should (eq (get-text-property (1- (point)) 'font-lock-face) + 'erc-input-face)) + (let ((erc-default-recipients '("+#mine"))) + (erc-send-message "tenderfoot")) + (funcall expect 5 "(@tester+) tenderfoot") + (should (equal "" (get-text-property (pos-bol) 'display))) + + ;; Simulate some "echoed" CTCP ACTION messages since we don't + ;; actually support that yet. + (funcall expect 5 "* (@tester+) mad") + (should (eq 'ctcp-action-statusmsg-input + (erc--get-inserted-msg-prop 'erc--msg))) + (should (equal (get-text-property (1- (point)) 'font-lock-face) + '(erc-input-face erc-action-face))) + (funcall expect 5 "* (@tester+) chad") + (should (equal "" (get-text-property (pos-bol) 'display)))) + + (ert-info ("Receive status messages prefixed") + (setq erc-show-speaker-membership-status t) + (erc-scenarios-common-say "/me ready") ; sync + (funcall expect 5 "* @tester ready") + (funcall expect 5 "(+dummy+) okie") + + ;; CTCP ACTION + (funcall expect 5 "* (+dummy+) dokie") + (funcall expect 5 "* +dummy out"))))) + +;;; erc-scenarios-base-statusmsg.el ends here diff --git a/test/lisp/erc/erc-scenarios-stamp.el b/test/lisp/erc/erc-scenarios-stamp.el index bb3a4195e0d..e4788f78654 100644 --- a/test/lisp/erc/erc-scenarios-stamp.el +++ b/test/lisp/erc/erc-scenarios-stamp.el @@ -68,7 +68,7 @@ erc-scenarios-stamp--left/display-margin-mode (ert-info ("Stamps appear in left margin and are invisible") (should (eq 'erc-timestamp (field-at-pos (pos-bol)))) (should (= (pos-bol) (field-beginning (pos-bol)))) - (should (eq 'msg (get-text-property (pos-bol) 'erc--msg))) + (should (eq 'query-notice (get-text-property (pos-bol) 'erc--msg))) (should (eq 'NOTICE (get-text-property (pos-bol) 'erc--cmd))) (should (= ?- (char-after (field-end (pos-bol))))) (should (equal (get-text-property (1+ (field-end (pos-bol))) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 94ba724ac43..b7e0cdcaa21 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -2285,7 +2285,8 @@ erc-message calls erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook) (cl-letf (((symbol-function 'erc-display-message) - (lambda (_ _ _ line) (push line calls))) + (lambda (_ _ _ msg &rest args) + (push (apply #'erc-format-message msg args) calls))) ((symbol-function 'erc-server-send) (lambda (line _) (push line calls))) ((symbol-function 'erc-server-buffer) @@ -2327,7 +2328,7 @@ erc-message (should-not erc-server-last-peers) (erc-message "PRIVMSG" ". hi") (should-not erc-server-last-peers) - (should (eq 'no-target (pop calls))) + (should (equal "No target" (pop calls))) (erc-message "PRIVMSG" ", hi") (should-not erc-server-last-peers) (should (string-match "alice :hi" (pop calls))))) @@ -2360,42 +2361,208 @@ erc-message (kill-buffer "ExampleNet") (kill-buffer "#chan"))) -(ert-deftest erc-format-privmessage () - ;; Basic PRIVMSG - (should (erc-tests--equal-including-properties - (erc-format-privmessage (copy-sequence "bob") - (copy-sequence "oh my") - nil 'msgp) - #(" oh my" - 0 1 (font-lock-face erc-default-face) - 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) - 4 11 (font-lock-face erc-default-face)))) - - ;; Basic NOTICE - (should (erc-tests--equal-including-properties - (erc-format-privmessage (copy-sequence "bob") - (copy-sequence "oh my") - nil nil) - #("-bob- oh my" - 0 1 (font-lock-face erc-default-face) - 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) - 4 11 (font-lock-face erc-default-face)))) - - ;; Prefixed PRIVMSG - (let* ((user (make-erc-server-user :nickname (copy-sequence "Bob"))) +;; This is an adapter that uses formatting templates from the +;; `-speaker' catalog to mimic `erc-format-privmessage', for testing +;; purposes. +(defun erc-tests--format-privmessage (nick msg privp msgp &optional inputp pfx) + (let ((erc-current-message-catalog erc--message-speaker-catalog)) + (apply #'erc-format-message + (erc--determine-speaker-message-format-args nick msg privp msgp + inputp nil pfx)))) + +;; This asserts that `erc--determine-speaker-message-format-args' +;; behaves identically to `erc-format-privmessage', the function whose +;; role it basically replaced. +(ert-deftest erc--determine-speaker-message-format-args () + ;; Basic PRIVMSG. + (let ((expect #(" oh my" + 0 1 (font-lock-face erc-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) + 4 11 (font-lock-face erc-default-face))) + (args (list (concat "bob") (concat "oh my") nil 'msgp))) + (should (erc-tests--equal-including-properties + (apply #'erc-format-privmessage args) + expect)) + (should (erc-tests--equal-including-properties + (apply #'erc-tests--format-privmessage args) + expect))) + + ;; Basic NOTICE. + (let ((expect #("-bob- oh my" + 0 1 (font-lock-face erc-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) + 4 11 (font-lock-face erc-default-face))) + (args (list (copy-sequence "bob") (copy-sequence "oh my") nil nil))) + (should (erc-tests--equal-including-properties + (apply #'erc-format-privmessage args) + expect)) + (should (erc-tests--equal-including-properties + (apply #'erc-tests--format-privmessage args) + expect))) + + ;; Status-prefixed PRIVMSG. + (let* ((expect + #("<@Bob> oh my" + 0 1 (font-lock-face erc-default-face) + 1 2 (font-lock-face erc-nick-prefix-face help-echo "operator") + 2 5 (erc--speaker "Bob" font-lock-face erc-nick-default-face) + 5 12 (font-lock-face erc-default-face))) + (user (make-erc-server-user :nickname (copy-sequence "Bob"))) (cuser (make-erc-channel-user :op t)) (erc-channel-users (make-hash-table :test #'equal))) (puthash "bob" (cons user cuser) erc-channel-users) + (with-suppressed-warnings ((obsolete erc-format-@nick)) + (should (erc-tests--equal-including-properties + (erc-format-privmessage (erc-format-@nick user cuser) + (copy-sequence "oh my") + nil 'msgp) + expect))) + (let ((nick "Bob") + (msg "oh my")) + (should (erc-tests--equal-including-properties + (erc-tests--format-privmessage nick msg nil 'msgp nil cuser) + expect)) ; overloaded on PREFIX arg + (should (erc-tests--equal-including-properties + (erc-tests--format-privmessage nick msg nil 'msgp nil t) + expect)) + ;; The new version makes a copy instead of adding properties to + ;; the input. + (should-not + (text-property-not-all 0 (length nick) 'font-lock-face nil nick)) + (should-not + (text-property-not-all 0 (length msg) 'font-lock-face nil msg))))) + +(ert-deftest erc--determine-speaker-message-format-args/queries-as-channel () + (should erc-format-query-as-channel-p) + + (with-current-buffer (get-buffer-create "bob") + (erc-mode) + (setq erc--target (erc--target-from-string "alice")) + + (insert "PRIVMSG\n" + (erc-tests--format-privmessage "bob" "oh my" 'queryp 'msgp)) + (should (erc-tests--equal-including-properties + #(" oh my" + 0 1 (font-lock-face erc-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) + 4 11 (font-lock-face erc-default-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (insert "\nNOTICE\n" + (erc-tests--format-privmessage "bob" "oh my" 'queryp nil)) + (should (erc-tests--equal-including-properties + #("-bob- oh my" + 0 1 (font-lock-face erc-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) + 4 11 (font-lock-face erc-default-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (insert "\nInput PRIVMSG\n" + (erc-tests--format-privmessage "bob" "oh my" + 'queryp 'privmsgp 'inputp)) + (should (erc-tests--equal-including-properties + #(" oh my" + 0 1 (font-lock-face erc-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) + 4 6 (font-lock-face erc-default-face) + 6 11 (font-lock-face erc-input-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (insert "\nInput NOTICE\n" + (erc-tests--format-privmessage "bob" "oh my" 'queryp nil 'inputp)) (should (erc-tests--equal-including-properties - (erc-format-privmessage (erc-format-@nick user cuser) - (copy-sequence "oh my") - nil 'msgp) - #("<@Bob> oh my" + #("-bob- oh my" 0 1 (font-lock-face erc-default-face) - 1 2 (font-lock-face erc-nick-prefix-face help-echo "operator") - 2 5 (erc--speaker "Bob" font-lock-face erc-nick-default-face) - 5 12 (font-lock-face erc-default-face)))))) + 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) + 4 6 (font-lock-face erc-default-face) + 6 11 (font-lock-face erc-input-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (when noninteractive (kill-buffer)))) + +(ert-deftest erc--determine-speaker-message-format-args/queries () + (should erc-format-query-as-channel-p) + + (with-current-buffer (get-buffer-create "bob") + (erc-mode) + (setq-local erc-format-query-as-channel-p nil) + (setq erc--target (erc--target-from-string "alice")) + + (insert "PRIVMSG\n" + (erc-tests--format-privmessage "bob" "oh my" 'queryp 'msgp)) + (should (erc-tests--equal-including-properties + #("*bob* oh my" + 0 1 (font-lock-face erc-direct-msg-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-msg-face) + 4 11 (font-lock-face erc-direct-msg-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (insert "\nNOTICE\n" + (erc-tests--format-privmessage "bob" "oh my" 'queryp nil)) + (should (erc-tests--equal-including-properties + #("-bob- oh my" + 0 1 (font-lock-face erc-direct-msg-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-msg-face) + 4 11 (font-lock-face erc-direct-msg-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (insert "\nInput PRIVMSG\n" + (erc-tests--format-privmessage "bob" "oh my" + 'queryp 'privmsgp 'inputp)) + (should (erc-tests--equal-including-properties + #("*bob* oh my" + 0 1 (font-lock-face erc-direct-msg-face) + 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) + 4 6 (font-lock-face erc-direct-msg-face) + 6 11 (font-lock-face erc-input-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (insert "\nInput NOTICE\n" + (erc-tests--format-privmessage "bob" "oh my" 'queryp nil 'inputp)) + (should (erc-tests--equal-including-properties + #("-bob- oh my" + 0 1 (font-lock-face erc-direct-msg-face) + 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) + 4 6 (font-lock-face erc-direct-msg-face) + 6 11 (font-lock-face erc-input-face)) + (buffer-substring (pos-bol) (pos-eol)))) + + (when noninteractive (kill-buffer)))) + +(defun erc-tests--format-my-nick (message) + (concat (erc-format-my-nick) + (propertize message 'font-lock-face 'erc-input-face))) + +;; This tests that the default behavior of the replacement formatting +;; function for prompt input, `erc--format-speaker-input-message' +;; matches that of the original being replaced, `erc-format-my-nick', +;; though it only handled the speaker portion. +(ert-deftest erc--format-speaker-input-message () + ;; No status prefix. + (let ((erc-server-current-nick "tester") + (expect #(" oh my" + 0 1 (font-lock-face erc-default-face) + 1 7 (font-lock-face erc-my-nick-face erc--speaker "tester") + 7 9 (font-lock-face erc-default-face) + 9 14 (font-lock-face erc-input-face)))) + (should (equal (erc-tests--format-my-nick "oh my") expect)) + (should (equal (erc--format-speaker-input-message "oh my") expect))) + + ;; With channel-operator status prefix. + (let* ((erc-server-current-nick "tester") + (cmem (cons (make-erc-server-user :nickname "tester") + (make-erc-channel-user :op t))) + (erc-channel-users (map-into (list "tester" cmem) + '(hash-table :test equal))) + (expect #("<@tester> oh my" + 0 1 (font-lock-face erc-default-face) + 1 2 (font-lock-face erc-my-nick-prefix-face) + 2 5 (font-lock-face erc-my-nick-face erc--speaker "bob") + 5 7 (font-lock-face erc-default-face) + 7 12 (font-lock-face erc-input-face)))) + (should (equal (erc-tests--format-my-nick "oh my") expect)) + (should (equal (erc--format-speaker-input-message "oh my") expect)))) (ert-deftest erc--route-insertion () (erc-tests--send-prep) diff --git a/test/lisp/erc/resources/base/display-message/statusmsg.eld b/test/lisp/erc/resources/base/display-message/statusmsg.eld new file mode 100644 index 00000000000..7c42117080c --- /dev/null +++ b/test/lisp/erc/resources/base/display-message/statusmsg.eld @@ -0,0 +1,47 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER tester 0 * :tester") + (0.00 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0.02 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version ergo-v2.11.1") + (0.01 ":irc.foonet.org 003 tester :This server was created Thu, 07 Dec 2023 08:04:35 UTC") + (0.00 ":irc.foonet.org 004 tester irc.foonet.org ergo-v2.11.1 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0.00 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# CHATHISTORY=1000 ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX :are supported by this server") + (0.01 ":irc.foonet.org 005 tester KICKLEN=390 MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8ONLY WHOX :are supported by this server") + (0.01 ":irc.foonet.org 005 tester draft/CHATHISTORY=1000 :are supported by this server") + (0.00 ":irc.foonet.org 251 tester :There are 0 users and 4 invisible on 1 server(s)") + (0.00 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0.00 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0.00 ":irc.foonet.org 254 tester 2 :channels formed") + (0.00 ":irc.foonet.org 255 tester :I have 4 clients and 0 servers") + (0.02 ":irc.foonet.org 265 tester 4 5 :Current local users 4, max 5") + (0.00 ":irc.foonet.org 266 tester 4 5 :Current global users 4, max 5") + (0.00 ":irc.foonet.org 422 tester :MOTD File is missing") + (0.00 ":irc.foonet.org 221 tester +i") + (0.00 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((mode-tester 10 "MODE tester +i")) + +((join-mine 10 "JOIN #mine") + (0.01 ":irc.foonet.org 221 tester +i") + (0.00 ":tester!~u@2jv6nwu4af69s.irc JOIN #mine") + (0.02 ":irc.foonet.org 353 tester = #mine :@tester +dummy") + (0.01 ":irc.foonet.org 366 tester #mine :End of NAMES list")) + +((mode-mine 10 "MODE #mine") + (0.00 ":irc.foonet.org 324 tester #mine +Cnt") + (0.02 ":irc.foonet.org 329 tester #mine 1702026418") + (0.04 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :hello") + (0.03 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :there") + (0.05 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION sad\1") + (0.03 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION glad\1")) + +((privmsg-statusmsg 10 "PRIVMSG +#mine :howdy")) +((privmsg-statusmsg-action 10 "PRIVMSG +#mine :tenderfoot") + ;; These are simulated "echoed messages" + (0.05 ":tester!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION mad\1") + (0.05 ":tester!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION chad\1")) + +((privmsg-prefixed 10 "PRIVMSG #mine :\1ACTION ready\1") + (0.04 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :okie") + (0.05 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION dokie\1") + (0.04 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG #mine :\1ACTION out\1")) diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld index 9f648915d5c..feaba85ec90 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--spkr "alice" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--spkr "bob" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld index a63fcad3d38..ed1488c8595 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--spkr "alice" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--spkr "bob" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld index 7cbabfd0581..a3530a6c44d 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--spkr "alice" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--spkr "bob" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file commit 236a416be76cbb0b79ad46c06652f6cbf8788fcb Author: F. Jason Park Date: Mon Dec 4 22:13:02 2023 -0800 Add erc--spkr text property to chat messages * etc/ERC-NEWS: Mention combined face ordering for "/me" messages. * lisp/erc/erc-backend.el (erc-server-PRIVMSG): Bind `erc--msg-prop-overrides' for the extent of this function's execution, which means a large amount of code will see this variable as being non-nil. However, no calls to `erc-display-message' or `erc-display-msg' should occur other than the one handling the final insertion. Code needing to influence the current message's "msg props" can push new pairs onto this value, which will override any existing collisions. * lisp/erc/erc-fill.el (erc-fill): Switch to `erc--spkr' as sentinel property. (erc-fill--wrap-continued-message-p): Look for `erc--spkr' property instead of `erc-speaker'. * lisp/erc/erc.el (erc--msg-props): Mention `erc--spkr' in doc. (erc--send-action-perform-ctcp): Add `erc--spkr' property. Fix bug in which `erc-my-nick-face' appeared below `erc-input-face' in the speaker portion. (erc--ensure-spkr-prop): New helper function to propagate speaker metadata. (erc--ranked-properties): Add `erc--spkr', `erc--ctcp', and `erc--ephemeral'. (erc-display-message): Use default hash table size when initializing. Remove unnecessary assignment of `msg' to `erc--msg' for PRIVMSG and NOTICE commands. Bind `string' below `erc--msg-props' so that implementers of the function form of the `erc-format-message' templating interface can read and write the current context's "msg props". (erc--own-property-names): Add all `erc--msg-props' props by subsumation. (erc--get-speaker-bounds): Use `erc--spkr' instead of `erc--msg' as a sentinel to detect a chat message guaranteed to have an `erc--speaker' text-property interval. (erc-format-privmessage, erc-format-my-nick, erc-ctcp-query-ACTION): Add `erc--spkr' to `erc--msg-prop-overrides' when available. * test/lisp/erc/erc-fill-tests.el: (erc-fill-tests--insert-privmsg): Bind `erc--msg-prop-overrides'. (erc-fill-tests--compare): Require environment variable value to match current test name exactly when saving snapshots. Add `erc--msg-props' individually to white list. * test/lisp/erc/erc-tests.el (erc--order-text-properties-from-hash): Include `erc--spkr'. (Bug#60936) (Bug#67677) ; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld: ; Update. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld: ; Update. ; * test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld: Update. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index b89c5228e32..146f6690c5e 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -214,7 +214,10 @@ Users of the default theme may notice that 'erc-action-face' and 'erc-notice-face' now appear slightly less bold on systems supporting a weight of 'semi-bold'. This was done to make buttons detectable and to spare users from resorting to tweaking these faces, or options like -'erc-notice-highlight-type', just to achieve this effect. +'erc-notice-highlight-type', just to achieve this effect. It's +currently most prominent in "/ME" messages, where 'erc-action-face' +sits beneath 'erc-input-face', as well as 'erc-my-nick-face' in the +speaker portion. ** Improved interplay between buffer truncation and message logging. While most of these improvements are subtle, some affect everyday use. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 1c29f49a129..0f6f7e2d4c3 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1919,6 +1919,7 @@ erc--server-determine-join-display-context (and erc-ignore-reply-list (erc-ignored-reply-p msg tgt proc))) (when erc-minibuffer-ignored (message "Ignored %s from %s to %s" cmd sender-spec tgt)) + (defvar erc--msg-prop-overrides) (let* ((sndr (erc-parse-user sender-spec)) (nick (nth 0 sndr)) (login (nth 1 sndr)) @@ -1929,6 +1930,8 @@ erc--server-determine-join-display-context (privp (erc-current-nick-p tgt)) (erc--display-context `((erc-buffer-display . ,(intern cmd)) ,@erc--display-context)) + (erc--msg-prop-overrides `((erc--msg . msg) + ,@erc--msg-prop-overrides)) s buffer fnick) (setq buffer (erc-get-buffer (if privp nick tgt) proc)) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index b1bbb5e19b9..0c2be4b5bc9 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -177,11 +177,10 @@ erc-fill (when-let ((erc-fill-line-spacing) (p (point-min))) (widen) - (when (or (erc--check-msg-prop 'erc--msg 'msg) - (and-let* ((m (save-excursion - (forward-line -1) - (erc--get-inserted-msg-prop 'erc--msg)))) - (eq 'msg m))) + (when (or (erc--check-msg-prop 'erc--spkr) + (save-excursion + (forward-line -1) + (erc--get-inserted-msg-prop 'erc--spkr))) (put-text-property (1- p) p 'line-spacing erc-fill-line-spacing)))))))) @@ -568,22 +567,19 @@ erc-fill--wrap-continued-message-p (props (save-restriction (widen) (and-let* - (((eq 'msg (get-text-property m 'erc--msg))) + ((speaker (get-text-property m 'erc--spkr)) ((not (eq (get-text-property m 'erc--ctcp) 'ACTION))) - ((not (invisible-p m))) - (spr (next-single-property-change m 'erc--speaker))) - (cons (get-text-property m 'erc--ts) - (get-text-property spr 'erc--speaker))))) + ((not (invisible-p m)))) + (cons (get-text-property m 'erc--ts) speaker)))) (ts (pop props)) (props) ((not (time-less-p (erc-stamp--current-time) ts))) ((time-less-p (time-subtract (erc-stamp--current-time) ts) erc-fill--wrap-max-lull)) ;; Assume presence of leading angle bracket or hyphen. - (speaker (next-single-property-change (point-min) 'erc--speaker)) + (nick (erc--check-msg-prop 'erc--spkr)) ((not (erc--check-msg-prop 'erc--ctcp 'ACTION))) - (nick (get-text-property speaker 'erc--speaker)) ((erc-nick-equal-p props nick)))) (set-marker erc-fill--wrap-last-msg (point-min)))))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index dad7ebab621..57194ed439e 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -167,6 +167,8 @@ erc--msg-props and help text, and on outgoing messages unless echoed back by the server (assuming future support) + - `erc--spkr': a string, the nick of the person speaking + - `erc--ctcp': a CTCP command, like `ACTION' - `erc--ts': a timestamp, possibly provided by the server; as of @@ -3018,13 +3020,16 @@ erc--send-action-perform-ctcp (defun erc--send-action-display (string) "Display STRING as an outgoing \"CTCP ACTION\" message." ;; Allow hooks acting on inserted PRIVMSG and NOTICES to process us. - (let ((erc--msg-prop-overrides `((erc--msg . msg) - (erc--ctcp . ACTION) - ,@erc--msg-prop-overrides)) - (nick (erc-current-nick))) + (defvar erc--merge-prop-behind-p) + (let* ((nick (erc-current-nick)) + (erc--msg-prop-overrides `((erc--msg . msg) + (erc--ctcp . ACTION) + (erc--spkr . ,nick) + ,@erc--msg-prop-overrides)) + (erc--merge-prop-behind-p t)) (setq nick (propertize nick 'erc--speaker nick 'font-lock-face 'erc-my-nick-face)) - (erc-display-message nil '(t action input) (current-buffer) + (erc-display-message nil '(t input action) (current-buffer) 'ACTION ?n nick ?a string ?u "" ?h ""))) (defun erc--send-action (target string force) @@ -3034,6 +3039,12 @@ erc--send-action ;; Display interface +(defun erc--ensure-spkr-prop (nick) + "Maybe add NICK to `erc--msg-props' or `erc--msg-prop-overrides'." + (cond (erc--msg-props (puthash 'erc--spkr nick erc--msg-props)) + (erc--msg-prop-overrides + (push (cons 'erc--spkr nick) erc--msg-prop-overrides)))) + (defun erc-string-invisible-p (string) "Check whether STRING is invisible or not. I.e. any char in it has the `invisible' property set." @@ -3463,7 +3474,8 @@ erc--delete-inserted-message (substring (delete-and-extract-region (1- (point)) (1+ end)) -1)))))))) -(defvar erc--ranked-properties '(erc--msg erc--ts erc--cmd)) +(defvar erc--ranked-properties + '(erc--msg erc--spkr erc--ts erc--cmd erc--ctcp erc--ephemeral)) (defun erc--order-text-properties-from-hash (table) "Return a plist of text props from items in TABLE. @@ -3729,32 +3741,29 @@ erc-display-message sent from a server. That is, guarantee \"local\" messages, for which PARSED is typically nil, will be subject to buttonizing, filling, and other effects." - (let ((string (if (symbolp msg) - (apply #'erc-format-message msg args) - msg)) - (erc--msg-props - (or erc--msg-props - (let ((table (make-hash-table :size 5)) - (cmd (and parsed (erc--get-eq-comparable-cmd - (erc-response.command parsed))))) - (puthash 'erc--msg - (cond ((and msg (symbolp msg)) msg) - ((and cmd (memq cmd '(PRIVMSG NOTICE)) 'msg)) - (type (pcase type - ((pred symbolp) type) - ((pred listp) - (intern (mapconcat #'prin1-to-string - type "-"))) - (_ 'unknown))) - (t 'unknown)) - table) - (when cmd - (puthash 'erc--cmd cmd table)) - (and-let* ((ovs erc--msg-prop-overrides)) - (pcase-dolist (`(,k . ,v) (reverse ovs)) - (puthash k v table))) - table))) - (erc-message-parsed parsed)) + (let* ((erc--msg-props + (or erc--msg-props + (let ((table (make-hash-table)) + (cmd (and parsed (erc--get-eq-comparable-cmd + (erc-response.command parsed))))) + (puthash 'erc--msg + (cond ((and msg (symbolp msg)) msg) + (type (pcase type + ((pred symbolp) type) + ((pred listp) + (intern (mapconcat #'prin1-to-string + type "-"))) + (_ 'unknown))) + (t 'unknown)) + table) + (when cmd + (puthash 'erc--cmd cmd table)) + (when erc--msg-prop-overrides + (pcase-dolist (`(,k . ,v) (reverse erc--msg-prop-overrides)) + (when v (puthash k v table)))) + table))) + (erc-message-parsed parsed) + (string (if (symbolp msg) (apply #'erc-format-message msg args) msg))) (setq string (cond ((null type) @@ -4650,6 +4659,9 @@ erc-send-message (funcall erc--send-message-nested-function line force) (erc--send-message-external line force))) +;; FIXME fully simulate `erc-display-msg'. This doesn't currently add +;; the correct text properties. For example, the LINE should have +;; `erc-default-face'. (defun erc--send-message-external (line force) (erc-message "PRIVMSG" (concat (erc-default-target) " " line) force) (erc-display-line @@ -5263,7 +5275,9 @@ erc-ensure-channel-name (concat "#" channel))) (defvar erc--own-property-names - '( tags erc--speaker erc-parsed display ; core + `( tags erc--speaker erc-parsed display ; core + ;; `erc--msg-props' + ,@erc--ranked-properties ;; `erc-display-prompt' rear-nonsticky erc-prompt field front-sticky read-only ;; stamp @@ -5749,7 +5763,7 @@ erc-is-message-ctcp-and-not-action-p (defun erc--get-speaker-bounds () "Return the bounds of `erc--speaker' text property when present. Assume buffer is narrowed to the confines of an inserted message." - (and-let* (((erc--check-msg-prop 'erc--msg 'msg)) + (and-let* (((erc--check-msg-prop 'erc--spkr)) (beg (text-property-not-all (point-min) (point-max) 'erc--speaker nil))) (cons beg (next-single-property-change beg 'erc--speaker)))) @@ -5777,6 +5791,7 @@ erc-format-privmessage nick-prefix-face nick)) 0)) (msg-face (if privp 'erc-direct-msg-face 'erc-default-face))) + (erc--ensure-spkr-prop nick) ;; add text properties to text before the nick, the nick and after the nick (erc-put-text-property 0 (length mark-s) 'font-lock-face msg-face str) (erc-put-text-properties (+ (length mark-s) prefix-len) @@ -5842,6 +5857,7 @@ erc-format-my-nick (close "> ") (nick (erc-current-nick)) (mode (erc-get-channel-membership-prefix nick))) + (erc--ensure-spkr-prop nick) (concat (propertize open 'font-lock-face 'erc-default-face) (propertize mode 'font-lock-face 'erc-my-nick-prefix-face) @@ -6126,6 +6142,7 @@ erc-ctcp-query-ACTION (buf (or (erc-get-buffer to proc) (erc-get-buffer nick proc) (process-buffer proc)))) + (erc--ensure-spkr-prop nick) (setq nick (propertize nick 'erc--speaker nick)) (erc-display-message parsed 'action buf diff --git a/test/lisp/erc/erc-fill-tests.el b/test/lisp/erc/erc-fill-tests.el index bfdf8cd7320..8560d421cc2 100644 --- a/test/lisp/erc/erc-fill-tests.el +++ b/test/lisp/erc/erc-fill-tests.el @@ -35,7 +35,8 @@ erc-stamp--current-time (defun erc-fill-tests--insert-privmsg (speaker &rest msg-parts) (declare (indent 1)) - (let* ((msg (erc-format-privmessage speaker + (let* ((erc--msg-prop-overrides `((erc--msg . msg))) + (msg (erc-format-privmessage speaker (apply #'concat msg-parts) nil t)) (parsed (make-erc-response :unparsed (format ":%s PRIVMSG #chan :%s" speaker msg) @@ -150,7 +151,9 @@ erc-fill-tests--compare "eld")) (erc--own-property-names (seq-difference `(font-lock-face ,@erc--own-property-names) - '(field display wrap-prefix line-prefix) + `(field display wrap-prefix line-prefix + erc--msg erc--cmd erc--spkr erc--ts erc--ctcp + erc--ephemeral) #'eq)) (print-circle t) (print-escape-newlines t) @@ -165,12 +168,12 @@ erc-fill-tests--compare (with-silent-modifications (insert (setq got (read repr)))) (erc-mode)) - (if erc-fill-tests--save-p + ;; LHS is a string, RHS is a symbol. + (if (string= erc-fill-tests--save-p (ert-test-name (ert-running-test))) (let (inhibit-message) (with-temp-file expect-file (insert repr)) ;; Limit writing snapshots to one test at a time. - (setq erc-fill-tests--save-p nil) (message "erc-fill-tests--compare: wrote %S" expect-file)) (if (file-exists-p expect-file) ;; Ensure string-valued properties, like timestamps, aren't diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index ca5582885f4..94ba724ac43 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -1883,6 +1883,7 @@ erc--order-text-properties-from-hash (erc--msg . s005) (b . 2) (erc--cmd . 5) + (erc--spkr . "X") (c . 3)) 'hash-table))) (with-temp-buffer @@ -1890,6 +1891,7 @@ erc--order-text-properties-from-hash (insert "abc\n") (add-text-properties 1 2 (erc--order-text-properties-from-hash table)) (should (equal '( erc--msg s005 + erc--spkr "X" erc--ts 0 erc--cmd 5 a 1 diff --git a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld index f4a43a9384f..3c32719a052 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 27 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc--msg msg erc--ts 1680332400 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 27 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc--msg msg erc--ts 1680332400 erc--spkr "Dummy" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc--msg msg erc--ts 1680332400 erc--spkr "Dummy" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld index 78450ec08e2..e2064b914c4 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 29 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 29 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 29 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 29 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 29 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 29 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 29 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 29 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18))) field erc-timestamp) 21 22 (wrap-prefix #1# line-prefix #2=(space :width (- 29 (4))) erc--msg notice erc--ts 0) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (wrap-prefix #1# line-prefix #2# field erc-timestamp display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (wrap-prefix #1# line-prefix #3=(space :width (- 29 (8))) erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix (space :width (- 29 (8)))) 349 350 (wrap-prefix #1# line-prefix #4=(space :width (- 29 (6))) erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (wrap-prefix #1# line-prefix (space :width (- 29 (18))) field erc-timestamp) 455 456 (wrap-prefix #1# line-prefix #5=(space :width (- 29 (6))) erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (wrap-prefix #1# line-prefix #5# field erc-timestamp display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (wrap-prefix #1# line-prefix #7=(space :width (- 29 (8))) erc--msg msg erc--ts 1680332400 erc--spkr "alice" erc--cmd PRIVMSG) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (wrap-prefix #1# line-prefix #8=(space :width (- 29 0)) erc--msg msg erc--ts 1680332400 erc--spkr "alice" erc--cmd PRIVMSG display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (wrap-prefix #1# line-prefix #10=(space :width (- 29 (6))) erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (wrap-prefix #1# line-prefix #11=(space :width (- 29 0)) erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (wrap-prefix #1# line-prefix #12=(space :width (- 29 (8))) erc--msg msg erc--ts 1680332400 erc--spkr "Dummy" erc--cmd PRIVMSG) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (wrap-prefix #1# line-prefix #13=(space :width (- 29 0)) erc--msg msg erc--ts 1680332400 erc--spkr "Dummy" erc--cmd PRIVMSG display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld index 8e5535093e1..9f648915d5c 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld index a0c03244afe..a63fcad3d38 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld index c4a51e06354..7cbabfd0581 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld b/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld index 5eea73b4f16..c94629cf357 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld b/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld index bc59c0bef22..127c0b29bc9 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld b/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld index bfb75c0838e..a9f3f1d1904 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 25) line-prefix (space :width (- 25 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 25 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 25 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 25 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 25) line-prefix (space :width (- 25 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 25 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 25 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 25 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld b/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld index 5eea73b4f16..c94629cf357 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld b/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld index 1362c57ef10..754d7989cea 100644 --- a/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld +++ b/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n This buffer is for text.\n*** one two three\n*** four five six\n Somebody stop me\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 190 191 (line-spacing 0.5) 191 192 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 348 349 (line-spacing 0.5) 349 350 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 435 436 (line-spacing 0.5) 436 437 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #5=(space :width (- 27 0)) display #6="") 437 440 (wrap-prefix #1# line-prefix #5# display #6#) 440 442 (wrap-prefix #1# line-prefix #5# display #6#) 442 466 (wrap-prefix #1# line-prefix #5#) 466 467 (line-spacing 0.5) 467 468 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #7=(space :width (- 27 (4)))) 468 484 (wrap-prefix #1# line-prefix #7#) 485 486 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #8=(space :width (- 27 (4)))) 486 502 (wrap-prefix #1# line-prefix #8#) 502 503 (line-spacing 0.5) 503 504 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 504 507 (wrap-prefix #1# line-prefix #9#) 507 525 (wrap-prefix #1# line-prefix #9#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n This buffer is for text.\n*** one two three\n*** four five six\n Somebody stop me\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 190 191 (line-spacing 0.5) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 348 349 (line-spacing 0.5) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 435 436 (line-spacing 0.5) 436 437 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 27 0)) display #6="") 437 440 (wrap-prefix #1# line-prefix #5# display #6#) 440 442 (wrap-prefix #1# line-prefix #5# display #6#) 442 466 (wrap-prefix #1# line-prefix #5#) 466 467 (line-spacing 0.5) 467 468 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #7=(space :width (- 27 (4)))) 468 484 (wrap-prefix #1# line-prefix #7#) 485 486 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #8=(space :width (- 27 (4)))) 486 502 (wrap-prefix #1# line-prefix #8#) 502 503 (line-spacing 0.5) 503 504 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 504 507 (wrap-prefix #1# line-prefix #9#) 507 525 (wrap-prefix #1# line-prefix #9#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld b/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld index 4f87c7d2547..1b22b6c5cfd 100644 --- a/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld @@ -1 +1 @@ -#("\n\n[00:00]*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.\n[00:00] bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n[00:00] alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg notice erc--ts 0 display #3=(#5=(margin left-margin) #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix #2=(space :width (- 27 (4)))) 3 9 (display #3# field erc-timestamp wrap-prefix #1# line-prefix #2#) 9 171 (wrap-prefix #1# line-prefix #2#) 172 173 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG display #6=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #4=(space :width (- 27 (8)))) 173 179 (display #6# field erc-timestamp wrap-prefix #1# line-prefix #4#) 179 180 (wrap-prefix #1# line-prefix #4#) 180 185 (wrap-prefix #1# line-prefix #4#) 185 187 (wrap-prefix #1# line-prefix #4#) 187 190 (wrap-prefix #1# line-prefix #4#) 190 303 (wrap-prefix #1# line-prefix #4#) 304 336 (wrap-prefix #1# line-prefix #4#) 337 338 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG display #8=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #7=(space :width (- 27 (6)))) 338 344 (display #8# field erc-timestamp wrap-prefix #1# line-prefix #7#) 344 345 (wrap-prefix #1# line-prefix #7#) 345 348 (wrap-prefix #1# line-prefix #7#) 348 350 (wrap-prefix #1# line-prefix #7#) 350 355 (wrap-prefix #1# line-prefix #7#) 355 430 (wrap-prefix #1# line-prefix #7#)) +#("\n\n[00:00]*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.\n[00:00] bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n[00:00] alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg notice erc--ts 0 display #3=(#5=(margin left-margin) #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix #2=(space :width (- 27 (4)))) 3 9 (display #3# field erc-timestamp wrap-prefix #1# line-prefix #2#) 9 171 (wrap-prefix #1# line-prefix #2#) 172 173 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG display #6=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #4=(space :width (- 27 (8)))) 173 179 (display #6# field erc-timestamp wrap-prefix #1# line-prefix #4#) 179 180 (wrap-prefix #1# line-prefix #4#) 180 185 (wrap-prefix #1# line-prefix #4#) 185 187 (wrap-prefix #1# line-prefix #4#) 187 190 (wrap-prefix #1# line-prefix #4#) 190 303 (wrap-prefix #1# line-prefix #4#) 304 336 (wrap-prefix #1# line-prefix #4#) 337 338 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG display #8=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #7=(space :width (- 27 (6)))) 338 344 (display #8# field erc-timestamp wrap-prefix #1# line-prefix #7#) 344 345 (wrap-prefix #1# line-prefix #7#) 345 348 (wrap-prefix #1# line-prefix #7#) 348 350 (wrap-prefix #1# line-prefix #7#) 350 355 (wrap-prefix #1# line-prefix #7#) 355 430 (wrap-prefix #1# line-prefix #7#)) \ No newline at end of file commit c1befaf0a8b19fdd3b22e824f4bfc10f8882db67 Author: F. Jason Park Date: Mon Sep 11 21:21:42 2023 -0700 Skip erc-ignored-user-p when erc-ignore-list is empty * lisp/erc/erc-backend.el (erc-server-PRIVMSG): Don't bother running `erc-ignored-user-p' and `erc-ignored-reply-p' when their associated options are null. The option `erc-ignore-list' is buffer-local when set, and `erc-ignored-user-p' looks for it in the server buffer. Moreover, all functions that set it, like `erc-cmd-IGNORE' and `erc-cmd-UNIGNORE', do so in the server buffer. And the response handler in question only runs in server buffers, so this shouldn't break anything. Also, remove stray call to reassign trailing response contents. * lisp/erc/erc-common.el (erc-get-server-user): Rearrange so `erc-with-server-buffer' doesn't have to switch to the server buffer because `erc-downcase' can run in channels as well. * lisp/erc/erc.el (erc-ignored-user-p): Add comment. (Bug#67677) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 6483192692b..1c29f49a129 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1913,8 +1913,10 @@ erc--server-determine-join-display-context (tgt (car (erc-response.command-args parsed))) (msg (erc-response.contents parsed))) (defvar erc-minibuffer-ignored) - (if (or (erc-ignored-user-p sender-spec) - (erc-ignored-reply-p msg tgt proc)) + (defvar erc-ignore-list) + (defvar erc-ignore-reply-list) + (if (or (and erc-ignore-list (erc-ignored-user-p sender-spec)) + (and erc-ignore-reply-list (erc-ignored-reply-p msg tgt proc))) (when erc-minibuffer-ignored (message "Ignored %s from %s to %s" cmd sender-spec tgt)) (let* ((sndr (erc-parse-user sender-spec)) @@ -1929,7 +1931,6 @@ erc--server-determine-join-display-context ,@erc--display-context)) s buffer fnick) - (setf (erc-response.contents parsed) msg) (setq buffer (erc-get-buffer (if privp nick tgt) proc)) ;; Even worth checking for empty target here? (invalid anyway) (unless (or buffer noticep (string-empty-p tgt) (eq ?$ (aref tgt 0)) diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index ce0831709c7..90112ab9126 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -498,8 +498,9 @@ erc-get-channel-user (define-inline erc-get-server-user (nick) "Find NICK in the current server's `erc-server-users' hash table." (inline-letevals (nick) - (inline-quote (erc-with-server-buffer - (gethash (erc-downcase ,nick) erc-server-users))))) + (inline-quote + (gethash (erc-downcase ,nick) + (erc-with-server-buffer erc-server-users))))) (defmacro erc--with-dependent-type-match (type &rest features) "Massage Custom :type TYPE with :match function that pre-loads FEATURES." diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 2e078651a52..dad7ebab621 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -7718,6 +7718,8 @@ erc-delete-query (setq erc-default-recipients d2) (error "Current target is not a QUERY")))) +;; FIXME move all ignore-related functionality to its own module, +;; required and enabled by default (until some major version change). (defun erc-ignored-user-p (spec) "Return non-nil if SPEC matches something in `erc-ignore-list'. commit 7db500b50be5f59ce65785a2cc35a8587e7e6cd1 Author: F. Jason Park Date: Mon Nov 27 22:53:00 2023 -0800 Make erc-get-user-mode-prefix more flexible * etc/ERC-NEWS: Mention renaming of `erc-get-user-mode-prefix'. * lisp/erc/erc-speedbar.el (erc-speedbar-insert-user): Use `erc-get-channel-membership-prefix' so that nicks in the nickbar can have prefixes beyond just those for "voice" and "op". * lisp/erc/erc.el (erc-get-user-mode-prefix, erc-get-channel-membership-prefix): Rename former to latter because "user mode" suggests the function somehow involves user modes, but it exclusively concerns channel modes. Also, overload the only parameter in order to avoid redundantly looking up `erc-channel-user' object with every predicate call. In the near future, ERC will likely need to offer an alternate version of this function that returns multiple prefixes instead of just one. (erc-format-@nick): Actually use the `channel-data' parameter. (erc-format-my-nick, erc--format-channel-status-prefix): Use new name for function `erc-get-user-mode-prefix'. (Bug#63595) (Bug#67677) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 3bb302e1dd2..b89c5228e32 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -437,6 +437,13 @@ The 'fill' module is now defined by 'define-erc-module'. The same goes for ERC's imenu integration, which has 'imenu' now appearing in the default value of 'erc-modules'. +*** Function 'erc-get-user-mode-prefix' renamed. +This utility has been renamed to 'erc-get-channel-membership-prefix' +to better reflect its role of delivering a formatted "status prefix", +like "+" (for "voice"), and to avoid confusion with user modes, like +"+i" (for "invisible"). Additionally, its lone parameter is now +overloaded to accept an 'erc-channel-user' object as well as a string. + *** Hidden messages contain a preceding rather than trailing newline. ERC has traditionally only offered to hide messages involving fools, but plans are to make hiding more powerful. Anyone depending on the diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index 93be7b9f074..90d7376fc0c 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -319,9 +319,7 @@ erc-speedbar-insert-user (info (erc-server-user-info user)) (login (erc-server-user-login user)) (name (erc-server-user-full-name user)) - (voice (and cuser (erc-channel-user-voice cuser))) - (op (and cuser (erc-channel-user-op cuser))) - (nick-str (concat (if op "@" "") (if voice "+" "") nick)) + (nick-str (concat (erc-get-channel-membership-prefix cuser) nick)) (finger (concat login (when (or login host) "@") host)) (sbtoken (list finger name info (buffer-name buffer)))) (if (or login host name info) ; we want to be expandable diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 333b762a113..2e078651a52 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -5798,21 +5798,31 @@ erc-format-nick See also `erc-format-nick-function'." (when user (erc-server-user-nickname user))) -(defun erc-get-user-mode-prefix (user) +(define-obsolete-function-alias 'erc-get-user-mode-prefix + #'erc-get-channel-membership-prefix "30.1") +(defun erc-get-channel-membership-prefix (user) + "Return channel membership prefix for USER as a string. +Ensure returned string has a `help-echo' text property with the +corresponding verbose membership type, like \"voice\", as its +value. Expect USER to be an `erc-channel-user' object or a +string nickname, not necessarily downcased." (when user - (cond ((erc-channel-user-owner-p user) + (when (stringp user) + (setq user (and erc-channel-users (cdr (erc-get-channel-user user))))) + (cond ((null user) "") + ((erc-channel-user-owner user) (propertize "~" 'help-echo "owner")) - ((erc-channel-user-admin-p user) + ((erc-channel-user-admin user) (propertize "&" 'help-echo "admin")) - ((erc-channel-user-op-p user) + ((erc-channel-user-op user) (propertize "@" 'help-echo "operator")) - ((erc-channel-user-halfop-p user) + ((erc-channel-user-halfop user) (propertize "%" 'help-echo "half-op")) - ((erc-channel-user-voice-p user) + ((erc-channel-user-voice user) (propertize "+" 'help-echo "voice")) (t "")))) -(defun erc-format-@nick (&optional user _channel-data) +(defun erc-format-@nick (&optional user channel-data) "Format the nickname of USER showing if USER has a voice, is an operator, half-op, admin or owner. Owners have \"~\", admins have \"&\", operators have \"@\" and users with voice have \"+\" as a @@ -5821,7 +5831,7 @@ erc-format-@nick (when user (let ((nick (erc-server-user-nickname user))) (concat (propertize - (erc-get-user-mode-prefix nick) + (erc-get-channel-membership-prefix channel-data) 'font-lock-face 'erc-nick-prefix-face) nick)))) @@ -5831,7 +5841,7 @@ erc-format-my-nick (let* ((open "<") (close "> ") (nick (erc-current-nick)) - (mode (erc-get-user-mode-prefix nick))) + (mode (erc-get-channel-membership-prefix nick))) (concat (propertize open 'font-lock-face 'erc-default-face) (propertize mode 'font-lock-face 'erc-my-nick-prefix-face) @@ -8467,7 +8477,7 @@ erc--format-user-modes (defun erc--format-channel-status-prefix () "Return the current channel membership prefix." (and (erc--target-channel-p erc--target) - (erc-get-user-mode-prefix (erc-current-nick)))) + (erc-get-channel-membership-prefix (erc-current-nick)))) (defun erc--format-modes (&optional no-query-p) "Return a string of channel modes in channels and user modes elsewhere. commit 11bae96d23b0e3c726be55c34a0493d49d57d2e8 Author: F. Jason Park Date: Mon Nov 27 19:41:09 2023 -0800 Clarify warning for process-dependent input in ERC * lisp/erc/erc.el (erc--check-prompt-input-for-running-process): Resolve dissonance between content of ancient `user-error' message and condition that triggered it by favoring the former because it's supported by the underlying mechanism, which revolves around the `process-not-needed' symbol property. * test/lisp/erc/erc-tests.el (erc--check-prompt-input-functions): Revise expected output for error assertion. (Bug#66073, originally from bug#54536, and included for discussion in bug#67677) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7fbc6859584..333b762a113 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -7299,11 +7299,20 @@ erc--check-prompt-input-for-point-in-bounds (when (< (point) (erc-beg-of-input-line)) "Point is not in the input area")) +;; Originally, `erc-send-current-line' inhibited sends whenever a +;; server buffer was missing. In 2007, this was narrowed to +;; occurrences involving process-dependent commands. However, the +;; accompanying error message, which was identical to that emitted by +;; `erc-server-send', "ERC: No process running", was always inaccurate +;; because a server buffer can be alive and its process dead. (defun erc--check-prompt-input-for-running-process (string _) - "Return non-nil unless in an active ERC server buffer." - (unless (or (erc-server-buffer-live-p) - (erc-command-no-process-p string)) - "ERC: No process running")) + "Return non-nil if STRING is a slash command missing a process. +Also do so when the server buffer has been killed." + ;; Even if the server buffer has been killed, the user should still + ;; be able to /reconnect and recall previous commands. + (and (not (erc-command-no-process-p string)) + (or (and (not (erc-server-buffer-live-p)) "Server buffer missing") + (and (not (erc-server-process-alive)) "Process not running")))) (defun erc--check-prompt-input-for-multiline-command (line lines) "Return non-nil when non-blank lines follow a command line." diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index fb4aef00c1e..ca5582885f4 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -1414,9 +1414,9 @@ erc--check-prompt-input-functions (ert-info ("Input remains untouched") (should (save-excursion (erc-bol) (looking-at "/msg #chan hi"))))) - (ert-info ("Errors when no process running") + (ert-info ("Errors when server buffer absent") (let ((e (should-error (erc-send-current-line)))) - (should (equal "ERC: No process running" (cadr e)))) + (should (equal "Server buffer missing" (cadr e)))) (ert-info ("Input remains untouched") (should (save-excursion (erc-bol) (looking-at "/msg #chan hi"))))) commit 4ee4865ce208c423afc8c2718922272509a4c1ae Author: F. Jason Park Date: Fri Aug 18 18:04:22 2023 -0700 Add erc-server-396 response handler * lisp/erc/erc-backend.el (erc-server-396, erc-server-396-functions): Define response handler for 396 numeric. For now, always display the message in the active buffer rather than bother with something like `erc-once-with-server-event' to try and suss out when this is a response to something client-initiated, like a /VHOST. Do this despite most users probably wanting the message to appear in the server buffer alone when the response is server-initiated. The `labeled-response' extension will hopefully make dealing with such matters less of a crapshoot. * lisp/erc/erc.el (erc--parse-user-regexp-pedantic): Tweak slightly to allow null groups and favor host. (erc--parse-user-regexp-legacy, erc--parse-user-regexp): Remove the first variable but preserve its value as that of the second. (erc--parse-nuh): New function. The behavior is nuanced and complex and so not easily described in a doc string. (erc-message-english-396): Define format template for 396 response. * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--VHOST): New test. * test/lisp/erc/erc-tests.el (erc-parse-user): Move "pedantic" section to new test. (erc--parse-nuh): New test. * test/lisp/erc/resources/commands/vhost.eld: New test data file. (Bug#67677) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 500e025e5a1..6483192692b 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -119,6 +119,7 @@ erc-verbose-server-ping (declare-function erc--init-channel-modes "erc" (channel raw-args)) (declare-function erc--open-target "erc" (target)) +(declare-function erc--parse-nuh "erc" (string)) (declare-function erc--target-from-string "erc" (string)) (declare-function erc--update-modes "erc" (raw-args)) (declare-function erc-active-buffer "erc" nil) @@ -2407,6 +2408,7 @@ erc-server-322-message (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's341 ?n nick ?c channel))) +;; FIXME update or add server user instead when channel is "*". (define-erc-response-handler (352) "WHO notice." nil (pcase-let ((`(,channel ,user ,host ,_server ,nick ,away-flag) @@ -2472,6 +2474,24 @@ erc-server-322-message 's391 ?s (cadr (erc-response.command-args parsed)) ?t (nth 2 (erc-response.command-args parsed)))) +;; https://defs.ircdocs.horse/defs/numerics.html#rpl-visiblehost-396 +;; As of ERC 5.6, if the client hasn't yet joined any channels, +;; there's a good chance a server user for the current nick simply +;; doesn't exist (and there's not enough info in this reply to create +;; one). To fix this, ERC could WHO itself on 372 or similar if it +;; hasn't yet received a 900. +(define-erc-response-handler (396) + "RPL_VISIBLEHOST or RPL_YOURDISPLAYHOST or RPL_HOSTHIDDEN." nil + (pcase-let* ((userhost (cadr (erc-response.command-args parsed))) + ;; Behavior blindly copied from event_hosthidden in irssi 1.4. + (rejectrx (rx (| (: bot (in ?@ ?: ?-)) (in ?* ?? ?! ?# ?& ?\s) + (: ?- eot)))) + (`(,_ ,user ,host) (and (not (string-match rejectrx userhost)) + (erc--parse-nuh userhost)))) + (when host + (erc-update-user-nick (erc-current-nick) nil host user) + (erc-display-message parsed 'notice 'active 's396 ?s userhost)))) + (define-erc-response-handler (401) "No such nick/channel." nil (let ((nick/channel (cadr (erc-response.command-args parsed)))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7982c23f4a1..7fbc6859584 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -7091,9 +7091,9 @@ erc-put-text-property (defalias 'erc-list 'ensure-list) (defconst erc--parse-user-regexp-pedantic - (rx bot (group (* (not (any "!\r\n")))) - "!" (group (* nonl)) - "@" (group (* nonl)) eot)) + (rx bot (? (? (group (+ (not (any "!@\r\n"))))) "!") + (? (? (group (+ nonl))) "@") + (? (group (+ nonl))) eot)) (defconst erc--parse-user-regexp-legacy "^\\([^!\n]*\\)!\\([^@\n]*\\)@\\(.*\\)$") @@ -7117,6 +7117,16 @@ erc-parse-user (t (list string "" "")))) +(defun erc--parse-nuh (string) + "Match STRING against `erc--parse-user-regexp-pedantic'. +Return matching groups or nil. Interpret a lone token or one +with only a leading \"!\" as a host. See associated unit test +for precise behavior." + (when (string-match erc--parse-user-regexp-pedantic string) + (list (match-string 1 string) + (match-string 2 string) + (match-string 3 string)))) + (defun erc-extract-nick (string) "Return the nick corresponding to a user specification STRING. @@ -8844,6 +8854,7 @@ english (s368 . "Banlist of %c ends.") (s379 . "%c: Forwarded to %f") (s391 . "The time at %s is %t") + (s396 . "Your visible host has changed to %s") (s401 . "%n: No such nick/channel") (s402 . "%c: No such server") (s403 . "%c: No such channel") diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index 2a36d52b835..b96782cf29c 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -91,4 +91,36 @@ erc-scenarios-misc-commands--SQUERY (funcall expect -0.1 "Incorrect arguments") (funcall expect 10 "See also: HELP EXAMPLES"))))) +;; Note that as of ERC 5.6, there is no actual slash-command function +;; named `erc-cmd-vhost'. At the moment, this test merely exists to +;; assert that the `erc-server-396' response handler updates the rolls +;; correctly. +(ert-deftest erc-scenarios-misc-commands--VHOST () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server (erc-d-run "localhost" t 'vhost)) + ;; As of ERC 5.6, we must join a channel before ERC adds itself + ;; to `erc-server-users'. Without such an entry, there's + ;; nothing to update when the 396 arrives. + (erc-autojoin-channels-alist '((foonet "#chan"))) + (port (process-contact dumb-server :service)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to server") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :password "changeme" + :full-name "tester") + (funcall expect 10 "debug mode"))) + + (ert-info ("Send VHOST") + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#chan")) + (erc-scenarios-common-say "/VHOST tester changeme") + (funcall expect 10 "visible host") + (should (string= (erc-server-user-host (erc-get-server-user "tester")) + "some.host.test.cc")))))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index ceb5d86c19c..fb4aef00c1e 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -632,8 +632,6 @@ erc-lurker-maybe-trim (should (string= "nick" (erc-lurker-maybe-trim "nick-_`"))))) (ert-deftest erc-parse-user () - (should (equal erc--parse-user-regexp erc--parse-user-regexp-legacy)) - (should (equal '("" "" "") (erc-parse-user "!@"))) (should (equal '("" "!" "") (erc-parse-user "!!@"))) (should (equal '("" "" "@") (erc-parse-user "!@@"))) @@ -646,23 +644,36 @@ erc-parse-user (should (equal '("abc" "123" "fake") (erc-parse-user "abc!123@fake"))) (should (equal '("abc" "!123" "@xy") (erc-parse-user "abc!!123@@xy"))) - (should (equal '("de" "fg" "xy") (erc-parse-user "abc\nde!fg@xy"))) + (should (equal '("de" "fg" "xy") (erc-parse-user "abc\nde!fg@xy")))) + +(ert-deftest erc--parse-nuh () + (should (equal '(nil nil nil) (erc--parse-nuh "!@"))) + (should (equal '(nil nil nil) (erc--parse-nuh "@"))) + (should (equal '(nil nil nil) (erc--parse-nuh "!"))) + (should (equal '(nil "!" nil) (erc--parse-nuh "!!@"))) + (should (equal '(nil "@" nil) (erc--parse-nuh "!@@"))) + (should (equal '(nil "!@" nil) (erc--parse-nuh "!!@@"))) + + (should (equal '("abc" nil nil) (erc--parse-nuh "abc!"))) + (should (equal '(nil "abc" nil) (erc--parse-nuh "abc@"))) + (should (equal '(nil "abc" nil) (erc--parse-nuh "!abc@"))) - (ert-info ("`erc--parse-user-regexp-pedantic'") - (let ((erc--parse-user-regexp erc--parse-user-regexp-pedantic)) - (should (equal '("" "" "") (erc-parse-user "!@"))) - (should (equal '("" "!" "") (erc-parse-user "!!@"))) - (should (equal '("" "@" "") (erc-parse-user "!@@"))) - (should (equal '("" "!@" "") (erc-parse-user "!!@@"))) + (should (equal '("abc" "123" "fake") (erc--parse-nuh "abc!123@fake"))) + (should (equal '("abc" "!123@" "xy") (erc--parse-nuh "abc!!123@@xy"))) - (should (equal '("abc" "" "") (erc-parse-user "abc"))) - (should (equal '("" "123" "fake") (erc-parse-user "!123@fake"))) - (should (equal '("abc" "" "123") (erc-parse-user "abc!123"))) + ;; Missing leading components. + (should (equal '(nil "abc" "123") (erc--parse-nuh "abc@123"))) + (should (equal '(nil "123" "fake") (erc--parse-nuh "!123@fake"))) + (should (equal '(nil nil "gnu.org") (erc--parse-nuh "@gnu.org"))) - (should (equal '("abc" "123" "fake") (erc-parse-user "abc!123@fake"))) - (should (equal '("abc" "!123@" "xy") (erc-parse-user "abc!!123@@xy"))) + ;; Host "wins" over nick and user (sans "@"). + (should (equal '(nil nil "abc") (erc--parse-nuh "abc"))) + (should (equal '(nil nil "gnu.org") (erc--parse-nuh "gnu.org"))) + (should (equal '(nil nil "gnu.org") (erc--parse-nuh "!gnu.org"))) + (should (equal '("abc" nil "123") (erc--parse-nuh "abc!123"))) - (should (equal '("de" "" "fg@xy") (erc-parse-user "abc\nde!fg@xy")))))) + ;; No fallback behavior. + (should-not (erc--parse-nuh "abc\nde!fg@xy"))) (ert-deftest erc--parsed-prefix () (erc-mode) diff --git a/test/lisp/erc/resources/commands/vhost.eld b/test/lisp/erc/resources/commands/vhost.eld new file mode 100644 index 00000000000..42013198fbc --- /dev/null +++ b/test/lisp/erc/resources/commands/vhost.eld @@ -0,0 +1,40 @@ +;; -*- mode: lisp-data; -*- +((pass 10 "PASS :changeme")) +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :tester") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #chan") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #chan") + (0 ":irc.foonet.org 353 tester = #chan :alice tester @bob") + (0 ":irc.foonet.org 366 tester #chan :End of NAMES list")) + +((mode-chan 10 "MODE #chan") + (0 ":irc.foonet.org 324 tester #chan +nt") + (0 ":irc.foonet.org 329 tester #chan 1620104779") + (0 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #chan :tester, welcome!") + (0 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #chan :tester, welcome!")) + +((vhost 10 "VHOST tester changeme") + (0 ":irc.foonet.org NOTICE tester :Setting your VHost: some.host.test.cc") + (0 ":irc.foonet.org 396 tester some.host.test.cc :is now your displayed host") + (0 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #chan :alice: But, as it seems, did violence on herself.") + (0 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #chan :bob: Well, this is the forest of Arden.")) commit 951b115c2ac9b60007eef6a13a25c618a69c7e0f Author: F. Jason Park Date: Fri Dec 1 13:54:12 2023 -0800 Make erc-input's refoldp slot conditionally available * etc/ERC-NEWS: Fix entry regarding `erc-input-refoldp'. * lisp/erc/erc-common.el (erc-input): Remove `refoldp' slot, which was to be new in 5.6, in order to reduce churn in the extremely unlikely event that third-party code uses the read-syntax of these objects or ones subclassed from it for some other purpose, outside of `erc-pre-send-functions'. (erc--input-split) Add `refoldp' slot here instead. * lisp/erc/erc.el (erc-pre-send-functions): Amend doc string to stress that `refoldp' is not a real slot. (erc--input-ensure-hook-context, erc-input-refoldp): New function, an impostor accessor for the nonexistent `refoldp' slot of `erc-input', and a helper function for asserting a valid context at runtime. (erc--run-send-hooks): Don't copy over `refoldp' from the `erc--input-lines' object to the working `erc-insert' object. Check the insertion context's `erc--input-split' object instead of the hook's `erc-insert' object when deciding whether to resplit. * test/lisp/erc/erc-tests.el: Adjust test environment to satisfy assertion. (Bug#62947) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 93437431289..3bb302e1dd2 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -464,8 +464,9 @@ ERC now adjusts input lines to fall within allowed length limits before showing hook members the result. For compatibility, third-party code can request that the final input be adjusted again prior to being sent. To facilitate this, the 'erc-input' object -shared among hook members has gained a new 'refoldp' slot, making this -a breaking change, if only in theory. See doc string for details. +shared among hook members has gained a "phony" 'refoldp' slot that's +only accessible from 'erc-pre-send-functions'. See doc string for +details. *** ERC's prompt survives the insertion of user input and messages. Previously, ERC's prompt and its input marker disappeared while diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index fd6ad476641..ce0831709c7 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -49,7 +49,7 @@ erc-session-server (declare-function widget-type "wid-edit" (widget)) (cl-defstruct erc-input - string insertp sendp refoldp) + string insertp sendp) (cl-defstruct (erc--input-split (:include erc-input (string :read-only) @@ -57,6 +57,7 @@ erc-input (sendp (with-suppressed-warnings ((obsolete erc-send-this)) erc-send-this)))) + (refoldp nil :type boolean) (lines nil :type (list-of string)) (abortp nil :type (list-of symbol)) (cmdp nil :type boolean)) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 4d027f0e6c4..7982c23f4a1 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1195,13 +1195,18 @@ erc-pre-send-functions `string': The current input string. `insertp': Whether the string should be inserted into the erc buffer. `sendp': Whether the string should be sent to the irc server. + +And one \"phony\" slot only accessible by hook members at runtime: + `refoldp': Whether the string should be re-split per protocol limits. This hook runs after protocol line splitting has taken place, so the value of `string' is originally \"pre-filled\". If you need -ERC to refill the entire payload before sending it, set the -`refoldp' slot to a non-nil value. Preformatted text and encoded -subprotocols should probably be handled manually." +ERC to refill the entire payload before sending it, set the phony +`refoldp' slot to a non-nil value. Note that this refilling is +only a convenience, and modules with special needs, such as +preserving \"preformatted\" text or encoding for subprotocol +\"tunneling\", should handle splitting manually." :group 'erc :type 'hook :version "27.1") @@ -7405,6 +7410,22 @@ erc--split-lines (setf (erc--input-split-lines state) (mapcan #'erc--split-line (erc--input-split-lines state))))) +(defun erc--input-ensure-hook-context () + (unless (erc--input-split-p erc--current-line-input-split) + (error "Invoked outside of `erc-pre-send-functions'"))) + +(defun erc-input-refoldp (_) + "Impersonate accessor for phony `erc-input' `refoldp' slot. +This function only works inside `erc-pre-send-functions' members." + (declare (gv-setter (lambda (v) + `(progn + (erc--input-ensure-hook-context) + (setf (erc--input-split-refoldp + erc--current-line-input-split) + ,v))))) + (erc--input-ensure-hook-context) + (erc--input-split-refoldp erc--current-line-input-split)) + (defun erc--run-send-hooks (lines-obj) "Run send-related hooks that operate on the entire prompt input. Sequester some of the back and forth involved in honoring old @@ -7424,8 +7445,6 @@ erc--run-send-hooks (run-hook-with-args 'erc-send-pre-hook str) (make-erc-input :string str :insertp erc-insert-this - :refoldp (erc--input-split-refoldp - lines-obj) :sendp erc-send-this)))) (run-hook-with-args 'erc-pre-send-functions state) (setf (erc--input-split-sendp lines-obj) (erc-input-sendp state) @@ -7437,7 +7456,7 @@ erc--run-send-hooks (if erc--allow-empty-outgoing-lines-p lines (cl-nsubst " " "" lines :test #'equal)))) - (when (erc-input-refoldp state) + (when (erc--input-split-refoldp lines-obj) (erc--split-lines lines-obj))))) (when (and (erc--input-split-cmdp lines-obj) (cdr (erc--input-split-lines lines-obj))) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 361e12c2a91..ceb5d86c19c 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -2254,10 +2254,11 @@ erc--run-send-hooks erc-pre-send-functions (lambda (o) (setf (erc-input-string o) "foo bar baz" (erc-input-refoldp o) t))) - (let ((erc-split-line-length 8)) + (let* ((split (make-erc--input-split :string "foo" :lines '("foo"))) + (erc--current-line-input-split split) + (erc-split-line-length 8)) (should - (pcase (erc--run-send-hooks (make-erc--input-split - :string "foo" :lines '("foo"))) + (pcase (erc--run-send-hooks split) ((cl-struct erc--input-split (string "foo") (sendp 't) (insertp 't) (lines '("foo bar " "baz")) (cmdp 'nil)) commit 69ca2cc1138b0fe722d601c2113c83f2a6f791ed Author: F. Jason Park Date: Sun Dec 3 19:19:37 2023 -0800 Add utility for iterating over arrays in ERC * lisp/erc/erc-common.el (erc--doarray): Add macro for mapping over arrays. ERC has the uncommon requirement of having to repeatedly traverse strings that contain flags for advertised server features. It doesn't make sense to translate these meanings into enums or dynamically generate variables for each flag. Hash tables and lists require additional setup and aren't as compact to inspect. * lisp/erc/erc-dcc.el (erc-dcc-handle-ctcp-send): Use `string-search' instead of `seq-contains-p' even though performance doesn't matter here. * lisp/erc/erc.el (erc--channel-mode-types): Use `erc--doarray' instead of `dolist'. (erc--process-channel-modes): Use `erc--doarray' instead of `dolist', and don't create a string from current char until needed. (erc--parse-user-modes): Use `erc--doarray' instead of `dolist'. * test/lisp/erc/erc-tests.el (erc--doarray): New test. (Bug#67677) diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index c79954cdee5..fd6ad476641 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -543,6 +543,25 @@ erc-define-message-format-catalog (declare (indent 1)) `(erc--define-catalog ,language ,entries)) +(defmacro erc--doarray (spec &rest body) + "Map over ARRAY, running BODY with VAR bound to iteration element. +Behave more or less like `seq-doseq', but tailor operations for +arrays. + +\(fn (VAR ARRAY [RESULT]) BODY...)" + (declare (indent 1) (debug ((symbolp form &optional form) body))) + (let ((array (make-symbol "array")) + (len (make-symbol "len")) + (i (make-symbol "i"))) + `(let* ((,array ,(nth 1 spec)) + (,len (length ,array)) + (,i 0)) + (while-let (((< ,i ,len)) + (,(car spec) (aref ,array ,i))) + ,@body + (cl-incf ,i)) + ,(nth 2 spec)))) + (provide 'erc-common) ;;; erc-common.el ends here diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 3bcdfb96eb8..ac7fc817cb9 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -713,8 +713,8 @@ erc-dcc-handle-ctcp-send (port (match-string 4 query)) (size (match-string 5 query)) (sub (substring (match-string 6 query) 0 -4)) - (secure (seq-contains-p sub ?S #'eq)) - (turbo (seq-contains-p sub ?T #'eq))) + (secure (string-search "S" sub)) + (turbo (string-search "T" sub))) ;; FIXME: a warning really should also be sent ;; if the ip address != the host the dcc sender is on. (erc-display-message diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index c499afb22f7..4d027f0e6c4 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -6781,7 +6781,7 @@ erc--channel-mode-types (ct (make-char-table 'erc--channel-mode-types)) (type ?a)) (dolist (cs types) - (dolist (c (append cs nil)) + (erc--doarray (c cs) (aset ct c type)) (cl-incf type)) (make-erc--channel-mode-types :key key @@ -6800,21 +6800,20 @@ erc--process-channel-modes (table (erc--channel-mode-types-table obj)) (fallbackp (erc--channel-mode-types-fallbackp obj)) (+p t)) - (dolist (c (append string nil)) - (let ((letter (char-to-string c))) - (cond ((= ?+ c) (setq +p t)) - ((= ?- c) (setq +p nil)) - ((and status-letters (string-search letter status-letters)) - (erc--update-membership-prefix (pop args) c (if +p 'on 'off))) - ((and-let* ((group (or (aref table c) (and fallbackp ?d)))) - (erc--handle-channel-mode group c +p - (and (/= group ?d) - (or (/= group ?c) +p) - (pop args))) - t)) - ((not fallbackp) - (erc-display-message nil '(notice error) (erc-server-buffer) - (format "Unknown channel mode: %S" c)))))) + (erc--doarray (c string) + (cond ((= ?+ c) (setq +p t)) + ((= ?- c) (setq +p nil)) + ((and status-letters (string-search (string c) status-letters)) + (erc--update-membership-prefix (pop args) c (if +p 'on 'off))) + ((and-let* ((group (or (aref table c) (and fallbackp ?d)))) + (erc--handle-channel-mode group c +p + (and (/= group ?d) + (or (/= group ?c) +p) + (pop args))) + t)) + ((not fallbackp) + (erc-display-message nil '(notice error) (erc-server-buffer) + (format "Unknown channel mode: %S" c))))) (setq erc-channel-modes (sort erc-channel-modes #'string<)) (setq erc--mode-line-mode-string (concat "+" (erc--channel-modes erc--mode-line-chanmodes-arg-len))) @@ -6894,9 +6893,7 @@ erc--parse-user-modes (let ((addp t) ;; redundant-add redundant-drop adding dropping) - ;; For short strings, `append' appears to be no slower than - ;; iteration var + `aref' or `mapc' + closure. - (dolist (c (append string nil)) + (erc--doarray (c string) (pcase c (?+ (setq addp t)) (?- (setq addp nil)) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 1b610a367b6..361e12c2a91 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -142,6 +142,19 @@ erc--with-dependent-type-match (widget-editable-list-match w v)) '(face))))) +(ert-deftest erc--doarray () + (let ((array "abcdefg") + out) + ;; No return form. + (should-not (erc--doarray (c array) (push c out))) + (should (equal out '(?g ?f ?e ?d ?c ?b ?a))) + + ;; Return form evaluated upon completion. + (setq out nil) + (should (= 42 (erc--doarray (c array (+ 39 (length out))) + (when (cl-evenp c) (push c out))))) + (should (equal out '(?f ?d ?b))))) + (defun erc-tests--send-prep () ;; Caller should probably shadow `erc-insert-modify-hook' or ;; populate user tables for erc-button. commit 1e2b156f040bae9a35c1cdf72f0ab0f6036a593f Author: F. Jason Park Date: Fri Dec 1 22:30:04 2023 -0800 Double hyphenate internal ERC 5.6 text props * lisp/erc/erc-fill.el (erc-fill, erc-fill-static, erc-fill--wrap-continued-message-p, erc-fill-wrap, erc-fill--wrap-rejigger-region): Add second hyphen to "msg prop" text properties. Rename `erc-speaker' to `erc--speaker'. * lisp/erc/erc-goodies.el (erc--command-indicator-display): Rename `erc-msg' to `erc--msg'. * lisp/erc/erc-stamp.el (erc-stamp--current-time, erc-add-timestamp, erc-stamp-prefix-log-filter, erc-stamp--lr-date-on-pre-modify, erc-munge-invisibility-spec, erc-stamp--add-csf-on-post-modify, erc-stamp--on-clear-message, erc-echo-timestamp, erc--echo-ts-csf): Rename "msg props" with second hyphen. * lisp/erc/erc-track.el (erc-track--skipped-msgs, erc-track-modified-channels): Rename "msg prop" text properties with second hyphen. * lisp/erc/erc.el (erc--msg-props): Update doc with double-hyphenated "msg prop" names. (erc--send-action-display erc--get-inserted-msg-bounds, erc--traverse-inserted, erc-insert-line, erc-display-line, erc--ranked-properties, erc-display-message, erc--get-speaker-bounds, erc-process-ctcp-query, erc-display-msg): Update all "msg prop" names to have two hyphens. (erc--send-action-display, erc--own-property-names, erc--get-speaker-bounds, erc-format-privmessage, erc-format-my-nick, erc-ctcp-query-ACTION): Rename `erc-speaker' to `erc--speaker'. * test/lisp/erc/erc-scenarios-display-message.el (erc-scenarios-display-message--multibuf): Double hyphenate "msg prop" text properties. * test/lisp/erc/erc-scenarios-match.el (erc-scenarios-match--hide-fools/stamp-both/fill-wrap, erc-scenarios-match--hide-fools/stamp-both/fill-wrap/speak, erc-scenarios-match--stamp-both-invisible-fill-static): Update "msg prop" names. * test/lisp/erc/erc-scenarios-stamp.el (erc-scenarios-stamp--on-post-modify, erc-scenarios-stamp--left/display-margin-mode, erc-scenarios-stamp--legacy-date-stamps, erc-scenarios-stamp--on-insert-modify, erc-scenarios-stamp--date-mode/left-and-right): Add second hyphen to all "msg props". Rename `erc-speaker' to `erc--speaker'. * test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp): Rename "msg prop". * test/lisp/erc/erc-tests.el (erc--get-inserted-msg-bounds, erc--delete-inserted-message, erc--order-text-properties-from-hash, erc--route-insertion): Rename "msg props" with second hyphen. (erc-format-privmessage): Rename `erc-speaker' to `erc--speaker'. (Bug#60936) (Bug#67677) ; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: ; Add second hyphen to msg props. ; * test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld: ; Add second hyphen to msg props. diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 9b0c74b518d..b1bbb5e19b9 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -177,10 +177,10 @@ erc-fill (when-let ((erc-fill-line-spacing) (p (point-min))) (widen) - (when (or (erc--check-msg-prop 'erc-msg 'msg) + (when (or (erc--check-msg-prop 'erc--msg 'msg) (and-let* ((m (save-excursion (forward-line -1) - (erc--get-inserted-msg-prop 'erc-msg)))) + (erc--get-inserted-msg-prop 'erc--msg)))) (eq 'msg m))) (put-text-property (1- p) p 'line-spacing erc-fill-line-spacing)))))))) @@ -190,7 +190,7 @@ erc-fill-static (save-restriction (goto-char (point-min)) (when-let (((looking-at "^\\(\\S-+\\)")) - ((not (erc--check-msg-prop 'erc-msg 'datestamp))) + ((not (erc--check-msg-prop 'erc--msg 'datestamp))) (nick (match-string 1))) (progn (let ((fill-column (- erc-fill-column (erc-timestamp-offset))) @@ -557,7 +557,7 @@ erc-fill--wrap-continued-message-p advance `erc-fill--wrap-last-msg' unless the message has been marked as being ephemeral." (and - (not (erc--check-msg-prop 'erc-ephemeral)) + (not (erc--check-msg-prop 'erc--ephemeral)) (progn ; preserve blame for now, unprogn on next major change (prog1 (and-let* @@ -568,22 +568,22 @@ erc-fill--wrap-continued-message-p (props (save-restriction (widen) (and-let* - (((eq 'msg (get-text-property m 'erc-msg))) - ((not (eq (get-text-property m 'erc-ctcp) + (((eq 'msg (get-text-property m 'erc--msg))) + ((not (eq (get-text-property m 'erc--ctcp) 'ACTION))) ((not (invisible-p m))) - (spr (next-single-property-change m 'erc-speaker))) - (cons (get-text-property m 'erc-ts) - (get-text-property spr 'erc-speaker))))) + (spr (next-single-property-change m 'erc--speaker))) + (cons (get-text-property m 'erc--ts) + (get-text-property spr 'erc--speaker))))) (ts (pop props)) (props) ((not (time-less-p (erc-stamp--current-time) ts))) ((time-less-p (time-subtract (erc-stamp--current-time) ts) erc-fill--wrap-max-lull)) ;; Assume presence of leading angle bracket or hyphen. - (speaker (next-single-property-change (point-min) 'erc-speaker)) - ((not (erc--check-msg-prop 'erc-ctcp 'ACTION))) - (nick (get-text-property speaker 'erc-speaker)) + (speaker (next-single-property-change (point-min) 'erc--speaker)) + ((not (erc--check-msg-prop 'erc--ctcp 'ACTION))) + (nick (get-text-property speaker 'erc--speaker)) ((erc-nick-equal-p props nick)))) (set-marker erc-fill--wrap-last-msg (point-min)))))) @@ -668,12 +668,12 @@ erc-fill-wrap (goto-char (point-min)) (let ((len (or (and erc-fill--wrap-length-function (funcall erc-fill--wrap-length-function)) - (and-let* ((msg-prop (erc--check-msg-prop 'erc-msg)) + (and-let* ((msg-prop (erc--check-msg-prop 'erc--msg)) ((not (eq msg-prop 'unknown)))) (when-let ((e (erc--get-speaker-bounds)) (b (pop e)) ((or erc-fill--wrap-action-dedent-p - (not (erc--check-msg-prop 'erc-ctcp + (not (erc--check-msg-prop 'erc--ctcp 'ACTION))))) (goto-char e)) (skip-syntax-forward "^-") @@ -746,7 +746,7 @@ erc-fill--wrap-rejigger-region (remove-text-properties beg (1+ end) '(line-prefix nil wrap-prefix nil)) (when-let ((repairp) (dbeg (text-property-not-all beg end 'display nil)) - ((get-text-property (1+ dbeg) 'erc-speaker)) + ((get-text-property (1+ dbeg) 'erc--speaker)) (dval (get-text-property dbeg 'display)) ((equal "" dval))) (remove-text-properties @@ -755,7 +755,7 @@ erc-fill--wrap-rejigger-region (field-beginning beg) beg)) (erc--msg-props (map-into (text-properties-at pos) 'hash-table)) - (erc-stamp--current-time (gethash 'erc-ts erc--msg-props))) + (erc-stamp--current-time (gethash 'erc--ts erc--msg-props))) (save-restriction (narrow-to-region beg (1+ end)) (let ((erc-fill--wrap-last-msg erc-fill--wrap-rejigger-last-message)) diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 6c8ec567bd9..e10f047b187 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -578,7 +578,7 @@ erc--command-indicator-display (let ((insert-position (marker-position (goto-char erc-insert-marker))) (erc--msg-props (or erc--msg-props (let ((ovs erc--msg-prop-overrides)) - (map-into `((erc-msg . slash-cmd) + (map-into `((erc--msg . slash-cmd) ,@(reverse ovs)) 'hash-table))))) (when-let ((string (erc-command-indicator)) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index e6a8f36c332..a6efa3b5151 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -212,7 +212,7 @@ erc-stamp--current-time (cl-defgeneric erc-stamp--current-time () "Return a lisp time object to associate with an IRC message. -This becomes the message's `erc-ts' text property." +This becomes the message's `erc--ts' text property." (erc-compat--current-lisp-time)) (cl-defmethod erc-stamp--current-time :around () @@ -249,10 +249,10 @@ erc-add-timestamp ;; FIXME on major version bump, make this `erc-' prefixed. (if invisible `(timestamp ,@(ensure-list invisible)) 'timestamp)) (skipp (or (and erc-stamp--skip-when-invisible invisible) - (erc--check-msg-prop 'erc-ephemeral))) + (erc--check-msg-prop 'erc--ephemeral))) (erc-stamp--current-time ct)) (when erc--msg-props - (puthash 'erc-ts ct erc--msg-props)) + (puthash 'erc--ts ct erc--msg-props)) (unless skipp (funcall erc-insert-timestamp-function (erc-format-timestamp ct erc-timestamp-format))) @@ -270,7 +270,7 @@ erc-add-timestamp ;; be different on different entries (bug#22700). (list 'cursor-sensor-functions ;; Regions are no longer contiguous ^ - '(erc--echo-ts-csf) 'erc-ts ct)))))) + '(erc--echo-ts-csf) 'erc--ts ct)))))) (defvar-local erc-timestamp-last-window-width nil "The width of the last window that showed the current buffer. @@ -403,7 +403,7 @@ erc-stamp-prefix-log-filter ;; Skip a line that's just a timestamp. ((> beg (point)))) (delete-region beg (1+ end))) - (when-let (time (erc--get-inserted-msg-prop 'erc-ts)) + (when-let (time (erc--get-inserted-msg-prop 'erc--ts)) (insert (format-time-string "[%H:%M:%S] " time))) (zerop (forward-line)))) "") @@ -711,8 +711,8 @@ erc-stamp--lr-date-on-pre-modify (setq erc-timestamp-last-inserted-left nil) (let* ((aligned (erc-stamp--time-as-day ct)) (erc-stamp--current-time aligned) - ;; Forget current `erc-cmd', etc. - (erc--msg-props (map-into `((erc-msg . datestamp)) + ;; Forget current `erc--cmd', etc. + (erc--msg-props (map-into `((erc--msg . datestamp)) 'hash-table)) (erc-timestamp-last-inserted-left rendered) erc-timestamp-format erc-away-timestamp-format) @@ -867,7 +867,7 @@ erc-munge-invisibility-spec erc-stamp--csf-props-updated-p nil) (unless erc-stamp--csf-props-updated-p (setq erc-stamp--csf-props-updated-p t) - (let ((erc--msg-props (map-into '((erc-ts . t)) 'hash-table))) + (let ((erc--msg-props (map-into '((erc--ts . t)) 'hash-table))) (with-silent-modifications (erc--traverse-inserted (point-min) erc-insert-marker @@ -889,7 +889,7 @@ erc-munge-invisibility-spec (defun erc-stamp--add-csf-on-post-modify () "Add `cursor-sensor-functions' to narrowed buffer." - (when (erc--check-msg-prop 'erc-ts) + (when (erc--check-msg-prop 'erc--ts) (put-text-property (point-min) (1- (point-max)) 'cursor-sensor-functions '(erc--echo-ts-csf)))) @@ -940,7 +940,7 @@ erc-stamp--last-stamp (defun erc-stamp--on-clear-message (&rest _) "Return `dont-clear-message' when operating inside the same stamp." (and erc-stamp--last-stamp erc-echo-timestamps - (eq (erc--get-inserted-msg-prop 'erc-ts) erc-stamp--last-stamp) + (eq (erc--get-inserted-msg-prop 'erc--ts) erc-stamp--last-stamp) 'dont-clear-message)) (defun erc-echo-timestamp (dir stamp &optional zone) @@ -950,7 +950,7 @@ erc-echo-timestamp interpret a \"raw\" prefix as UTC. To specify a zone for use with the option `erc-echo-timestamps', see the companion option `erc-echo-timestamp-zone'." - (interactive (list nil (erc--get-inserted-msg-prop 'erc-ts) + (interactive (list nil (erc--get-inserted-msg-prop 'erc--ts) (pcase current-prefix-arg ((and (pred numberp) v) (if (<= (abs v) 14) (* v 3600) v)) @@ -964,7 +964,7 @@ erc-echo-timestamp (setq erc-stamp--last-stamp nil)))) (defun erc--echo-ts-csf (_window _before dir) - (erc-echo-timestamp dir (erc--get-inserted-msg-prop 'erc-ts))) + (erc-echo-timestamp dir (erc--get-inserted-msg-prop 'erc--ts))) (defun erc-stamp--update-saved-position (&rest _) (remove-hook 'erc-stamp--insert-date-hook diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index a36b781e04d..7dc4fe754cd 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -786,7 +786,7 @@ erc-track-select-mode-line-face choice)))) (defvar erc-track--skipped-msgs '(datestamp) - "Values of `erc-msg' text prop to ignore.") + "Values of `erc--msg' text prop to ignore.") (defun erc-track-modified-channels () "Hook function for `erc-insert-post-hook'. @@ -806,7 +806,7 @@ erc-track-modified-channels erc-track-exclude-types) ;; Skip certain non-server-sent messages. (and (not parsed) - (erc--check-msg-prop 'erc-msg + (erc--check-msg-prop 'erc--msg erc-track--skipped-msgs)))))) ;; If the active buffer is not visible (not shown in a ;; window), and not to be excluded, determine the kinds of diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 558b17788bf..c499afb22f7 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -154,26 +154,26 @@ erc--msg-props their markers accordingly. The following properties have meaning as of ERC 5.6: - - `erc-msg': a symbol, guaranteed present; values include: + - `erc--msg': a symbol, guaranteed present; values include: `msg', signifying a `PRIVMSG' or an incoming `NOTICE'; `unknown', a fallback for `erc-display-message'; a catalog key, such as `s401' or `finished'; an `erc-display-message' TYPE parameter, like `notice' - - `erc-cmd': a message's associated IRC command, as read by + - `erc--cmd': a message's associated IRC command, as read by `erc--get-eq-comparable-cmd'; currently either a symbol, like `PRIVMSG', or a number, like 5, which represents the numeric \"005\"; absent on \"local\" messages, such as simple warnings and help text, and on outgoing messages unless echoed back by the server (assuming future support) - - `erc-ctcp': a CTCP command, like `ACTION' + - `erc--ctcp': a CTCP command, like `ACTION' - - `erc-ts': a timestamp, possibly provided by the server; as of + - `erc--ts': a timestamp, possibly provided by the server; as of 5.6, a ticks/hertz pair on Emacs 29 and above, and a \"list\" type otherwise; managed by the `stamp' module - - `erc-ephemeral': a symbol prefixed by or matching a module + - `erc--ephemeral': a symbol prefixed by or matching a module name; indicates to other modules and members of modification hooks that the current message should not affect stateful operations, such as recording a channel's most recent speaker @@ -3004,7 +3004,7 @@ erc-send-action ;; Sending and displaying are provided separately to afford modules ;; more flexibility, e.g., to forgo displaying on the way out when ;; expecting the server to echo messages back and/or to associate -;; outgoing messages with IDs generated for `erc-ephemeral' +;; outgoing messages with IDs generated for `erc--ephemeral' ;; placeholders. (defun erc--send-action-perform-ctcp (target string force) "Send STRING to TARGET, possibly immediately, with FORCE." @@ -3013,11 +3013,11 @@ erc--send-action-perform-ctcp (defun erc--send-action-display (string) "Display STRING as an outgoing \"CTCP ACTION\" message." ;; Allow hooks acting on inserted PRIVMSG and NOTICES to process us. - (let ((erc--msg-prop-overrides `((erc-msg . msg) - (erc-ctcp . ACTION) + (let ((erc--msg-prop-overrides `((erc--msg . msg) + (erc--ctcp . ACTION) ,@erc--msg-prop-overrides)) (nick (erc-current-nick))) - (setq nick (propertize nick 'erc-speaker nick + (setq nick (propertize nick 'erc--speaker nick 'font-lock-face 'erc-my-nick-face)) (erc-display-message nil '(t action input) (current-buffer) 'ACTION ?n nick ?a string ?u "" ?h ""))) @@ -3142,20 +3142,20 @@ erc--get-inserted-msg-bounds POINT, search from POINT instead of `point'." ;; TODO add edebug spec. `(let* ((point ,(or point '(point))) - (at-start-p (get-text-property point 'erc-msg))) + (at-start-p (get-text-property point 'erc--msg))) (and-let* (,@(and (member only '(nil beg 'beg)) '((b (or (and at-start-p point) (and-let* ((p (previous-single-property-change point - 'erc-msg))) + 'erc--msg))) (if (= p (1- point)) - (if (get-text-property p 'erc-msg) p (1- p)) + (if (get-text-property p 'erc--msg) p (1- p)) (1- p))))))) ,@(and (member only '(nil end 'end)) '((e (1- (next-single-property-change (if at-start-p (1+ point) point) - 'erc-msg nil erc-insert-marker)))))) + 'erc--msg nil erc-insert-marker)))))) ,(pcase only ('(quote beg) 'b) ('(quote end) 'e) @@ -3184,12 +3184,12 @@ erc--traverse-inserted (set-marker end (min erc-insert-marker end))) (save-excursion (goto-char beg) - (let ((b (if (get-text-property (point) 'erc-msg) + (let ((b (if (get-text-property (point) 'erc--msg) (point) - (next-single-property-change (point) 'erc-msg nil end)))) + (next-single-property-change (point) 'erc--msg nil end)))) (while-let ((b) ((< b end)) - (e (next-single-property-change (1+ b) 'erc-msg nil end))) + (e (next-single-property-change (1+ b) 'erc--msg nil end))) (save-restriction (narrow-to-region b e) (funcall fn)) @@ -3267,7 +3267,7 @@ erc-insert-line (let ((props (if erc--msg-props (erc--order-text-properties-from-hash erc--msg-props) - '(erc-msg unknown)))) + '(erc--msg unknown)))) (add-text-properties (point-min) (1+ (point-min)) props))) (erc--refresh-prompt))))) (run-hooks 'erc-insert-done-hook) @@ -3340,8 +3340,8 @@ erc-display-line being equivalent to a `erc-display-message' TYPE of `notice'." (let ((erc--msg-prop-overrides erc--msg-prop-overrides)) (when (eq 'erc-notice-face (get-text-property 0 'font-lock-face string)) - (unless (assq 'erc-msg erc--msg-prop-overrides) - (push '(erc-msg . notice) erc--msg-prop-overrides))) + (unless (assq 'erc--msg erc--msg-prop-overrides) + (push '(erc--msg . notice) erc--msg-prop-overrides))) (erc-display-message nil nil buffer string))) (defvar erc--merge-text-properties-p nil @@ -3458,7 +3458,7 @@ erc--delete-inserted-message (substring (delete-and-extract-region (1- (point)) (1+ end)) -1)))))))) -(defvar erc--ranked-properties '(erc-msg erc-ts erc-cmd)) +(defvar erc--ranked-properties '(erc--msg erc--ts erc--cmd)) (defun erc--order-text-properties-from-hash (table) "Return a plist of text props from items in TABLE. @@ -3732,7 +3732,7 @@ erc-display-message (let ((table (make-hash-table :size 5)) (cmd (and parsed (erc--get-eq-comparable-cmd (erc-response.command parsed))))) - (puthash 'erc-msg + (puthash 'erc--msg (cond ((and msg (symbolp msg)) msg) ((and cmd (memq cmd '(PRIVMSG NOTICE)) 'msg)) (type (pcase type @@ -3744,7 +3744,7 @@ erc-display-message (t 'unknown)) table) (when cmd - (puthash 'erc-cmd cmd table)) + (puthash 'erc--cmd cmd table)) (and-let* ((ovs erc--msg-prop-overrides)) (pcase-dolist (`(,k . ,v) (reverse ovs)) (puthash k v table))) @@ -5258,7 +5258,7 @@ erc-ensure-channel-name (concat "#" channel))) (defvar erc--own-property-names - '( tags erc-speaker erc-parsed display ; core + '( tags erc--speaker erc-parsed display ; core ;; `erc-display-prompt' rear-nonsticky erc-prompt field front-sticky read-only ;; stamp @@ -5742,12 +5742,12 @@ erc-is-message-ctcp-and-not-action-p (not (string-match "^\C-aACTION.*\C-a$" message)))) (defun erc--get-speaker-bounds () - "Return the bounds of `erc-speaker' text property when present. + "Return the bounds of `erc--speaker' text property when present. Assume buffer is narrowed to the confines of an inserted message." - (and-let* (((erc--check-msg-prop 'erc-msg 'msg)) + (and-let* (((erc--check-msg-prop 'erc--msg 'msg)) (beg (text-property-not-all (point-min) (point-max) - 'erc-speaker nil))) - (cons beg (next-single-property-change beg 'erc-speaker)))) + 'erc--speaker nil))) + (cons beg (next-single-property-change beg 'erc--speaker)))) (defvar erc--cmem-from-nick-function #'erc--cmem-get-existing "Function maybe returning a \"channel member\" cons from a nick. @@ -5776,7 +5776,7 @@ erc-format-privmessage (erc-put-text-property 0 (length mark-s) 'font-lock-face msg-face str) (erc-put-text-properties (+ (length mark-s) prefix-len) (+ (length mark-s) (length nick)) - '(font-lock-face erc-speaker) str + '(font-lock-face erc--speaker) str (list nick-face (substring-no-properties nick prefix-len))) (erc-put-text-property (+ (length mark-s) (length nick)) (length str) @@ -5830,7 +5830,7 @@ erc-format-my-nick (concat (propertize open 'font-lock-face 'erc-default-face) (propertize mode 'font-lock-face 'erc-my-nick-prefix-face) - (propertize nick 'font-lock-face 'erc-my-nick-face 'erc-speaker nick) + (propertize nick 'font-lock-face 'erc-my-nick-face 'erc--speaker nick) (propertize close 'font-lock-face 'erc-default-face))) (let ((prefix "> ")) (propertize prefix 'font-lock-face 'erc-default-face)))) @@ -6074,8 +6074,8 @@ erc-process-ctcp-query (while queries (let* ((type (upcase (car (split-string (car queries))))) (hook (intern-soft (concat "erc-ctcp-query-" type "-hook"))) - (erc--msg-prop-overrides `((erc-msg . msg) - (erc-ctcp . ,(intern type)) + (erc--msg-prop-overrides `((erc--msg . msg) + (erc--ctcp . ,(intern type)) ,@erc--msg-prop-overrides))) (if (and hook (boundp hook)) (if (string-equal type "ACTION") @@ -6111,7 +6111,7 @@ erc-ctcp-query-ACTION (buf (or (erc-get-buffer to proc) (erc-get-buffer nick proc) (process-buffer proc)))) - (setq nick (propertize nick 'erc-speaker nick)) + (setq nick (propertize nick 'erc--speaker nick)) (erc-display-message parsed 'action buf 'ACTION ?n nick ?u login ?h host ?a s)))) @@ -7521,7 +7521,7 @@ erc-display-msg (let ((insert-position (marker-position (goto-char erc-insert-marker))) (erc--msg-props (or erc--msg-props (let ((ovs erc--msg-prop-overrides)) - (map-into `((erc-msg . msg) ,@(reverse ovs)) + (map-into `((erc--msg . msg) ,@(reverse ovs)) 'hash-table)))) beg) (insert (erc-format-my-nick)) diff --git a/test/lisp/erc/erc-scenarios-display-message.el b/test/lisp/erc/erc-scenarios-display-message.el index c7e0c2fc17a..91b82889f3e 100644 --- a/test/lisp/erc/erc-scenarios-display-message.el +++ b/test/lisp/erc/erc-scenarios-display-message.el @@ -50,12 +50,12 @@ erc-scenarios-display-message--multibuf (with-current-buffer (erc-d-t-wait-for 5 (get-buffer "dummy")) (funcall expect 10 " hi") (funcall expect 10 "*** dummy (~u@rdjcgiwfuwqmc.irc) has quit") - (should (eq 'QUIT (get-text-property (match-beginning 0) 'erc-msg))))) + (should (eq 'QUIT (get-text-property (match-beginning 0) 'erc--msg))))) (ert-info ("Dummy's QUIT notice in #chan contains metadata props") (with-current-buffer (erc-d-t-wait-for 5 (get-buffer "#chan")) (funcall expect 10 "*** dummy (~u@rdjcgiwfuwqmc.irc) has quit") - (should (eq 'QUIT (get-text-property (match-beginning 0) 'erc-msg))))) + (should (eq 'QUIT (get-text-property (match-beginning 0) 'erc--msg))))) (with-current-buffer "foonet" (erc-cmd-QUIT "")))) diff --git a/test/lisp/erc/erc-scenarios-match.el b/test/lisp/erc/erc-scenarios-match.el index 17f7649566e..0eed1853879 100644 --- a/test/lisp/erc/erc-scenarios-match.el +++ b/test/lisp/erc/erc-scenarios-match.el @@ -304,9 +304,9 @@ erc-scenarios-match--hide-fools/stamp-both/fill-wrap (should (= mend (field-end right-stamp))) (should (eq (field-at-pos (1- mend)) 'erc-timestamp)))) - ;; The `erc-ts' property is present in prop stack. - (should (get-text-property (pos-bol) 'erc-ts)) - (should-not (next-single-property-change (1+ (pos-bol)) 'erc-ts)) + ;; The `erc--ts' property is present in prop stack. + (should (get-text-property (pos-bol) 'erc--ts)) + (should-not (next-single-property-change (1+ (pos-bol)) 'erc--ts)) ;; Line ending has the `invisible' property `match-fools'. (should (eq (get-text-property mbeg 'invisible) 'match-fools)) @@ -413,7 +413,7 @@ erc-scenarios-match--hide-fools/stamp-both/fill-wrap/speak (should-not (equal "" (get-text-property (pos-bol) 'display))) ;; No remaining meta-data positions, no more timestamps. - (should-not (next-single-property-change (1+ (pos-bol)) 'erc-ts)) + (should-not (next-single-property-change (1+ (pos-bol)) 'erc--ts)) ;; No remaining invisible messages. (should-not (text-property-not-all (pos-bol) erc-insert-marker 'invisible nil)) @@ -456,10 +456,10 @@ erc-scenarios-match--stamp-both-invisible-fill-static (should (eq (field-at-pos (field-end mbeg)) 'erc-timestamp)) (should (eq (field-at-pos (1- mend)) 'erc-timestamp))) - ;; The `erc-ts' property is present in the message's + ;; The `erc--ts' property is present in the message's ;; width 1 prop collection at its first char. - (should (get-text-property (pos-bol) 'erc-ts)) - (should-not (next-single-property-change (1+ (pos-bol)) 'erc-ts)) + (should (get-text-property (pos-bol) 'erc--ts)) + (should-not (next-single-property-change (1+ (pos-bol)) 'erc--ts)) ;; Line ending has the `invisible' property `match-fools'. (should (= (char-after mend) ?\n)) diff --git a/test/lisp/erc/erc-scenarios-stamp.el b/test/lisp/erc/erc-scenarios-stamp.el index 49307dd228a..bb3a4195e0d 100644 --- a/test/lisp/erc/erc-scenarios-stamp.el +++ b/test/lisp/erc/erc-scenarios-stamp.el @@ -29,7 +29,7 @@ (defvar erc-scenarios-stamp--user-marker nil) (defun erc-scenarios-stamp--on-post-modify () - (when-let (((erc--check-msg-prop 'erc-cmd 4))) + (when-let (((erc--check-msg-prop 'erc--cmd 4))) (set-marker erc-scenarios-stamp--user-marker (point-max)) (ert-info ("User marker correctly placed at `erc-insert-marker'") (should (= ?\n (char-before erc-scenarios-stamp--user-marker))) @@ -68,11 +68,11 @@ erc-scenarios-stamp--left/display-margin-mode (ert-info ("Stamps appear in left margin and are invisible") (should (eq 'erc-timestamp (field-at-pos (pos-bol)))) (should (= (pos-bol) (field-beginning (pos-bol)))) - (should (eq 'msg (get-text-property (pos-bol) 'erc-msg))) - (should (eq 'NOTICE (get-text-property (pos-bol) 'erc-cmd))) + (should (eq 'msg (get-text-property (pos-bol) 'erc--msg))) + (should (eq 'NOTICE (get-text-property (pos-bol) 'erc--cmd))) (should (= ?- (char-after (field-end (pos-bol))))) (should (equal (get-text-property (1+ (field-end (pos-bol))) - 'erc-speaker) + 'erc--speaker) "irc.foonet.org")) (should (pcase (get-text-property (pos-bol) 'display) (`((margin left-margin) ,s) @@ -104,14 +104,14 @@ erc-scenarios-stamp--legacy-date-stamps (funcall expect 5 "Opening connection") (goto-char (1- (match-beginning 0))) (should (eq 'erc-timestamp (field-at-pos (point)))) - (should (eq 'unknown (erc--get-inserted-msg-prop 'erc-msg))) + (should (eq 'unknown (erc--get-inserted-msg-prop 'erc--msg))) ;; Force redraw of date stamp. (setq erc-timestamp-last-inserted-left nil) (funcall expect 5 "This server is in debug mode") (while (and (zerop (forward-line -1)) (not (eq 'erc-timestamp (field-at-pos (point)))))) - (should (erc--get-inserted-msg-prop 'erc-cmd))))))) + (should (erc--get-inserted-msg-prop 'erc--cmd))))))) ;; This user-owned hook member places a marker on the first message in ;; a buffer. Inserting a date stamp in front of it shouldn't move the @@ -125,18 +125,18 @@ erc-scenarios-stamp--on-insert-modify ;; Sometime after the first message ("Opening connection.."), assert ;; that the marker we just placed hasn't moved. - (when (erc--check-msg-prop 'erc-cmd 2) + (when (erc--check-msg-prop 'erc--cmd 2) (save-restriction (widen) (ert-info ("Date stamp preserves opening user marker") (goto-char erc-scenarios-stamp--user-marker) (should-not (eq 'erc-timestamp (field-at-pos (point)))) (should (looking-at "Opening")) - (should (eq 'unknown (get-text-property (point) 'erc-msg)))))) + (should (eq 'unknown (get-text-property (point) 'erc--msg)))))) ;; On 003 ("*** This server was created on"), clear state to force a ;; new date stamp on the next message. - (when (erc--check-msg-prop 'erc-cmd 3) + (when (erc--check-msg-prop 'erc--cmd 3) (setq erc-timestamp-last-inserted-left nil) (set-marker erc-scenarios-stamp--user-marker erc-insert-marker))) @@ -174,7 +174,7 @@ erc-scenarios-stamp--date-mode/left-and-right (goto-char erc-scenarios-stamp--user-marker) (should-not (eq 'erc-timestamp (field-at-pos (point)))) (should (looking-at (rx "*** irc.foonet.org oragono"))) - (should (eq 's004 (get-text-property (point) 'erc-msg)))) + (should (eq 's004 (get-text-property (point) 'erc--msg)))) (funcall expect 5 "This server is in debug mode"))))) diff --git a/test/lisp/erc/erc-stamp-tests.el b/test/lisp/erc/erc-stamp-tests.el index cc61d599387..fd2e7000c0e 100644 --- a/test/lisp/erc/erc-stamp-tests.el +++ b/test/lisp/erc/erc-stamp-tests.el @@ -279,7 +279,7 @@ erc-echo-timestamp (should-not erc-echo-timestamps) (should-not erc-stamp--last-stamp) - (insert (propertize "a" 'erc-ts 433483200 'erc-msg 'msg) "bc") + (insert (propertize "a" 'erc--ts 433483200 'erc--msg 'msg) "bc") (goto-char (point-min)) (let ((inhibit-message t) (erc-echo-timestamp-format "%Y-%m-%d %H:%M:%S %Z") diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 03879b02347..1b610a367b6 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -1738,7 +1738,7 @@ erc--get-inserted-msg-bounds :command "PRIVMSG" :command-args (list "#chan" "hi") :contents "hi")) - (erc--msg-prop-overrides '((erc-ts . 0)))) + (erc--msg-prop-overrides '((erc--ts . 0)))) (erc-display-message parsed nil (current-buffer) (erc-format-privmessage "bob" "hi" nil t))) (goto-char 3) @@ -1785,7 +1785,7 @@ erc--delete-inserted-message ;; Put unique invisible properties on the line endings. (erc-display-message nil 'notice nil "one") (put-text-property (1- erc-insert-marker) erc-insert-marker 'invisible 'a) - (let ((erc--msg-prop-overrides '((erc-msg . datestamp) (erc-ts . 0)))) + (let ((erc--msg-prop-overrides '((erc--msg . datestamp) (erc--ts . 0)))) (erc-display-message nil nil nil (propertize "\n[date]" 'field 'erc-timestamp))) (put-text-property (1- erc-insert-marker) erc-insert-marker 'invisible 'b) @@ -1794,7 +1794,7 @@ erc--delete-inserted-message (ert-info ("Date stamp deleted cleanly") (goto-char 11) (should (looking-at (rx "\n[date]"))) - (should (eq 'datestamp (get-text-property (point) 'erc-msg))) + (should (eq 'datestamp (get-text-property (point) 'erc--msg))) (should (eq (point) (field-beginning (1+ (point))))) (erc--delete-inserted-message (point)) @@ -1855,19 +1855,19 @@ erc--delete-inserted-message (ert-deftest erc--order-text-properties-from-hash () (let ((table (map-into '((a . 1) - (erc-ts . 0) - (erc-msg . s005) + (erc--ts . 0) + (erc--msg . s005) (b . 2) - (erc-cmd . 5) + (erc--cmd . 5) (c . 3)) 'hash-table))) (with-temp-buffer (erc-mode) (insert "abc\n") (add-text-properties 1 2 (erc--order-text-properties-from-hash table)) - (should (equal '( erc-msg s005 - erc-ts 0 - erc-cmd 5 + (should (equal '( erc--msg s005 + erc--ts 0 + erc--cmd 5 a 1 b 2 c 3) @@ -2341,7 +2341,7 @@ erc-format-privmessage nil 'msgp) #(" oh my" 0 1 (font-lock-face erc-default-face) - 1 4 (erc-speaker "bob" font-lock-face erc-nick-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) 4 11 (font-lock-face erc-default-face)))) ;; Basic NOTICE @@ -2351,7 +2351,7 @@ erc-format-privmessage nil nil) #("-bob- oh my" 0 1 (font-lock-face erc-default-face) - 1 4 (erc-speaker "bob" font-lock-face erc-nick-default-face) + 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) 4 11 (font-lock-face erc-default-face)))) ;; Prefixed PRIVMSG @@ -2367,7 +2367,7 @@ erc-format-privmessage #("<@Bob> oh my" 0 1 (font-lock-face erc-default-face) 1 2 (font-lock-face erc-nick-prefix-face help-echo "operator") - 2 5 (erc-speaker "Bob" font-lock-face erc-nick-default-face) + 2 5 (erc--speaker "Bob" font-lock-face erc-nick-default-face) 5 12 (font-lock-face erc-default-face)))))) (ert-deftest erc--route-insertion () @@ -2392,7 +2392,7 @@ erc--route-insertion (ert-info ("Cons `buffer' routes to live members") ;; Copies a let-bound `erc--msg-props' before mutating. - (let* ((table (map-into '(erc-msg msg) 'hash-table)) + (let* ((table (map-into '(erc--msg msg) 'hash-table)) (erc--msg-props table)) (erc--route-insertion "cons" (list server-buffer spam-buffer)) (should-not (eq table erc--msg-props))) diff --git a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld index c07eee3517f..f4a43a9384f 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc-msg datestamp erc-ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 27 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 27 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) diff --git a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld index cf5cdb4f825..78450ec08e2 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc-msg datestamp erc-ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 29 (18)))) 455 456 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 29 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 29 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 29 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 29 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 29 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 29 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 29 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#6=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 29 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #5=(space :width (- 29 (6)))) 456 459 (wrap-prefix #1# line-prefix #5#) 459 466 (wrap-prefix #1# line-prefix #5#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #5# display (#6# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 29 (8)))) 475 480 (wrap-prefix #1# line-prefix #7#) 480 486 (wrap-prefix #1# line-prefix #7#) 487 488 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #8=(space :width (- 29 0)) display #9="") 488 493 (wrap-prefix #1# line-prefix #8# display #9#) 493 495 (wrap-prefix #1# line-prefix #8# display #9#) 495 499 (wrap-prefix #1# line-prefix #8#) 500 501 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 29 (6)))) 501 504 (wrap-prefix #1# line-prefix #10#) 504 512 (wrap-prefix #1# line-prefix #10#) 513 514 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 29 0)) display #9#) 514 517 (wrap-prefix #1# line-prefix #11# display #9#) 517 519 (wrap-prefix #1# line-prefix #11# display #9#) 519 524 (wrap-prefix #1# line-prefix #11#) 525 526 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 29 (8)))) 526 531 (wrap-prefix #1# line-prefix #12#) 531 538 (wrap-prefix #1# line-prefix #12#) 539 540 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 29 0)) display #9#) 540 545 (wrap-prefix #1# line-prefix #13# display #9#) 545 547 (wrap-prefix #1# line-prefix #13# display #9#) 547 551 (wrap-prefix #1# line-prefix #13#)) diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld index ad4e6483f01..8e5535093e1 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc-msg datestamp erc-ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG erc-ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG erc-ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld index 893588c028f..a0c03244afe 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc-msg datestamp erc-ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG erc-ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG erc-ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld index 2b67cbbf90e..c4a51e06354 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc-msg datestamp erc-ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG erc-ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG erc-ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc-msg msg erc-ts 1680332400 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n 0.5\n* bob one.\n two.\n 2.5\n* bob three\n four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld b/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld index 84a1e34670c..5eea73b4f16 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld b/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld index 83394f2f639..bc59c0bef22 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 29) line-prefix (space :width (- 29 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 29 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 29 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 29 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld b/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld index 1605628b29f..bfb75c0838e 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 25) line-prefix (space :width (- 25 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 25 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 25 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 25 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 25) line-prefix (space :width (- 25 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 25 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 25 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 25 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld b/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld index 84a1e34670c..5eea73b4f16 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#)) diff --git a/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld b/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld index 7a7e01de49d..1362c57ef10 100644 --- a/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld +++ b/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n This buffer is for text.\n*** one two three\n*** four five six\n Somebody stop me\n" 2 3 (erc-msg datestamp erc-ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 190 191 (line-spacing 0.5) 191 192 (erc-msg msg erc-cmd PRIVMSG erc-ts 0 wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 348 349 (line-spacing 0.5) 349 350 (erc-msg msg erc-cmd PRIVMSG erc-ts 0 wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 435 436 (line-spacing 0.5) 436 437 (erc-msg msg erc-cmd PRIVMSG erc-ts 0 wrap-prefix #1# line-prefix #5=(space :width (- 27 0)) display #6="") 437 440 (wrap-prefix #1# line-prefix #5# display #6#) 440 442 (wrap-prefix #1# line-prefix #5# display #6#) 442 466 (wrap-prefix #1# line-prefix #5#) 466 467 (line-spacing 0.5) 467 468 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #7=(space :width (- 27 (4)))) 468 484 (wrap-prefix #1# line-prefix #7#) 485 486 (erc-msg notice erc-ts 0 wrap-prefix #1# line-prefix #8=(space :width (- 27 (4)))) 486 502 (wrap-prefix #1# line-prefix #8#) 502 503 (line-spacing 0.5) 503 504 (erc-msg msg erc-cmd PRIVMSG erc-ts 0 wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 504 507 (wrap-prefix #1# line-prefix #9#) 507 525 (wrap-prefix #1# line-prefix #9#)) +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n This buffer is for text.\n*** one two three\n*** four five six\n Somebody stop me\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display ((margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 190 191 (line-spacing 0.5) 191 192 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 348 349 (line-spacing 0.5) 349 350 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 435 436 (line-spacing 0.5) 436 437 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #5=(space :width (- 27 0)) display #6="") 437 440 (wrap-prefix #1# line-prefix #5# display #6#) 440 442 (wrap-prefix #1# line-prefix #5# display #6#) 442 466 (wrap-prefix #1# line-prefix #5#) 466 467 (line-spacing 0.5) 467 468 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #7=(space :width (- 27 (4)))) 468 484 (wrap-prefix #1# line-prefix #7#) 485 486 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #8=(space :width (- 27 (4)))) 486 502 (wrap-prefix #1# line-prefix #8#) 502 503 (line-spacing 0.5) 503 504 (erc--msg msg erc--cmd PRIVMSG erc--ts 0 wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 504 507 (wrap-prefix #1# line-prefix #9#) 507 525 (wrap-prefix #1# line-prefix #9#)) diff --git a/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld b/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld index bb248ffb28e..4f87c7d2547 100644 --- a/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld @@ -1 +1 @@ -#("\n\n[00:00]*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.\n[00:00] bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n[00:00] alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc-msg notice erc-ts 0 display #3=(#5=(margin left-margin) #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix #2=(space :width (- 27 (4)))) 3 9 (display #3# field erc-timestamp wrap-prefix #1# line-prefix #2#) 9 171 (wrap-prefix #1# line-prefix #2#) 172 173 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG display #6=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #4=(space :width (- 27 (8)))) 173 179 (display #6# field erc-timestamp wrap-prefix #1# line-prefix #4#) 179 180 (wrap-prefix #1# line-prefix #4#) 180 185 (wrap-prefix #1# line-prefix #4#) 185 187 (wrap-prefix #1# line-prefix #4#) 187 190 (wrap-prefix #1# line-prefix #4#) 190 303 (wrap-prefix #1# line-prefix #4#) 304 336 (wrap-prefix #1# line-prefix #4#) 337 338 (erc-msg msg erc-ts 0 erc-cmd PRIVMSG display #8=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #7=(space :width (- 27 (6)))) 338 344 (display #8# field erc-timestamp wrap-prefix #1# line-prefix #7#) 344 345 (wrap-prefix #1# line-prefix #7#) 345 348 (wrap-prefix #1# line-prefix #7#) 348 350 (wrap-prefix #1# line-prefix #7#) 350 355 (wrap-prefix #1# line-prefix #7#) 355 430 (wrap-prefix #1# line-prefix #7#)) +#("\n\n[00:00]*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.\n[00:00] bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n[00:00] alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 3 (erc--msg notice erc--ts 0 display #3=(#5=(margin left-margin) #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix #2=(space :width (- 27 (4)))) 3 9 (display #3# field erc-timestamp wrap-prefix #1# line-prefix #2#) 9 171 (wrap-prefix #1# line-prefix #2#) 172 173 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG display #6=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #4=(space :width (- 27 (8)))) 173 179 (display #6# field erc-timestamp wrap-prefix #1# line-prefix #4#) 179 180 (wrap-prefix #1# line-prefix #4#) 180 185 (wrap-prefix #1# line-prefix #4#) 185 187 (wrap-prefix #1# line-prefix #4#) 187 190 (wrap-prefix #1# line-prefix #4#) 190 303 (wrap-prefix #1# line-prefix #4#) 304 336 (wrap-prefix #1# line-prefix #4#) 337 338 (erc--msg msg erc--ts 0 erc--cmd PRIVMSG display #8=(#5# #("[00:00]" 0 7 (invisible timestamp font-lock-face erc-timestamp-face))) field erc-timestamp wrap-prefix #1# line-prefix #7=(space :width (- 27 (6)))) 338 344 (display #8# field erc-timestamp wrap-prefix #1# line-prefix #7#) 344 345 (wrap-prefix #1# line-prefix #7#) 345 348 (wrap-prefix #1# line-prefix #7#) 348 350 (wrap-prefix #1# line-prefix #7#) 350 355 (wrap-prefix #1# line-prefix #7#) 355 430 (wrap-prefix #1# line-prefix #7#)) commit 61b22ae9f37e8af31dc322df37663476af2adb74 Author: F. Jason Park Date: Sun Nov 26 18:24:48 2023 -0800 Sequester some special-variable declarations in ERC * lisp/erc/erc-backend.el (erc-log-p): Remove declaration entirely. (erc-server-reconnect): Move declaration for `erc-reuse-buffers' here. (erc-process-sentinel-1): Move `erc-kill-server-buffer-on-quit' declaration here. (erc--conceal-prompt): Move `erc-prompt-hidden' declaration here. (erc-server-INVITE): Move `erc-invitation' declaration here. (erc-server-PART): Move `erc-kill-buffer-on-part' declaration here. (erc-server-PRIVMSG): Move declarations for `erc-minibuffer-ignored', `erc-receive-query-display', `erc-receive-query-display-defer', `erc--cmem-from-nick-function', `erc-format-nick-function', and `erc-format-query-as-channel-p' here. (erc-server-401): Move `erc-whowas-on-nosuchnick' declaration here. (erc-server-475): Move `erc--called-as-input-p' and `erc-prompt-for-channel-key' declarations here. * lisp/erc/erc-common.el (erc-log-p): Remove declaration for `erc-log-p' and replace with actual definition. (erc-log-aux): Move `erc-dbuf' declaration from top level into function body. * lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Note in the doc string that this function produces side effects. * lisp/erc/erc-networks.el (erc-determine-network, erc-networks--copy-server-buffer-functions): Move some variable declarations to function body. (erc-settings, erc-get): Deprecate for now and explain why in doc strings. We could deprecate them unconditionally, but they never provided usable code, and their names are short and valuable. * lisp/erc/erc.el (tabbar--local-hlf, motif-version-string, gtk-version-string): Prefer moving these single-serving declarations to function bodies, if only to make closures from this library less cluttered when debugging. This should also help avoid stray declarations. (erc-hooks, erc-timer-hook): Revise doc strings. (erc-log-p): Move definition to erc-common.el. (erc-cmd-SV): Mimic `emacs-version' and stick with `featurep', here in combination with special-variable declarations, instead of `boundp' or similar. (erc-header-line-uses-tabbar-p): Explain that this has nothing to do with `tab-bar'. (erc-update-mode-line-buffer): Only assign when bound. This has been verified to work with version 2.0 on EmacsWiki. * test/lisp/erc/erc-scenarios-base-reconnect.el: Timeouts. * test/lisp/erc/erc-scenarios-base-renick.el: Timeouts. * test/lisp/erc/resources/join/network-id/foonet-again.eld: Timeouts. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 7ff55de0d0c..500e025e5a1 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -101,36 +101,21 @@ (eval-when-compile (require 'cl-lib)) (require 'erc-common) -(defvar erc--called-as-input-p) (defvar erc--display-context) (defvar erc--target) -(defvar erc--cmem-from-nick-function) (defvar erc-channel-list) (defvar erc-channel-users) (defvar erc-default-nicks) (defvar erc-default-recipients) (defvar erc-ensure-target-buffer-on-privmsg) -(defvar erc-format-nick-function) -(defvar erc-format-query-as-channel-p) (defvar erc-hide-prompt) (defvar erc-input-marker) (defvar erc-insert-marker) -(defvar erc-invitation) (defvar erc-join-buffer) -(defvar erc-kill-buffer-on-part) -(defvar erc-kill-server-buffer-on-quit) -(defvar erc-log-p) -(defvar erc-minibuffer-ignored) (defvar erc-networks--id) (defvar erc-nick) (defvar erc-nick-change-attempt-count) -(defvar erc-prompt-for-channel-key) -(defvar erc-prompt-hidden) -(defvar erc-receive-query-display) -(defvar erc-receive-query-display-defer) -(defvar erc-reuse-buffers) (defvar erc-verbose-server-ping) -(defvar erc-whowas-on-nosuchnick) (declare-function erc--init-channel-modes "erc" (channel raw-args)) (declare-function erc--open-target "erc" (target)) @@ -816,6 +801,7 @@ erc-server-reconnect nil nil nil erc-session-client-certificate erc-session-username (erc-networks--id-given erc-networks--id)) + (defvar erc-reuse-buffers) (unless (with-suppressed-warnings ((obsolete erc-reuse-buffers)) erc-reuse-buffers) (cl-assert (not (eq buffer (current-buffer))))))))) @@ -1038,6 +1024,7 @@ erc-process-sentinel-1 (erc-update-mode-line) ;; Kill server buffer if user wants it (set-buffer-modified-p nil) + (defvar erc-kill-server-buffer-on-quit) (when erc-kill-server-buffer-on-quit (kill-buffer (current-buffer)))) ;; unexpected disconnect @@ -1055,6 +1042,7 @@ erc--conceal-prompt (when-let (((null erc--hidden-prompt-overlay)) (ov (make-overlay erc-insert-marker (1- erc-input-marker) nil 'front-advance))) + (defvar erc-prompt-hidden) (overlay-put ov 'display erc-prompt-hidden) (setq erc--hidden-prompt-overlay ov))) @@ -1716,6 +1704,7 @@ define-erc-response-handler (chnl (erc-response.contents parsed))) (pcase-let ((`(,nick ,login ,host) (erc-parse-user (erc-response.sender parsed)))) + (defvar erc-invitation) (setq erc-invitation chnl) (when (string= target (erc-current-nick)) (erc-display-message @@ -1888,6 +1877,7 @@ erc--server-determine-join-display-context (with-suppressed-warnings ((obsolete erc-delete-default-channel)) (erc-delete-default-channel chnl buffer)) (erc-update-mode-line buffer) + (defvar erc-kill-buffer-on-part) (when erc-kill-buffer-on-part (kill-buffer buffer)))))) @@ -1921,6 +1911,7 @@ erc--server-determine-join-display-context (cmd (erc-response.command parsed)) (tgt (car (erc-response.command-args parsed))) (msg (erc-response.contents parsed))) + (defvar erc-minibuffer-ignored) (if (or (erc-ignored-user-p sender-spec) (erc-ignored-reply-p msg tgt proc)) (when erc-minibuffer-ignored @@ -1942,6 +1933,8 @@ erc--server-determine-join-display-context ;; Even worth checking for empty target here? (invalid anyway) (unless (or buffer noticep (string-empty-p tgt) (eq ?$ (aref tgt 0)) (erc-is-message-ctcp-and-not-action-p msg)) + (defvar erc-receive-query-display) + (defvar erc-receive-query-display-defer) (if privp (when-let ((erc-join-buffer (or (and (not erc-receive-query-display-defer) @@ -1963,6 +1956,8 @@ erc--server-determine-join-display-context ;; at this point. (erc-update-channel-member (if privp nick tgt) nick nick privp nil nil nil nil nil host login nil nil t) + (defvar erc--cmem-from-nick-function) + (defvar erc-format-nick-function) (let ((cdata (funcall erc--cmem-from-nick-function (erc-downcase nick) sndr parsed))) (setq fnick (funcall erc-format-nick-function @@ -1975,6 +1970,7 @@ erc--server-determine-join-display-context (match-string 1 msg))))) (t (setq erc-server-last-peers (cons nick (cdr erc-server-last-peers))) + (defvar erc-format-query-as-channel-p) (setq s (erc-format-privmessage (or fnick nick) msg ;; If buffer is a query buffer, @@ -2479,6 +2475,7 @@ erc-server-322-message (define-erc-response-handler (401) "No such nick/channel." nil (let ((nick/channel (cadr (erc-response.command-args parsed)))) + (defvar erc-whowas-on-nosuchnick) (when erc-whowas-on-nosuchnick (erc-log (format "cmd: WHOWAS: %s" nick/channel)) (erc-server-send (format "WHOWAS %s 1" nick/channel))) @@ -2579,6 +2576,8 @@ erc-server-322-message "Channel key needed." nil (erc-display-message parsed '(notice error) nil 's475 ?c (cadr (erc-response.command-args parsed))) + (defvar erc-prompt-for-channel-key) + (defvar erc--called-as-input-p) (when erc-prompt-for-channel-key (let ((channel (cadr (erc-response.command-args parsed))) (erc--called-as-input-p t) diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 3b138b394bd..c79954cdee5 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -29,9 +29,7 @@ (defvar erc--casemapping-rfc1459) (defvar erc--casemapping-rfc1459-strict) (defvar erc-channel-users) -(defvar erc-dbuf) (defvar erc-insert-this) -(defvar erc-log-p) (defvar erc-modules) (defvar erc-send-this) (defvar erc-server-process) @@ -458,6 +456,7 @@ erc-log-aux (if session-buffer (progn (set-buffer session-buffer) + (defvar erc-dbuf) (if (not (and erc-dbuf (bufferp erc-dbuf) (buffer-live-p erc-dbuf))) (progn (setq erc-dbuf (get-buffer-create @@ -473,6 +472,9 @@ erc-log-aux (set-buffer cb)) (message "ERC: ** %s" string)))) +(defvar erc-log-p nil + "When non-nil, generate debug messages in an \"*ERC-DEBUG*\" buffer.") + (define-inline erc-log (string) "Logs STRING if logging is on (see `erc-log-p')." (inline-quote diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 82e881cb71c..9b0c74b518d 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -553,7 +553,9 @@ erc-fill--wrap-max-lull (defun erc-fill--wrap-continued-message-p () "Return non-nil when the current speaker hasn't changed. That is, indicate whether the text just inserted is from the same -sender as that of the previous \"PRIVMSG\"." +sender as that of the previous \"PRIVMSG\". As a side effect, +advance `erc-fill--wrap-last-msg' unless the message has been +marked as being ephemeral." (and (not (erc--check-msg-prop 'erc-ephemeral)) (progn ; preserve blame for now, unprogn on next major change diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index f168c90df65..694f56ed0d5 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -42,16 +42,12 @@ (defvar erc--target) (defvar erc-insert-marker) -(defvar erc-kill-buffer-hook) -(defvar erc-kill-server-hook) (defvar erc-modules) (defvar erc-rename-buffers) (defvar erc-reuse-buffers) (defvar erc-server-announced-name) (defvar erc-server-connected) -(defvar erc-server-parameters) (defvar erc-server-process) -(defvar erc-session-server) (declare-function erc--get-isupport-entry "erc-backend" (key &optional single)) (declare-function erc-buffer-filter "erc" (predicate &optional proc)) @@ -1229,6 +1225,8 @@ erc-determine-network server name and search for a match in `erc-networks-alist'." ;; The server made it easy for us and told us the name of the NETWORK (declare (obsolete "maybe see `erc-networks--determine'" "29.1")) + (defvar erc-server-parameters) + (defvar erc-session-server) (let ((network-name (cdr (assoc "NETWORK" erc-server-parameters)))) (if network-name (intern network-name) @@ -1381,6 +1379,8 @@ erc-networks--copy-server-buffer-functions (defun erc-networks--copy-over-server-buffer-contents (existing name) "Kill off existing server buffer after copying its contents. Must be called from the replacement buffer." + (defvar erc-kill-buffer-hook) + (defvar erc-kill-server-hook) ;; ERC expects `erc-open' to be idempotent when setting up local ;; vars and other context properties for a new identity. Thus, it's ;; unlikely we'll have to copy anything else over besides text. And @@ -1586,14 +1586,29 @@ erc-settings '((pals Libera.Chat ("kensanata" "shapr" "anti\\(fuchs\\|gone\\)")) (format-nick-function (Libera.Chat "#emacs") erc-format-@nick)) "Experimental: Alist of configuration options. + +WARNING: this variable is a vestige from a long-abandoned +experiment. ERC may redefine it using the same name for any +purpose at any time. + The format is (VARNAME SCOPE VALUE) where VARNAME is a symbol identifying the configuration option, SCOPE is either a symbol which identifies an entry from `erc-networks-alist' or a list (NET TARGET) where NET is a network symbol and TARGET is a string identifying the channel/query target. VALUE is the options value.") +(make-obsolete-variable 'erc-settings + "temporarily deprecated for later repurposing" "30.1") (defun erc-get (var &optional net target) + "Retrieve configuration values from `erc-settings'. + +WARNING: this function is a non-functioning remnant from a +long-abandoned experiment. ERC may redefine it using the same +name for any purpose at any time. + +\(fn &rest UNKNOWN)" + (declare (obsolete "temporarily deprecated for later repurposing" "30.1")) (let ((items erc-settings) elt val) (while items diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e39e50a7343..558b17788bf 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -191,10 +191,6 @@ erc--msg-prop-overrides already non-nil.") ;; Forward declarations -(defvar tabbar--local-hlf) -(defvar motif-version-string) -(defvar gtk-version-string) - (declare-function decoded-time-period "time-date" (time)) (declare-function iso8601-parse-duration "iso8601" (string)) (declare-function word-at-point "thingatpt" (&optional no-properties)) @@ -1138,7 +1134,13 @@ erc-user-information ;; Hooks (defgroup erc-hooks nil - "Hook variables for fancy customizations of ERC." + "Hooks for ERC. +Users of the interactive client should be aware that many of +these hooks have names predating the modern convention of +conveying abnormality via the \"-function\" suffix. Users should +likewise be aware that built-in and third-party modules use these +hooks as well, and some of their variables may be buffer-local in +particular sessions and/or `let'-bound for spells." :group 'erc) (defcustom erc-mode-hook nil @@ -1148,9 +1150,8 @@ erc-mode-hook :options '(erc-add-scroll-to-bottom)) (defcustom erc-timer-hook nil - "Put functions which should get called more or less periodically here. -The idea is that servers always play ping pong with the client, and so there -is no need for any idle-timer games with Emacs." + "Abnormal hook run after each response handler. +Called with a float returned from `erc-current-time'." :group 'erc-hooks :type 'hook) @@ -1450,9 +1451,8 @@ erc-nick-msg-face ;; Debugging support -(defvar erc-log-p nil - "When set to t, generate debug messages in a separate debug buffer.") - +;; FIXME if this variable plays some role, indicate that here. +;; Otherwise, deprecate. (defvar erc-debug-log-file (expand-file-name "ERC.debug") "Debug log file name.") @@ -4969,9 +4969,11 @@ erc-cmd-SV system-configuration (concat (cond ((featurep 'motif) + (defvar motif-version-string) (concat ", " (substring motif-version-string 4))) ((featurep 'gtk) + (defvar gtk-version-string) (concat ", GTK+ Version " gtk-version-string)) ((featurep 'x-toolkit) ", X toolkit") @@ -8288,8 +8290,13 @@ erc-header-line-format :type '(choice (const :tag "Disabled" nil) string)) +;; This should optionally support the built-in `tab-bar'. (defcustom erc-header-line-uses-tabbar-p nil - "Use tabbar mode instead of the header line to display the header." + "Use `tabbar-mode' integration instead of the header line. +This concerns a historical integration with the external library +`tabbar' , which +shouldn't be confused with the built-in `tab-bar' described in +Info node `(emacs) Tab Bars'." :group 'erc-mode-line-and-header :type 'boolean) @@ -8496,7 +8503,8 @@ erc-update-mode-line-buffer (format-spec erc-header-line-format spec) nil))) (cond (erc-header-line-uses-tabbar-p - (setq-local tabbar--local-hlf header-line-format) + (when (boundp 'tabbar--local-hlf) + (setq-local tabbar--local-hlf header-line-format)) (kill-local-variable 'header-line-format)) ((null header) (setq header-line-format nil)) diff --git a/test/lisp/erc/erc-scenarios-base-reconnect.el b/test/lisp/erc/erc-scenarios-base-reconnect.el index 7bd16d1ed14..163521f4a7b 100644 --- a/test/lisp/erc/erc-scenarios-base-reconnect.el +++ b/test/lisp/erc/erc-scenarios-base-reconnect.el @@ -171,7 +171,7 @@ erc-scenarios-base-cancel-reconnect (funcall expect 2 "Canceled") (funcall expect 3 "Opening connection") (funcall expect 2 "Password incorrect") - (funcall expect 2 "Connection failed!") + (funcall expect 10 "Connection failed!") (funcall expect 2 "Re-establishing connection")) (ert-info ("Explicitly cancel timer") (erc-cmd-RECONNECT "cancel") diff --git a/test/lisp/erc/erc-scenarios-base-renick.el b/test/lisp/erc/erc-scenarios-base-renick.el index 5a87e5871f7..689f962812a 100644 --- a/test/lisp/erc/erc-scenarios-base-renick.el +++ b/test/lisp/erc/erc-scenarios-base-renick.el @@ -267,7 +267,7 @@ erc-scenarios-base-renick-queries-bouncer (ert-info ("Sync convo for rando@foonet") (with-current-buffer "rando@foonet" - (funcall expect 1 "u are dumb") + (funcall expect 10 "u are dumb") (erc-scenarios-common-say "not so"))) (ert-info ("Sync convo for rando@barnet") diff --git a/test/lisp/erc/resources/join/network-id/foonet-again.eld b/test/lisp/erc/resources/join/network-id/foonet-again.eld index b230eff27c7..a8b8a52f87a 100644 --- a/test/lisp/erc/resources/join/network-id/foonet-again.eld +++ b/test/lisp/erc/resources/join/network-id/foonet-again.eld @@ -43,4 +43,4 @@ (0.1 ":bob!~u@q6ddatxcq6txy.irc PRIVMSG #chan :alice: But we are spirits of another sort.") (0.1 ":alice!~u@q6ddatxcq6txy.irc PRIVMSG #chan :bob: It was not given me, nor I did not buy it.")) -((linger 6 LINGER)) +((linger 30 LINGER)) commit b5da8ba80709286284a4ba7a0c7806e3169e76a6 Author: F. Jason Park Date: Tue Nov 28 16:51:36 2023 -0800 Define ERC message-formatting templates with defvar * etc/ERC-NEWS: Mention convenience macro being preferred means of defining message templates. Mention renaming of `notify' formatting templates. * lisp/erc/erc-common.el (erc--define-catalog, erc-define-message-format-catalog): New macro and internal variant to replace `erc-define-catalog-entry'. The internal variant allows us to defer reindenting existing definitions until meaningfully edited. * lisp/erc/erc-dcc.el (erc-message-english-dcc-chat-discarded, erc-message-english-dcc-chat-ended, erc-message-english-dcc-chat-no-request, erc-message-english-dcc-chat-offered, erc-message-english-dcc-chat-offer, erc-message-english-dcc-chat-accept, erc-message-english-dcc-chat-privmsg, erc-message-english-dcc-closed, erc-message-english-dcc-command-undefined, erc-message-english-dcc-ctcp-errmsg, erc-message-english-dcc-ctcp-unknown, erc-message-english-dcc-get-bytes-received, erc-message-english-dcc-get-complete, erc-message-english-dcc-get-failed, erc-message-english-dcc-get-cmd-aborted, erc-message-english-dcc-get-file-too-long, erc-message-english-dcc-get-notfound, erc-message-english-dcc-list-head, erc-message-english-dcc-list-line, erc-message-english-dcc-list-item, erc-message-english-dcc-list-end, erc-message-english-dcc-malformed, erc-message-english-dcc-privileged-port, erc-message-english-dcc-request-bogus, erc-message-english-dcc-send-finished, erc-message-english-dcc-send-offered, erc-message-english-dcc-send-offer): Define at top level using `defvar'. * lisp/erc/erc-netsplit.el (erc-netsplit-mode, erc-netsplit-enable): Don't call `erc-netsplit-install-message-catalogs'. (erc-netsplit-install-message-catalogs): Deprecate function. (erc-message-english-netsplit, erc-message-english-netjoin, erc-message-english-netjoin-done, erc-message-english-netsplit-none, erc-message-english-netsplit-wholeft): Define at top level using `defvar'. * lisp/erc/erc-notify.el (erc-notify-install-message-catalogs): Deprecate, and rename all format templates with hyphens instead of underscores. (erc-notify-timer, erc-notify-JOIN, erc-notify-NICK, erc-notify-QUIT): Use hyphenated template names. (erc-cmd-NOTIFY): Use hyphenated template names. Load the module when necessary and emit a warning. Otherwise, people who discover this autoloaded command without being aware of the module's existence may think it's "broken". (pcomplete/erc-mode/NOTIFY): Replace top-level autoload with `require' in function body. Include `erc-notify-list' in list of completions, which makes removal easier if you don't share any channels with a person, and they're not in `erc-server-users'. A better long-term solution might be to WHOIS folks we're unsure about when they're listed in a 303. (erc-message-english-notify_current, erc-message-english-notify_list, erc-message-english-notify_on, erc-message-english-notify_off): Define at top level using `defvar'. Replace nonstandard underscores with hyphens. Alias obsolete names. * lisp/erc/erc-page.el (erc-message-english-CTCP-PAGE): Define at top level using `defvar'. * lisp/erc/erc-sasl.el (erc-message-english-s902, erc-message-english-s904, erc-message-english-s905, erc-message-english-s906, erc-message-english-s907, erc-message-english-s908): Define at top level using `defvar'. * lisp/erc/erc-sound.el (erc-message-english-CTCP-SOUND): Define using `defvar'. * lisp/erc/erc.el (erc--make-message-variable-name): New function to replace `erc-make-message-variable-name' internally, where most uses previously checked whether the returned variable was bound. This helper now does that conditionally, when asked. (erc-make-message-variable-name): Defer to internal variant, `erc--make-message-variable-name'. (erc-define-catalog-entry, erc-define-catalog): Deprecate. (erc-retrieve-catalog-entry): Refactor to favor `default-toplevel-value' of `erc-current-message-catalog' before falling back to `english'. Not doing this was arguably a bug. (erc-message-english-bad-ping-response, erc-message-english-bad-syntax, erc-message-english-incorrect-args, erc-message-english-cannot-find-file, erc-message-english-cannot-read-file, erc-message-english-connect, erc-message-english-country, erc-message-english-country-unknown, erc-message-english-ctcp-empty, erc-message-english-ctcp-request, erc-message-english-ctcp-request-to, erc-message-english-ctcp-too-many, erc-message-english-flood-ctcp-off, erc-message-english-flood-strict-mode, erc-message-english-disconnected, erc-message-english-disconnected-noreconnect, erc-message-english-reconnecting, erc-message-english-reconnect-canceled, erc-message-english-finished, erc-message-english-terminated, erc-message-english-login, erc-message-english-nick-in-use, erc-message-english-nick-too-long, erc-message-english-no-default-channel, erc-message-english-no-invitation, erc-message-english-no-target, erc-message-english-ops, erc-message-english-ops-none, erc-message-english-undefined-ctcp, erc-message-english-user-mode-redundant-add, erc-message-english-user-mode-redundant-drop, erc-message-english-variable-not-bound, erc-message-english-ACTION, erc-message-english-CTCP-CLIENTINFO, erc-message-english-CTCP-ECHO, erc-message-english-CTCP-FINGER, erc-message-english-CTCP-PING, erc-message-english-CTCP-TIME, erc-message-english-CTCP-UNKNOWN, erc-message-english-CTCP-VERSION, erc-message-english-ERROR, erc-message-english-INVITE, erc-message-english-JOIN, erc-message-english-JOIN-you, erc-message-english-KICK, erc-message-english-KICK-you, erc-message-english-KICK-by-you, erc-message-english-MODE, erc-message-english-MODE-nick, erc-message-english-NICK, erc-message-english-NICK-you, erc-message-english-PART, erc-message-english-PING, erc-message-english-PONG, erc-message-english-QUIT, erc-message-english-TOPIC, erc-message-english-WALLOPS, erc-message-english-s004, erc-message-english-s221, erc-message-english-s252, erc-message-english-s253, erc-message-english-s254, erc-message-english-s275, erc-message-english-s301, erc-message-english-s303, erc-message-english-s305, erc-message-english-s306, erc-message-english-s307, erc-message-english-s311, erc-message-english-s312, erc-message-english-s313, erc-message-english-s314, erc-message-english-s317, erc-message-english-s317-on-since, erc-message-english-s319, erc-message-english-s320, erc-message-english-s321, erc-message-english-s322, erc-message-english-s324, erc-message-english-s328, erc-message-english-s329, erc-message-english-s330, erc-message-english-s331, erc-message-english-s332, erc-message-english-s333, erc-message-english-s341, erc-message-english-s352, erc-message-english-s353, erc-message-english-s367, erc-message-english-s367-set-by, erc-message-english-s368, erc-message-english-s379, erc-message-english-s391, erc-message-english-s396, erc-message-english-s401, erc-message-english-s402, erc-message-english-s403, erc-message-english-s404, erc-message-english-s405, erc-message-english-s406, erc-message-english-s412, erc-message-english-s421, erc-message-english-s431, erc-message-english-s432, erc-message-english-s442, erc-message-english-s445, erc-message-english-s446, erc-message-english-s451, erc-message-english-s461, erc-message-english-s462, erc-message-english-s463, erc-message-english-s464, erc-message-english-s465, erc-message-english-s471, erc-message-english-s473, erc-message-english-s474, erc-message-english-s475, erc-message-english-s481, erc-message-english-s482, erc-message-english-s483, erc-message-english-s484, erc-message-english-s485, erc-message-english-s491, erc-message-english-s501, erc-message-english-s502, erc-message-english-s671): Define at top level using `defvar'. * test/lisp/erc/erc-tests.el (erc-tests--string-to-propertized-parts, erc-tests-pp-propertized-parts, erc--make-message-variable-name, erc-retrieve-catalog-entry): New tests along with utility functions and a convenience command for manipulating catalogs. (Bug#67677) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 4642c742b0f..93437431289 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -425,6 +425,13 @@ Built-in modules can now provide more detailed help for a particular subcommand by telling ERC to defer to a specialized handler. This facility can be opened up to third parties should any one request it. +*** Message-formatting templates in 'notify' renamed. +All templates beginning with the prefix "erc-message-english-notify_" +have been renamed to begin with "erc-message-english-notify-". For +example, the variable 'erc-message-english-notify_current' is now +'erc-message-english-notify_current'. The old names have been +preserved as obsolete aliases. + *** Longtime quasi modules made proper. The 'fill' module is now defined by 'define-erc-module'. The same goes for ERC's imenu integration, which has 'imenu' now appearing in @@ -510,6 +517,11 @@ handling specific "MODE" types and letters in coming releases. If you'd like a say in shaping how this transpires, please share your ideas and use cases on the tracker. +*** A better way to define message-formatting templates. +The functions 'erc-define-catalog-entry' and 'erc-define-catalog' have +been deprecated in favor of 'erc-define-message-format-catalog', a new +macro for defining template "catalogs" at the top level of libraries. + *** Miscellaneous changes Two helper macros from GNU ELPA's Compat library are now available to third-party modules as 'erc-compat-call' and 'erc-compat-function'. diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 8daedf9b019..3b138b394bd 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -506,6 +506,41 @@ erc--with-dependent-type-match (,(widget-get (widget-convert type) :match) w v)) ',(cdr type))) +;; This internal variant exists as a transition aid to avoid +;; immediately having to reflow lengthy definition lists, like the one +;; in erc.el. These sites should switch to using the public macro +;; when undergoing their next major edit. +(defmacro erc--define-catalog (name entries) + "Define `erc-display-message' formatting templates for NAME, a symbol. + +See `erc-define-message-format-catalog' for the meaning of +ENTRIES, an alist. Also see `erc-tests-pp-propertized-parts' in +tests/lisp/erc/erc-tests.el for a convenience command to convert +a literal string into a sequence of `propertize' forms, which +are much easier to review and edit." + (declare (indent 1)) + (let (out) + (dolist (e entries (cons 'progn (nreverse out))) + (push `(defvar ,(intern (format "erc-message-%s-%s" name (car e))) + ,(cdr e) + ,(let* ((first (format "Message template for key `%s'" (car e))) + (last (format "catalog `%s'." name)) + (combined (concat first " in " last))) + (if (< (length combined) 80) + combined + (concat first ".\nFor use with " last)))) + out)))) + +(defmacro erc-define-message-format-catalog (language &rest entries) + "Define message-formatting templates for LANGUAGE, a symbol. +Expect ENTRIES to be pairs of (KEY . FORMAT), where KEY is a +symbol, and FORMAT evaluates to a format string compatible with +`format-spec'. Expect modules that only define a handful of +entries to do so manually, instead of using this macro, so that +the resulting variables will end up with more useful doc strings." + (declare (indent 1)) + `(erc--define-catalog ,language ,entries)) + (provide 'erc-common) ;;; erc-common.el ends here diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index f05ae41fc51..3bcdfb96eb8 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -131,9 +131,8 @@ erc-dcc-open-network-stream (open-network-stream procname buffer addr port :type (and (plist-get entry :secure) 'tls)))) -(erc-define-catalog - 'english - '((dcc-chat-discarded +(erc--define-catalog english + ((dcc-chat-discarded . "DCC: previous chat request from %n (%u@%h) discarded") (dcc-chat-ended . "DCC: chat with %n ended %t: %e") (dcc-chat-no-request . "DCC: chat request from %n not found") diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 5dd11ab1869..076e1f0254b 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -41,7 +41,7 @@ erc-netsplit ;;;###autoload(autoload 'erc-netsplit-mode "erc-netsplit") (define-erc-module netsplit nil "This mode hides quit/join messages if a netsplit occurs." - ((erc-netsplit-install-message-catalogs) + ( ; FIXME delete newline on next edit (add-hook 'erc-server-JOIN-functions #'erc-netsplit-JOIN) (add-hook 'erc-server-MODE-functions #'erc-netsplit-MODE) (add-hook 'erc-server-QUIT-functions #'erc-netsplit-QUIT) @@ -85,13 +85,22 @@ erc-netsplit-list join from that split has been detected or not.") (defun erc-netsplit-install-message-catalogs () + (declare (obsolete "defined at top level in erc-netsplit.el" "30.1")) + (with-suppressed-warnings ((obsolete erc-define-catalog)) ; indentation (erc-define-catalog 'english '((netsplit . "netsplit: %s") (netjoin . "netjoin: %s, %N were split") (netjoin-done . "netjoin: All lost souls are back!") (netsplit-none . "No netsplits in progress") - (netsplit-wholeft . "split: %s missing: %n %t")))) + (netsplit-wholeft . "split: %s missing: %n %t"))))) ; indentation + +(erc-define-message-format-catalog english + (netsplit . "netsplit: %s") + (netjoin . "netjoin: %s, %N were split") + (netjoin-done . "netjoin: All lost souls are back!") + (netsplit-none . "No netsplits in progress") + (netsplit-wholeft . "split: %s missing: %n %t")) (defun erc-netsplit-JOIN (proc parsed) "Show/don't show rejoins." diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index cf7ffbb40d7..1aa5bc34f33 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -30,7 +30,6 @@ ;;; Code: (require 'erc) -(require 'erc-networks) (eval-when-compile (require 'pcomplete)) ;;;; Customizable variables @@ -78,12 +77,14 @@ erc-last-ison-time ;;;; Setup (defun erc-notify-install-message-catalogs () - (erc-define-catalog - 'english - '((notify_current . "Notified people online: %l") - (notify_list . "Current notify list: %l") - (notify_on . "Detected %n on IRC network %m") - (notify_off . "%n has left IRC network %m")))) + (declare (obsolete "defined at top level in erc-notify.el" "30.1")) + (with-suppressed-warnings ((obsolete erc-define-catalog)) + (erc-define-catalog + 'english + '((notify-current . "Notified people online: %l") + (notify-list . "Current notify list: %l") + (notify-on . "Detected %n on IRC network %m") + (notify-off . "%n has left IRC network %m"))))) ;;;###autoload(autoload 'erc-notify-mode "erc-notify" nil t) (define-erc-module notify nil @@ -119,14 +120,14 @@ erc-notify-timer (run-hook-with-args 'erc-notify-signon-hook server (car new-list)) (erc-display-message parsed 'notice proc - 'notify_on ?n (car new-list) ?m (erc-network-name))) + 'notify-on ?n (car new-list) ?m (erc-network-name))) (setq new-list (cdr new-list))) (while old-list (when (not (erc-member-ignore-case (car old-list) ison-list)) (run-hook-with-args 'erc-notify-signoff-hook server (car old-list)) (erc-display-message parsed 'notice proc - 'notify_off ?n (car old-list) ?m (erc-network-name))) + 'notify-off ?n (car old-list) ?m (erc-network-name))) (setq old-list (cdr old-list))) (setq erc-last-ison ison-list) t))) @@ -136,8 +137,8 @@ erc-notify-timer (defun erc-notify-JOIN (proc parsed) "Check if channel joiner is on `erc-notify-list' and not on `erc-last-ison'. -If this condition is satisfied, produce a notify_on message and add the nick -to `erc-last-ison' to prevent any further notifications." +When that's the case, produce a `notify-on' message and add the +nick to `erc-last-ison' to prevent any further notifications." (let ((nick (erc-extract-nick (erc-response.sender parsed)))) (when (and (erc-member-ignore-case nick erc-notify-list) (not (erc-member-ignore-case nick erc-last-ison))) @@ -147,13 +148,13 @@ erc-notify-JOIN nick) (erc-display-message parsed 'notice proc - 'notify_on ?n nick ?m (erc-network-name))) + 'notify-on ?n nick ?m (erc-network-name))) nil)) (defun erc-notify-NICK (proc parsed) "Check if new nick is on `erc-notify-list' and not on `erc-last-ison'. -If this condition is satisfied, produce a notify_on message and add the nick -to `erc-last-ison' to prevent any further notifications." +When that's the case, produce a `notify-on' message and add the +nick to `erc-last-ison' to prevent any further notifications." (let ((nick (erc-response.contents parsed))) (when (and (erc-member-ignore-case nick erc-notify-list) (not (erc-member-ignore-case nick erc-last-ison))) @@ -163,13 +164,13 @@ erc-notify-NICK nick) (erc-display-message parsed 'notice proc - 'notify_on ?n nick ?m (erc-network-name))) + 'notify-on ?n nick ?m (erc-network-name))) nil)) (defun erc-notify-QUIT (proc parsed) "Check if quitter is on `erc-notify-list' and on `erc-last-ison'. -If this condition is satisfied, produce a notify_off message and remove the -nick from `erc-last-ison' to prevent any further notifications." +When that's the case, insert a `notify-off' message and remove +the nick from `erc-last-ison' to prevent further notifications." (let ((nick (erc-extract-nick (erc-response.sender parsed)))) (when (and (erc-member-ignore-case nick erc-notify-list) (erc-member-ignore-case nick erc-last-ison)) @@ -183,7 +184,7 @@ erc-notify-QUIT nick) (erc-display-message parsed 'notice proc - 'notify_off ?n nick ?m (erc-network-name))) + 'notify-off ?n nick ?m (erc-network-name))) nil)) ;;;; User level command @@ -193,6 +194,12 @@ erc-cmd-NOTIFY "Change `erc-notify-list' or list current notify-list members online. Without args, list the current list of notified people online, with args, toggle notify status of people." + (unless erc-notify-mode + (erc-notify-mode +1) + (erc-button--display-error-notice-with-keys + (current-buffer) + "Command /NOTIFY requires the `notify' module. Enabling now. Add `notify'" + " to `erc-modules' before next starting ERC to silence this message.")) (cond ((null args) ;; Print current notified people (online) @@ -202,11 +209,12 @@ erc-cmd-NOTIFY nil 'notice 'active "No ison-list yet!") (erc-display-message nil 'notice 'active - 'notify_current ?l ison)))) + 'notify-current ?l ison)))) ((string= (car args) "-l") - (erc-display-message nil 'notice 'active - 'notify_list ?l (mapconcat #'identity erc-notify-list - " "))) + (let ((list (if erc-notify-list + (mapconcat #'identity erc-notify-list " ") + "(empty)"))) + (erc-display-message nil 'notice 'active 'notify-list ?l list))) (t (while args (if (erc-member-ignore-case (car args) erc-notify-list) @@ -225,23 +233,34 @@ erc-cmd-NOTIFY (setq erc-notify-list (cons (erc-string-no-properties (car args)) erc-notify-list))) (setq args (cdr args))) - (erc-display-message - nil 'notice 'active - 'notify_list ?l (mapconcat #'identity erc-notify-list " ")))) + (erc-cmd-NOTIFY "-l"))) t) -(autoload 'pcomplete-erc-all-nicks "erc-pcomplete") - ;; "--" is not a typo. (declare-function pcomplete--here "pcomplete" (&optional form stub paring form-only)) +(declare-function pcomplete-erc-all-nicks "erc-pcomplete" + (&optional postfix)) ;;;###autoload (defun pcomplete/erc-mode/NOTIFY () - (require 'pcomplete) - (pcomplete-here (pcomplete-erc-all-nicks))) - -(erc-notify-install-message-catalogs) + (require 'erc-pcomplete) + (pcomplete-here (append erc-notify-list (pcomplete-erc-all-nicks)))) + +(define-obsolete-variable-alias 'erc-message-english-notify_on + 'erc-message-english-notify-on "30.1") +(define-obsolete-variable-alias 'erc-message-english-notify_off + 'erc-message-english-notify-off "30.1") +(define-obsolete-variable-alias 'erc-message-english-notify_list + 'erc-message-english-notify-list "30.1") +(define-obsolete-variable-alias 'erc-message-english-notify_current + 'erc-message-english-notify-current "30.1") + +(erc-define-message-format-catalog english + (notify-current . "Notified people online: %l") + (notify-list . "Current notify list: %l") + (notify-on . "Detected %n on IRC network %m") + (notify-off . "%n has left IRC network %m")) (provide 'erc-notify) diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index a94678e5132..2e5974bd22e 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -42,7 +42,8 @@ page "Process CTCP PAGE requests from IRC." nil nil) -(erc-define-catalog-entry 'english 'CTCP-PAGE "Page from %n (%u@%h): %m") +(defvar erc-message-english-CTCP-PAGE "Page from %n (%u@%h): %m" + "English template for a CTCP PAGE message.") (defcustom erc-page-function nil "A function to process a \"page\" request. diff --git a/lisp/erc/erc-sasl.el b/lisp/erc/erc-sasl.el index c6922b1b26b..8ecce7aef31 100644 --- a/lisp/erc/erc-sasl.el +++ b/lisp/erc/erc-sasl.el @@ -305,9 +305,8 @@ erc-sasl--mechanism-offered-p (| eot ","))) (downcase offered))) -(erc-define-catalog - 'english - '((s902 . "ERR_NICKLOCKED nick %n unavailable: %s") +(erc--define-catalog english + ((s902 . "ERR_NICKLOCKED nick %n unavailable: %s") (s904 . "ERR_SASLFAIL (authentication failed) %s") (s905 . "ERR SASLTOOLONG (credentials too long) %s") (s906 . "ERR_SASLABORTED (authentication aborted) %s") diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index 083d72805df..aaa2e059070 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -63,7 +63,8 @@ sound ((remove-hook 'erc-ctcp-query-SOUND-hook #'erc-ctcp-query-SOUND) (define-key erc-mode-map "\C-c\C-s" #'undefined))) -(erc-define-catalog-entry 'english 'CTCP-SOUND "%n (%u@%h) plays %s:%m") +(defvar erc-message-english-CTCP-SOUND "%n (%u@%h) plays %s:%m" + "English template for a CTCP SOUND message.") (defcustom erc-play-sound t "Play sounds when you receive CTCP SOUND requests." diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 62fdc0ad6e8..e39e50a7343 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -8690,24 +8690,38 @@ erc-popup-input-buffer ;;; Message catalog +(define-inline erc--make-message-variable-name (catalog key softp) + "Return variable name conforming to ERC's message-catalog interface. +Given a CATALOG symbol `mycat' and format-string KEY `mykey', +also a symbol, return the symbol `erc-message-mycat-mykey'. With +SOFTP, only do so when defined as a variable." + (inline-quote + (let* ((catname (symbol-name ,catalog)) + (prefix (if (eq ?- (aref catname 0)) "erc--message" "erc-message-")) + (name (concat prefix catname "-" (symbol-name ,key)))) + (if ,softp + (and-let* ((s (intern-soft name)) ((boundp s))) s) + (intern name))))) + (defun erc-make-message-variable-name (catalog entry) "Create a variable name corresponding to CATALOG's ENTRY." - (intern (concat "erc-message-" - (symbol-name catalog) "-" (symbol-name entry)))) + (erc--make-message-variable-name catalog entry nil)) (defun erc-define-catalog-entry (catalog entry format-spec) "Set CATALOG's ENTRY to FORMAT-SPEC." + (declare (obsolete "define manually using `defvar' instead" "30.1")) (set (erc-make-message-variable-name catalog entry) format-spec)) (defun erc-define-catalog (catalog entries) "Define a CATALOG according to ENTRIES." - (dolist (entry entries) - (erc-define-catalog-entry catalog (car entry) (cdr entry)))) + (declare (obsolete erc-define-message-format-catalog "30.1")) + (with-suppressed-warnings ((obsolete erc-define-catalog-entry)) + (dolist (entry entries) + (erc-define-catalog-entry catalog (car entry) (cdr entry))))) -(erc-define-catalog - 'english - '((bad-ping-response . "Unexpected PING response from %n (time %t)") +(erc--define-catalog english + ((bad-ping-response . "Unexpected PING response from %n (time %t)") (bad-syntax . "Error occurred - incorrect usage?\n%c %u\n%d") (incorrect-args . "Incorrect arguments. Usage:\n%c %u\n%d") (cannot-find-file . "Cannot find file %f") @@ -8764,7 +8778,7 @@ erc-define-catalog (MODE-nick . "%n has changed mode for %t to %m") (NICK . "%n (%u@%h) is now known as %N") (NICK-you . "Your new nickname is %N") - (PART . erc-message-english-PART) + (PART . #'erc-message-english-PART) (PING . "PING from server (last: %s sec. ago)") (PONG . "PONG from %h (%i second%s)") (QUIT . "%n (%u@%h) has quit: %r") @@ -8861,19 +8875,20 @@ erc-message-english-PART (defvar-local erc-current-message-catalog 'english) -(defun erc-retrieve-catalog-entry (entry &optional catalog) - "Retrieve ENTRY from CATALOG. - -If CATALOG is nil, `erc-current-message-catalog' is used. - -If ENTRY is nil in CATALOG, it is retrieved from the fallback, -english, catalog." +(defun erc-retrieve-catalog-entry (key &optional catalog) + "Retrieve `format-spec' entry for symbol KEY in CATALOG. +Without symbol CATALOG, use `erc-current-message-catalog'. If +lookup fails, try the latter's `default-toplevel-value' if it's +not the same as CATALOG. Failing that, try the `english' catalog +if yet untried." (unless catalog (setq catalog erc-current-message-catalog)) - (let ((var (erc-make-message-variable-name catalog entry))) - (if (boundp var) - (symbol-value var) - (when (boundp (erc-make-message-variable-name 'english entry)) - (symbol-value (erc-make-message-variable-name 'english entry)))))) + (symbol-value + (or (erc--make-message-variable-name catalog key 'softp) + (let ((default (default-toplevel-value 'erc-current-message-catalog))) + (or (and (not (eq default catalog)) + (erc--make-message-variable-name default key 'softp)) + (and (not (memq 'english (list default catalog))) + (erc--make-message-variable-name 'english key 'softp))))))) (defun erc-format-message (msg &rest args) "Format MSG according to ARGS. diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index e9bca2a3ac3..03879b02347 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -3262,4 +3262,113 @@ define-erc-module--local (put 'erc-mname-enable 'definition-name 'mname) (put 'erc-mname-disable 'definition-name 'mname)))))) +(defun erc-tests--string-to-propertized-parts (string) + "Return a sequence of `propertize' forms for generating STRING. +Expect maintainers manipulating template catalogs to use this +with `pp-eval-last-sexp' or similar to convert back and forth +between literal strings." + `(concat + ,@(mapcar + (pcase-lambda (`(,beg ,end ,plist)) + ;; At the time of writing, `propertize' produces a string + ;; with the order of the input plist reversed. + `(propertize ,(substring-no-properties string beg end) + ,@(let (out) + (while-let ((plist) + (k (pop plist)) + (v (pop plist))) + (push (if (or (consp v) (symbolp v)) `',v v) out) + (push `',k out)) + out))) + (object-intervals string)))) + +(defun erc-tests-pp-propertized-parts (arg) + "Convert literal string before point into a `propertize'd form. +For simplicity, assume string evaluates to itself." + (interactive "P") + (let ((sexp (erc-tests--string-to-propertized-parts (pp-last-sexp)))) + (if arg (insert (pp-to-string sexp)) (pp-eval-expression sexp)))) + +(ert-deftest erc-tests--string-to-propertized-parts () + :tags '(:unstable) ; only run this locally + (unless (>= emacs-major-version 28) (ert-skip "Missing `object-intervals'")) + + (should (equal (erc-tests--string-to-propertized-parts + #("abc" + 0 1 (face default foo 1) + 1 3 (face (default italic) bar "2"))) + '(concat (propertize "a" 'foo 1 'face 'default) + (propertize "bc" 'bar "2" 'face '(default italic))))) + (should (equal #("abc" + 0 1 (face default foo 1) + 1 3 (face (default italic) bar "2")) + (concat (propertize "a" 'foo 1 'face 'default) + (propertize "bc" 'bar "2" 'face '(default italic)))))) + +(ert-deftest erc--make-message-variable-name () + (should (erc--make-message-variable-name 'english 'QUIT 'softp)) + (should (erc--make-message-variable-name 'english 'QUIT nil)) + + (let ((obarray (obarray-make))) + (should-not (erc--make-message-variable-name 'testcat 'testkey 'softp)) + (should (erc--make-message-variable-name 'testcat 'testkey nil)) + (should (intern-soft "erc-message-testcat-testkey" obarray)) + (should-not (erc--make-message-variable-name 'testcat 'testkey 'softp)) + (set (intern "erc-message-testcat-testkey" obarray) "hello world") + (should (equal (symbol-value + (erc--make-message-variable-name 'testcat 'testkey nil)) + "hello world"))) + + ;; Hyphenated (internal catalog). + (let ((obarray (obarray-make))) + (should-not (erc--make-message-variable-name '-testcat 'testkey 'softp)) + (should (erc--make-message-variable-name '-testcat 'testkey nil)) + (should (intern-soft "erc--message-testcat-testkey" obarray)) + (should-not (erc--make-message-variable-name '-testcat 'testkey 'softp)) + (set (intern "erc--message-testcat-testkey" obarray) "hello world") + (should (equal (symbol-value + (erc--make-message-variable-name '-testcat 'testkey nil)) + "hello world")))) + +(ert-deftest erc-retrieve-catalog-entry () + (should (eq 'english erc-current-message-catalog)) + (should (equal (erc-retrieve-catalog-entry 's221) "User modes for %n: %m")) + + ;; Local binding. + (with-temp-buffer + (should (equal (erc-retrieve-catalog-entry 's221) "User modes for %n: %m")) + (setq erc-current-message-catalog 'test) + ;; No catalog named `test'. + (should (equal (erc-retrieve-catalog-entry 's221) "User modes for %n: %m")) + + (let ((obarray (obarray-make))) + (set (intern "erc-message-test-s221") "test 221 val") + (should (equal (erc-retrieve-catalog-entry 's221) "test 221 val")) + (set (intern "erc-message-english-s221") "eng 221 val") + + (let ((erc-current-message-catalog 'english)) + (should (equal (erc-retrieve-catalog-entry 's221) "eng 221 val"))) + + (with-temp-buffer + (should (equal (erc-retrieve-catalog-entry 's221) "eng 221 val")) + (let ((erc-current-message-catalog 'test)) + (should (equal (erc-retrieve-catalog-entry 's221) "test 221 val")))) + + (should (equal (erc-retrieve-catalog-entry 's221) "test 221 val"))) + + (should (equal (erc-retrieve-catalog-entry 's221) "User modes for %n: %m")) + (should (equal erc-current-message-catalog 'test))) + + ;; Default top-level value. + (set-default-toplevel-value 'erc-current-message-catalog 'test-top) + (should (equal (erc-retrieve-catalog-entry 's221) "User modes for %n: %m")) + (set (intern "erc-message-test-top-s221") "test-top 221 val") + (should (equal (erc-retrieve-catalog-entry 's221) "test-top 221 val")) + + (setq erc-current-message-catalog 'test-local) + (should (equal (erc-retrieve-catalog-entry 's221) "test-top 221 val")) + + (makunbound (intern "erc-message-test-top-s221")) + (unintern "erc-message-test-top-s221" obarray)) + ;;; erc-tests.el ends here commit 7c2e02e6d797f2a61e8de951975cba3e27f229da Author: F. Jason Park Date: Sat Dec 9 07:15:32 2023 -0800 Remove module from suggested lineup in ERC's manual * doc/misc/erc.texi (Sample Configuration): Remove `irccontrols' from `erc-modules' because it's already enabled by default. Add `erc-scrolltobottom-all'. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index d7260ffa329..94081b79099 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -1307,10 +1307,10 @@ Sample Configuration (use-package erc :config - ;; Prefer SASL to NickServ, colorize nicknames, interpret mIRC colors, - ;; and list buffers and channel members in separate side panels. + ;; Prefer SASL to NickServ, colorize nicknames, and show side panels + ;; with joined channels and members (setopt erc-modules - (seq-union '(sasl nicks irccontrols bufbar nickbar scrolltobottom) + (seq-union '(sasl nicks bufbar nickbar scrolltobottom) erc-modules)) :custom @@ -1318,6 +1318,8 @@ Sample Configuration (erc-inhibit-multiline-input t) (erc-send-whitespace-lines t) (erc-ask-about-multiline-input t) + ;; Scroll all windows to prompt when submitting input. + (erc-scrolltobottom-all t) ;; Reconnect automatically using a fancy strategy. (erc-server-reconnect-function #'erc-server-delayed-check-reconnect) @@ -1401,13 +1403,13 @@ Sample Configuration via the Customize interface. Start by running @kbd{M-x customize-group @key{RET} erc @key{RET}}, and search for ``Modules'' with @kbd{C-s modules @key{RET}}. Toggle open the flyout menu to -reveal the full ``widget'' panel, a web-form-like interface for ``Erc -Modules''. Tick the boxes for @samp{bufbar}, @samp{irccontrols}, -@samp{nickbar}, @samp{nicks}, @samp{sasl}, and @samp{scrolltobottom}. +reveal the full @dfn{widget} panel, a web-form-like interface for +``Erc Modules''. Tick the boxes for @samp{bufbar}, @samp{nickbar}, +@samp{nicks}, @samp{sasl}, and @samp{scrolltobottom}. Next, search for the phrases ``Erc Ask About Multiline Input'', ``Erc -Inhibit Mulitline Input'', and ``Erc Send Whitespace Lines''. These -are the print names of three Boolean options that control how ERC +Inhibit Multiline Input'', and ``Erc Send Whitespace Lines''. These +are the print names of three boolean options that control how ERC treats prompt input containing line breaks. When visiting each option's section, twirl open its triangle icon to reveal its widget UI, and click its @samp{[Toggle]} button to set its value to @code{t}. @@ -1453,12 +1455,19 @@ Sample Configuration @code{erc-interactive-display}, which lives in the @samp{Erc Buffers} group (@kbd{M-x customize-group @key{RET} erc-buffers @key{RET}}). As its doc string explains, the option controls where new buffers show up -when you do @kbd{M-x erc-tls @key{RET}} or issue certain ``slash'' -commands, like @kbd{/JOIN #emacs-beginners @key{RET}}, at ERC's +when you do @kbd{M-x erc-tls @key{RET}} or issue certain @dfn{slash +commands}, like @kbd{/JOIN #emacs-beginners @key{RET}}, at ERC's prompt. Change its value to the symbol @code{buffer} by choosing @samp{Use current window} (item @kbd{5}) from the option's @samp{[Value Menu]}. Don't forget to save. +If you need more practice, try enabling the boolean option +@code{erc-scrolltobottom-all}, which lives in the @samp{Erc Display} +group (@kbd{M-x customize-group @key{RET} erc-display @key{RET}}). +When enabled, this option tells the @samp{scrolltobottom} module to +adjust all ERC windows instead of just the one you're currently typing +in. + Now it's time to set some key bindings for @code{erc-mode-map}, a major-mode keymap active in all ERC buffers. In general, it's best to do this part either entirely or in conjunction with some lisp code in @@ -1535,8 +1544,8 @@ Sample Configuration @code{erc-track-priority-faces-only} to the @samp{[Value Menu]} choice @samp{all}. Once again, save your changes. -Let's say you'd like to enable a ``local module'' (ERC's version of a -local minor mode) in a specific channel. One way to do that is by +Let's say you'd like to enable a @dfn{local module} (ERC's version of +a local minor mode) in a specific channel. One way to do that is by running some code to activate the module if the channel's name matches. Try that now by customizing the option @code{erc-join-hook}. Add the following in the value field before saving your changes: @@ -1548,7 +1557,7 @@ Sample Configuration (erc-keep-place-indicator-mode +1))) @end lisp -Lastly, if you really want the two ``slash'' commands defined at the +Lastly, if you really want the two @dfn{slash commands} defined at the end of the previous section, you can put them in any file listed in @code{erc-startup-file-list}, such as @file{~/.emacs.d/.ercrc.el}. Make sure to put @code{(require 'erc-track)} near the top of the file. commit 64a4904353f3208e1d16598787c67d146686d011 Merge: 103f36cced3 5ab82229bda Author: Po Lu Date: Mon Dec 18 11:11:35 2023 +0800 Merge remote-tracking branch 'savannah/master' into master-android-1 commit 103f36cced37eed1bb51cd704b0a64b42f7b8144 Author: Po Lu Date: Mon Dec 18 11:10:40 2023 +0800 Enable the new font scaler * src/sfnt.c (sfnt_curve_is_flat): Tighten threshold for flat curves. (sfnt_insert_raster_step): Rewrite loop for clarity. (sfnt_poly_set_steps): New function; fill small spans with a plain unexceptional loop rather than memset. (sfnt_poly_steps): Call that function. (sfnt_verbose, main): Adjust tests such that the scaler can be selected at runtime. * src/sfnt.h: Update prototypes. * src/sfntfont.c (sfntfont_get_glyph_raster) (syms_of_sfntfont) : New variable. diff --git a/src/sfnt.c b/src/sfnt.c index 208d0139022..7d43f06b748 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -3905,11 +3905,11 @@ sfnt_curve_is_flat (struct sfnt_point control0, h.x = endpoint.x - control0.x; h.y = endpoint.y - control0.y; - /* 2.0 is a constant describing the area covered at which point the - curve is considered "flat". */ + /* 1.0 is a constant representing the area covered at which point + the curve is considered "flat". */ return (abs (sfnt_mul_fixed (g.x, h.y) - sfnt_mul_fixed (g.y, h.x)) - <= 0400000); + <= 0200000); } /* Recursively split the splines in the bezier curve formed from @@ -4621,8 +4621,6 @@ #define sfnt_mul(a, b) \ -#ifdef SFNT_EXACT_SCALING - /* Exact coverage scaler. The foregoing routines calculate partial coverage for each pixel by @@ -4910,13 +4908,8 @@ sfnt_insert_raster_step (struct sfnt_step_raster *raster, p_next = &raster->steps[scanline]; - while (true) + while ((step = *p_next)) { - step = *p_next; - - if (!step) - break; - if (step->x > x) break; @@ -4926,7 +4919,8 @@ sfnt_insert_raster_step (struct sfnt_step_raster *raster, p_next = &step->next; } - if (!raster->chunks || raster->chunks->nused == SFNT_BLOCK_STEPS) + if (!raster->chunks + || raster->chunks->nused == SFNT_BLOCK_STEPS) { /* All chunks have been consumed, and consequently a new chunk must be allocated. */ @@ -4989,7 +4983,7 @@ sfnt_fedge_sort (struct sfnt_fedge *edges, size_t size) guarantee that no steps generated extend past WIDTH, steps starting after width might be omitted, and as such it must be accurate. */ -static void +TEST_STATIC void sfnt_poly_edges_exact (struct sfnt_fedge *edges, size_t nedges, size_t height, size_t width, sfnt_step_raster_proc proc, void *dcontext) @@ -5409,6 +5403,45 @@ sfnt_compute_fill (float value) return MIN (value * 255, 255); } +/* Set N pixels at DATA to the value VALUE. If N is large, call + memset; otherwise set this by hand. */ + +static void +sfnt_poly_set_steps (unsigned char *data, int value, int n) +{ + unsigned char *p; + + p = data; + switch (n) + { + case 7: + *p++ = value; + FALLTHROUGH; + case 6: + *p++ = value; + FALLTHROUGH; + case 5: + *p++ = value; + FALLTHROUGH; + case 4: + *p++ = value; + FALLTHROUGH; + case 3: + *p++ = value; + FALLTHROUGH; + case 2: + *p++ = value; + FALLTHROUGH; + case 1: + *p++ = value; + FALLTHROUGH; + case 0: + break; + default: + memset (data, value, n); + } +} + /* Transfer steps generated by sfnt_poly_edges_exact from STEPS to the provided raster RASTER. */ @@ -5438,7 +5471,7 @@ sfnt_poly_steps (struct sfnt_step_raster *steps, xend = MIN (step->x, raster->width); if (fill) - memset (data + x, fill, xend - x); + sfnt_poly_set_steps (data + x, fill, xend - x); total += step->coverage; fill = sfnt_compute_fill (total); @@ -5446,7 +5479,7 @@ sfnt_poly_steps (struct sfnt_step_raster *steps, } if (x < raster->width) - memset (data + x, fill, raster->width - x); + sfnt_poly_set_steps (data + x, fill, raster->width - x); } } @@ -5499,8 +5532,6 @@ sfnt_raster_glyph_outline_exact (struct sfnt_glyph_outline *outline) return data; } -#endif /* SFNT_EXACT_SCALING */ - /* Glyph metrics computation. */ @@ -16464,10 +16495,6 @@ sfnt_read_post_table (int fd, struct sfnt_offset_subtable *subtable) #ifdef TEST -#ifdef SFNT_EXACT_SCALING -#define sfnt_raster_glyph_outline sfnt_raster_glyph_outline_exact -#endif /* SFNT_EXACT_SCALING */ - struct sfnt_test_dcontext { /* Context for sfnt_test_get_glyph. */ @@ -20124,6 +20151,11 @@ sfnt_identify_instruction (struct sfnt_interpreter *interpreter) return buffer; } +/* Function called to rasterize a glyph outline. */ +#define TYPE struct sfnt_glyph_outline * +static struct sfnt_raster *(*test_raster_glyph_outline) (TYPE); +#undef TYPE + static void sfnt_verbose (struct sfnt_interpreter *interpreter) { @@ -20157,7 +20189,7 @@ sfnt_verbose (struct sfnt_interpreter *interpreter) sfnt_coerce_fixed (outline->xmax), sfnt_coerce_fixed (outline->ymax)); - raster = sfnt_raster_glyph_outline (outline); + raster = (*test_raster_glyph_outline) (outline); if (raster) sfnt_test_raster (raster, NULL, 0); @@ -20380,6 +20412,11 @@ main (int argc, char **argv) exit (0); } + if (getenv ("SFNT_EXACT_SCALING")) + test_raster_glyph_outline = sfnt_raster_glyph_outline_exact; + else + test_raster_glyph_outline = sfnt_raster_glyph_outline; + fd = open (argv[1], O_RDONLY); if (fd < 0) @@ -20471,8 +20508,8 @@ main (int argc, char **argv) return 1; } -#define FANCY_PPEM 12 -#define EASY_PPEM 12 +#define FANCY_PPEM 30 +#define EASY_PPEM 30 interpreter = NULL; head = sfnt_read_head_table (fd, font); @@ -20723,7 +20760,7 @@ #define EASY_PPEM 12 xfree (value); - raster = sfnt_raster_glyph_outline (outline); + raster = (*test_raster_glyph_outline) (outline); if (!raster) exit (7); @@ -21028,10 +21065,10 @@ #define EASY_PPEM 12 clock_gettime (CLOCK_THREAD_CPUTIME_ID, &start); - for (i = 0; i < 120; ++i) + for (i = 0; i < 800; ++i) { xfree (raster); - raster = sfnt_raster_glyph_outline (outline); + raster = (*test_raster_glyph_outline) (outline); } clock_gettime (CLOCK_THREAD_CPUTIME_ID, &end); @@ -21116,7 +21153,8 @@ #define FG sfnt_test_free_glyph if (outline) { - raster = sfnt_raster_glyph_outline (outline); + raster + = (*test_raster_glyph_outline) (outline); if (raster) { @@ -21142,7 +21180,7 @@ #define FG sfnt_test_free_glyph printf ("time spent building edges: %lld sec %ld nsec\n", (long long) sub1.tv_sec, sub1.tv_nsec); printf ("time spent rasterizing: %lld sec %ld nsec\n", - (long long) sub2.tv_sec / 120, sub2.tv_nsec / 120); + (long long) sub2.tv_sec / 800, sub2.tv_nsec / 800); xfree (outline); } diff --git a/src/sfnt.h b/src/sfnt.h index a875c1a722d..2ae47ad30ce 100644 --- a/src/sfnt.h +++ b/src/sfnt.h @@ -1512,6 +1512,7 @@ #define PROTOTYPE \ #define PROTOTYPE struct sfnt_glyph_outline * extern struct sfnt_raster *sfnt_raster_glyph_outline (PROTOTYPE); +extern struct sfnt_raster *sfnt_raster_glyph_outline_exact (PROTOTYPE); #undef PROTOTYPE #define PROTOTYPE \ diff --git a/src/sfntfont.c b/src/sfntfont.c index f002712dc10..0a8797bfb3b 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c @@ -2444,7 +2444,11 @@ sfntfont_get_glyph_raster (sfnt_glyph glyph_code, } /* Not already cached. Raster the outline. */ - raster = sfnt_raster_glyph_outline (outline); + + if (!sfnt_raster_glyphs_exactly) + raster = sfnt_raster_glyph_outline (outline); + else + raster = sfnt_raster_glyph_outline_exact (outline); if (!raster) return NULL; @@ -4116,6 +4120,13 @@ syms_of_sfntfont (void) upscaling of glyph outline data. Instruction code is occasionally incompatible with Emacs and must be disregarded. */); Vsfnt_uninstructable_family_regexp = Qnil; + + DEFVAR_BOOL ("sfnt-raster-glyphs-exactly", sfnt_raster_glyphs_exactly, + doc: /* How font glyph outlines should be converted to graphics. +If non-nil, glyphs will be displayed in a more precise manner, at the +cost of performance on devices where floating-point math operations +are slow. */); + sfnt_raster_glyphs_exactly = true; } void commit 5ab82229bdad1519e8642c9348577f5ef0f2cd85 Author: Dmitry Gutov Date: Mon Dec 18 04:43:21 2023 +0200 ; Improve a recent NEWS entry diff --git a/etc/NEWS b/etc/NEWS index 0710bb768d2..90ff23b7937 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -482,7 +482,10 @@ When a fileset's VC change history ('C-x v l') ends at a rename, we now print the old name(s) and a button which jumps to their history. Git and Hg are supported. Naturally, 'vc-git-print-log-follow' should be nil for this to work (or '--follow' should not be in -'vc-hg-print-log-switches', in Hg's case). +'vc-hg-print-log-switches', in Hg's case). Unlike when the '--follow' +switch is used, commands to see the diff of the old revision ('d'), +check out an old file version ('f') or annotate it right away ('a'), +also work on revisions which precede renames. *** New option 'vc-git-file-name-changes-switches'. It allows tweaking the thresholds for rename and copy detection. commit 4fc2fcb37d62748ef5fbaeddde91447de69bf2a6 Author: Stefan Kangas Date: Sun Dec 17 18:59:38 2023 +0100 ; Document sending extra HTTP headers in NEWS * etc/NEWS: Note how to send email address in HTTP requests. This change was requested in: https://lists.gnu.org/r/emacs-devel/2023-12/msg00500.html diff --git a/etc/NEWS b/etc/NEWS index d3521633a5f..0710bb768d2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -73,9 +73,13 @@ more details. Emacs never sent email addresses by default, but it used to be possible to customize 'url-privacy-level' so that the users email address was sent along in HTTP requests. This feature has now been -removed, as it was considered more risky than useful. The user option +removed, as it was considered more dangerous than useful. RFC 9110 +(§ 10.1.2) also recommends against it. The user option 'url-personal-mail-address' is now also obsolete. +To send an email address in the header of individual HTTP requests, +see the variable `url-request-extra-headers'. + * Changes in Emacs 30.1 commit 678a594f4f3ddd24a46253d77237580fe4db9fc1 Author: Po Lu Date: Sun Dec 17 20:55:23 2023 +0800 * src/sfnt.h (sfnt_coerce_fixed): New macro. diff --git a/src/sfnt.h b/src/sfnt.h index 42ae64c362b..a875c1a722d 100644 --- a/src/sfnt.h +++ b/src/sfnt.h @@ -123,6 +123,7 @@ #define SFNT_ENDOF(type, field, type1) \ typedef uint16_t sfnt_ufword; #define sfnt_coerce_fixed(fixed) ((sfnt_fixed) (fixed) / 65535.0) +#define sfnt_fixed_float(fixed) ((sfnt_fixed) (fixed) / 65535.0f) typedef unsigned int sfnt_glyph; typedef unsigned int sfnt_char; @@ -778,7 +779,7 @@ #define sfnt_coerce_fixed(fixed) ((sfnt_fixed) (fixed) / 65535.0) /* X position, top and bottom of edges. */ sfnt_fixed x, top, bottom; - /* Amount to move X by upon each change of Y. */ + /* Amount to move X by upon each change of Y, and vice versa. */ sfnt_fixed step_x; }; commit 8e10aad3ab4f28d3ff99e04f352d561089d6f8f9 Author: Po Lu Date: Sun Dec 17 20:54:56 2023 +0800 ; * src/sfnt.c: Fix typos. diff --git a/src/sfnt.c b/src/sfnt.c index 441c810bd76..208d0139022 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -4637,8 +4637,8 @@ #define sfnt_mul(a, b) \ generating at length an array of scanlines, in which each is represented by a list of steps. Each step holds an X coordinate and a coverage value, which contributes to the coverage of each - pixel within the scanline leftwards or equal to the pixel with its - X coordinate within. + pixel within the scanline rightwards or equal to the pixel with its + X coordinate. Such a coverage value can be positive or negative; when the winding direction of the span it derives from is positive, so is the commit 6f14fc5f3d4f6de489de3079f3dc3ff486b270c6 Author: Po Lu Date: Sun Dec 17 20:51:54 2023 +0800 Introduce the rudiments of a new font rasterizer * src/sfnt.c (xzalloc): New function. (sfnt_poly_edges): Remove redundant statement. (sfnt_add, sfnt_sub, sfnt_mul): Move macro definitions above the new scaler. (sfnt_build_outline_fedges, sfnt_insert_raster_step) (sfnt_fedge_sort, sfnt_poly_edges_exact, sfnt_compute_fill) (sfnt_poly_steps, sfnt_raster_steps, sfnt_raster_edges_exact) (sfnt_raster_glyph_outline_exact): New functions, presently disabled. (sfnt_x_raster, main): Introduce new tests. diff --git a/src/sfnt.c b/src/sfnt.c index f9ffc86da58..441c810bd76 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -67,6 +67,19 @@ xmalloc (size_t size) return ptr; } +MAYBE_UNUSED static void * +xzalloc (size_t size) +{ + void *ptr; + + ptr = calloc (1, size); + + if (!ptr) + abort (); + + return ptr; +} + static void * xrealloc (void *ptr, size_t size) { @@ -4211,7 +4224,6 @@ sfnt_build_outline_edges (struct sfnt_glyph_outline *outline, /* Compute the step X. This is how much X changes for each increase in Y. */ - step_x = sfnt_div_fixed (dx, dy); edges[edge].next = NULL; @@ -4301,7 +4313,6 @@ sfnt_poly_edges (struct sfnt_edge *edges, size_t size, /* Step down line by line. Find active edges. */ y = edges[0].bottom; - active = 0; active = NULL; e = 0; @@ -4599,6 +4610,899 @@ sfnt_raster_glyph_outline (struct sfnt_glyph_outline *outline) +#define sfnt_add(a, b) \ + ((int) ((unsigned int) (a) + (unsigned int) (b))) + +#define sfnt_sub(a, b) \ + ((int) ((unsigned int) (a) - (unsigned int) (b))) + +#define sfnt_mul(a, b) \ + ((int) ((unsigned int) (a) * (unsigned int) (b))) + + + +#ifdef SFNT_EXACT_SCALING + +/* Exact coverage scaler. + + The foregoing routines calculate partial coverage for each pixel by + increasing each span in increments finer than a single pixel, then + merging active spans into the raster. + + Experience has proven this yields imperfect display results, + particularly when combined with glyph instruction code which aligns + points in a certain and as yet undetermined manner. + + The scaler implemented in this page attains greater precision, + generating at length an array of scanlines, in which each is + represented by a list of steps. Each step holds an X coordinate + and a coverage value, which contributes to the coverage of each + pixel within the scanline leftwards or equal to the pixel with its + X coordinate within. + + Such a coverage value can be positive or negative; when the winding + direction of the span it derives from is positive, so is the + coverage value, that the pixels to its right (thus further into the + polygon it demarcates) might be painted in. In the other case, the + value is negative, thus negating the effect of preceding steps and + marking the outer boundary of the section of the polygon's + intersection with the scanline. + + The procedure for producing this array of scanlines is largely an + adaptation of that which sfnt_poly_edges implements; in particular + the process of sorting and filtering edges remains untouched. + + Rather than advancing through the edges SFNT_POLY_STEP at a time, + the edges are iterated over scanline-by-scanline. Every edge + overlapping with a particular scanline is considered piecemeal to + generate its array of steps. + + An edge might overlap pixels within the scanline in one of four + fashions; each is illustrated with a graphic below: + + +--------ee-----+------------------------------------------------+ (I) + | ee.......|................................................| + | ee.........|................................................| + | ee...........|................................................| + |ee.............|................................................| + ee---------------+------------------------------------------------+ + + In this instance, the edge partially overlaps its first pixel, but + the remainder all receive complete coverage. + + +---------------+---------eeeeee+--------------------------------+ (II) + | | eeeeee......|................................| + | eeeee............|................................| + | eeeeee.|...............|................................| + | eeeeee.......|...............|................................| + eee-------------+---------------+--------------------------------+ + + In this instance, the edge partially overlaps two or more pixels on + this scanline. These pixels are referred to as a run. + + +---------------+---------------+----------------+---------------+ (III) + | eeeeeee.|...............|................|...............| + | eeeeeeee..|...............|................|...............| + | eeeeeeee....|...............|................|...............| + | eeeeeee......|...............|................|...............| + +---------------+---------------+----------------+---------------+ + + This instance is much like the first instance, save that the + covered vertical area does not span the entire scanline. + + +---------------+---------------+----------------+---------------+ (IV) + | | | | eeeeeeeeeee...| + | | eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...| + | eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee|...............| + |eeeeeeeeeeeeeeeeeeeeeee........|................|...............| + +---------------+---------------+----------------+---------------+ + + And this the second, again with the same distinction therefrom. + + In each of these instances, a trapezoid is formed within every + pixel of the scanline, between: + + - The point of the span's entry into the first pixel, either that + point itself or, for subsequent pixels, its projection onto + those pixels. + + - The point of the span's exit or its termination. + + - Both those points projected into the outer boundary of the + pertinent pixel. + + The proportion formed by the area of this trapezoid and that of the + pixel then constitutes the coverage value to be recorded. */ + +/* Structure representing a step, as above. */ + +struct sfnt_step +{ + /* The next step in this list. */ + struct sfnt_step *next; + + /* X coordinate of the step. This value affects all pixels at and + beyond this X coordinate. */ + int x; + + /* Coverage value between -1 and 1. */ + float coverage; +}; + +/* Structure representing an array of steps, one for each + scanline. */ + +struct sfnt_step_raster +{ + /* Number of scanlines within this raster. */ + size_t scanlines; + + /* Array of steps with one element for each scanline. */ + struct sfnt_step **steps; + + /* Linked list of chunks of steps allocated for this raster. */ + struct sfnt_step_chunk *chunks; +}; + +enum + { + SFNT_BLOCK_STEPS = 128, + }; + +/* Structure representing a block of steps, which are allocated + SFNT_BLOCK_STEPS at a time. */ + +struct sfnt_step_chunk +{ + /* The next chunk in this list, or NULL. */ + struct sfnt_step_chunk *next; + + /* Number of steps used within this chunk thus far. */ + size_t nused; + + /* The steps themselves. */ + struct sfnt_step steps[SFNT_BLOCK_STEPS]; +}; + +/* Structure representing an edge as consumed by the exact coverage + scaler. This structure is much like struct sfnt_edge, albeit with + all fractionals replaced by floating point numbers and an extra + field holding a Y delta. */ + +struct sfnt_fedge +{ + /* Next edge in this chain. */ + struct sfnt_fedge *next; + + /* Winding direction. 1 if clockwise, -1 if counterclockwise. */ + int winding; + + /* X position, top and bottom of edges. */ + float x, top, bottom; + + /* Amount to move X by upon each change of Y, and vice versa. */ + float step_x, step_y; +}; + +typedef void (*sfnt_fedge_proc) (struct sfnt_fedge *, size_t, + void *); + +/* Build a list of edges for each contour in OUTLINE, displacing each + edge by xmin and ymin. Call EDGE_PROC with DCONTEXT and the edges + produced as arguments. */ + +static void +sfnt_build_outline_fedges (struct sfnt_glyph_outline *outline, + sfnt_fedge_proc edge_proc, void *dcontext) +{ + struct sfnt_fedge *edges; + size_t i, edge, next_vertex; + sfnt_fixed dx, dy, step_x, step_y, ymin, xmin; + size_t top, bottom; + + edges = alloca (outline->outline_used * sizeof *edges); + edge = 0; + + /* ymin and xmin must be the same as the offset used to set offy and + offx in rasters. */ + ymin = sfnt_floor_fixed (outline->ymin); + xmin = sfnt_floor_fixed (outline->xmin); + + for (i = 0; i < outline->outline_used; ++i) + { + /* Set NEXT_VERTEX to the next point (vertex) in this contour. + + If i is past the end of the contour, then don't build edges + for this point. */ + next_vertex = i + 1; + + if (next_vertex == outline->outline_used + || !(outline->outline[next_vertex].flags + & SFNT_GLYPH_OUTLINE_LINETO)) + continue; + + /* Skip past horizontal vertices. */ + if (outline->outline[next_vertex].y == outline->outline[i].y) + continue; + + /* Figure out the winding direction. */ + if (outline->outline[next_vertex].y < outline->outline[i].y) + /* Vector will cross imaginary ray from its bottom from the + left of the ray. Winding is thus 1. */ + edges[edge].winding = 1; + else + /* Moving clockwise. Winding is thus -1. */ + edges[edge].winding = -1; + + /* Figure out the top and bottom values of this edge. If the + next edge is below, top is here and bot is the edge below. + If the next edge is above, then top is there and this is the + bottom. */ + + if (outline->outline[next_vertex].y < outline->outline[i].y) + { + /* End of edge is below this one (keep in mind this is a + cartesian coordinate system, so smaller values are below + larger ones.) */ + top = i; + bottom = next_vertex; + } + else + { + /* End of edge is above this one. */ + bottom = i; + top = next_vertex; + } + + /* Record the edge. Rasterization happens from bottom to + up, so record the X at the bottom. */ + dx = (outline->outline[top].x - outline->outline[bottom].x); + dy = abs (outline->outline[top].y + - outline->outline[bottom].y); + + /* Compute the step X. This is how much X changes for each + increase in Y. */ + step_x = sfnt_div_fixed (dx, dy); + + /* And the step Y, which is the amount of movement to Y an + increase in X will incur. */ + step_y = dx ? sfnt_div_fixed (dy, dx) : 0; + + /* Save information computed above into the edge. */ + edges[edge].top + = sfnt_fixed_float (outline->outline[top].y - ymin); + edges[edge].bottom + = sfnt_fixed_float (outline->outline[bottom].y - ymin); + edges[edge].x + = sfnt_fixed_float (outline->outline[bottom].x - xmin); + edges[edge].step_x = sfnt_fixed_float (step_x); + edges[edge].step_y = sfnt_fixed_float (step_y); + edges[edge].next = NULL; + + /* Increment the edge index. */ + edge++; + } + + if (edge) + edge_proc (edges, edge, dcontext); +} + +typedef void (*sfnt_step_raster_proc) (struct sfnt_step_raster *, void *); + +/* Append a step with the supplied COVERAGE at X to the sorted list of + scanline steps within the container RASTER. Y is the scanline to + append to. */ + +static void +sfnt_insert_raster_step (struct sfnt_step_raster *raster, + int x, float coverage, size_t scanline) +{ + struct sfnt_step_chunk *chunk; + struct sfnt_step *step, **p_next; + + if (scanline >= raster->scanlines) + return; + + if (x < 0) + x = 0; + + /* Search within RASTER->steps[scanline] for a step at X. */ + + p_next = &raster->steps[scanline]; + + while (true) + { + step = *p_next; + + if (!step) + break; + + if (step->x > x) + break; + + if (step->x == x) + goto found; + + p_next = &step->next; + } + + if (!raster->chunks || raster->chunks->nused == SFNT_BLOCK_STEPS) + { + /* All chunks have been consumed, and consequently a new chunk + must be allocated. */ + chunk = xmalloc (sizeof *chunk); + chunk->next = raster->chunks; + chunk->nused = 0; + raster->chunks = chunk; + } + else + chunk = raster->chunks; + + step = &chunk->steps[chunk->nused++]; + step->next = *p_next; + *p_next = step; + step->x = x; + step->coverage = 0; + + found: + step->coverage += coverage; +} + +/* Sort an array of SIZE edges to increase by bottom Y position, in + preparation for building spans. + + Insertion sort is used because there are usually not very many + edges, and anything larger would bloat up the code. */ + +static void +sfnt_fedge_sort (struct sfnt_fedge *edges, size_t size) +{ + ssize_t i, j; + struct sfnt_fedge edge; + + for (i = 1; i < size; ++i) + { + edge = edges[i]; + j = i - 1; + + /* Comparing truncated values yields a faint speedup, for not as + many edges must be moved as would be otherwise. */ + while (j >= 0 && ((int) edges[j].bottom + > (int) edge.bottom)) + { + edges[j + 1] = edges[j]; + j--; + } + + edges[j + 1] = edge; + } +} + +/* Draw EDGES, an unsorted array of polygon edges of size NEDGES. + + Transform EDGES into an array of steps representing a raster with + HEIGHT scanlines, then call POLY_FUNC with DCONTEXT and the + resulting struct sfnt_step_raster to transfer it onto an actual + raster. + + WIDTH must be the width of the raster. Although there is no + guarantee that no steps generated extend past WIDTH, steps starting + after width might be omitted, and as such it must be accurate. */ + +static void +sfnt_poly_edges_exact (struct sfnt_fedge *edges, size_t nedges, + size_t height, size_t width, + sfnt_step_raster_proc proc, void *dcontext) +{ + int y; + size_t size, e; + struct sfnt_fedge *active, **prev, *a; + struct sfnt_step_raster raster; + struct sfnt_step_chunk *next, *last; + + if (!height) + return; + + /* Sort edges to ascend by Y-order. Once again, remember: cartesian + coordinates. */ + sfnt_fedge_sort (edges, nedges); + + /* Step down line by line. Find active edges. */ + + y = sfnt_floor_fixed (MAX (0, edges[0].bottom)); + e = 0; + active = NULL; + + /* Allocate the array of edges. */ + + raster.scanlines = height; + raster.chunks = NULL; + + if (!INT_MULTIPLY_OK (height, sizeof *raster.steps, &size)) + abort (); + + raster.steps = xzalloc (size); + + for (; y != height; y += 1) + { + /* Add in new edges keeping them sorted. */ + for (; e < nedges && edges[e].bottom < y + 1; ++e) + { + if (edges[e].top > y) + { + /* Find where to place this edge. */ + for (prev = &active; (a = *prev); prev = &(a->next)) + { + if (a->x > edges[e].x) + break; + } + + edges[e].next = *prev; + *prev = &edges[e]; + } + } + + /* Iterate through each active edge, appending steps for it, and + removing it if it does not overlap with the next + scanline. */ + + for (prev = &active; (a = *prev);) + { + float x_top, x_bot, x_min, x_max; + float y_top, y_bot; + int x_pixel_min, x_pixel_max; + +#define APPEND_STEP(x, coverage) \ + sfnt_insert_raster_step (&raster, x, coverage, y); + + /* Calculate several values to establish which overlap + category this edge falls into. */ + + y_top = y + 1; /* Topmost coordinate covered by this + edge in this scanline. */ + y_bot = y; /* Bottom-most coordinate covered by this + edge in this scanline. */ + + /* III or IV? If the edge terminates before the next + scanline, make its terminus y_top. */ + + if (y_top > a->top) + y_top = a->top; + + /* Same goes for y_bottom. */ + + if (a->bottom > y_bot) + y_bot = a->bottom; + + /* y_top should never equal y_bottom, but check to be on the + safe side. */ + if (y_top == y_bot) + goto next; + + /* x_top and x_bot are the X positions where the edge enters + and exits this scanline. */ + + /* + (x_top) + +--------ee-----+------------------------------------------------+ (y_top) + | ee.......|................................................| + | ee.........|................................................| + | ee...........|................................................| + |ee.............|................................................| + ee---------------+------------------------------------------------+ (y_bot) +(x_bot) + (y_bot might be further below.) + */ + + x_top = (y_top - a->bottom) * a->step_x + a->x; + x_bot = (y_bot - a->bottom) * a->step_x + a->x; + + x_min = MIN (x_top, x_bot); + x_max = MAX (x_top, x_bot); + + /* Pixels containing x_bot and x_top respectively. */ + x_pixel_min = (int) (x_min); + x_pixel_max = (int) (x_max); + +#define TRAPEZOID_AREA(height, top_start, top_end, bot_start, bot_end) \ + ((((float) (top_end) - (top_start)) \ + + ((float) (bot_end) - (bot_start))) \ + / 2.0f * (float) (height)) + + /* I, III? These two instances' criteria are that the edge + enters and exits within one pixel. */ + + if (x_pixel_min == x_pixel_max) + { + float xmin, xmax, ytop, ybot, height; + float coverage, delta; + + /* Partial coverage for the first pixel. */ + + xmin = (x_min); + xmax = (x_max); + ytop = (y_top); + ybot = (y_bot); + height = ytop - ybot; + + /* The trapezoid here is one of the following two: + + ytop+------xmax--+-----------+---------------------------------------------+ + | /................................................................| + | /.......|...........|.............................................| + | /........|...........|.............................................| + | /.........|...........|.............................................| + | / ...................................................................| + xmin+------------+-----------+---------------------------------------------+ + ybot + ytop+------------+-----------+---------------------------------------------+ + |\ xmin................................................................| + | \..........|...........|.............................................| + | \.........|...........|.............................................| + | \........|...........|.............................................| + | \.......|...........|.............................................| + | \................................................................| + +------xmax--+-----------+---------------------------------------------+ + + In either situation, the first pixel's coverage is + the space occupied by a trapezoid whose corners are + xmin and x_pixel_min + 1 and xmax and x_pixel_min + + 1, and whose height is ytop - ybot. The coverage for + the remainder is the height alone. */ + + coverage = (TRAPEZOID_AREA (height, + xmin, (int) xmin + 1, + xmax, (int) xmax + 1) + * a->winding); + APPEND_STEP (x_pixel_min, coverage); + + /* Then if the next pixel isn't beyond the raster, + append complete coverage for it. */ + + if (x_pixel_min + 1 < width) + { + delta = (y_top - y_bot) * a->winding; + APPEND_STEP (x_pixel_max + 1, delta - coverage); + } + } + else + { + float dy, y_crossing, coverage; + float ytop, ybot, xtop, xbot, increment; + float x, last, here; + + ytop = (y_top); + ybot = (y_bot); + xtop = (x_top); + xbot = (x_bot); + +#define TRIANGLE_AREA(width, height) \ + ((width) * (height) / 2.0f) + + /* II, IV. Coverage must be computed for each pixel + from x_pixel_min to x_pixel_max, with the latter + treated much as in I or III. */ + + if (x_bot < x_top) + { + /* + + + y_top x_top + +-----------+-----------+-----------+------------+-------/------+-------------------------------+ + | | | | | /--.......|...............................| + |x_pixel_min| | | | /--..........|...............................| + | | | | /+-y_crossing...|...............................| + | | | | /--.|..............|...............................| + | | | | /-....|..............|...............................| + | | | | /--......|..x_pixel_max.|...............................| + | | | |/--.........|..............|...............................| + | | | /-+............|..............|...............................| + | | | /--..|............|..............|...............................| + | | | /--.....|............|..............|...............................| + | | |/--........|............|..............|...............................| + | | /-+...........|............|..............|...............................| + | | /--..|...........|............|..............|...............................| + | | /--.....|...........|............|..............|...............................| + | | /-........|...........|............|..............|...............................| + | /+-y_crossing|...........|............|..............|...............................| + | /--.|...........|...........|............|..............|...............................| + | /--....|...........|...........|............|..............|...............................| + | /--.......|...........|...........|............|..............|...............................| + +-----------+-----------+-----------+------------+--------------+-------------------------------+ + y_bot x_bot + + +The purpose of this code is to calculate the area occupied by dots of +each pixel in between x_pixel_min and x_pixel_max + 1. + +The area occupied in the first pixel is a triangle comprising [x_bot, +y_bot], [x_bot + 1, y_bot], and [x_bot + 1, y_crossing]. + +The area occupied in the second pixel through x_pixel_max - 1 is that +of a rectangle comprising [y_bot, pixel], [the previous rectangle's +y_crossing, pixel], [the previous rectangle's y_crossing, pixel + 1], +and [pixel + 1, y_bot] summed with the area the remaining triangle. + +The area occupied in the last pixel is a trapezoid proper. + +Thus the procedure is roughly as follows: dy is computed, which is the +increase to the Y of the edge for each increase in scanline X. */ + + dy = a->step_y; + + /* As is y_crossing for the first pixel. */ + y_crossing = ybot + dy * ((int) xbot + 1 - xbot); + + /* And the area of the first triangle. + + The width is (int) xbot + 1 - xbot, and the + height is y_crossing - ybot. */ + last = ((TRIANGLE_AREA (y_crossing - ybot, + (int) xbot + 1 - xbot)) + * a->winding); + APPEND_STEP (x_pixel_min, last); + + /* Coverage value for subsequent rectangles. The + value set here is for the next pixel, which is + filled from ybot to y_crossing. */ + + coverage = (y_crossing - ybot) * a->winding; + increment = dy * a->winding; + + for (x = x_pixel_min + 1; x < x_pixel_max; x++) + { + here = coverage + increment / 2; + APPEND_STEP (x, here - last); + last = here; + coverage += increment; + } + + /* The y_crossing for the last pixel. */ + y_crossing = ybot + dy * ((int) xtop - xbot); + + /* And calculate the area of the trapezoid in the + last pixel. */ + + coverage += a->winding * TRAPEZOID_AREA (ytop - y_crossing, + xtop, + (int) xtop + 1, + (int) xtop, + (int) xtop + 1); + here = coverage; + APPEND_STEP (x_pixel_max, here - last); + last = here; + + /* Fill the remainder of the scanline with + height-derived coverage. */ + + if (x_pixel_max < width) + APPEND_STEP (x_pixel_max, ((y_top - y_bot) + * a->winding - last)); + } + else /* if (x_bot > x_top) */ + { + /* + + y_top x_top + +----------------+----------------+-----------------+-----------------+-----------------------------+ + | \--........|................|.................|.................|.............................| + | \--.....|................|.................|.................|.............................| + | \--..|................|.................|.................|.............................| + | \-+.y_crossing.....|.................|.................|.............................| + | |\--.............|.................|.................|.............................| + | | \--..........|.................|.................|.............................| + | x_pixel_min | \---......|.................|.................|.............................| + | | \--...|.................|.................|.............................| + | | \--|y_crossing.......|.................|.............................| + | | \--...............|.................|.............................| + | | | \--............|.................|.............................| + | | | \--.........|.................|.............................| + | | | \--......|.................|.............................| + +----------------+----------------+-----------\-----+-----------------+-----------------------------+ + y_bot x_bot + +Whereas in this situation the trapezoid is inverted, and the code must +be as well. */ + + /* The edge's Y decreases as the edge's X increases, + yielding a negative a->step_x. */ + dy = a->step_y; + + /* Calculate y_crossing for the first pixel. */ + y_crossing = ytop + dy * ((int) xtop + 1 - xtop); + + /* And the area of the first triangle. */ + last = ((TRIANGLE_AREA ((int) xtop + 1 - xtop, + ytop - y_crossing)) + * a->winding); + APPEND_STEP (x_pixel_min, last); + + /* Coverage value for subsequent rectangles. The + value set here is for the next pixel, which is + filled from ytop to y_crossing. */ + coverage = (ytop - y_crossing) * a->winding; + increment = -dy * a->winding; + + for (x = x_pixel_min + 1; x < x_pixel_max; x ++) + { + here = coverage + increment / 2; + APPEND_STEP (x, here - last); + last = here; + coverage += increment; + } + + /* The y_crossing for the last pixel. */ + y_crossing = ytop + dy * ((int) xbot - xtop); + + /* And calculate the area of the trapezoid in the + last pixel. */ + + coverage += a->winding * TRAPEZOID_AREA (y_crossing - ybot, + (int) xbot, + (int) xbot + 1, + xbot, + (int) xbot + 1); + here = coverage; + APPEND_STEP (x_pixel_max, here - last); + last = here; + + /* Fill the remainder of the scanline with + height-derived coverage. */ + + if (x_pixel_max + 1 < width) + APPEND_STEP (x_pixel_max + 1, ((y_top - y_bot) + * a->winding - last)); + } + +#undef TRIANGLE_AREA + } + +#undef APPEND_STEP +#undef TRAPEZOID_AREA + + /* When an edge is created, its a->bottom (and by extension + a->y) is not aligned to a->x. Since this iteration can + only affect the scan line Y, align a to the next + scanline, that the next iteration of this loop to + consider it might consider its entire intersection. */ + a->x += a->step_x * (y + 1 - a->bottom); + a->bottom = y + 1; + next: + + if (a->top < y + 1) + *prev = a->next; + else + prev = &a->next; + } + + /* Break if all is done. */ + if (!active && e == nedges) + break; + } + + (*proc) (&raster, dcontext); + xfree (raster.steps); + + /* Free each block of steps allocated. */ + next = raster.chunks; + while (next) + { + last = next; + next = next->next; + xfree (last); + } + +#undef ONE_PIXEL +} + +/* Apply winding rule to the coverage value VALUE. Convert VALUE to a + number between 0 and 255. If VALUE is negative, invert it. If it + exceeds 255 afterwards, truncate it to 255. */ + +static int +sfnt_compute_fill (float value) +{ + if (value < 0) + value = -value; + + return MIN (value * 255, 255); +} + +/* Transfer steps generated by sfnt_poly_edges_exact from STEPS to the + provided raster RASTER. */ + +static void +sfnt_poly_steps (struct sfnt_step_raster *steps, + struct sfnt_raster *raster) +{ + int y; + unsigned char *data; + int x, xend, fill; + float total; + struct sfnt_step *step; + + y = 0; /* This y is an X-style coordinate in RASTER's space. + + Its counterpart array of steps is STEPS->steps[ + raster->height - y - 1]. */ + data = raster->cells; + + for (y = 0; y < raster->height; ++y, data += raster->stride) + { + fill = total = x = 0; + + for (step = steps->steps[raster->height - y - 1]; + step && x < raster->width; step = step->next) + { + xend = MIN (step->x, raster->width); + + if (fill) + memset (data + x, fill, xend - x); + + total += step->coverage; + fill = sfnt_compute_fill (total); + x = xend; + } + + if (x < raster->width) + memset (data + x, fill, raster->width - x); + } +} + +/* Poly each edge in EDGES onto the raster supplied in DCONTEXT. */ + +static void +sfnt_raster_steps (struct sfnt_step_raster *steps, void *dcontext) +{ + sfnt_poly_steps (steps, dcontext); +} + +/* Call sfnt_poly_edges_exact with suitable arguments for polying + EDGES onto DCONTEXT, a raster structure. */ + +static void +sfnt_raster_edges_exact (struct sfnt_fedge *edges, size_t size, + void *dcontext) +{ + struct sfnt_raster *raster; + + raster = dcontext; + sfnt_poly_edges_exact (edges, size, raster->height, + raster->width, sfnt_raster_steps, + dcontext); +} + +/* Generate an alpha mask for the glyph outline OUTLINE by means of + the exact coverage scaler. Value is the alpha mask upon success, + NULL upon failure. */ + +TEST_STATIC struct sfnt_raster * +sfnt_raster_glyph_outline_exact (struct sfnt_glyph_outline *outline) +{ + struct sfnt_raster raster, *data; + + /* Get the raster parameters. */ + sfnt_prepare_raster (&raster, outline); + + /* Allocate the raster data. */ + data = xmalloc (sizeof *data + raster.stride * raster.height); + *data = raster; + data->cells = (unsigned char *) (data + 1); + memset (data->cells, 0, raster.stride * raster.height); + + /* Generate edges for the outline, polying each array of edges to + the raster. */ + sfnt_build_outline_fedges (outline, sfnt_raster_edges_exact, data); + + /* All done. */ + return data; +} + +#endif /* SFNT_EXACT_SCALING */ + + + /* Glyph metrics computation. */ /* Read an hmtx table from the font FD, using the table directory @@ -5860,15 +6764,6 @@ #define CHECK_PREP() \ TRAP ("instruction executed not valid" \ " outside control value program") \ -#define sfnt_add(a, b) \ - ((int) ((unsigned int) (a) + (unsigned int) (b))) - -#define sfnt_sub(a, b) \ - ((int) ((unsigned int) (a) - (unsigned int) (b))) - -#define sfnt_mul(a, b) \ - ((int) ((unsigned int) (a) * (unsigned int) (b))) - /* Register, alu and logic instructions. */ @@ -15569,6 +16464,10 @@ sfnt_read_post_table (int fd, struct sfnt_offset_subtable *subtable) #ifdef TEST +#ifdef SFNT_EXACT_SCALING +#define sfnt_raster_glyph_outline sfnt_raster_glyph_outline_exact +#endif /* SFNT_EXACT_SCALING */ + struct sfnt_test_dcontext { /* Context for sfnt_test_get_glyph. */ @@ -15963,7 +16862,7 @@ sfnt_x_raster (struct sfnt_raster **rasters, ascent = sfnt_mul_fixed (hhea->ascent * 65536, scale) / 65536; - origin = 0; + origin = 5; for (i = 0; i < nrasters; ++i) { @@ -19572,8 +20471,8 @@ main (int argc, char **argv) return 1; } -#define FANCY_PPEM 40 -#define EASY_PPEM 40 +#define FANCY_PPEM 12 +#define EASY_PPEM 12 interpreter = NULL; head = sfnt_read_head_table (fd, font); commit ff20898dad8825fb39883ca3f09f829528291943 Author: Philip Kaludercic Date: Sun Dec 3 13:49:07 2023 +0100 Add slashes to 'thing-at-point-email-regexp' * lisp/thingatpt.el (thing-at-point-email-regexp): Allow for a (thing-at-point 'email) query to match addresses with slashes, as used by Sourcehut. (Bug#67600) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 88efbf73beb..80dc5ee60b7 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -652,7 +652,7 @@ thing-at-point-looking-at ;; Email addresses (defvar thing-at-point-email-regexp - "?" + "?" "A regular expression probably matching an email address. This does not match the real name portion, only the address, optionally with angle brackets.") commit 7b46b24d3902dc43d920daf670e8c2b560a6ee45 Author: Stefan Kangas Date: Sun Dec 17 12:14:04 2023 +0100 ; Move NEWS item to "Incomatible Changes" section diff --git a/etc/NEWS b/etc/NEWS index 918c12b91d2..d3521633a5f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -65,6 +65,17 @@ arranges for Emacs to be the default application for the 'org-protocol' URI scheme. See the Org mode manual, Info node "(org) Protocols" for more details. + +* Incompatible Changes in Emacs 30.1 + ++++ +** URL now never sends user email addresses in HTTP requests. +Emacs never sent email addresses by default, but it used to be +possible to customize 'url-privacy-level' so that the users email +address was sent along in HTTP requests. This feature has now been +removed, as it was considered more risky than useful. The user option +'url-personal-mail-address' is now also obsolete. + * Changes in Emacs 30.1 @@ -1093,14 +1104,6 @@ Highlighting Tests" node in the ERT manual. ** URL -+++ -*** URL now never sends user email addresses in HTTP requests. -Emacs never sent email addresses by default, but it used to be -possible to customize 'url-privacy-level' so that the users email -address was sent along in HTTP requests. This feature has now been -removed, as it was considered more risky than useful. The user option -'url-personal-mail-address' is now also obsolete. - +++ *** 'url-gateway-broken-resolution' is now obsolete. This option was intended for use on SunOS 4.x and Ultrix systems, commit 8c448c6b4f75bb1cb1c560d7a674bd349147d2c8 Author: Stefan Kangas Date: Sun Dec 17 11:58:24 2023 +0100 Silence warning in print.c * src/print.c (print_bool_vector): Silence warning. diff --git a/src/print.c b/src/print.c index a5d57adbd3b..09e00329676 100644 --- a/src/print.c +++ b/src/print.c @@ -1618,7 +1618,7 @@ print_bool_vector (Lisp_Object obj, Lisp_Object printcharfun) ptrdiff_t real_size_in_bytes = size_in_bytes; unsigned char *data = bool_vector_uchar_data (obj); - char buf[sizeof "#&" + INT_STRLEN_BOUND (ptrdiff_t)]; + char buf[sizeof "#&\"" + INT_STRLEN_BOUND (ptrdiff_t)]; int len = sprintf (buf, "#&%"pI"d\"", size); strout (buf, len, len, printcharfun); commit 346e5712304e66bb1b52387115b89d1966cf184b Author: Stefan Kangas Date: Sun Dec 17 09:45:05 2023 +0100 Never send user email address in HTTP requests It used to be possible to customize 'url-privacy-level' so that the user's email address was sent along in HTTP requests. Since 'url-privacy-level' is also a blocklist, rather than an allowlist, this meant that a mere misconfiguration of Emacs risked exposing the user's email address. This is a serious privacy risk, and it is thus better if we remove this dangerous feature altogether. * lisp/url/url-http.el (url-http-create-request): Never send the user email address. * lisp/url/url-vars.el (url-personal-mail-address): Make obsolete. * lisp/url/url-privacy.el (url-setup-privacy-info): Don't set above obsolete variable. * doc/misc/url.texi (Customization): * lisp/url/url-vars.el (url-privacy-level): Update documentation to reflect the above changes. diff --git a/doc/misc/url.texi b/doc/misc/url.texi index 6517f858324..3a447a20559 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi @@ -1231,8 +1231,6 @@ Customization A number means log all messages and show them with @code{message}. It may also be a list of the types of messages to be logged. @end defopt -@defopt url-personal-mail-address -@end defopt @defopt url-privacy-level @end defopt @defopt url-lastloc-privacy-level diff --git a/etc/NEWS b/etc/NEWS index 491ade0c069..918c12b91d2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1093,6 +1093,14 @@ Highlighting Tests" node in the ERT manual. ** URL ++++ +*** URL now never sends user email addresses in HTTP requests. +Emacs never sent email addresses by default, but it used to be +possible to customize 'url-privacy-level' so that the users email +address was sent along in HTTP requests. This feature has now been +removed, as it was considered more risky than useful. The user option +'url-personal-mail-address' is now also obsolete. + +++ *** 'url-gateway-broken-resolution' is now obsolete. This option was intended for use on SunOS 4.x and Ultrix systems, diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index ada6341ee73..947c6517ed1 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -358,10 +358,6 @@ url-http-create-request (url-port url-http-target-url)) (format "Host: %s\r\n" (url-http--encode-string (puny-encode-domain host)))) - ;; Who its from - (if url-personal-mail-address - (concat - "From: " url-personal-mail-address "\r\n")) ;; Encodings we understand (if (or url-mime-encoding-string ;; MS-Windows loads zlib dynamically, so recheck diff --git a/lisp/url/url-privacy.el b/lisp/url/url-privacy.el index 2be77b33035..be4b063d18f 100644 --- a/lisp/url/url-privacy.el +++ b/lisp/url/url-privacy.el @@ -59,16 +59,6 @@ url-setup-privacy-info ('tty "TTY") (_ nil))))) - (setq url-personal-mail-address (or url-personal-mail-address - user-mail-address - (format "%s@%s" (user-real-login-name) - (system-name)))) - - (if (or (memq url-privacy-level '(paranoid high)) - (and (listp url-privacy-level) - (memq 'email url-privacy-level))) - (setq url-personal-mail-address nil)) - (setq url-os-type (cond ((or (eq url-privacy-level 'paranoid) diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index 630de7f4e43..6d7d0d3c94c 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -90,6 +90,7 @@ url-personal-mail-address request." :type '(choice (const :tag "Unspecified" nil) string) :group 'url) +(make-obsolete-variable 'url-personal-mail-address nil "30.1") (defcustom url-directory-index-file "index.html" "The filename to look for when indexing a directory. @@ -113,18 +114,22 @@ url-privacy-level If a list, this should be a list of symbols of what NOT to send. Valid symbols are: -email -- the email address +email -- the email address (in Emacs 29 or older) os -- the operating system info emacs -- the version of Emacs lastloc -- the last location (see also `url-lastloc-privacy-level') agent -- do not send the User-Agent string cookies -- never accept HTTP cookies +Emacs 30 and newer never includes the email address in the +User-Agent string. If you expect to use older versions of Emacs, +it is recommended to always customize this list to include `email'. + Samples: (setq url-privacy-level \\='high) (setq url-privacy-level \\='(email lastloc)) ;; equivalent to \\='high - (setq url-privacy-level \\='(os)) + (setq url-privacy-level \\='(email lastloc os emacs)) ::NOTE:: This variable controls several other variables and is _NOT_ automatically commit 68565c0e90f0da375123e1283caf13c2309f8c46 Author: Eric Abrahamsen Date: Fri Dec 15 06:59:38 2023 -0800 ; Remove out-of-date documentation about Gnus delayed articles * doc/misc/gnus.texi (Delayed Articles): As of commit 7725fbc5b this paragraph is no longer true; the "Date" header is not included in `message-draft-headers' by default. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index ead5954a96e..fc41934ace4 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -6243,13 +6243,6 @@ Delayed Articles Just don't forget to set that up :-) @end table -When delaying an article with @kbd{C-c C-j}, Message mode will -automatically add a @code{"Date"} header with the current time. In -many cases you probably want the @code{"Date"} header to reflect the -time the message is sent instead. To do this, you have to delete -@code{Date} from @code{message-draft-headers}. - - @node Marking Articles @section Marking Articles @cindex article marking commit 2b08cc2d5f17327f54d3b2c7b790ef34dd015925 Author: Stefan Kangas Date: Sun Dec 17 00:14:43 2023 +0100 ; Fix typo * java/org/gnu/emacs/EmacsSafThread.java (cacheDirectoryFromCursor): Fix typo. diff --git a/java/org/gnu/emacs/EmacsSafThread.java b/java/org/gnu/emacs/EmacsSafThread.java index 8bb84126b07..333c3a29790 100644 --- a/java/org/gnu/emacs/EmacsSafThread.java +++ b/java/org/gnu/emacs/EmacsSafThread.java @@ -504,7 +504,7 @@ private static final class CacheEntry cacheDirectoryFromCursor (CacheToplevel toplevel, String documentId, Cursor cursor) { - CacheEntry entry, constitutent; + CacheEntry entry, constituent; int nameColumn, idColumn, typeColumn; String id, name, type; DocIdEntry idEntry; @@ -561,8 +561,8 @@ private static final class CacheEntry /* Otherwise, create a new cache entry comprised of its type. */ - constitutent = new CacheEntry (); - constitutent.type = type; + constituent = new CacheEntry (); + constituent.type = type; toplevel.idCache.put (documentId, entry); } catch (Exception e) commit 059ae68087bf4498a0529d07319f5c5c2671cad7 Author: Jared Finder Date: Sat Dec 16 09:06:22 2023 -0800 Using remap for binding of log-edit-beginning-of-line. * lisp/vc/log-edit.el (log-edit-mode-map): Change binding. diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index c77f4494c1a..39e0799ba73 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -61,12 +61,12 @@ log-edit-mode-map "C-c C-d" #'log-edit-show-diff "C-c C-f" #'log-edit-show-files "C-c C-k" #'log-edit-kill-buffer - "C-a" #'log-edit-beginning-of-line "M-n" #'log-edit-next-comment "M-p" #'log-edit-previous-comment "M-r" #'log-edit-comment-search-backward "M-s" #'log-edit-comment-search-forward - "C-c ?" #'log-edit-mode-help) + "C-c ?" #'log-edit-mode-help + " " #'log-edit-beginning-of-line) (easy-menu-define log-edit-menu log-edit-mode-map "Menu used for `log-edit-mode'." commit a1ac7d0720d59aee3534dc518abccf1a77cd5e5a Merge: d1341ef3f0d 3eb421bda38 Author: Stefan Monnier Date: Sat Dec 16 13:13:23 2023 -0500 Merge branch 'same-frame' commit 3eb421bda38981dbb08c3342833b1c7156156469 Author: Stefan Monnier Date: Sat Dec 9 18:38:35 2023 -0500 (display-buffer): New `pop-up-frames` action alist entry Allow overriding the `pop-up-frames` variable from `display-buffer-alist` so as to provide a worthy replacement for the old `same-frame` parameter of `special-display-*` (bug#67249). * lisp/window.el (special-display-popup-frame): Declare obsolete; that was apparently forgotten back when `special-display-*` variables were declared obsolete. Use the new `pop-up-frames` action alist entry instead of the variable. (display-buffer): Document new alist entry. (window--pop-up-frames): New function. (display-buffer--maybe-pop-up-frame, display-buffer-in-previous-window) (display-buffer-reuse-window, display-buffer-reuse-mode-window): Use it. * doc/lispref/windows.texi (Choosing Window Options): Mention that `pop-up-frames` is also an action alist entry. (Buffer Display Action Alists): Add `pop-up-frames` entry. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 22c1b307252..b11f6d4f3ab 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3268,6 +3268,15 @@ Buffer Display Action Alists if one is created. @code{display-buffer-pop-up-frame} is its one and only addressee. +@vindex pop-up-frames@r{, a buffer display action alist entry} +@item pop-up-frames +The value controls whether @code{display-buffer} may display buffers +by making new frames. It has the same meaning as the +@code{pop-up-frames} variable and takes precedence over it when present. +Its main intended purpose is to override a non-nil value of the +variable for particular buffers which the user prefers to keep +in the selected frame. + @vindex parent-frame@r{, a buffer display action alist entry} @item parent-frame The value specifies the parent frame to be used when the buffer is @@ -3441,6 +3450,9 @@ Choosing Window Options looking for a window already displaying @var{buffer-or-name}, it can search any visible or iconified frame, not just the selected frame. +An entry by the same name in @code{display-buffer}'s @var{alist} +takes precedence over the variable. + This variable is provided mainly for backward compatibility. It is obeyed by @code{display-buffer} via a special mechanism in @code{display-buffer-fallback-action}, which calls the action function @@ -3512,15 +3524,12 @@ Choosing Window Options @item pop-up-frames @vindex pop-up-frames@r{, replacement for} -Instead of customizing this variable to @code{t}, customize +Instead of customizing this variable to @code{t}, you can customize @code{display-buffer-base-action}, for example, as follows: @example @group -(setopt - display-buffer-base-action - '((display-buffer-reuse-window display-buffer-pop-up-frame) - (reusable-frames . 0))) +(setopt display-buffer-base-action '(nil (pop-up-frames . t))) @end group @end example diff --git a/etc/NEWS b/etc/NEWS index 60391cfb22e..060d1a2fe5c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1289,6 +1289,10 @@ values. * Lisp Changes in Emacs 30.1 +** New 'pop-up-frames' action alist entry for 'display-buffer'. +This has the same effect as the variable of the same name and takes +precedence over the variable when present. + ** New function 'merge-ordered-lists'. Mostly used internally to do a kind of topological sort of inheritance hierarchies. diff --git a/lisp/window.el b/lisp/window.el index fbdcd611068..40070a4d929 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6862,6 +6862,7 @@ special-display-popup-frame If ARGS is a list whose car is a symbol, use (car ARGS) as a function to do the work. Pass it BUFFER as first argument, and pass the elements of (cdr ARGS) as the remaining arguments." + (declare (obsolete display-buffer-pop-up-frame "30.1")) (if (and args (symbolp (car args))) (apply (car args) buffer (cdr args)) (let ((window (get-buffer-window buffer 0))) @@ -6881,9 +6882,8 @@ special-display-popup-frame ;; Stay on the same frame if requested. (when (or (cdr (assq 'same-frame args)) (cdr (assq 'same-window args))) (let* ((pop-up-windows t) - pop-up-frames special-display-buffer-names special-display-regexps) - (display-buffer buffer))) + (display-buffer buffer '((pop-up-frames . nil))))) ;; If no window yet, make one in a new frame. (let* ((frame (with-current-buffer buffer @@ -6996,6 +6996,13 @@ pop-up-frames (const :tag "Always" t)) :group 'windows) +(defun window--pop-up-frames (alist) + (let* ((override (assq 'pop-up-frames alist)) + (pop-up (if override (cdr override) pop-up-frames))) + (if (eq pop-up 'graphic-only) + (display-graphic-p) + pop-up))) + (defcustom display-buffer-reuse-frames nil "Non-nil means `display-buffer' should reuse frames. If the buffer in question is already displayed in a frame, raise @@ -7742,6 +7749,8 @@ display-buffer Possible values are nil (the selected frame), t (any live frame), visible (any visible frame), 0 (any visible or iconified frame) or an existing live frame. + `pop-up-frames' -- Same effect as the eponymous variable. + Takes precedence over the variable. `pop-up-frame-parameters' -- The value specifies an alist of frame parameters to give a new frame, if one is created. `window-height' -- The value specifies the desired height of the @@ -7830,12 +7839,12 @@ display-buffer user-action special-action action extra-action display-buffer-base-action display-buffer-fallback-action)) - (functions (apply 'append + (functions (apply #'append (mapcar (lambda (x) (setq x (car x)) (if (functionp x) (list x) x)) actions))) - (alist (apply 'append (mapcar 'cdr actions))) + (alist (apply #'append (mapcar #'cdr actions))) window) (unless (buffer-live-p buffer) (error "Invalid buffer")) @@ -7978,9 +7987,7 @@ display-buffer-reuse-window indirectly called by the latter." (let* ((alist-entry (assq 'reusable-frames alist)) (frames (cond (alist-entry (cdr alist-entry)) - ((if (eq pop-up-frames 'graphic-only) - (display-graphic-p) - pop-up-frames) + ((window--pop-up-frames alist) 0) (display-buffer-reuse-frames 0) (t (last-nonminibuffer-frame)))) @@ -8034,9 +8041,7 @@ display-buffer-reuse-mode-window (let* ((alist-entry (assq 'reusable-frames alist)) (alist-mode-entry (assq 'mode alist)) (frames (cond (alist-entry (cdr alist-entry)) - ((if (eq pop-up-frames 'graphic-only) - (display-graphic-p) - pop-up-frames) + ((window--pop-up-frames alist) 0) (display-buffer-reuse-frames 0) (t (last-nonminibuffer-frame)))) @@ -8182,9 +8187,7 @@ display-buffer--maybe-pop-up-frame ALIST is an association list of action symbols and values. See Info node `(elisp) Buffer Display Action Alists' for details of such alists." - (and (if (eq pop-up-frames 'graphic-only) - (display-graphic-p) - pop-up-frames) + (and (window--pop-up-frames alist) (display-buffer-pop-up-frame buffer alist))) (defun display-buffer--maybe-pop-up-window (buffer alist) @@ -8548,9 +8551,7 @@ display-buffer-in-previous-window (cdr (assq 'inhibit-same-window alist))) (frames (cond (alist-entry (cdr alist-entry)) - ((if (eq pop-up-frames 'graphic-only) - (display-graphic-p) - pop-up-frames) + ((window--pop-up-frames alist) 0) (display-buffer-reuse-frames 0) (t (last-nonminibuffer-frame)))) commit d1341ef3f0d7f2e64d26791ea41c752feef3fd3c Author: Stefan Monnier Date: Sat Dec 16 13:03:46 2023 -0500 * lisp/subr.el (derived-mode-p): Disable warnings for old convention diff --git a/lisp/subr.el b/lisp/subr.el index 7f2dcdc4d90..7b52f4f68f9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2804,7 +2804,11 @@ derived-mode-p We also still support the deprecated calling convention: \(derived-mode-p &rest MODES)." (declare (side-effect-free t) - (advertised-calling-convention (modes) "30.1")) + ;; FIXME: It's cumbersome for external packages to write code which + ;; accommodates both the old and the new calling conventions *and* + ;; doesn't cause spurious warnings. So let's be more lenient + ;; for now and maybe remove `deprecated-args' for Emacs-31. + (advertised-calling-convention (modes &rest deprecated-args) "30.1")) (provided-mode-derived-p major-mode (if old-modes (cons modes old-modes) modes))) commit 2a591b228aaa8c66c27cc5b7cb3033aa6625bc0b Author: Eli Zaretskii Date: Sat Dec 16 16:26:26 2023 +0200 ; * lisp/startup.el (normal-top-level): Avoid byte-compiler warning. diff --git a/lisp/startup.el b/lisp/startup.el index 09ec24c6c67..255c31257b0 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -643,6 +643,7 @@ normal-top-level (if (and (featurep 'android) (eq system-type 'android) + (fboundp 'android-locale-for-system-language) initial-window-system) ;; If Android windowing is enabled, derive a proper locale ;; from the system's language preferences. On Android, LANG commit a1d3862c6240805bde997bb57f60fceb0fbccb85 Merge: 47b10d062df bf4ccb0be07 Author: Eli Zaretskii Date: Sat Dec 16 09:17:51 2023 -0500 Merge from origin/emacs-29 bf4ccb0be07 ; * lisp/term.el (term--xterm-paste): Fix last change. 0d9e2e448d9 ; * doc/lispref/functions.texi (Function Documentation): ... 791cc5065da Fix shaping of Sinhala text efcbf0b5abf Add use cases of (fn) documentation facility. c3331cb3659 Fix pasting into terminal-mode on term.el 5be94e2bce5 Fix opening directory trees from Filesets menu 6b6e770a1f5 Eglot: Add ruff-lsp as an alternative Python server ed8a8a5ba16 Fix symbol name in Multisession Variables examples 400ef15bdc3 js-ts-mode: Fix font-lock rules conflict c165247c300 Add indentation rules for bracketless statements in js-ts... 7f1bd69cd19 Fix c-ts-mode bracketless indentation for BSD style (bug#... e23068cb9a1 Add missing indent rules in c-ts-mode (bug#66152) d2c4b926ac2 Fix treesit-default-defun-skipper (bug#66711) 9874561f39e Fix treesit-node-field-name and friends (bug#66674) eace9e11226 python-ts-mode: Highlight default parameters 23c06c7c308 Update to Org 9.6.13 commit bf4ccb0be076d8b65498c56dedf0eee17cb3c24c Author: Eli Zaretskii Date: Sat Dec 16 16:08:52 2023 +0200 ; * lisp/term.el (term--xterm-paste): Fix last change. diff --git a/lisp/term.el b/lisp/term.el index b9f739dc8f1..2c7c1adaa77 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1390,7 +1390,7 @@ term-paste (interactive) (term-send-raw-string (current-kill 0))) -(defun term--xterm-paste () +(defun term--xterm-paste (event) "Insert the text pasted in an XTerm bracketed paste operation." (interactive "e") (unless (eq (car-safe event) 'xterm-paste) commit 0d9e2e448d9ef3efae3111503a0947fa0159e03c Author: Eli Zaretskii Date: Sat Dec 16 16:06:29 2023 +0200 ; * doc/lispref/functions.texi (Function Documentation): Fix @itemize. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 34a568b728e..3ef7fd5ac6a 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -564,6 +564,7 @@ Function Documentation "@dots{} \(fn ABBREV PROP)") @end example +@end itemize @end ifnottex @cindex computed documentation string commit 791cc5065da2bfac47f8c7485bc870880548eb9d Author: Eli Zaretskii Date: Sat Dec 16 15:33:02 2023 +0200 Fix shaping of Sinhala text * lisp/language/sinhala.el (composition-function-table): Allow U+200D U+0DCA as well as U+0DCA U+200D between consonants. Suggested by Richard Wordingham . (Bug#67828) diff --git a/lisp/language/sinhala.el b/lisp/language/sinhala.el index bf320506001..a5c379b3aae 100644 --- a/lisp/language/sinhala.el +++ b/lisp/language/sinhala.el @@ -36,11 +36,11 @@ composition-function-table '(#xD80 . #xDFF) (list (vector - ;; C:consonant, H:HALANT, J:ZWJ, v:vowel sign, + ;; C:consonant, H:HALANTA, J:ZWJ, v:vowel sign, ;; V:independent vowel, a:ANUSVARA .. VISARGA (concat - ;; C(HJC)*v*H?a?, or - "[\u0D9A-\u0DC6]\\(?:\u0DCA\u200D[\u0D9A-\u0DC6]\\)*[\u0DCF-\u0DDF\u0DF2-\u0DF3]*\u0DCA?[\u0D82-\u0D83]?\\|" + ;; C(HJ|JH)C)*v*H?a?, or + "[\u0D9A-\u0DC6]\\(?:\\(\u0DCA\u200D\\|\u200D\u0DCA\\)[\u0D9A-\u0DC6]\\)*[\u0DCF-\u0DDF\u0DF2-\u0DF3]*\u0DCA?[\u0D82-\u0D83]?\\|" ;; Va?, or "[\u0D85-\u0D96][\u0D82-\u0D83]?\\|" ;; any other singleton characters commit 47b10d062df643da6ecc6fc3b6b1cbb668eebb39 Author: Jens Schmidt Date: Thu Dec 14 20:47:22 2023 +0100 ; Move preload of rmc to a more appropriate place See discussion on https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00309.html. * lisp/loadup.el ("emacs-lisp/rmc"): Move preload to a more appropriate place. diff --git a/lisp/loadup.el b/lisp/loadup.el index 1f959464b23..d2a4c6a7cf7 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -387,6 +387,9 @@ (load "tooltip")) (load "international/iso-transl") ; Binds Alt-[ and friends. +;; Used by `kill-buffer', for instance. +(load "emacs-lisp/rmc") + ;; This file doesn't exist when building a development version of Emacs ;; from the repository. It is generated just after temacs is built. (load "leim/leim-list.el" t) @@ -406,9 +409,6 @@ (message "Warning: Change in load-path due to site-load will be \ lost after dumping"))) -;; Used by `kill-buffer', for instance. -(load "emacs-lisp/rmc") - ;; Actively check for advised functions during preload since: ;; - advices in Emacs's core are generally considered bad style; ;; - `Snarf-documentation' looses docstrings of primitives advised commit efcbf0b5abfed8bbf767209a913b5e25270596a4 Author: Jeremy Bryant Date: Sun Dec 3 21:32:01 2023 +0000 Add use cases of (fn) documentation facility. * doc/lispref/functions.texi (Function Documentation): Add examples. (Bug#67499) Co-authored-by: Eli Zaretskii diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index e646e7c8b0a..34a568b728e 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -533,6 +533,39 @@ Function Documentation compiler emit a warning message when it compiles Lisp programs which use the deprecated calling convention. +@ifnottex +The @code{(fn)} feature is typically used in the following situations: + +@itemize @minus +@item To spell out arguments and their purposes in a macro or a function. Example: + +@example +(defmacro lambda (&rest cdr) + "@dots{} +\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"@dots{}) +@end example + +@item To provide a more detailed description and names of arguments. Example: + +@example +(defmacro macroexp--accumulate (var+list &rest body) + "@dots{} +\(fn (VAR LIST) BODY@dots{})" + (declare (indent 1)) + (let ((var (car var+list)) + (list (cadr var+list)) +@dots{}))) +@end example + +@item To better explain the purpose of a @code{defalias}. Example: + +@example +(defalias 'abbrev-get 'get + "@dots{} +\(fn ABBREV PROP)") +@end example +@end ifnottex + @cindex computed documentation string @kindex :documentation Documentation strings are usually static, but occasionally it can be commit 75add076ba507f49092f260572f6762403db5389 Author: Eli Zaretskii Date: Sat Dec 16 14:52:36 2023 +0200 ; * lisp/net/shr.el (shr-put-image): No more need to test for nil ALT. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 8a24a4f6696..ec9fb1573ac 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1148,8 +1148,8 @@ shr-put-image (insert "\n")) (let ((image-pos (point))) (if (eq size 'original) - (insert-sliced-image image (or alt "*") nil 20 1) - (insert-image image (or alt "*"))) + (insert-sliced-image image alt nil 20 1) + (insert-image image alt)) (put-text-property start (point) 'image-size size) (when (and (not inline) shr-max-inline-image-size) (insert "\n")) commit 745ec75677b3768f9adc436303f3886b88f6f569 Author: Visuwesh Date: Mon Dec 11 17:09:03 2023 +0530 Fix 'shr-put-image' with nil value for ALT * lisp/net/shr.el (shr-put-image): Account for nil value for ALT. (Bug#67764) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index e0888c61496..8a24a4f6696 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1137,7 +1137,9 @@ shr-put-image (when image ;; The trailing space can confuse shr-insert into not ;; putting any space after inline images. - (setq alt (string-trim alt)) + ;; ALT may be nil when visiting image URLs in eww + ;; (bug#67764). + (setq alt (if alt (string-trim alt) "*")) ;; When inserting big-ish pictures, put them at the ;; beginning of the line. (let ((inline (shr--inline-image-p image))) commit c3331cb3659ffca0b04e0b789e9826b53777a70a Author: Eli Zaretskii Date: Sat Dec 16 14:44:32 2023 +0200 Fix pasting into terminal-mode on term.el * lisp/term.el (term--xterm-paste): Read pasted text from the input event. Suggested by Jared Finder . (Bug#49253) diff --git a/lisp/term.el b/lisp/term.el index 68b1136a0b4..b9f739dc8f1 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1392,8 +1392,13 @@ term-paste (defun term--xterm-paste () "Insert the text pasted in an XTerm bracketed paste operation." - (interactive) - (term-send-raw-string (xterm--pasted-text))) + (interactive "e") + (unless (eq (car-safe event) 'xterm-paste) + (error "term--xterm-paste must be found to xterm-paste event")) + (let ((str (nth 1 event))) + (unless (stringp str) + (error "term--xterm-paste provided event does not contain paste text")) + (term-send-raw-string str))) (declare-function xterm--pasted-text "term/xterm" ()) commit 6f181a0ef7a0152fb6d52133b492d3cb74e4cd8d Author: Eli Zaretskii Date: Sat Dec 16 14:38:21 2023 +0200 ; * doc/emacs/android.texi (Android Environment): Fix node name. diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index a3485a0a574..3b81f5cb43f 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -414,7 +414,7 @@ Android Environment system do not influence the C locale set for programs, but are taken into account by Emacs during startup: a locale name is generated from the selected language and regional variant and a language environment -(@pxref{Language Environment}) is selected on that basis, which does +(@pxref{Language Environments}) is selected on that basis, which does not overwrite @code{LANG} or other locale-related environment variables. The coding system for language environments set in this fashion is @code{utf-8-unix} without exception. commit c4541a35770fe7925f733fcdaa9e4e3348a3c85c Author: Visuwesh Date: Wed Dec 6 13:45:03 2023 +0530 Offer to show diff against auto-save in recover-file * lisp/files.el (recover-file): Show diff against the selected auto save file. (Bug#52242) * doc/emacs/files.texi (Recover): Document the new feature. * etc/NEWS: Announce the new feature. diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 917e937d32d..832c189ce49 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1329,6 +1329,10 @@ Recover so you can compare their sizes and dates. If the auto-save file is older, @kbd{M-x recover-file} does not offer to read it. +When @kbd{M-x recover-file} asks for confirmation, if you answer with +@kbd{diff} or @kbd{=}, it shows the diffs between @var{file} and its +auto-save file @file{#@var{file}#} and reprompts you for confirmation. + @findex recover-session If Emacs or the computer crashes, you can recover all the files you were editing from their auto save files with the command @kbd{M-x diff --git a/etc/NEWS b/etc/NEWS index 29b3d6676de..26a97206b47 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -258,6 +258,11 @@ called in the '--eval' expression, which is useful when those arguments contain arbitrary characters that otherwise might require elaborate and error-prone escaping (to protect them from the shell). ++++ +** 'recover-file' can show diffs between auto save file and current file. +When answering the prompt with "diff" or "=", it now shows the diffs +between the auto save file and the current file. + * Editing Changes in Emacs 30.1 diff --git a/lisp/files.el b/lisp/files.el index f87e7807301..21f3376016c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7083,7 +7083,15 @@ recover-file #'(lambda (window _value) (with-selected-window window (unwind-protect - (yes-or-no-p (format "Recover auto save file %s? " file-name)) + (let ((prompt (format "Recover auto save file %s? " file-name)) + (choices + '(("yes" ?y "recover auto save file") + ("no" ?n "don't recover auto save file") + ("diff" ?= "show changes between auto save file and current file"))) + ans) + (while (equal "diff" (setq ans (read-answer prompt choices))) + (diff file file-name)) + (equal ans "yes")) (when (window-live-p window) (quit-restore-window window 'kill))))) (with-current-buffer standard-output commit 5be94e2bce53f9826b64d3566a0d5524aeccbccd Author: Eli Zaretskii Date: Sat Dec 16 13:25:58 2023 +0200 Fix opening directory trees from Filesets menu In bug#976, the code was fixed, but the cautious condition in the original author's code, which catered to invoking 'filelists-open' from the menu-bar menu, was omitted, which made that invocation, which did work before, broken. * lisp/filesets.el (filesets-get-filelist): Fix opening directory trees from the Filesets menu-bar menu. (Bug#67658) diff --git a/lisp/filesets.el b/lisp/filesets.el index 1b7e6ffa81f..d00a29c2ebf 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1653,7 +1653,17 @@ filesets-get-filelist (filesets-entry-get-master entry))))) (cons entry (filesets-ingroup-cache-get entry)))) (:tree - (let* ((dirpatt (filesets-entry-get-tree entry)) + ;; Warning: ENTRY here could be of at least two + ;; differente forms, either + ;; (NAME (:tree DIRECTORY PATTERN)) + ;; or + ;; (DIRECTORY PATTERN) + ;; The latter happens when opening a tree fileset + ;; from the Filesets menu. We need to support both + ;; of these forms! + (let* ((dirpatt (if (consp (nth 1 entry)) + (filesets-entry-get-tree entry) + entry)) (dir (nth 0 dirpatt)) (patt (nth 1 dirpatt)) (depth (or (filesets-entry-get-tree-max-level entry) commit 6b6e770a1f55da0580706c7ec21a409437d19ab4 Author: Niall Dooley Date: Fri Nov 24 16:52:36 2023 +0100 Eglot: Add ruff-lsp as an alternative Python server ruff-lsp [1] is an LSP server for Ruff [2], [3], a fast Python linter and code formatter. It supports surfacing Ruff diagnostics and providing Code Actions to fix them, but is intended to be used alongside another Python LSP in order to support features like navigation and autocompletion. [1]: https://github.com/astral-sh/ruff-lsp [2]: https://github.com/astral-sh/ruff [3]: https://docs.astral.sh/ruff/ * lisp/progmodes/eglot.el (eglot-server-programs): Add ruff-lsp. Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 80f98d7553d..967d86955a4 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -188,7 +188,7 @@ eglot-server-programs (vimrc-mode . ("vim-language-server" "--stdio")) ((python-mode python-ts-mode) . ,(eglot-alternatives - '("pylsp" "pyls" ("pyright-langserver" "--stdio") "jedi-language-server"))) + '("pylsp" "pyls" ("pyright-langserver" "--stdio") "jedi-language-server" "ruff-lsp"))) ((js-json-mode json-mode json-ts-mode) . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") ("vscode-json-languageserver" "--stdio") commit 51a296014bef653860676fce0717e86d078cfa9d Author: john muhl Date: Mon Dec 4 12:03:34 2023 -0600 Fix comint-next/previous-prompt in lua-ts-mode * lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Don't set 'comint-use-prompt-regexp'. (Bug#67616) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 5318144a057..cbf0e573e37 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -552,7 +552,6 @@ lua-ts-inferior-lua (with-current-buffer lua-ts-inferior-buffer (setq-local comint-input-ignoredups t comint-input-ring-file-name lua-ts-inferior-history - comint-use-prompt-regexp t comint-prompt-read-only t comint-prompt-regexp (rx-to-string `(: bol ,lua-ts-inferior-prompt commit f5e7aaed66e807920f084b309e7595a2a6c9c216 Author: nverno Date: Sun Dec 3 19:21:04 2023 -0800 Fix: add comint hook locally in lua-ts-inferior-lua * lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Add 'comint-preoutput-filter-functions' hook locally. (Bug#67616) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 7307a5b13f1..5318144a057 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -560,9 +560,7 @@ lua-ts-inferior-lua (comint-read-input-ring t) (add-hook 'comint-preoutput-filter-functions (lambda (string) - (if (or (not (equal (buffer-name) lua-ts-inferior-buffer)) - (equal string - (concat lua-ts-inferior-prompt-continue " "))) + (if (equal string (concat lua-ts-inferior-prompt-continue " ")) string (concat ;; Filter out the extra prompt characters that @@ -576,7 +574,8 @@ lua-ts-inferior-lua (group (* nonl)))) "\\1" string) ;; Re-add the prompt for the next line. - lua-ts-inferior-prompt " ")))))) + lua-ts-inferior-prompt " "))) + nil t))) (select-window (display-buffer lua-ts-inferior-buffer '((display-buffer-reuse-window display-buffer-pop-up-frame) commit 8b3fc9833845eb0f197b27e8fe999cfeed8dc48c Author: Eli Zaretskii Date: Sat Dec 16 11:13:33 2023 +0200 ; * src/androidfns.c (syms_of_androidfns) : Doc fix. diff --git a/src/androidfns.c b/src/androidfns.c index e1fd772df9c..14561afe29a 100644 --- a/src/androidfns.c +++ b/src/androidfns.c @@ -3500,23 +3500,22 @@ syms_of_androidfns (void) android_keyboard_bell_duration = 50; DEFVAR_LISP ("android-os-language", Vandroid_os_language, - doc: /* List representing the system language configured. -This list incorporates four elements LANGUAGE, COUNTRY, SCRIPT -and VARIANT, of which: + doc: /* A list representing the configured system language on Android. +This list has four elements: LANGUAGE, COUNTRY, SCRIPT and VARIANT, where: LANGUAGE and COUNTRY are ISO language and country codes identical to -those stored within POSIX locales. +those found in POSIX locale specifications. SCRIPT is an ISO 15924 script tag, representing the script used if available, or if required to disambiguate between distinct writing systems for the same combination of language and country. VARIANT is an arbitrary string representing the variant of the -LANGUAGE or SCRIPT represented. +LANGUAGE or SCRIPT. Each of these fields might be empty or nil, but the locale is invalid if LANGUAGE is empty. Users of this variable should consider the -language US English in this scenario. */); +language to be US English if LANGUAGE is empty. */); Vandroid_os_language = Qnil; /* Functions defined. */ commit 100a2ab24605b973172b39d0b21adcdcd9907ba9 Author: Eli Zaretskii Date: Sat Dec 16 11:04:24 2023 +0200 ; * lisp/vc/vc-git.el (vc-git-print-log-follow): Doc fix. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f6e8e1b7042..24469f04f7c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1429,15 +1429,16 @@ vc-git-clone ;; Long explanation here: ;; https://stackoverflow.com/questions/46487476/git-log-follow-graph-skips-commits (defcustom vc-git-print-log-follow nil - "If true, use the flag `--follow' when producing single file logs. + "If non-nil, use the flag `--follow' when producing single file logs. -It will make the printed log automatically follow the renames. -The downsides is that the log produced this way may omit -certain (merge) commits, and that `log-view-diff' fails on -commits that used the previous name, in that log buffer. +A non-nil value will make the printed log automatically follow +the file renames. The downsides is that the log produced this +way may omit certain (merge) commits, and that `log-view-diff' +fails on commits that used the previous name, in that log buffer. When this variable is nil, and the log ends with a rename, we -print a button below that shows the log for the previous name." +show a button below that which allows to show the log for the +file name before the rename." :type 'boolean :version "26.1") commit 746507dc3b9f555ff6e8e6282ff03ac211752325 Author: Dmitry Gutov Date: Sat Dec 16 04:57:44 2023 +0200 ruby-syntax-methods-before-regexp: Drop this whitelist * lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re): Match only based on keywords and operators. (ruby-syntax-methods-before-regexp): Delete. (ruby-syntax-propertize): Use the new heuristic based on spaces instead of checking for method names before (bug#67569). * test/lisp/progmodes/ruby-mode-tests.el (ruby-regexp-not-division-when-only-space-before): Use non-whitelisted method name. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Adjust two examples. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 5fab2bf02c4..bca86a57c7d 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2106,12 +2106,6 @@ ruby-find-library-file "\\(%\\)[qQrswWxIi]?\\([[:punct:]]\\)" "Regexp to match the beginning of percent literal.") - (defconst ruby-syntax-methods-before-regexp - '("gsub" "gsub!" "sub" "sub!" "scan" "split" "split!" "index" "match" - "assert_match" "Given" "Then" "When") - "Methods that can take regexp as the first argument. -It will be properly highlighted even when the call omits parens.") - (defvar ruby-syntax-before-regexp-re (concat ;; Special tokens that can't be followed by a division operator. @@ -2123,11 +2117,9 @@ ruby-find-library-file "\\|\\(?:^\\|\\s \\)" (regexp-opt '("if" "elsif" "unless" "while" "until" "when" "and" "or" "not" "&&" "||")) - ;; Method name from the list. - "\\|\\_<" - (regexp-opt ruby-syntax-methods-before-regexp t) "\\)\\s *") - "Regexp to match text that can be followed by a regular expression.")) + "Regexp to match text that disambiguates a regular expression. +A slash character after any of these should begin a regexp.")) (defun ruby-syntax-propertize (start end) "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." @@ -2183,20 +2175,18 @@ ruby-syntax-propertize (when (save-excursion (forward-char -1) (cl-evenp (skip-chars-backward "\\\\"))) - (let ((state (save-excursion (syntax-ppss (match-beginning 1)))) - division-like) + (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) (when (or ;; Beginning of a regexp. (and (null (nth 8 state)) - (save-excursion - (setq division-like - (or (eql (char-after) ?\s) - (not (eql (char-before (1- (point))) ?\s)))) - (forward-char -1) - (looking-back ruby-syntax-before-regexp-re - (line-beginning-position))) - (not (and division-like - (match-beginning 2)))) + (or (not + ;; Looks like division. + (or (eql (char-after) ?\s) + (not (eql (char-before (1- (point))) ?\s)))) + (save-excursion + (forward-char -1) + (looking-back ruby-syntax-before-regexp-re + (line-beginning-position))))) ;; End of regexp. We don't match the whole ;; regexp at once because it can have ;; string interpolation inside, or span diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb index 81d0dfd75c9..a411b39a8fc 100644 --- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb +++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb @@ -34,11 +34,11 @@ def foo # Regexp after whitelisted method. "abc".sub /b/, 'd' -# Don't mismatch "sub" at the end of words. -a = asub / aslb + bsub / bslb; +# Don't mistake division for regexp. +a = sub / aslb + bsub / bslb; # Highlight the regexp after "if". -x = toto / foo if /do bar/ =~ "dobar" +x = toto / foo if / do bar/ =~ "dobar" # Regexp options are highlighted. diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index a931541ba35..fea5f58b92e 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -164,7 +164,7 @@ ruby-slash-not-regexp-when-no-spaces (ruby-assert-state "x = index/3" 3 nil)) (ert-deftest ruby-regexp-not-division-when-only-space-before () - (ruby-assert-state "x = index /3" 3 ?/)) + (ruby-assert-state "x = foo_index /3" 3 ?/)) (ert-deftest ruby-slash-not-regexp-when-only-space-after () (ruby-assert-state "x = index/ 3" 3 nil)) commit a2c2ec548bb7fc03e1f050c2c784b65e9725fea1 Author: Po Lu Date: Sat Dec 16 10:55:18 2023 +0800 Provide for Num Lock and Scroll Lock on Android * java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Retain META_NUM_LOCK_ON and META_SCROLL_LOCK_ON while filtering meta state. diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 3c9e6eb215f..0dc4a274731 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -644,7 +644,7 @@ private static class Coordinate public void onKeyDown (int keyCode, KeyEvent event) { - int state, state_1; + int state, state_1, num_lock_flag; long serial; String characters; @@ -665,13 +665,23 @@ private static class Coordinate state = eventModifiers (event); + /* Num Lock and Scroll Lock aren't supported by systems older than + Android 3.0. */ + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) + num_lock_flag = (KeyEvent.META_NUM_LOCK_ON + | KeyEvent.META_SCROLL_LOCK_ON); + else + num_lock_flag = 0; + /* Ignore meta-state understood by Emacs for now, or key presses such as Ctrl+C and Meta+C will not be recognized as an ASCII key press event. */ state_1 = state & ~(KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK - | KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK); + | KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK + | num_lock_flag); synchronized (eventStrings) { @@ -692,19 +702,29 @@ private static class Coordinate public void onKeyUp (int keyCode, KeyEvent event) { - int state, state_1, unicode_char; + int state, state_1, unicode_char, num_lock_flag; long time; /* Compute the event's modifier mask. */ state = eventModifiers (event); + /* Num Lock and Scroll Lock aren't supported by systems older than + Android 3.0. */ + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) + num_lock_flag = (KeyEvent.META_NUM_LOCK_ON + | KeyEvent.META_SCROLL_LOCK_ON); + else + num_lock_flag = 0; + /* Ignore meta-state understood by Emacs for now, or key presses such as Ctrl+C and Meta+C will not be recognized as an ASCII key press event. */ state_1 = state & ~(KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK - | KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK); + | KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK + | num_lock_flag); unicode_char = getEventUnicodeChar (event, state_1); commit 4072e06a5f7d14b11799d8dd41d7c50082dca4e6 Author: Dmitry Gutov Date: Sat Dec 16 02:34:34 2023 +0200 ; vc-print-log-setup-buttons: Update a TODO comment diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0f74449c92d..4e6581f7f27 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2736,8 +2736,9 @@ vc-print-log-setup-buttons relatives ", ")) " ") ;; TODO: Also print a different button somewhere in the - ;; created buffer to be able to go back easily. (There - ;; are different ways to do that.) + ;; created buffer to be able to go back easily. Might + ;; require some sort of stack/history because a file can + ;; be renamed multiple times. (insert-text-button "View log" 'action (lambda (&rest _ignore) commit 62d96473867dfa71a9719dd41710cd2a155d9055 Author: Dmitry Gutov Date: Sat Dec 16 01:48:29 2023 +0200 (vc-print-log-setup-buttons): Start "previous" history with specified revision * lisp/vc/vc-git.el (vc-git-file-name-changes-switches): Remove the comment above the option. Seems unnecessary now. * lisp/vc/vc.el (vc-print-log-setup-buttons): Start the "previous" change history buffer with the specified revision, rather than have the sentinel jump to it. Apparently in some cases the history of the old name can't be found. In others, the log just shows faster. But note the caveat described in the second new comment (bug#55871). diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index fa1f14b65bb..f6e8e1b7042 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -153,8 +153,6 @@ vc-git-shortlog-switches (repeat :tag "Argument List" :value ("") string)) :version "30.1") -;; XXX: (setq vc-git-log-switches '("--simplify-merges")) can also -;; create fuller history when using this feature. Not sure why. (defcustom vc-git-file-name-changes-switches '("-M" "-C") "String or list of string to pass to Git when finding previous names. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1234424a8d9..0f74449c92d 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2709,6 +2709,8 @@ vc-print-log-setup-buttons (if (< entries limit) ;; The log has been printed in full. Perhaps it started ;; with a copy or rename? + ;; FIXME: We'd probably still want this button even when + ;; vc-log-show-limit is customized to 0 (should be rare). (let* ((last-revision (log-view-current-tag (point-max))) ;; XXX: Could skip this when vc-git-print-log-follow = t. (name-changes @@ -2743,7 +2745,14 @@ vc-print-log-setup-buttons (with-current-buffer vc-parent-buffer ;; To set up parent buffer in the new viewer. (vc-print-log-internal backend old-names - last-revision nil limit)))) + last-revision t limit)))) + ;; XXX: Showing the full history for OLD-NAMES (with + ;; IS-START-REVISION=nil) can be better sometimes + ;; (e.g. when some edits still occurred after a rename + ;; -- multiple branches scenario), but it also can hurt + ;; in others because of Git's automatic history + ;; simplification: as a result, the logs for some + ;; use-package's files before merge could not be found. 'help-echo "Show the log for the file name(s) before the rename"))) ;; Perhaps there are more entries in the log. commit e154c81c0bfcd2159a3c86e53d7281dfd5797088 Author: Dmitry Gutov Date: Sat Dec 16 01:36:47 2023 +0200 Show buttons below vc-log even when REVISION is specified E.g. in the vc-print-branch-log which specifies start revision. * lisp/vc/vc.el (vc-print-log-internal): Remove outdated comment. (vc-print-log-setup-buttons): Only special-case non-nil IS-START-REVISION when LIMIT=1. We often do need buttons for logs that start with a particular revision, because those are still limited by vc-log-show-limit. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 3689dcb9b27..1234424a8d9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2693,11 +2693,15 @@ log-view-message-re (defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return) "Insert at the end of the current buffer buttons to show more log entries. In the new log, leave point at WORKING-REVISION (if non-nil). -LIMIT is the number of entries currently shown. -Does nothing if IS-START-REVISION is non-nil, or if LIMIT is nil, -or if PL-RETURN is `limit-unsupported'." +LIMIT is the current maximum number of entries shown. Does +nothing if IS-START-REVISION is non-nil and LIMIT is 1, or if +LIMIT is nil, or if PL-RETURN is `limit-unsupported'." + ;; LIMIT=1 is set by vc-annotate-show-log-revision-at-line + ;; or by vc-print-root-log with current-prefix-arg=1. + ;; In either case only one revision is wanted, no buttons. (when (and limit (not (eq 'limit-unsupported pl-return)) - (not is-start-revision)) + (not (and is-start-revision + (= limit 1)))) (let ((entries 0)) (goto-char (point-min)) (while (re-search-forward log-view-message-re nil t) @@ -2770,9 +2774,6 @@ vc-print-log-internal If IS-START-REVISION is non-nil, start the log from WORKING-REVISION \(not all backends support this); i.e., show only WORKING-REVISION and earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." - ;; As of 2013/04 the only thing that passes IS-START-REVISION non-nil - ;; is vc-annotate-show-log-revision-at-line, which sets LIMIT = 1. - ;; Don't switch to the output buffer before running the command, ;; so that any buffer-local settings in the vc-controlled ;; buffer can be accessed by the command. commit 5b80894d0a7ff94496c37bad595579c29f5a925c Author: Dmitry Gutov Date: Fri Dec 15 22:26:59 2023 +0200 Support viewing VC change history across renames (Git, Hg) * lisp/vc/vc.el (vc-print-log-setup-buttons): When the log ends at a rename, add a button to jump to the previous names. Use the new backend action 'file-name-changes'. * lisp/vc/vc-git.el (vc-git-print-log-follow): New option. (vc-git-file-name-changes): Implementation (bug#55871, bug#39044). (vc-git-print-log-follow): Update docstring. * lisp/vc/log-view.el (log-view-find-revision) (log-view-annotate-version): Pass the log's VC backend explicitly. * lisp/vc/vc-hg.el (vc-hg-file-name-changes): Add Hg implementation (bug#13004). * etc/NEWS: Mention the changes. diff --git a/etc/NEWS b/etc/NEWS index 1ff2f8a149f..29b3d6676de 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -457,6 +457,16 @@ With this value only the revision number is displayed on the mode-line. *** Obsolete command 'vc-switch-backend' re-added as 'vc-change-backend'. The command was previously obsoleted and unbound in Emacs 28. +*** Support for viewing VC change history across renames. +When a fileset's VC change history ('C-x v l') ends at a rename, we +now print the old name(s) and a button which jumps to their history. +Git and Hg are supported. Naturally, 'vc-git-print-log-follow' should +be nil for this to work (or '--follow' should not be in +'vc-hg-print-log-switches', in Hg's case). + +*** New option 'vc-git-file-name-changes-switches'. +It allows tweaking the thresholds for rename and copy detection. + ** Diff mode +++ diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index af24fcfd398..6c3abd15d8d 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -516,7 +516,8 @@ log-view-find-revision (switch-to-buffer (vc-find-revision (if log-view-per-file-logs (log-view-current-file) (car log-view-vc-fileset)) - (log-view-current-tag))))) + (log-view-current-tag) + log-view-vc-backend)))) (defun log-view-extract-comment () @@ -562,7 +563,8 @@ log-view-annotate-version (vc-annotate (if log-view-per-file-logs (log-view-current-file) (car log-view-vc-fileset)) - (log-view-current-tag)))) + (log-view-current-tag) + nil nil nil log-view-vc-backend))) ;; ;; diff diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2e057ecfaa7..fa1f14b65bb 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -89,6 +89,7 @@ ;; - make-version-backups-p (file) NOT NEEDED ;; - previous-revision (file rev) OK ;; - next-revision (file rev) OK +;; - file-name-changes (rev) OK ;; - check-headers () COULD BE SUPPORTED ;; - delete-file (file) OK ;; - rename-file (old new) OK @@ -152,6 +153,20 @@ vc-git-shortlog-switches (repeat :tag "Argument List" :value ("") string)) :version "30.1") +;; XXX: (setq vc-git-log-switches '("--simplify-merges")) can also +;; create fuller history when using this feature. Not sure why. +(defcustom vc-git-file-name-changes-switches '("-M" "-C") + "String or list of string to pass to Git when finding previous names. + +This option should usually at least contain '-M'. You can adjust +the flags to change the similarity thresholds (default 50%). Or +add `--find-copies-harder' (slower in large projects, since it +uses a full scan)." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "30.1") + (defcustom vc-git-resolve-conflicts t "When non-nil, mark conflicted file as resolved upon saving. That is performed after all conflict markers in it have been @@ -1416,7 +1431,15 @@ vc-git-clone ;; Long explanation here: ;; https://stackoverflow.com/questions/46487476/git-log-follow-graph-skips-commits (defcustom vc-git-print-log-follow nil - "If true, follow renames in Git logs for a single file." + "If true, use the flag `--follow' when producing single file logs. + +It will make the printed log automatically follow the renames. +The downsides is that the log produced this way may omit +certain (merge) commits, and that `log-view-diff' fails on +commits that used the previous name, in that log buffer. + +When this variable is nil, and the log ends with a rename, we +print a button below that shows the log for the previous name." :type 'boolean :version "26.1") @@ -1866,6 +1889,31 @@ vc-git-next-revision (progn (forward-line 1) (1- (point))))))))) (or (vc-git-symbolic-commit next-rev) next-rev))) +(defun vc-git-file-name-changes (rev) + (with-temp-buffer + (let ((root (vc-git-root default-directory))) + (unless vc-git-print-log-follow + (apply #'vc-git-command (current-buffer) t nil + "diff" + "--name-status" + "--diff-filter=ADCR" + (concat rev "^") rev + (vc-switches 'git 'file-name-changes))) + (let (res) + (goto-char (point-min)) + (while (re-search-forward "^\\([ADCR]\\)[0-9]*\t\\([^\n\t]+\\)\\(?:\t\\([^\n\t]+\\)\\)?" nil t) + (pcase (match-string 1) + ("A" (push (cons nil (match-string 2)) res)) + ("D" (push (cons (match-string 2) nil) res)) + ((or "C" "R") (push (cons (match-string 2) (match-string 3)) res)) + ;; ("M" (push (cons (match-string 1) (match-string 1)) res)) + )) + (mapc (lambda (c) + (if (car c) (setcar c (expand-file-name (car c) root))) + (if (cdr c) (setcdr c (expand-file-name (cdr c) root)))) + res) + (nreverse res))))) + (defun vc-git-delete-file (file) (vc-git-command nil 0 file "rm" "-f" "--")) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 9df517ea847..d6dadb74469 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -77,6 +77,7 @@ ;; - make-version-backups-p (file) ?? ;; - previous-revision (file rev) OK ;; - next-revision (file rev) OK +;; - file-name-changes (rev) OK ;; - check-headers () ?? ;; - delete-file (file) TEST IT ;; - rename-file (old new) OK @@ -1203,6 +1204,22 @@ vc-hg-find-revision (vc-hg-command buffer 0 file "cat" "-r" rev) (vc-hg-command buffer 0 file "cat")))) +(defun vc-hg-file-name-changes (rev) + (unless (member "--follow" vc-hg-log-switches) + (with-temp-buffer + (let ((root (vc-hg-root default-directory))) + (vc-hg-command (current-buffer) t nil + "log" "-g" "-p" "-r" rev) + (let (res) + (goto-char (point-min)) + (while (re-search-forward "^diff --git a/\\([^ \n]+\\) b/\\([^ \n]+\\)" nil t) + (when (not (equal (match-string 1) (match-string 2))) + (push (cons + (expand-file-name (match-string 1) root) + (expand-file-name (match-string 2) root)) + res))) + (nreverse res)))))) + (defun vc-hg-find-ignore-file (file) "Return the root directory of the repository of FILE." (expand-file-name ".hgignore" diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 958929fe4c6..3689dcb9b27 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -517,6 +517,13 @@ ;; Return the revision number that precedes REV for FILE, or nil if no such ;; revision exists. ;; +;; - file-name-changes (rev) +;; +;; Return the list of pairs with changes in file names in REV. When +;; a file was added, it should be a cons with nil car. When +;; deleted, a cons with nil cdr. When copied or renamed, a cons +;; with the source name as car and destination name as cdr. +;; ;; - next-revision (file rev) ;; ;; Return the revision number that follows REV for FILE, or nil if no such @@ -2695,9 +2702,47 @@ vc-print-log-setup-buttons (goto-char (point-min)) (while (re-search-forward log-view-message-re nil t) (cl-incf entries)) - ;; If we got fewer entries than we asked for, then displaying - ;; the "more" buttons isn't useful. - (when (>= entries limit) + (if (< entries limit) + ;; The log has been printed in full. Perhaps it started + ;; with a copy or rename? + (let* ((last-revision (log-view-current-tag (point-max))) + ;; XXX: Could skip this when vc-git-print-log-follow = t. + (name-changes + (condition-case nil + (vc-call-backend log-view-vc-backend + 'file-name-changes last-revision) + (vc-not-supported nil))) + (matching-changes + (cl-delete-if-not (lambda (f) (member f log-view-vc-fileset)) + name-changes :key #'cdr)) + (old-names (delq nil (mapcar #'car matching-changes))) + (relatives (mapcar #'file-relative-name old-names))) + (when old-names + (goto-char (point-max)) + (unless (looking-back "\n\n" (- (point) 2)) + (insert "\n")) + (insert + (format + "Renamed from %s" + (mapconcat (lambda (s) + (propertize s 'font-lock-face + 'log-view-file)) + relatives ", ")) + " ") + ;; TODO: Also print a different button somewhere in the + ;; created buffer to be able to go back easily. (There + ;; are different ways to do that.) + (insert-text-button + "View log" + 'action (lambda (&rest _ignore) + (let ((backend log-view-vc-backend)) + (with-current-buffer vc-parent-buffer + ;; To set up parent buffer in the new viewer. + (vc-print-log-internal backend old-names + last-revision nil limit)))) + 'help-echo + "Show the log for the file name(s) before the rename"))) + ;; Perhaps there are more entries in the log. (goto-char (point-max)) (insert "\n") (insert-text-button commit 8e0882d17a38cb9d309df705e76a8e88529f30a9 Author: Eli Zaretskii Date: Fri Dec 15 15:32:22 2023 +0200 Support case-sensitive register names * lisp/register.el (register-read-with-preview): Make register names case-sensitive. (Bug#66394) diff --git a/lisp/register.el b/lisp/register.el index fa4bbcf483f..ef529cd67e5 100644 --- a/lisp/register.el +++ b/lisp/register.el @@ -383,7 +383,12 @@ register-read-with-preview (setq pat input)))) (if (setq win (get-buffer-window buffer)) (with-selected-window win - (let ((ov (make-overlay (point-min) (point-min)))) + (let ((ov (make-overlay + (point-min) (point-min))) + ;; Allow upper-case and + ;; lower-case letters to refer + ;; to different registers. + (case-fold-search nil)) (goto-char (point-min)) (remove-overlays) (unless (string= pat "") commit b4c8a88ac188c760d6b0916e3919eb17175813ad Author: Po Lu Date: Fri Dec 15 19:55:30 2023 +0800 ; * doc/emacs/android.texi (Android Environment): Wording fixes. diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index 3cdeec6ba9e..a3485a0a574 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -411,7 +411,7 @@ Android Environment @cindex system language settings, Android The ``Languages & Input'' preferences which apply to the operating -system do not influence the C locale set for programs, but is taken +system do not influence the C locale set for programs, but are taken into account by Emacs during startup: a locale name is generated from the selected language and regional variant and a language environment (@pxref{Language Environment}) is selected on that basis, which does @@ -424,8 +424,8 @@ Android Environment Variables}) is set to @code{en_US.utf8} when Emacs starts on Android 5.0 or newer, which induces subprocesses linked against the Android C library to print output sensibly. Earlier versions of Android do not -implement locales at all, on account of which the variable is set to -@code{C} instead. +implement locales at all, and on that account, the variable is set to +@code{C}. @cindex running emacs in the background, android @cindex emacs killed, android commit ed8a8a5ba1607a37f0ed9cc11a77221d66946efb Author: Adam Porter Date: Thu Dec 14 18:28:53 2023 -0600 Fix symbol name in Multisession Variables examples * doc/lispref/variables.texi (Multisession Variables): Fix symbol name. (Bug#67823) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 5de5ac6efa7..b4c6d8ac5c3 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2971,7 +2971,7 @@ Multisession Variables @lisp @group -(define-multisession-variable foo-var 0) +(define-multisession-variable foo 0) (defun my-adder (num) (interactive "nAdd number: ") (setf (multisession-value foo) @@ -2981,7 +2981,7 @@ Multisession Variables @end lisp @noindent -This defines the variable @code{foo-var} and binds it to a special +This defines the variable @code{foo} and binds it to a special multisession object which is initialized with the value @samp{0} (if the variable doesn't already exist from a previous session). The @code{my-adder} command queries the user for a number, adds this to @@ -3004,7 +3004,7 @@ Multisession Variables @var{package-symbol} isn't given, this will default to the first ``segment'' of the @var{name} symbol's name, which is the part of its name up to and excluding the first @samp{-}. For instance, if -@var{name} is @code{foo-var} and @var{package-symbol} isn't given, +@var{name} is @code{foo} and @var{package-symbol} isn't given, @var{package-symbol} will default to @code{foo}. @cindex synchronized multisession variables @@ -3012,7 +3012,7 @@ Multisession Variables Multisession variables can be @dfn{synchronized} if @var{bool} is non-@code{nil}. This means that if there're two concurrent Emacs instances running, and the other Emacs changes the multisession -variable @code{foo-var}, the current Emacs instance will retrieve that +variable @code{foo}, the current Emacs instance will retrieve that modified data when accessing the value. If @var{synchronized} is @code{nil} or missing, this won't happen, and the values in all Emacs sessions using the variable will be independent of each other. commit a4feb79ad4c23fbe2a0741b2a6d931c9cd1dc263 Author: João Távora Date: Thu Dec 14 23:53:07 2023 +0000 Eglot: use new jsonrpc-autoport-bootstrap * lisp/progmodes/eglot.el (eglot-lsp-server): Delete slot inferior-process. (eglot--on-shutdown): Simplify. (eglot--inferior-bootstrap): Delete. (eglot--connect): Call jsonrpc-autoport-bootstrap. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 84c5e6639df..51d2dd74e2b 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1011,10 +1011,7 @@ eglot-lsp-server :accessor eglot--managed-buffers) (saved-initargs :documentation "Saved initargs for reconnection purposes." - :accessor eglot--saved-initargs) - (inferior-process - :documentation "Server subprocess started automatically." - :accessor eglot--inferior-process)) + :accessor eglot--saved-initargs)) :documentation "Represents a server. Wraps a process for LSP communication.") @@ -1151,9 +1148,6 @@ eglot--on-shutdown (maphash (lambda (_dir watch-and-ids) (file-notify-rm-watch (car watch-and-ids))) (eglot--file-watches server)) - ;; Kill any autostarted inferior processes - (when-let (proc (eglot--inferior-process server)) - (delete-process proc)) ;; Sever the project/server relationship for `server' (setf (gethash (eglot--project server) eglot--servers-by-project) (delq server @@ -1464,7 +1458,6 @@ eglot--connect (let* ((default-directory (project-root project)) (nickname (project-name project)) (readable-name (format "EGLOT (%s/%s)" nickname managed-modes)) - autostart-inferior-process server-info (contact (if (functionp contact) (funcall contact) contact)) (initargs @@ -1477,16 +1470,16 @@ eglot--connect readable-name nil (car contact) (cadr contact) (cddr contact))))) - ((and (stringp (car contact)) (memq :autoport contact)) + ((and (stringp (car contact)) + (cl-find-if (lambda (x) + (or (eq x :autoport) + (eq (car-safe x) :autoport))) + contact)) (setq server-info (list "")) - `(:process ,(lambda () - (pcase-let ((`(,connection . ,inferior) - (eglot--inferior-bootstrap + `(:process ,(jsonrpc-autoport-bootstrap readable-name contact - '(:noquery t)))) - (setq autostart-inferior-process inferior) - connection)))) + :connect-args '(:noquery t)))) ((stringp (car contact)) (let* ((probe (cl-position-if #'keywordp contact)) (more-initargs (and probe (cl-subseq contact probe))) @@ -1535,7 +1528,6 @@ eglot--connect (setf (eglot--languages server) (cl-loop for m in managed-modes for l in language-ids collect (cons m l))) - (setf (eglot--inferior-process server) autostart-inferior-process) (run-hook-with-args 'eglot-server-initialized-hook server) ;; Now start the handshake. To honor `eglot-sync-connect' ;; maybe-sync-maybe-async semantics we use `jsonrpc-async-request' @@ -1628,55 +1620,6 @@ eglot--connect (quit (jsonrpc-shutdown server) (setq canceled 'quit))) (setq tag nil)))) -(defun eglot--inferior-bootstrap (name contact &optional connect-args) - "Use CONTACT to start a server, then connect to it. -Return a cons of two process objects (CONNECTION . INFERIOR). -Name both based on NAME. -CONNECT-ARGS are passed as additional arguments to -`open-network-stream'." - (let* ((port-probe (make-network-process :name "eglot-port-probe-dummy" - :server t - :host "localhost" - :service 0)) - (port-number (unwind-protect - (process-contact port-probe :service) - (delete-process port-probe))) - inferior connection) - (unwind-protect - (progn - (setq inferior - (make-process - :name (format "autostart-inferior-%s" name) - :stderr (format "*%s stderr*" name) - :noquery t - :command (cl-subst - (format "%s" port-number) :autoport contact))) - (setq connection - (cl-loop - repeat 10 for i from 1 - do (accept-process-output nil 0.5) - while (process-live-p inferior) - do (eglot--message - "Trying to connect to localhost and port %s (attempt %s)" - port-number i) - thereis (ignore-errors - (apply #'open-network-stream - (format "autoconnect-%s" name) - nil - "localhost" port-number connect-args)))) - (cons connection inferior)) - (cond ((and (process-live-p connection) - (process-live-p inferior)) - (eglot--message "Done, connected to %s!" port-number)) - (t - (when inferior (delete-process inferior)) - (when connection (delete-process connection)) - (eglot--error "Could not start and connect to server%s" - (if inferior - (format " started with %s" - (process-command inferior)) - "!"))))))) - ;;; Helpers (move these to API?) ;;; commit 9e24cde227a1bf2e1f0c005ca16b2a70e704ff5c Author: João Távora Date: Thu Dec 14 22:56:33 2023 +0000 Jsonrpc: add new jsonrpc-autoport-bootstrap helper This will help Eglot and some other extensions connect to network servers that are started with a call to a local program. * lisp/jsonrpc.el (jsonrpc--process-sentinel): Also delete inferior. (jsonrpc-process-connection): Add -autoport-inferior slot. (initialize-instance jsonrpc-process-connection): Check process-creating function arity. Use jsonrpc-forwarding-buffer (jsonrpc-autoport-bootstrap): New helper. (Version): Bump to 1.0.20. diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index dde1c880912..f5db3674366 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ ;; Author: João Távora ;; Keywords: processes, languages, extensions -;; Version: 1.0.19 +;; Version: 1.0.20 ;; Package-Requires: ((emacs "25.2")) ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -400,16 +400,20 @@ jsonrpc-process-connection :accessor jsonrpc--on-shutdown :initform #'ignore :initarg :on-shutdown - :documentation "Function run when the process dies.")) + :documentation "Function run when the process dies.") + (-autoport-inferior + :initform nil + :documentation "Used by `jsonrpc-autoport-bootstrap'.")) :documentation "A JSONRPC connection over an Emacs process. The following initargs are accepted: :PROCESS (mandatory), a live running Emacs process object or a -function of no arguments producing one such object. The process -represents either a pipe connection to locally running process or -a stream connection to a network host. The remote endpoint is -expected to understand JSONRPC messages with basic HTTP-style -enveloping headers such as \"Content-Length:\". +function producing one such object. If a function, it is passed +the `jsonrpc-process-connection' object. The process represents +either a pipe connection to locally running process or a stream +connection to a network host. The remote endpoint is expected to +understand JSONRPC messages with basic HTTP-style enveloping +headers such as \"Content-Length:\". :ON-SHUTDOWN (optional), a function of one argument, the connection object, called when the process dies.") @@ -424,37 +428,22 @@ initialize-instance ;; could use a pipe with a process filter instead of ;; `after-change-functions'. Alternatively, we need a new initarg ;; (but maybe not a slot). - (let ((calling-buffer (current-buffer))) - (with-current-buffer (get-buffer-create (format "*%s stderr*" name)) - (let ((inhibit-read-only t) - (hidden-name (concat " " (buffer-name)))) - (erase-buffer) - (buffer-disable-undo) - (add-hook - 'after-change-functions - (lambda (beg _end _pre-change-len) - (cl-loop initially (goto-char beg) - do (forward-line) - when (bolp) - for line = (buffer-substring - (line-beginning-position 0) - (line-end-position 0)) - do (with-current-buffer (jsonrpc-events-buffer conn) - (goto-char (point-max)) - (let ((inhibit-read-only t)) - (insert (format "[stderr] %s\n" line)))) - until (eobp))) - nil t) - ;; If we are correctly coupled to the client, the process - ;; now created should pick up the current stderr buffer, - ;; which we immediately rename - (setq proc (if (functionp proc) - (with-current-buffer calling-buffer (funcall proc)) - proc)) - (ignore-errors (kill-buffer hidden-name)) - (rename-buffer hidden-name) - (process-put proc 'jsonrpc-stderr (current-buffer)) - (setq buffer-read-only t)))) + (let* ((stderr-buffer-name (format "*%s stderr*" name)) + (stderr-buffer (jsonrpc--forwarding-buffer stderr-buffer-name "[stderr]" conn)) + (hidden-name (concat " " stderr-buffer-name))) + ;; If we are correctly coupled to the client, the process now + ;; created should pick up the `stderr-buffer' just created, which + ;; we immediately rename + (setq proc (if (functionp proc) + (if (zerop (cdr (func-arity proc))) + (funcall proc) + (funcall proc conn)) + proc)) + (with-current-buffer stderr-buffer + (ignore-errors (kill-buffer hidden-name)) + (rename-buffer hidden-name) + (setq buffer-read-only t)) + (process-put proc 'jsonrpc-stderr stderr-buffer)) (setf (jsonrpc--process conn) proc) (set-process-buffer proc (get-buffer-create (format " *%s output*" name))) (set-process-filter proc #'jsonrpc--process-filter) @@ -601,6 +590,7 @@ jsonrpc--process-sentinel (jsonrpc--request-continuations connection)) (jsonrpc--message "Server exited with status %s" (process-exit-status proc)) (delete-process proc) + (when-let (p (slot-value connection '-autoport-inferior)) (delete-process p)) (funcall (jsonrpc--on-shutdown connection) connection))))) (cl-defun jsonrpc--process-filter (proc string) @@ -811,5 +801,110 @@ jsonrpc--log-event (forward-line 2) (point))))))))))))) +(defun jsonrpc--forwarding-buffer (name prefix conn) + "Helper for `jsonrpc-process-connection' helpers. +Make a stderr buffer named NAME, forwarding lines prefixed by +PREFIX to CONN's events buffer." + (with-current-buffer (get-buffer-create name) + (let ((inhibit-read-only t)) + (fundamental-mode) + (erase-buffer) + (buffer-disable-undo) + (add-hook + 'after-change-functions + (lambda (beg _end _pre-change-len) + (cl-loop initially (goto-char beg) + do (forward-line) + when (bolp) + for line = (buffer-substring + (line-beginning-position 0) + (line-end-position 0)) + do (with-current-buffer (jsonrpc-events-buffer conn) + (goto-char (point-max)) + (let ((inhibit-read-only t)) + (insert (format "%s %s\n" prefix line)))) + until (eobp))) + nil t)) + (current-buffer))) + + +;;;; More convenience utils +(cl-defun jsonrpc-autoport-bootstrap (name contact + &key connect-args) + "Use CONTACT to start network server, then connect to it. + +Return function suitable for the :PROCESS initarg of +`jsonrpc-process-connection' (which see). + +CONTACT is a list where all the elements are strings except for +one, which is usuallky the keyword `:autoport'. + +When the returned function is called it will start a program +using a command based on CONTACT, where `:autoport' is +substituted by a locally free network port. Thereafter, a +network is made to this port. + +Instead of the keyword `:autoport', a cons cell (:autoport +FORMAT-FN) is also accepted. In that case FORMAT-FN is passed +the port number and should return a string used for the +substitution. + +The internal processes and control buffers are named after NAME. + +CONNECT-ARGS are passed as additional arguments to +`open-network-stream'." + (lambda (conn) + (let* ((port-probe (make-network-process :name "jsonrpc-port-probe-dummy" + :server t + :host "localhost" + :service 0)) + (port-number (unwind-protect + (process-contact port-probe :service) + (delete-process port-probe))) + (inferior-buffer (jsonrpc--forwarding-buffer + (format " *%s inferior output*" name) + "[inferior]" + conn)) + (cmd (cl-loop for e in contact + if (eq e :autoport) collect (format "%s" port-number) + else if (eq (car-safe e) :autoport) + collect (funcall (cdr e) port-number) + else collect e)) + inferior np) + (unwind-protect + (progn + (message "[jsonrpc] Attempting to start `%s'" + (string-join cmd " ")) + (setq inferior + (make-process + :name (format "inferior (%s)" name) + :buffer inferior-buffer + :noquery t + :command cmd)) + (setq np + (cl-loop + repeat 10 for i from 0 + do (accept-process-output nil 0.5) + while (process-live-p inferior) + do (message + "[jsonrpc] %sTrying to connect to localhost:%s (attempt %s)" + (if (zerop i) "Started. " "") + port-number (1+ i)) + thereis (ignore-errors + (apply #'open-network-stream + (format "autostart (%s)" name) + nil + "localhost" port-number connect-args)))) + (setf (slot-value conn '-autoport-inferior) inferior) + np) + (cond ((and (process-live-p np) + (process-live-p inferior)) + (message "[jsonrpc] Done, connected to %s!" port-number)) + (t + (when inferior (delete-process inferior)) + (when np (delete-process np)) + (error "[jsonrpc] Could not start and/or connect"))))))) + + (provide 'jsonrpc) ;;; jsonrpc.el ends here commit af1fe69f05d803a6958f9d8a045d1013e2ce785c Author: João Távora Date: Thu Dec 14 16:32:54 2023 +0000 Eglot: beware activation in fundamental-mode In the specific situation of visiting a buffer via M-. with eglot-extend-to-xref set to t, it was found that buffer was first visited in fundamental mode, running after-change-major-mode-hook, and then again in the proper major mode for the file. The call to eglot-current-server of the first visit returned non-nil which cause two didOpen notifications to be issued for the same file. Furthermore, in the first call, eglot--languageId to returned nil, prompting an error from servers such as rust-analyzer. See also: https://github.com/joaotavora/eglot/discussions/1330 * lisp/progmodes/eglot.el (eglot-current-server): Watch out for fundamental-mode. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 608389f1c05..84c5e6639df 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2034,13 +2034,15 @@ eglot-current-server "Return logical Eglot server for current buffer, nil if none." (setq eglot--cached-server (or eglot--cached-server - (cl-find-if #'eglot--languageId - (gethash (eglot--current-project) - eglot--servers-by-project)) - (and eglot-extend-to-xref - buffer-file-name - (gethash (expand-file-name buffer-file-name) - eglot--servers-by-xrefed-file))))) + (and (not (eq major-mode 'fundamental-mode)) ; gh#1330 + (or + (cl-find-if #'eglot--languageId + (gethash (eglot--current-project) + eglot--servers-by-project)) + (and eglot-extend-to-xref + buffer-file-name + (gethash (expand-file-name buffer-file-name) + eglot--servers-by-xrefed-file))))))) (defun eglot--current-server-or-lose () "Return current logical Eglot server connection or error." commit d9814efe0759ce916a1c470c5908d2ca3c80b29b Author: Po Lu Date: Thu Dec 14 13:57:59 2023 +0800 ; * src/androidfns.c (syms_of_androidfns_for_pdumper): Fix crash. diff --git a/src/androidfns.c b/src/androidfns.c index 60ace4fd453..e1fd772df9c 100644 --- a/src/androidfns.c +++ b/src/androidfns.c @@ -3278,31 +3278,36 @@ syms_of_androidfns_for_pdumper (void) /* Proceed to retrieve the script. */ - method = (*android_java_env)->GetMethodID (android_java_env, locale, - "getScript", - "()Ljava/lang/String;"); - if (!method) - emacs_abort (); - - string = (*android_java_env)->CallObjectMethod (android_java_env, object, - method); - android_exception_check_2 (object, locale); - - if (!string) + if (android_get_current_api_level () < 21) script = empty_unibyte_string; else { - data = (*android_java_env)->GetStringUTFChars (android_java_env, - string, NULL); - android_exception_check_3 (object, locale, string); + method = (*android_java_env)->GetMethodID (android_java_env, locale, + "getScript", + "()Ljava/lang/String;"); + if (!method) + emacs_abort (); - if (!data) + string = (*android_java_env)->CallObjectMethod (android_java_env, + object, method); + android_exception_check_2 (object, locale); + + if (!string) script = empty_unibyte_string; else { - script = build_unibyte_string (data); - (*android_java_env)->ReleaseStringUTFChars (android_java_env, - string, data); + data = (*android_java_env)->GetStringUTFChars (android_java_env, + string, NULL); + android_exception_check_3 (object, locale, string); + + if (!data) + script = empty_unibyte_string; + else + { + script = build_unibyte_string (data); + (*android_java_env)->ReleaseStringUTFChars (android_java_env, + string, data); + } } } commit f5a3b5e66a8fd5d397a4540bde6826ef56c5b8eb Merge: de25aaa11a8 ea29a48da13 Author: Po Lu Date: Thu Dec 14 13:25:40 2023 +0800 Merge remote-tracking branch 'savannah/master' into master-android-1 commit de25aaa11a8ef264c6f76841daa7e2a721c60937 Author: Po Lu Date: Thu Dec 14 13:24:42 2023 +0800 Respect Language & Input preferences under Android * doc/emacs/android.texi (Android Environment): * doc/emacs/cmdargs.texi (General Variables): Mention the manner in which the default language environment is selected on Android. * lisp/startup.el (normal-top-level): If android and initial-window-system, call android-locale-for-system-language for the default locale name. * lisp/term/android-win.el (android-locale-for-system-language): New function. * src/androidfns.c (syms_of_androidfns_for_pdumper): New function. (syms_of_androidfns) : New variable. Call syms_of_androidfns_for_pdumper both now and after loading the dump image. diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index fe73bc09d67..3cdeec6ba9e 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -409,15 +409,23 @@ Android Environment $ adb shell "settings put global settings_enable_monitor_phantom_procs false" @end example +@cindex system language settings, Android + The ``Languages & Input'' preferences which apply to the operating +system do not influence the C locale set for programs, but is taken +into account by Emacs during startup: a locale name is generated from +the selected language and regional variant and a language environment +(@pxref{Language Environment}) is selected on that basis, which does +not overwrite @code{LANG} or other locale-related environment +variables. The coding system for language environments set in this +fashion is @code{utf-8-unix} without exception. + @cindex C locale settings, Android - Emacs does not respect the locale configured for user applications -in the system, for the selection of locales available there does not -match that supplied by the C library. When Emacs starts on Android -5.0 or newer, the @code{LANG} environment variable is set to -@code{en_US.utf8}, which induces subprocesses linked against the -Android C library to print output sensibly. Earlier versions of -Android do not implement locales at all, on account of which the -variable is set to @code{C} instead. + Instead, the @code{LANG} environment variable (@pxref{General +Variables}) is set to @code{en_US.utf8} when Emacs starts on Android +5.0 or newer, which induces subprocesses linked against the Android C +library to print output sensibly. Earlier versions of Android do not +implement locales at all, on account of which the variable is set to +@code{C} instead. @cindex running emacs in the background, android @cindex emacs killed, android diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 38e683bd7f5..7cdc29ea30b 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -640,6 +640,11 @@ General Variables of MS-Windows, and in the ``Language and Region'' System Preference on macOS. +When running a GUI session on Android, @env{LANG} is set to a fixed +value, but the language and locale environment is derived from the +system's ``Languages & Input'' preferences. @xref{Android +Environment}. + The value of the @env{LC_CTYPE} category is matched against entries in @code{locale-language-names}, @code{locale-charset-language-names}, and diff --git a/lisp/startup.el b/lisp/startup.el index e40c316a8e8..09ec24c6c67 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -641,7 +641,23 @@ normal-top-level (setq eol-mnemonic-dos "(DOS)" eol-mnemonic-mac "(Mac)"))) - (set-locale-environment nil) + (if (and (featurep 'android) + (eq system-type 'android) + initial-window-system) + ;; If Android windowing is enabled, derive a proper locale + ;; from the system's language preferences. On Android, LANG + ;; and LC_* must be set to one of the two locales the C + ;; library supports, but, by contrast with other systems, the + ;; C library locale does not reflect the configured system + ;; language. + ;; + ;; For this reason, the locale from which Emacs derives a + ;; default language environment is computed from such + ;; preferences, rather than environment variables that the C + ;; library refers to. + (set-locale-environment + (funcall 'android-locale-for-system-language)) + (set-locale-environment nil)) ;; Decode all default-directory's (probably, only *scratch* exists ;; at this point). default-directory of *scratch* is the basis ;; for many other file-name variables and directory lists, so it diff --git a/lisp/term/android-win.el b/lisp/term/android-win.el index 3e759a37a71..b2cc7b5d040 100644 --- a/lisp/term/android-win.el +++ b/lisp/term/android-win.el @@ -424,6 +424,61 @@ android-after-splash-screen 'follow-link t) (newline)))) + +;;; Locale preferences. + +(defvar android-os-language) + +(defun android-locale-for-system-language () + "Return a locale representing the system language. +This locale reflects the system's language preferences in its +language name and country variant fields, and always specifies +the UTF-8 coding system." + ;; android-os-language is a list comprising four elements LANGUAGE, + ;; COUNTRY, SCRIPT, and VARIANT. + ;; + ;; LANGUAGE and COUNTRY are ISO language and country codes identical + ;; to those stored within POSIX locales. + ;; + ;; SCRIPT is an ISO 15924 script tag, representing the script used + ;; if available, or if required to disambiguate between distinct + ;; writing systems for the same combination of language and country. + ;; + ;; VARIANT is an arbitrary string representing the variant of the + ;; LANGUAGE or SCRIPT represented. + ;; + ;; Each of these fields might be empty, but the locale is invalid if + ;; LANGUAGE is empty, which if true "en_US.UTF-8" is returned as a + ;; placeholder. + (let ((language (or (nth 0 android-os-language) "")) + (country (or (nth 1 android-os-language) "")) + (script (or (nth 2 android-os-language) "")) + (variant (or (nth 3 android-os-language) "")) + locale-base locale-modifier) + (if (string-empty-p language) + (setq locale-base "en_US.UTF-8") + (if (string-empty-p country) + (setq locale-base (concat language ".UTF-8")) + (setq locale-base (concat language "_" country + ".UTF-8")))) + ;; No straightforward relation between Java script and variant + ;; combinations exist: Java permits both a script and a variant to + ;; be supplied at once, whereas POSIX's closest analog "modifiers" + ;; permit only either an alternative script or a variant to be + ;; supplied. + ;; + ;; Emacs disregards variants besides "EURO" and scripts besides + ;; "Cyrl", for these two never coexist in existing locales, and + ;; their POSIX equivalents are the sole modifiers recognized by + ;; Emacs. + (if (string-equal script "Cyrl") + (setq locale-modifier "@cyrillic") + (if (string-equal variant "EURO") + (setq locale-modifier "@euro") + (setq locale-modifier ""))) + ;; Return the concatenation of both these values. + (concat locale-base locale-modifier))) + (provide 'android-win) ;; android-win.el ends here. diff --git a/src/androidfns.c b/src/androidfns.c index 31a4924e34d..60ace4fd453 100644 --- a/src/androidfns.c +++ b/src/androidfns.c @@ -27,6 +27,7 @@ Copyright (C) 2023 Free Software Foundation, Inc. #include "keyboard.h" #include "buffer.h" #include "androidgui.h" +#include "pdumper.h" #ifndef ANDROID_STUBIFY @@ -3170,6 +3171,186 @@ android_set_preeditarea (struct window *w, int x, int y) +#ifndef ANDROID_STUBIFY + +static void +syms_of_androidfns_for_pdumper (void) +{ + jclass locale; + jmethodID method; + jobject object; + jstring string; + Lisp_Object language, country, script, variant; + const char *data; + + /* Find the Locale class. */ + + locale = (*android_java_env)->FindClass (android_java_env, + "java/util/Locale"); + if (!locale) + emacs_abort (); + + /* And the method from which the default locale can be + extracted. */ + + method = (*android_java_env)->GetStaticMethodID (android_java_env, + locale, + "getDefault", + "()Ljava/util/Locale;"); + if (!method) + emacs_abort (); + + /* Retrieve the default locale. */ + + object = (*android_java_env)->CallStaticObjectMethod (android_java_env, + locale, method); + android_exception_check_1 (locale); + + if (!object) + emacs_abort (); + + /* Retrieve its language field. Each of these methods is liable to + return the empty string, though if language is empty, the locale + is malformed. */ + + method = (*android_java_env)->GetMethodID (android_java_env, locale, + "getLanguage", + "()Ljava/lang/String;"); + if (!method) + emacs_abort (); + + string = (*android_java_env)->CallObjectMethod (android_java_env, object, + method); + android_exception_check_2 (object, locale); + + if (!string) + language = empty_unibyte_string; + else + { + data = (*android_java_env)->GetStringUTFChars (android_java_env, + string, NULL); + android_exception_check_3 (object, locale, string); + + if (!data) + language = empty_unibyte_string; + else + { + language = build_unibyte_string (data); + (*android_java_env)->ReleaseStringUTFChars (android_java_env, + string, data); + } + } + + /* Delete the reference to this string. */ + ANDROID_DELETE_LOCAL_REF (string); + + /* Proceed to retrieve the country code. */ + + method = (*android_java_env)->GetMethodID (android_java_env, locale, + "getCountry", + "()Ljava/lang/String;"); + if (!method) + emacs_abort (); + + string = (*android_java_env)->CallObjectMethod (android_java_env, object, + method); + android_exception_check_2 (object, locale); + + if (!string) + country = empty_unibyte_string; + else + { + data = (*android_java_env)->GetStringUTFChars (android_java_env, + string, NULL); + android_exception_check_3 (object, locale, string); + + if (!data) + country = empty_unibyte_string; + else + { + country = build_unibyte_string (data); + (*android_java_env)->ReleaseStringUTFChars (android_java_env, + string, data); + } + } + + ANDROID_DELETE_LOCAL_REF (string); + + /* Proceed to retrieve the script. */ + + method = (*android_java_env)->GetMethodID (android_java_env, locale, + "getScript", + "()Ljava/lang/String;"); + if (!method) + emacs_abort (); + + string = (*android_java_env)->CallObjectMethod (android_java_env, object, + method); + android_exception_check_2 (object, locale); + + if (!string) + script = empty_unibyte_string; + else + { + data = (*android_java_env)->GetStringUTFChars (android_java_env, + string, NULL); + android_exception_check_3 (object, locale, string); + + if (!data) + script = empty_unibyte_string; + else + { + script = build_unibyte_string (data); + (*android_java_env)->ReleaseStringUTFChars (android_java_env, + string, data); + } + } + + ANDROID_DELETE_LOCAL_REF (string); + + /* And variant. */ + + method = (*android_java_env)->GetMethodID (android_java_env, locale, + "getVariant", + "()Ljava/lang/String;"); + if (!method) + emacs_abort (); + + string = (*android_java_env)->CallObjectMethod (android_java_env, object, + method); + android_exception_check_2 (object, locale); + + if (!string) + variant = empty_unibyte_string; + else + { + data = (*android_java_env)->GetStringUTFChars (android_java_env, + string, NULL); + android_exception_check_3 (object, locale, string); + + if (!data) + variant = empty_unibyte_string; + else + { + variant = build_unibyte_string (data); + (*android_java_env)->ReleaseStringUTFChars (android_java_env, + string, data); + } + } + + /* Delete the reference to this string. */ + ANDROID_DELETE_LOCAL_REF (string); + + /* And other remaining local references. */ + ANDROID_DELETE_LOCAL_REF (object); + ANDROID_DELETE_LOCAL_REF (locale); + + /* Set Vandroid_os_language. */ + Vandroid_os_language = list4 (language, country, script, variant); +} + +#endif /* ANDROID_STUBIFY */ + void syms_of_androidfns (void) { @@ -3313,6 +3494,26 @@ syms_of_androidfns (void) bell being rung. */); android_keyboard_bell_duration = 50; + DEFVAR_LISP ("android-os-language", Vandroid_os_language, + doc: /* List representing the system language configured. +This list incorporates four elements LANGUAGE, COUNTRY, SCRIPT +and VARIANT, of which: + +LANGUAGE and COUNTRY are ISO language and country codes identical to +those stored within POSIX locales. + +SCRIPT is an ISO 15924 script tag, representing the script used +if available, or if required to disambiguate between distinct +writing systems for the same combination of language and country. + +VARIANT is an arbitrary string representing the variant of the +LANGUAGE or SCRIPT represented. + +Each of these fields might be empty or nil, but the locale is invalid +if LANGUAGE is empty. Users of this variable should consider the +language US English in this scenario. */); + Vandroid_os_language = Qnil; + /* Functions defined. */ defsubr (&Sx_create_frame); defsubr (&Sxw_color_defined_p); @@ -3363,5 +3564,7 @@ syms_of_androidfns (void) staticpro (&tip_dx); tip_dy = Qnil; staticpro (&tip_dy); + + pdumper_do_now_and_after_load (syms_of_androidfns_for_pdumper); #endif /* !ANDROID_STUBIFY */ } commit ea29a48da13d6e6b87a3b017bcf92689bc18ca54 Author: João Távora Date: Wed Nov 8 08:36:04 2023 -0600 Jsonrpc: support some JSONesque non-JSONRPC protocols, like DAP * lisp/jsonrpc.el (jsonrpc-convert-to-endpoint) (jsonrpc-convert-from-endpoint): New generics. (jsonrpc-connection-send): Call jsonrpc-convert-to-endpoint. Rework logging. (jsonrpc-connection-receive): Call jsonrpc-convert-from-endpoint. Rework logging. jsonrpc--reply with METHOD. (jsonrpc--log-event): Take subtype. (Version): Bump to 1.0.19 * test/lisp/progmodes/eglot-tests.el (eglot--sniffing): Adapt to new protocol of jsonrpc--log-event. * doc/lispref/text.texi (JSONRPC Overview): Rework. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index b17eb087f42..e35d449ca6d 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5919,74 +5919,109 @@ JSONRPC Overview @cindex JSONRPC application interfaces @enumerate -@item A user interface for building JSONRPC applications +@item An API for building JSONRPC applications @findex :request-dispatcher @findex :notification-dispatcher @findex jsonrpc-notify @findex jsonrpc-request @findex jsonrpc-async-request -In this scenario, the JSONRPC application selects a concrete subclass -of @code{jsonrpc-connection}, and proceeds to create objects of that -subclass using @code{make-instance}. To initiate a contact to the -remote endpoint, the JSONRPC application passes this object to the -functions @code{jsonrpc-notify}, @code{jsonrpc-request}, and/or -@code{jsonrpc-async-request}. For handling remotely initiated -contacts, which generally come in asynchronously, the instantiation -should include @code{:request-dispatcher} and -@code{:notification-dispatcher} initargs, which are both functions of -3 arguments: the connection object; a symbol naming the JSONRPC method -invoked remotely; and a JSONRPC @code{params} object. +In this scenario, a new aspiring JSONRPC-based application selects a +concrete subclass of @code{jsonrpc-connection} that provides the +transport for the JSONRPC messages to be exchanged between endpoints. + +The application creates objects of that subclass using +@code{make-instance}. To initiate a contact to a remote endpoint, the +application passes this object to the functions such as +@code{jsonrpc-notify}, @code{jsonrpc-request}, or +@code{jsonrpc-async-request}. + +For handling remotely initiated contacts, which generally come in +asynchronously, the @code{make-instance} instantiation should +initialize it the @code{:request-dispatcher} and +@code{:notification-dispatcher} EIEIO keyword arguments. These are +both functions of 3 arguments: the connection object; a symbol naming +the JSONRPC method invoked remotely; and a JSONRPC @code{params} +object. @findex jsonrpc-error The function passed as @code{:request-dispatcher} is responsible for handling the remote endpoint's requests, which expect a reply from the -local endpoint (in this case, the program you're building). Inside -that function, you may either return locally (a normal return) or -non-locally (an error return). A local return value must be a Lisp -object that can be serialized as JSON (@pxref{Parsing JSON}). This -determines a success response, and the object is forwarded to the -server as the JSONRPC @code{result} object. A non-local return, -achieved by calling the function @code{jsonrpc-error}, causes an error -response to be sent to the server. The details of the accompanying -JSONRPC @code{error} are filled out with whatever was passed to +local endpoint (in this case, the application you're building). +Inside that function, you may either return locally (a regular return) +or non-locally (throw an error). Both exits from the request +dispatcher cause a reply to the remote endpoint's request to be sent +through the transport. + +A regular return determines a success response, and the return value +must be a Lisp object that can be serialized as JSON (@pxref{Parsing +JSON}). The result is forwarded to the server as the JSONRPC +@code{result} object. A non-local return, achieved by calling the +function @code{jsonrpc-error}, causes an error response to be sent to +the server. The details of the accompanying JSONRPC @code{error} +object are filled out with whatever was passed to @code{jsonrpc-error}. A non-local return triggered by an unexpected error of any other type also causes an error response to be sent (unless you have set @code{debug-on-error}, in which case this calls the Lisp debugger, @pxref{Error Debugging}). -@item A inheritance interface for building JSONRPC transport implementations - -In this scenario, @code{jsonrpc-connection} is subclassed to implement +@findex jsonrpc-convert-to-endpoint +@findex jsonrpc-convert-from-endpoint +It's possible to use the @code{jsonrpc} library to build applications +based on transport protocols that can be described as +``quasi-JSONRPC''. These are similar, but not quite identical to +JSONRPC, such as the @uref{https://www.jsonrpc.org/, DAP (Debug +Adapter Protocol)}. These protocols also define request, response and +notification messages but the format is not quite the same as JSONRPC. +The generic functions @code{jsonrpc-convert-to-endpoint} and +@code{jsonrpc-convert-from-endpoint} can be customized for converting +between the internal representation of JSONRPC and whatever the +endpoint accepts (@pxref{Generic Functions}). + +@item An API for building JSONRPC transports + +In this scenario, @code{jsonrpc-connection} is sub-classed to implement a different underlying transport strategy (for details on how to subclass, see @ref{Inheritance,Inheritance,,eieio}.). Users of the application-building interface can then instantiate objects of this concrete class (using the @code{make-instance} function) and connect -to JSONRPC endpoints using that strategy. +to JSONRPC endpoints using that strategy. See @ref{Process-based +JSONRPC connections} for a built-in transport implementation. This API has mandatory and optional parts. @findex jsonrpc-connection-send To allow its users to initiate JSONRPC contacts (notifications or -requests) or reply to endpoint requests, the subclass must have an -implementation of the @code{jsonrpc-connection-send} method. +requests) or reply to endpoint requests, the new transport +implementation must equip the @code{jsonrpc-connection-send} generic +function with a specialization for the the new subclass +(@pxref{Generic Functions}). This generic function is called +automatically by primitives such as @code{jsonrpc-request} and +@code{jsonrpc-notify}. The specialization should ensure that the +message described in the argument list is sent through whatever +underlying communication mechanism (a.k.a.@: ``wire'') is used by the +new transport to talk to endpoints. This ``wire'' may be a network +socket, a serial interface, an HTTP connection, etc. @findex jsonrpc-connection-receive Likewise, for handling the three types of remote contacts (requests, notifications, and responses to local requests), the transport implementation must arrange for the function -@code{jsonrpc-connection-receive} to be called after noticing a new -JSONRPC message on the wire (whatever that "wire" may be). +@code{jsonrpc-connection-receive} to be called from Elisp after +noticing some data on the ``wire'' that can be used to craft a JSONRPC +(or quasi-JSONRPC) message. @findex jsonrpc-shutdown @findex jsonrpc-running-p Finally, and optionally, the @code{jsonrpc-connection} subclass should -implement the @code{jsonrpc-shutdown} and @code{jsonrpc-running-p} -methods if these concepts apply to the transport. If they do, then -any system resources (e.g.@: processes, timers, etc.) used to listen for -messages on the wire should be released in @code{jsonrpc-shutdown}, -i.e.@: they should only be needed while @code{jsonrpc-running-p} is -non-@code{nil}. +add specializations to the @code{jsonrpc-shutdown} and +@code{jsonrpc-running-p} generic functions if these concepts apply to +the transport. The specialization of @code{jsonrpc-shutdown} should +ensure the release of any system resources (e.g.@: processes, timers, +etc.) used to listen for messages on the wire. The specialization of +@code{jsonrpc-running-p} should tell if these resources are still +active or have already been released (via @code{jsonrpc-shutdown} or +otherwise). @end enumerate diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 9cb6b90f733..dde1c880912 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ ;; Author: João Távora ;; Keywords: processes, languages, extensions -;; Version: 1.0.18 +;; Version: 1.0.19 ;; Package-Requires: ((emacs "25.2")) ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -133,6 +133,38 @@ jsonrpc-connection-ready-p (:method (_s _what) ;; by default all connections are ready t)) +;;; API optional +(cl-defgeneric jsonrpc-convert-to-endpoint (connection message subtype) + "Convert MESSAGE to JSONRPCesque message accepted by endpoint. +MESSAGE is a plist, jsonrpc.el's internal representation of a +JSONRPC message. SUBTYPE is one of `request', `reply' or +`notification'. + +Return a plist to be serialized to JSON with `json-serialize' and +transmitted to endpoint." + ;; TODO: describe representations and serialization in manual and + ;; link here. + (:method (_s message subtype) + `(:jsonrpc "2.0" + ,@(if (eq subtype 'reply) + ;; true JSONRPC doesn't have `method' + ;; fields in responses. + (cl-loop for (k v) on message by #'cddr + unless (eq k :method) + collect k and collect v) + message)))) + +;;; API optional +(cl-defgeneric jsonrpc-convert-from-endpoint (connection remote-message) + "Convert JSONRPC-esque REMOTE-MESSAGE to a plist. +REMOTE-MESSAGE is a plist read with `json-parse'. + +Return a plist of jsonrpc.el's internal representation of a +JSONRPC message." + ;; TODO: describe representations and serialization in manual and + ;; link here. + (:method (_s remote-message) remote-message)) + ;;; Convenience ;;; @@ -170,9 +202,12 @@ jsonrpc-connection-receive This function will destructure MESSAGE and call the appropriate dispatcher in CONNECTION." (cl-destructuring-bind (&key method id error params result _jsonrpc) - message + (jsonrpc-convert-from-endpoint connection message) + (jsonrpc--log-event connection message 'server + (cond ((and method id) 'request) + (method 'notification) + (id 'reply))) (let (continuations) - (jsonrpc--log-event connection message 'server) (setf (jsonrpc-last-error connection) error) (cond (;; A remote request @@ -193,7 +228,7 @@ jsonrpc-connection-receive "Internal error"))))) (error '(:error (:code -32603 :message "Internal error")))))) - (apply #'jsonrpc--reply connection id reply))) + (apply #'jsonrpc--reply connection id method reply))) (;; A remote notification method (funcall (jsonrpc--notification-dispatcher connection) @@ -435,11 +470,11 @@ initialize-instance (cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection) &rest args &key - _id + id method _params - _result - _error + (_result nil result-supplied-p) + error _partial) "Send MESSAGE, a JSON object, to CONNECTION." (when method @@ -448,18 +483,21 @@ jsonrpc-connection-send ((symbolp method) (symbol-name method)) ((stringp method) method) (t (error "[jsonrpc] invalid method %s" method))))) - (let* ( (message `(:jsonrpc "2.0" ,@args)) - (json (jsonrpc--json-encode message)) - (headers - `(("Content-Length" . ,(format "%d" (string-bytes json))) - ;; ("Content-Type" . "application/vscode-jsonrpc; charset=utf-8") - ))) + (let* ((subtype (cond ((or result-supplied-p error) 'reply) + (id 'request) + (method 'notification))) + (converted (jsonrpc-convert-to-endpoint connection args subtype)) + (json (jsonrpc--json-encode converted)) + (headers + `(("Content-Length" . ,(format "%d" (string-bytes json))) + ;; ("Content-Type" . "application/vscode-jsonrpc; charset=utf-8") + ))) (process-send-string (jsonrpc--process connection) (cl-loop for (header . value) in headers concat (concat header ": " value "\r\n") into header-section finally return (format "%s\r\n%s" header-section json))) - (jsonrpc--log-event connection message 'client))) + (jsonrpc--log-event connection converted 'client subtype))) (defun jsonrpc-process-type (conn) "Return the `process-type' of JSONRPC connection CONN." @@ -526,12 +564,13 @@ 'jsonrpc--json-encode "Encode OBJECT into a JSON string.") (cl-defun jsonrpc--reply - (connection id &key (result nil result-supplied-p) (error nil error-supplied-p)) + (connection id method &key (result nil result-supplied-p) (error nil error-supplied-p)) "Reply to CONNECTION's request ID with RESULT or ERROR." (apply #'jsonrpc-connection-send connection `(:id ,id ,@(and result-supplied-p `(:result ,result)) - ,@(and error-supplied-p `(:error ,error))))) + ,@(and error-supplied-p `(:error ,error)) + :method ,method))) (defun jsonrpc--call-deferred (connection) "Call CONNECTION's deferred actions, who may again defer themselves." @@ -738,24 +777,19 @@ jsonrpc--warn (apply #'format format args) :warning))) -(defun jsonrpc--log-event (connection message &optional type) +(defun jsonrpc--log-event (connection message &optional origin subtype) "Log a JSONRPC-related event. CONNECTION is the current connection. MESSAGE is a JSON-like -plist. TYPE is a symbol saying if this is a client or server -originated." +plist. ORIGIN is a symbol saying where event originated. +SUBTYPE tells more about the event." (let ((max (jsonrpc--events-buffer-scrollback-size connection))) (when (or (null max) (cl-plusp max)) (with-current-buffer (jsonrpc-events-buffer connection) - (cl-destructuring-bind (&key method id error &allow-other-keys) message + (cl-destructuring-bind (&key _method id error &allow-other-keys) message (let* ((inhibit-read-only t) - (subtype (cond ((and method id) 'request) - (method 'notification) - (id 'reply) - (t 'message))) (type - (concat (format "%s" (or type 'internal)) - (if type - (format "-%s" subtype))))) + (concat (format "%s" (or origin 'internal)) + (if origin (format "-%s" (or subtype 'message)))))) (goto-char (point-max)) (prog1 (let ((msg (format "[%s]%s%s %s:\n%s" diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 575a6ac8ef1..996ff276e68 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -209,27 +209,25 @@ eglot--sniffing client-replies)) (advice-add #'jsonrpc--log-event :before - (lambda (_proc message &optional type) - (cl-destructuring-bind (&key method id _error &allow-other-keys) - message - (let ((req-p (and method id)) - (notif-p method) - (reply-p id)) - (cond - ((eq type 'server) - (cond (req-p ,(when server-requests - `(push message ,server-requests))) - (notif-p ,(when server-notifications - `(push message ,server-notifications))) - (reply-p ,(when server-replies - `(push message ,server-replies))))) - ((eq type 'client) - (cond (req-p ,(when client-requests - `(push message ,client-requests))) - (notif-p ,(when client-notifications - `(push message ,client-notifications))) - (reply-p ,(when client-replies - `(push message ,client-replies))))))))) + (lambda (_proc message &optional origin subtype) + (let ((req-p (eq subtype 'request)) + (notif-p (eq subtype 'notification)) + (reply-p (eql subtype 'reply))) + (cond + ((eq origin 'server) + (cond (req-p ,(when server-requests + `(push message ,server-requests))) + (notif-p ,(when server-notifications + `(push message ,server-notifications))) + (reply-p ,(when server-replies + `(push message ,server-replies))))) + ((eq origin 'client) + (cond (req-p ,(when client-requests + `(push message ,client-requests))) + (notif-p ,(when client-notifications + `(push message ,client-notifications))) + (reply-p ,(when client-replies + `(push message ,client-replies)))))))) '((name . ,log-event-ad-sym))) ,@body) (advice-remove #'jsonrpc--log-event ',log-event-ad-sym)))) commit 60473c4d90a6cdce3f06e183809f5be440dd8797 Author: João Távora Date: Mon Dec 11 00:01:03 2023 +0000 Jsonrpc: rework fix for bug#60088 Try to decouple receiving text and processing messages in the event loop. This should allow for requests within requests in both Eglot and the Dape extension (https://github.com/svaante/dape). jsonrpc-connection-receive is now called from timers after the process filter finished. Because of this, a detail is that any serialization errors are now thrown from timers instead of the synchronous process filter, and there's no good way to test this in ert, so a test has been deleted. * lisp/jsonrpc.el (jsonrpc--process-filter): Rework. * test/lisp/jsonrpc-tests.el (json-el-cant-serialize-this): Delete test. diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 67243fd49e3..9cb6b90f733 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -564,27 +564,12 @@ jsonrpc--process-sentinel (delete-process proc) (funcall (jsonrpc--on-shutdown connection) connection))))) -(defvar jsonrpc--in-process-filter nil - "Non-nil if inside `jsonrpc--process-filter'.") - (cl-defun jsonrpc--process-filter (proc string) "Called when new data STRING has arrived for PROC." - (when jsonrpc--in-process-filter - ;; Problematic recursive process filters may happen if - ;; `jsonrpc--connection-receive', called by us, eventually calls - ;; client code which calls `process-send-string' (which see) to, - ;; say send a follow-up message. If that happens to writes enough - ;; bytes for pending output to be received, we will lose JSONRPC - ;; messages. In that case, remove recursiveness by re-scheduling - ;; ourselves to run from within a timer as soon as possible - ;; (bug#60088) - (run-at-time 0 nil #'jsonrpc--process-filter proc string) - (cl-return-from jsonrpc--process-filter)) (when (buffer-live-p (process-buffer proc)) (with-current-buffer (process-buffer proc) - (let* ((jsonrpc--in-process-filter t) - (connection (process-get proc 'jsonrpc-connection)) - (expected-bytes (jsonrpc--expected-bytes connection))) + (let* ((conn (process-get proc 'jsonrpc-connection)) + (expected-bytes (jsonrpc--expected-bytes conn))) ;; Insert the text, advancing the process marker. ;; (save-excursion @@ -619,24 +604,24 @@ jsonrpc--process-filter expected-bytes) (let* ((message-end (byte-to-position (+ (position-bytes (point)) - expected-bytes)))) + expected-bytes))) + message + ) (unwind-protect (save-restriction (narrow-to-region (point) message-end) - (let* ((json-message - (condition-case-unless-debug oops - (jsonrpc--json-read) - (error - (jsonrpc--warn "Invalid JSON: %s %s" - (cdr oops) (buffer-string)) - nil)))) - (when json-message - ;; Process content in another - ;; buffer, shielding proc buffer from - ;; tamper - (with-temp-buffer - (jsonrpc-connection-receive connection - json-message))))) + (setq message + (condition-case-unless-debug oops + (jsonrpc--json-read) + (error + (jsonrpc--warn "Invalid JSON: %s %s" + (cdr oops) (buffer-string)) + nil))) + (when message + (process-put proc 'jsonrpc-mqueue + (nconc (process-get proc + 'jsonrpc-mqueue) + (list message))))) (goto-char message-end) (let ((inhibit-read-only t)) (delete-region (point-min) (point))) @@ -645,9 +630,21 @@ jsonrpc--process-filter ;; Message is still incomplete ;; (setq done :waiting-for-more-bytes-in-this-message)))))))) - ;; Saved parsing state for next visit to this filter + ;; Saved parsing state for next visit to this filter, which + ;; may well be a recursive one stemming from the tail call + ;; to `jsonrpc-connection-receive' below (bug#60088). ;; - (setf (jsonrpc--expected-bytes connection) expected-bytes)))))) + (setf (jsonrpc--expected-bytes conn) expected-bytes) + ;; Now, time to notify user code of one or more messages in + ;; order. Very often `jsonrpc-connection-receive' will exit + ;; non-locally (typically the reply to a request), so do + ;; this all this processing in top-level loops timer. + (cl-loop + for msg = (pop (process-get proc 'jsonrpc-mqueue)) while msg + do (run-at-time 0 nil + (lambda (m) (with-temp-buffer + (jsonrpc-connection-receive conn m))) + msg))))))) (cl-defun jsonrpc--async-request-1 (connection method diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el index 85ac96a931c..5c3b694194f 100644 --- a/test/lisp/jsonrpc-tests.el +++ b/test/lisp/jsonrpc-tests.el @@ -103,6 +103,7 @@ jsonrpc--call-with-emacsrpc-fixture (process-get listen-server 'handlers)))))))) (cl-defmacro jsonrpc--with-emacsrpc-fixture ((endpoint-sym) &body body) + (declare (indent 1)) `(jsonrpc--call-with-emacsrpc-fixture (lambda (,endpoint-sym) ,@body))) (ert-deftest returns-3 () @@ -151,14 +152,6 @@ stretching-it-but-works [1 2 3 3 4 5] (jsonrpc-request conn 'vconcat [[1 2 3] [3 4 5]]))))) -(ert-deftest json-el-cant-serialize-this () - "Can't serialize a response that is half-vector/half-list." - (jsonrpc--with-emacsrpc-fixture (conn) - (should-error - ;; (append [1 2 3] [3 4 5]) => (1 2 3 . [3 4 5]), which can't be - ;; serialized - (jsonrpc-request conn 'append [[1 2 3] [3 4 5]])))) - (cl-defmethod jsonrpc-connection-ready-p ((conn jsonrpc--test-client) what) (and (cl-call-next-method) commit d2f95ea44c8ea408f5c11d89e40982376ae268cc Author: João Távora Date: Sat Dec 9 20:13:39 2023 +0000 Jsonrpc: better initforms in jsonrpc-connection * lisp/jsonrpc.el (jsonrpc-connection): Better initforms diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index f7ccc8d2745..67243fd49e3 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -51,6 +51,7 @@ (defclass jsonrpc-connection () ((name :accessor jsonrpc-name + :initform "anonymous" :initarg :name :documentation "A name for the connection") (-request-dispatcher @@ -76,6 +77,7 @@ jsonrpc-connection :accessor jsonrpc--events-buffer :documentation "A buffer pretty-printing the JSONRPC events") (-events-buffer-scrollback-size + :initform nil :initarg :events-buffer-scrollback-size :accessor jsonrpc--events-buffer-scrollback-size :documentation "Max size of events buffer. 0 disables, nil means infinite.") commit 8de749faa14f6a1566a5a92b84a6f834944eb22f Author: João Távora Date: Wed Nov 8 08:22:23 2023 -0600 Jsonrpc: allow method identifiers to be simply strings * lisp/jsonrpc.el (jsonrpc-connection-send): Support string methods. diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 7726712d056..f7ccc8d2745 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -443,7 +443,9 @@ jsonrpc-connection-send (when method (plist-put args :method (cond ((keywordp method) (substring (symbol-name method) 1)) - ((and method (symbolp method)) (symbol-name method))))) + ((symbolp method) (symbol-name method)) + ((stringp method) method) + (t (error "[jsonrpc] invalid method %s" method))))) (let* ( (message `(:jsonrpc "2.0" ,@args)) (json (jsonrpc--json-encode message)) (headers commit 33aa46fe94f5551d3158a6b2dcb3e81e908bdbd1 Author: Michael Albinus Date: Wed Dec 13 13:20:43 2023 +0100 Improve tramp-compat-connection-local-p * lisp/net/tramp-compat.el (tramp-compat-connection-local-p): Make it compatible with Emacs 27. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 820d9f07883..e05f371f406 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -310,13 +310,11 @@ 'tramp-compat-auth-source-netrc-parse-all ;; Macro `connection-local-p' is new in Emacs 30.1. (if (macrop 'connection-local-p) (defalias 'tramp-compat-connection-local-p #'connection-local-p) - (defmacro tramp-compat-connection-local-p (variable &optional application) - "Non-nil if VARIABLE has a connection-local binding in `default-directory'. -If APPLICATION is nil, the value of -`connection-local-default-application' is used." + (defmacro tramp-compat-connection-local-p (variable) + "Non-nil if VARIABLE has a connection-local binding in `default-directory'." `(let (connection-local-variables-alist file-local-variables-alist) (hack-connection-local-variables - (connection-local-criteria-for-default-directory ,application)) + (connection-local-criteria-for-default-directory)) (and (assq ',variable connection-local-variables-alist) t)))) (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) commit 281a16d15fad5b05d88d03e2f4c9718c81657840 Author: Andrea Corallo Date: Wed Dec 13 12:22:39 2023 +0100 * configure.ac: Fix '--without-all' if libgccjit installed (bug#67799) diff --git a/configure.ac b/configure.ac index a279f78a0ea..0224c9c32eb 100644 --- a/configure.ac +++ b/configure.ac @@ -5149,6 +5149,11 @@ AC_DEFUN with_native_compilation=no]) +if test "$with_features" = "no" \ + && test "${with_native_compilation}" = "default"; then + with_native_compilation=no +fi + if test "${with_native_compilation}" = "default"; then # Check if libgccjit is available. AC_CHECK_LIB([gccjit], [gcc_jit_context_acquire], commit 400ef15bdc373b05e877cf0914f0fd5eda56cf1d Author: Dmitry Gutov Date: Wed Dec 13 00:00:38 2023 +0200 js-ts-mode: Fix font-lock rules conflict * lisp/progmodes/js.el (js--treesit-font-lock-settings): Move 'property' to after 'jsx'. Stop using predicate (bug#67684). (js--treesit-property-not-function-p): Delete. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index aaf5779699b..c8d507c784b 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3580,16 +3580,6 @@ js--treesit-font-lock-settings ;; full namespace import (* as alias) (import_clause (namespace_import (identifier) @font-lock-variable-name-face))) - :language 'javascript - :feature 'property - '(((property_identifier) @font-lock-property-use-face - (:pred js--treesit-property-not-function-p - @font-lock-property-use-face)) - - (pair value: (identifier) @font-lock-variable-use-face) - - ((shorthand_property_identifier) @font-lock-property-use-face)) - :language 'javascript :feature 'assignment '((assignment_expression @@ -3610,6 +3600,12 @@ js--treesit-font-lock-settings (jsx_self_closing_element name: (_) @font-lock-function-call-face) (jsx_attribute (property_identifier) @font-lock-constant-face)) + :language 'javascript + :feature 'property + '(((property_identifier) @font-lock-property-use-face) + (pair value: (identifier) @font-lock-variable-use-face) + ((shorthand_property_identifier) @font-lock-property-use-face)) + :language 'javascript :feature 'number '((number) @font-lock-number-face @@ -3661,14 +3657,6 @@ js--fontify-template-string (setq font-beg (treesit-node-end child) child (treesit-node-next-sibling child))))) -(defun js--treesit-property-not-function-p (node) - "Check that NODE, a property_identifier, is not used as a function." - (not (equal (treesit-node-type - (treesit-node-parent ; Maybe call_expression. - (treesit-node-parent ; Maybe member_expression. - node))) - "call_expression"))) - (defvar js--treesit-lhs-identifier-query (when (treesit-available-p) (treesit-query-compile 'javascript '((identifier) @id commit 75fd7550ed6cede6c9e8224f1f2d62637c43fdd4 Author: Eric Abrahamsen Date: Fri Dec 8 09:39:58 2023 -0800 Provide option to forward Gnus messages with all (most) headers Bug#67520 * lisp/gnus/gnus-msg.el (gnus-summary-mail-forward): Accept symbolic prefix to let-bind message-forward-included-headers to nil, which will include most original message headers in the forwarded copy. (gnus-summary-post-forward): Corresponding arglist update. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 586e4b94ba1..ead5954a96e 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -5868,15 +5868,23 @@ Summary Mail Commands @findex gnus-summary-mail-forward @c @icon{gnus-summary-mail-forward} Forward the current article to some other person -(@code{gnus-summary-mail-forward}). If no prefix is given, the message -is forwarded according to the value of (@code{message-forward-as-mime}) -and (@code{message-forward-show-mml}); if the prefix is 1, decode the -message and forward directly inline; if the prefix is 2, forward message -as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and -forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message -directly inline; otherwise, the message is forwarded as no prefix given -but use the flipped value of (@code{message-forward-as-mime}). By -default, the forwarded message is inlined into the mail. +(@code{gnus-summary-mail-forward}). If no prefix is given, the +message is forwarded according to the value of +(@code{message-forward-as-mime}) and +(@code{message-forward-show-mml}); if the prefix is 1, decode the +message and forward directly inline; if the prefix is 2, forward +message as an rfc822 @acronym{MIME} section; if the prefix is 3, +decode message and forward as an rfc822 @acronym{MIME} section; if the +prefix is 4, forward message directly inline; otherwise, the message +is forwarded as no prefix given but use the negated value of +(@code{message-forward-as-mime}). By default, the forwarded message +is inlined into the mail. + +Which headers from the original message are included in the forwarded +message is determined by options specific to @code{message-mode}, +@pxref{Forwarding,,, message}. In addition, this command can be given +the symbolic prefix @samp{a}, using @kbd{M-i a}, to include most original +headers. @item S m @itemx m diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index b065ae34851..e503ccae00f 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1209,7 +1209,7 @@ gnus-summary-very-wide-reply-with-original (gnus-summary-reply (gnus-summary-work-articles n) t (gnus-summary-work-articles n))) -(defun gnus-summary-mail-forward (&optional arg post) +(defun gnus-summary-mail-forward (&optional arg all-headers post) "Forward the current message(s) to another user. If process marks exist, forward all marked messages; if ARG is nil, see `message-forward-as-mime' and `message-forward-show-mml'; @@ -1217,17 +1217,25 @@ gnus-summary-mail-forward if ARG is 2, forward message as an rfc822 MIME section; if ARG is 3, decode message and forward as an rfc822 MIME section; if ARG is 4, forward message directly inline; -otherwise, use flipped `message-forward-as-mime'. +otherwise, use negated `message-forward-as-mime'. If POST, post instead of mail. -For the \"inline\" alternatives, also see the variable -`message-forward-ignored-headers'." - (interactive "P" gnus-summary-mode) +If symbolic prefix ALL-HEADERS is the symbol `a', include all +original headers in the forwarded message, except those matching +`message-forward-ignored-headers'. Otherwise, include headers +based on the options `message-forward-included-headers', +`message-forward-ignored-headers', and potentially +`message-forward-included-mime-headers'." + (interactive (gnus-interactive "P\ny") gnus-summary-mode) (if (cdr (gnus-summary-work-articles nil)) ;; Process marks are given. (gnus-uu-digest-mail-forward nil post) ;; No process marks. (let ((message-forward-as-mime message-forward-as-mime) - (message-forward-show-mml message-forward-show-mml)) + (message-forward-show-mml message-forward-show-mml) + (message-forward-included-headers + (if (eq all-headers 'a) + nil + message-forward-included-headers))) (cond ((null arg)) ((eq arg 1) @@ -1380,11 +1388,11 @@ gnus-summary-resend-message-edit (forward-char 1)) (widen))))) -(defun gnus-summary-post-forward (&optional arg) +(defun gnus-summary-post-forward (&optional arg all-headers) "Forward the current article to a newsgroup. See `gnus-summary-mail-forward' for ARG." - (interactive "P" gnus-summary-mode) - (gnus-summary-mail-forward arg t)) + (interactive (gnus-interactive "P\ny") gnus-summary-mode) + (gnus-summary-mail-forward arg all-headers t)) (defun gnus-summary-mail-crosspost-complaint (n) "Send a complaint about crossposting to the current article(s)." commit 67654fe96577823e6fcbd3e88b9779653f8b6201 Author: Michael Albinus Date: Tue Dec 12 17:39:51 2023 +0100 New macro connection-local-p * doc/lispref/variables.texi (Applying Connection Local Variables): Add macro 'connection-local-p'. * etc/NEWS: Add macro `connection-local-p'. * lisp/files-x.el (connection-local-p): New macro. (connection-local-value): Add debug declaration. * lisp/net/tramp-compat.el (tramp-compat-connection-local-p): New macro. * lisp/net/tramp-crypt.el (tramp-crypt-cleanup-connection): Bind `tramp-crypt-enabled'. * test/lisp/files-x-tests.el (files-x-test-connection-local-value): * test/lisp/net/tramp-tests.el (tramp-test18-file-attributes) (tramp-test35-remote-path): Adapt tests. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 36468bddffa..85a28c1d9c1 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2487,7 +2487,7 @@ Applying Connection Local Variables @defvar connection-local-default-application The default application, a symbol, to be applied in -@code{with-connection-local-variables} and +@code{with-connection-local-variables}, @code{connection-local-p} and @code{connection-local-value}. It defaults to @code{tramp}, but you can let-bind it to change the application temporarily (@pxref{Local Variables}). @@ -2546,6 +2546,13 @@ Applying Connection Local Variables This variable must not be changed globally. @end defvar +@defmac connection-local-p symbol &optional application +This macro returns non-@code{nil} if @var{symbol} has a +connection-local binding for @var{application}. If @var{application} +is @code{nil}, the value of +@code{connection-local-default-application} is used. +@end defmac + @defmac connection-local-value symbol &optional application This macro returns the connection-local value of @var{symbol} for @var{application}. If @var{application} is @code{nil}, the value of diff --git a/etc/NEWS b/etc/NEWS index 33afb34b029..1ff2f8a149f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1655,9 +1655,10 @@ dir-locals file to modify. ** Connection local variables +++ -*** New macro 'connection-local-value'. -This macro returns the connection-local value of a variable if any, or -its current value. +*** New macros 'connection-local-p' and 'connection-local-value'. +The former macro returns non-nil if a variable has a connection-local +binding. The latter macro returns the connection-local value of a +variable if any, or its current value. * Changes in Emacs 30.1 on Non-Free Operating Systems diff --git a/lisp/files-x.el b/lisp/files-x.el index 282cc79f26e..41d9cd3bab8 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -926,6 +926,19 @@ setq-connection-local connection-local-criteria connection-local-profile-name-for-setq))))) +;;;###autoload +(defmacro connection-local-p (variable &optional application) + "Non-nil if VARIABLE has a connection-local binding in `default-directory'. +If APPLICATION is nil, the value of +`connection-local-default-application' is used." + (declare (debug (symbolp &optional form))) + (unless (symbolp variable) + (signal 'wrong-type-argument (list 'symbolp variable))) + `(let (connection-local-variables-alist file-local-variables-alist) + (hack-connection-local-variables + (connection-local-criteria-for-default-directory ,application)) + (and (assq ',variable connection-local-variables-alist) t))) + ;;;###autoload (defmacro connection-local-value (variable &optional application) "Return connection-local VARIABLE for APPLICATION in `default-directory'. @@ -933,6 +946,7 @@ connection-local-value `connection-local-default-application' is used. If VARIABLE does not have a connection-local binding, the return value is the default binding of the variable." + (declare (debug (symbolp &optional form))) (unless (symbolp variable) (signal 'wrong-type-argument (list 'symbolp variable))) `(let (connection-local-variables-alist file-local-variables-alist) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 22ee5b32717..820d9f07883 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -307,6 +307,18 @@ 'tramp-compat-auth-source-netrc-parse-all ?\N{KHMER SIGN CAMNUC PII KUUH}) "List of characters equivalent to trailing colon in \"password\" prompts.")) +;; Macro `connection-local-p' is new in Emacs 30.1. +(if (macrop 'connection-local-p) + (defalias 'tramp-compat-connection-local-p #'connection-local-p) + (defmacro tramp-compat-connection-local-p (variable &optional application) + "Non-nil if VARIABLE has a connection-local binding in `default-directory'. +If APPLICATION is nil, the value of +`connection-local-default-application' is used." + `(let (connection-local-variables-alist file-local-variables-alist) + (hack-connection-local-variables + (connection-local-criteria-for-default-directory ,application)) + (and (assq ',variable connection-local-variables-alist) t)))) + (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) (function-put (intern elt) 'tramp-suppress-trace t)) diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 0d79f88f10c..0680fcbe8c9 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -859,7 +859,8 @@ tramp-crypt-cleanup-connection "Cleanup crypt resources determined by VEC." (let ((tramp-cleanup-connection-hook (remove - #'tramp-crypt-cleanup-connection tramp-cleanup-connection-hook))) + #'tramp-crypt-cleanup-connection tramp-cleanup-connection-hook)) + (tramp-crypt-enabled t)) (dolist (dir tramp-crypt-directories) (when (tramp-file-name-equal-p vec (tramp-dissect-file-name dir)) (tramp-cleanup-connection (tramp-crypt-dissect-file-name dir)))))) diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el index 795d03a071d..c7a56611497 100644 --- a/test/lisp/files-x-tests.el +++ b/test/lisp/files-x-tests.el @@ -39,6 +39,7 @@ files-x-test--variables4 (defconst files-x-test--variables5 '((remote-lazy-var . nil) (remote-null-device . "/dev/null"))) +(defvar remote-shell-file-name) (defvar remote-null-device) (defvar remote-lazy-var nil) (put 'remote-shell-file-name 'safe-local-variable #'identity) @@ -497,8 +498,10 @@ files-x-test-connection-local-value (connection-local-set-profiles nil 'remote-ksh 'remote-nullfile) + (connection-local-set-profile-variables + 'remote-lazy files-x-test--variables5) (connection-local-set-profiles - files-x-test--application 'remote-bash) + files-x-test--application 'remote-lazy 'remote-bash) (with-temp-buffer ;; We need a remote `default-directory'. @@ -512,24 +515,36 @@ files-x-test-connection-local-value (should (string-equal (symbol-value 'remote-null-device) "null")) ;; The proper variable values are set. + (should (connection-local-p remote-shell-file-name)) (should (string-equal (connection-local-value remote-shell-file-name) "/bin/ksh")) + (should (connection-local-p remote-null-device)) (should (string-equal (connection-local-value remote-null-device) "/dev/null")) + (should-not (connection-local-p remote-lazy-var)) ;; Run with a different application. + (should + (connection-local-p + remote-shell-file-name (cadr files-x-test--application))) (should (string-equal (connection-local-value remote-shell-file-name (cadr files-x-test--application)) "/bin/bash")) + (should + (connection-local-p + remote-null-device (cadr files-x-test--application))) (should (string-equal (connection-local-value remote-null-device (cadr files-x-test--application)) "/dev/null")) + (should + (connection-local-p + remote-lazy-var (cadr files-x-test--application))) ;; The previous bindings haven't changed. (should-not connection-local-variables-alist) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index d8932a28e4d..68bf928eb62 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3811,7 +3811,7 @@ tramp-test18-file-attributes (should (eq (file-attribute-type attr) t))) ;; Cleanup. - (ignore-errors (delete-directory tmp-name1)) + (ignore-errors (delete-directory tmp-name1 'recursive)) (ignore-errors (delete-file tmp-name1)) (ignore-errors (delete-file tmp-name2)))))) @@ -6360,6 +6360,8 @@ tramp-test35-remote-path (tramp-remote-path tramp-remote-path) (orig-tramp-remote-path tramp-remote-path) path) + ;; The "flatpak" method modifies `tramp-remote-path'. + (skip-unless (not (tramp-compat-connection-local-p tramp-remote-path))) (unwind-protect (progn ;; Non existing directories are removed. commit c165247c3009adec912abdf74d6d7d73c8c76c33 Author: Noah Peart Date: Sun Dec 10 14:58:31 2023 -0800 Add indentation rules for bracketless statements in js-ts-mode * lisp/progmodes/js.el (js--treesit-indent-rules): Add indentation rules to handle bracketless statements (bug#67758). * test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation): New test for js-ts-mode indentation. * test/lisp/progmodes/js-resources/js-ts-indents.erts: New file with indentation tests for js-ts-mode. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 71aa5cbea68..aaf5779699b 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3472,6 +3472,11 @@ js--treesit-indent-rules ((parent-is "class_body") parent-bol js-indent-level) ((parent-is ,switch-case) parent-bol js-indent-level) ((parent-is "statement_block") parent-bol js-indent-level) + ((match "while" "do_statement") parent-bol 0) + ((match "else" "if_statement") parent-bol 0) + ((parent-is ,(rx (or (seq (or "if" "for" "for_in" "while" "do") "_statement") + "else_clause"))) + parent-bol js-indent-level) ;; JSX ,@(js-jsx--treesit-indent-compatibility-bb1f97b) diff --git a/test/lisp/progmodes/js-resources/js-ts-indents.erts b/test/lisp/progmodes/js-resources/js-ts-indents.erts new file mode 100644 index 00000000000..2e34b23acef --- /dev/null +++ b/test/lisp/progmodes/js-resources/js-ts-indents.erts @@ -0,0 +1,44 @@ +Code: + (lambda () + (setq indent-tabs-mode nil) + (setq js-indent-level 2) + (js-ts-mode) + (indent-region (point-min) (point-max))) + +Name: Basic indentation + +=-= +const foo = () => { + console.log("bar"); + if (x) { + return y; + } else if (y) { + return u; + } + return baz.x() + ? true + : false; +} +=-=-= + +Name: Statement indentation without braces + +=-= +function bracketless_statements(x) { + if (x == 0) + console.log("if_statement"); + else if (x == 1) + console.log("if_statement"); + else + console.log("else_clause"); + for (let i = 0; i < 1; i++) + console.log("for_statement"); + for (let _ of [true]) + console.log("for_in_statement"); + while (x-- > 0) + console.log("while_statement"); + do + console.log("do_statement"); + while (false) +}; +=-=-= diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 5db92b08f8a..827d7bb8a99 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -288,6 +288,12 @@ js-mode-end-of-defun ;; end-of-defun should move point to eob. (should (eobp)))) +;;;; Tree-sitter tests. + +(ert-deftest js-ts-mode-test-indentation () + (skip-unless (treesit-ready-p 'javascript)) + (ert-test-erts-file (ert-resource-file "js-ts-indents.erts"))) + (provide 'js-tests) ;;; js-tests.el ends here commit 6abea4d98d1d964c68a78cb9b5321071da851654 Author: Juri Linkov Date: Mon Dec 11 19:16:37 2023 +0200 Fix typo in commit 3c093148958d56e0ed8e12a8e00ced1ef052259a * lisp/minibuffer.el (minibuffer-completion-help): Set t to LOCAL arg of add-hook for after-change-functions. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a9814fb0bac..1af890968d0 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2551,7 +2551,7 @@ minibuffer-completion-help . ,#'(lambda (_window) (with-current-buffer mainbuf (when completion-auto-deselect - (add-hook 'after-change-functions #'completions--after-change t)) + (add-hook 'after-change-functions #'completions--after-change nil t)) ;; Remove the base-size tail because `sort' requires a properly ;; nil-terminated list. (when last (setcdr last nil)) commit 9434ad25ce2747864e0bcf5665f65eb65a079178 Author: Po Lu Date: Mon Dec 11 11:39:00 2023 +0800 Introduce menus beneath new chapters in the Transient menu * doc/misc/transient.texi (Usage) (Modifying Existing Transients): Insert menus from which Texinfo 4.13 can infer Prev and Next nodes. diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index ac330e09702..cba434d072e 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -203,6 +203,18 @@ Introduction @node Usage @chapter Usage +@menu +* Invoking Transients:: +* Aborting and Resuming Transients:: +* Common Suffix Commands:: +* Saving Values:: +* Using History:: +* Getting Help for Suffix Commands:: +* Enabling and Disabling Suffixes:: +* Other Commands:: +* Configuration:: +@end menu + @node Invoking Transients @section Invoking Transients @@ -926,6 +938,15 @@ Modifying Existing Transients @node Defining New Commands @chapter Defining New Commands +@menu +* Technical Introduction:: +* Defining Transients:: +* Binding Suffix and Infix Commands:: +* Defining Suffix and Infix Commands:: +* Using Infix Arguments:: +* Transient State:: +@end menu + @node Technical Introduction @section Technical Introduction commit 1ec8e76bcf9aa9ec31718c9a2bb80f89219383e4 Author: Po Lu Date: Mon Dec 11 11:28:34 2023 +0800 Correct implementation of UTP * src/sfnt.c (sfnt_interpret_utp): Derive which flags to reset from the freedom vector. diff --git a/src/sfnt.c b/src/sfnt.c index 44906b12ce9..f9ffc86da58 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -7450,6 +7450,8 @@ sfnt_scale_by_freedom_vector (struct sfnt_interpreter *interpreter, sfnt_interpret_utp (struct sfnt_interpreter *interpreter, uint32_t p) { + unsigned char mask; + if (!interpreter->state.zp0) { if (p >= interpreter->twilight_zone_size) @@ -7463,7 +7465,31 @@ sfnt_interpret_utp (struct sfnt_interpreter *interpreter, || p >= interpreter->glyph_zone->num_points) TRAP ("UTP[] p lies outside glyph zone"); - interpreter->glyph_zone->flags[p] &= ~SFNT_POINT_TOUCHED_X; + /* The flags unset by UTP are subject to which axes in the freedom + vector are significant, as stated in the TrueType reference + manual by this needless mouthful: + + A point may be touched in the x-direction, the y-direction, or + in both the x and y-directions. The position of the freedom + vector determines whether the point is untouched in the + x-direction, the y-direction, or both. If the vector is set to + the x-axis, the point will be untouched in the x-direction. If + the vector is set to the y-axis, the point will be untouched in + the y-direction. Otherwise the point will be untouched in both + directions. + + A points that is marked as untouched will be moved by an IUP[] + instruction even if the point was previously touched. */ + + mask = 0xff; + + if (interpreter->state.freedom_vector.x) + mask &= ~SFNT_POINT_TOUCHED_X; + + if (interpreter->state.freedom_vector.y) + mask &= ~SFNT_POINT_TOUCHED_Y; + + interpreter->glyph_zone->flags[p] &= mask; } /* Save the specified unit VECTOR into INTERPRETER's graphics state as commit 7f1bd69cd19504f2bd47e13c530a55ffca08e27d Author: Yuan Fu Date: Sun Dec 10 18:24:27 2023 -0800 Fix c-ts-mode bracketless indentation for BSD style (bug#66152) * lisp/progmodes/c-ts-mode.el: (c-ts-mode--indent-styles): Make sure the BSD rules only apply to opening bracket (compound_statement), then bracketless statements will fallback to common rules. * test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: Copy the bracketless test from indent.erts to here. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 5606996eee2..ca831a9c5f9 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -515,13 +515,13 @@ c-ts-mode--indent-styles ((node-is "labeled_statement") parent-bol c-ts-mode-indent-offset) ((parent-is "labeled_statement") parent-bol c-ts-mode-indent-offset) ((parent-is "compound_statement") parent-bol c-ts-mode-indent-offset) - ((parent-is "if_statement") parent-bol 0) - ((parent-is "else_clause") parent-bol 0) - ((parent-is "for_statement") parent-bol 0) - ((parent-is "while_statement") parent-bol 0) - ((parent-is "switch_statement") parent-bol 0) - ((parent-is "case_statement") parent-bol 0) - ((parent-is "do_statement") parent-bol 0) + ((match "compound_statement" "if_statement") standalone-parent 0) + ((match "compound_statement" "else_clause") standalone-parent 0) + ((match "compound_statement" "for_statement") standalone-parent 0) + ((match "compound_statement" "while_statement") standalone-parent 0) + ((match "compound_statement" "switch_statement") standalone-parent 0) + ((match "compound_statement" "case_statement") standalone-parent 0) + ((match "compound_statement" "do_statement") standalone-parent 0) ,@common)))) (defun c-ts-mode--top-level-label-matcher (node parent &rest _) diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts b/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts index 74e34fe821b..fa65ba83a69 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts @@ -91,3 +91,37 @@ main (int argc, } } =-=-= + +Name: Bracketless Simple Statement (bug#66152) + +=-= +for (int i = 0; i < 5; i++) +continue; + +while (true) +return 1; + +do +i++; +while (true) + +if (true) +break; +else +break; +=-= +for (int i = 0; i < 5; i++) + continue; + +while (true) + return 1; + +do + i++; +while (true) + +if (true) + break; +else + break; +=-=-= commit e23068cb9a1692fc3c50b0b386237a56cae201f4 Author: Augustin Chéneau Date: Wed Sep 20 12:23:06 2023 +0200 Add missing indent rules in c-ts-mode (bug#66152) Example: static myttype * variable_name; * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add rules. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index e708420148a..5606996eee2 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -436,6 +436,8 @@ c-ts-mode--indent-styles ((parent-is "preproc") c-ts-mode--anchor-prev-sibling 0) ((parent-is "function_definition") parent-bol 0) + ((parent-is "pointer_declarator") parent-bol 0) + ((parent-is "declaration") parent-bol 0) ((parent-is "conditional_expression") first-sibling 0) ((parent-is "assignment_expression") parent-bol c-ts-mode-indent-offset) ((parent-is "concatenated_string") first-sibling 0) commit d2c4b926ac20de6f7d9f3576b22272bc560bd0f7 Author: Yuan Fu Date: Sun Dec 10 17:40:39 2023 -0800 Fix treesit-default-defun-skipper (bug#66711) * lisp/treesit.el: (treesit-default-defun-skipper): Add bol to the rx pattern. diff --git a/lisp/treesit.el b/lisp/treesit.el index 9dc5d4970b6..8a07f5023a9 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1962,7 +1962,7 @@ treesit-default-defun-skipper (forward-line 1)) ;; Moving backward, but there are some whitespace (and only ;; whitespace) between point and BOL: go back to BOL. - ((looking-back (rx (+ (or " " "\t"))) + ((looking-back (rx bol (+ (or " " "\t"))) (line-beginning-position)) (beginning-of-line)))) commit 64cdcf7f51f1428c40d8c2a902c76b9877e2ff8d Author: Dmitry Gutov Date: Mon Dec 11 03:19:11 2023 +0200 project-any-command: Use 'project-aware' * lisp/progmodes/project.el (project-any-command): Change the symbol it's looking for to 'project-aware'. Seems to convey the semantics best. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index cc473a12baf..0fa623616b6 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1843,7 +1843,7 @@ project-any-command "Run the next command in the current project. If the command name starts with `project-', or its symbol has -property `project-related', it gets passed the project to use +property `project-aware', it gets passed the project to use with the variable `project-current-directory-override'. Otherwise, `default-directory' is temporarily set to the current project's root. @@ -1862,7 +1862,7 @@ project-any-command (when command (if (when (symbolp command) (or (string-prefix-p "project-" (symbol-name command)) - (get command 'project-related))) + (get command 'project-aware))) (let ((project-current-directory-override root)) (call-interactively command)) (let ((default-directory root)) commit 9874561f39e62c1c9fada6c2e013f93d9ea65729 Author: Yuan Fu Date: Sun Dec 10 16:23:44 2023 -0800 Fix treesit-node-field-name and friends (bug#66674) So turns out ts_node_field_name_for_child takes a named node index, but we were passing it normal index that counts both named and anonymous nodes. That's what makes the field name all wrong in treesit explorer. * doc/lispref/parsing.texi: (Accessing Node Information): Update docstring. * lisp/treesit.el (treesit-node-index): Add some unrelated comment. (treesit-node-field-name): Get named node index rather than all node index. * src/treesit.c (Ftreesit_node_field_name_for_child): Update docstring, use ts_node_named_child_count. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 353585f79c7..34eb2826a21 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -1015,8 +1015,8 @@ Accessing Node Information @var{node}. It returns @code{nil} if there is no @var{n}'th child, or the @var{n}'th child doesn't have a field name. -Note that @var{n} counts both named and anonymous children, and -@var{n} can be negative, e.g., @minus{}1 represents the last child. +Note that @var{n} counts named nodes only, and @var{n} can be +negative, e.g., @minus{}1 represents the last child. @end defun @defun treesit-node-child-count node &optional named diff --git a/lisp/treesit.el b/lisp/treesit.el index 962a6fc3cf8..9dc5d4970b6 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -360,6 +360,7 @@ treesit-node-index "Return the index of NODE in its parent. If NAMED is non-nil, count named child only." (let ((count 0)) + ;; TODO: Use next-sibling as it's more efficient. (while (setq node (treesit-node-prev-sibling node named)) (cl-incf count)) count)) @@ -367,7 +368,7 @@ treesit-node-index (defun treesit-node-field-name (node) "Return the field name of NODE as a child of its parent." (when-let ((parent (treesit-node-parent node)) - (idx (treesit-node-index node))) + (idx (treesit-node-index node t))) (treesit-node-field-name-for-child parent idx))) ;;; Query API supplement diff --git a/src/treesit.c b/src/treesit.c index 8419452d54a..45de82ec096 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2015,9 +2015,8 @@ DEFUN ("treesit-node-field-name-for-child", Return nil if there's no Nth child, or if it has no field. If NODE is nil, return nil. -N counts all children, i.e., named ones and anonymous ones. - -N could be negative, e.g., -1 represents the last child. */) +Note that N counts named nodes only. Also, N could be negative, e.g., +-1 represents the last child. */) (Lisp_Object node, Lisp_Object n) { if (NILP (node)) @@ -2031,7 +2030,7 @@ DEFUN ("treesit-node-field-name-for-child", /* Process negative index. */ if (idx < 0) - idx = ts_node_child_count (treesit_node) + idx; + idx = ts_node_named_child_count (treesit_node) + idx; if (idx < 0) return Qnil; if (idx > UINT32_MAX) commit eace9e1122601bdc2f7f03228816198ce726f8fc Author: Maciej Kalandyk Date: Mon Dec 11 01:15:34 2023 +0200 python-ts-mode: Highlight default parameters * lisp/progmodes/python.el (python--treesit-settings): Highlight default parameters (bug#67703). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a7944576196..7c5c20608bd 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1114,7 +1114,8 @@ python--treesit-settings name: (identifier) @font-lock-function-name-face) (class_definition name: (identifier) @font-lock-type-face) - (parameters (identifier) @font-lock-variable-name-face)) + (parameters (identifier) @font-lock-variable-name-face) + (parameters (default_parameter name: (identifier) @font-lock-variable-name-face))) :feature 'function :language 'python commit 9ee911ce318ad701c024b151d8b625e9311bf945 Author: Stefan Kangas Date: Sun Dec 10 22:06:54 2023 +0100 Mark `;#@` as :safe for asm-comment-char * lisp/progmodes/asm-mode.el (asm--safe-comment-char-p): New function that returns true for characters #, @, and ;. (asm-comment-char): Use new function as :safe predicate. diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el index 0f5af9803a5..efe9982feab 100644 --- a/lisp/progmodes/asm-mode.el +++ b/lisp/progmodes/asm-mode.el @@ -1,6 +1,6 @@ ;;; asm-mode.el --- mode for editing assembler code -*- lexical-binding: t; -*- -;; Copyright (C) 1991, 2001-2023 Free Software Foundation, Inc. +;; Copyright (C) 1991-2023 Free Software Foundation, Inc. ;; Author: Eric S. Raymond ;; Maintainer: emacs-devel@gnu.org @@ -52,9 +52,13 @@ asm :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) :group 'languages) +(defun asm--safe-comment-char-p (char) + (memq char '(?\; ?# ?@))) + (defcustom asm-comment-char ?\; "The `comment-start' character assumed by Asm mode." - :type 'character) + :type 'character + :safe #'asm--safe-comment-char-p) (defvar asm-mode-syntax-table (let ((st (make-syntax-table))) commit c3b41c123ac496f51479c326da27e42c2afedfd7 Author: Stefan Kangas Date: Sun Dec 10 22:04:51 2023 +0100 ; Use ?c instead of integer in local variables * exec/loader-armeabi.s (timespec): * exec/loader-mips64el.s (__start): * exec/loader-mipsel.s (__start): Use ?c instead of integer in local variables. diff --git a/exec/loader-armeabi.s b/exec/loader-armeabi.s index 32b2a5268d6..bee81edb326 100644 --- a/exec/loader-armeabi.s +++ b/exec/loader-armeabi.s @@ -200,5 +200,5 @@ timespec: .long 10 @ Local Variables: -@ asm-comment-char: 64 +@ asm-comment-char: ?@ @ End: diff --git a/exec/loader-mips64el.s b/exec/loader-mips64el.s index f4a6f918497..c340824a6f0 100644 --- a/exec/loader-mips64el.s +++ b/exec/loader-mips64el.s @@ -230,5 +230,5 @@ dnl syscall # syscall .quad 10 # Local Variables: -# asm-comment-char: 35 +# asm-comment-char: ?# # End: diff --git a/exec/loader-mipsel.s b/exec/loader-mipsel.s index baba3f05a94..e1ae68af0ca 100644 --- a/exec/loader-mipsel.s +++ b/exec/loader-mipsel.s @@ -232,5 +232,5 @@ RESTORE() # restore sp .long 10 # Local Variables: -# asm-comment-char: 35 +# asm-comment-char: ?# # End: commit 23c06c7c3080d83ae0eee70c70fb50587339a63e Author: Kyle Meyer Date: Sun Dec 10 11:16:58 2023 -0500 Update to Org 9.6.13 diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 4b73a544e80..11e046fc0dd 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.6.11} +\def\orgversionnumber{9.6.13} \def\versionyear{2023} % latest update \input emacsver.tex diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el index 3202c6e415d..febdb3964c6 100644 --- a/lisp/org/ob-plantuml.el +++ b/lisp/org/ob-plantuml.el @@ -57,7 +57,7 @@ org-plantuml-exec-mode `plantuml' means to use the PlantUML executable. The executable can be configured via `org-plantuml-executable-path'. -You can also configure extra arguments via `org-plantuml-executable-args'." +You can also configure extra arguments via `org-plantuml-args'." :group 'org-babel :package-version '(Org . "9.4") :type 'symbol diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index e6bff9120c4..44694d73084 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -5906,7 +5906,7 @@ org-element--cache-remove (org-element-property :begin element) (org-element-property :org-element--cache-sync-key element)) (org-element-cache-reset) - (throw 'quit nil)) + (throw 'org-element--cache-quit nil)) (or (avl-tree-delete org-element--cache element) (progn ;; This should not happen, but if it is, would be better to know @@ -5919,7 +5919,7 @@ org-element--cache-remove (org-element-property :begin element) (org-element-property :org-element--cache-sync-key element)) (org-element-cache-reset) - (throw 'quit nil))))) + (throw 'org-element--cache-quit nil))))) ;;;; Synchronization @@ -6382,6 +6382,10 @@ org-element--cache-process-request ;; We altered the tree structure. The tree ;; traversal needs to be restarted. (setf (org-element--request-key request) key) + ;; Make sure that we restart tree traversal + ;; past already shifted elements (before the + ;; removed DATA). + (setq start key) (setf (org-element--request-parent request) parent) ;; Restart tree traversal. (setq node (org-element--cache-root) diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 4efa8ba6800..6ed901b7397 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -1119,7 +1119,12 @@ org-string-width (setq pixel-width (if (get-buffer-window (current-buffer)) (car (window-text-pixel-size - nil (line-beginning-position) (point-max))) + ;; FIXME: 10000 because + ;; `most-positive-fixnum' ain't working + ;; (tests failing) and this call will be + ;; removed after we drop Emacs 28 support + ;; anyway. + nil (line-beginning-position) (point-max) 10000)) (let ((dedicatedp (window-dedicated-p)) (oldbuffer (window-buffer))) (unwind-protect @@ -1128,7 +1133,7 @@ org-string-width (set-window-dedicated-p nil nil) (set-window-buffer nil (current-buffer)) (car (window-text-pixel-size - nil (line-beginning-position) (point-max)))) + nil (line-beginning-position) (point-max) 10000))) (set-window-buffer nil oldbuffer) (set-window-dedicated-p nil dedicatedp))))) (unless pixels @@ -1137,7 +1142,7 @@ org-string-width (setq symbol-width (if (get-buffer-window (current-buffer)) (car (window-text-pixel-size - nil (line-beginning-position) (point-max))) + nil (line-beginning-position) (point-max) 10000)) (let ((dedicatedp (window-dedicated-p)) (oldbuffer (window-buffer))) (unwind-protect @@ -1146,7 +1151,7 @@ org-string-width (set-window-dedicated-p nil nil) (set-window-buffer nil (current-buffer)) (car (window-text-pixel-size - nil (line-beginning-position) (point-max)))) + nil (line-beginning-position) (point-max) 10000))) (set-window-buffer nil oldbuffer) (set-window-dedicated-p nil dedicatedp))))))) (if pixels diff --git a/lisp/org/org-persist.el b/lisp/org/org-persist.el index dc9fe3a7103..59ef2ac27a0 100644 --- a/lisp/org/org-persist.el +++ b/lisp/org/org-persist.el @@ -481,9 +481,14 @@ org-persist--normalize-associated (unless (stringp associated) (setq associated (cadr associated))) (let* ((rtn `(:file ,associated)) - (inode (and (fboundp 'file-attribute-inode-number) - (file-attribute-inode-number - (file-attributes associated))))) + (inode (and + ;; Do not store :inode for remote files - it may + ;; be time-consuming on slow connections or even + ;; fail completely when ssh connection is closed. + (not (file-remote-p associated)) + (fboundp 'file-attribute-inode-number) + (file-attribute-inode-number + (file-attributes associated))))) (when inode (plist-put rtn :inode inode)) rtn)) ((or (pred bufferp) `(:buffer ,_)) @@ -501,6 +506,10 @@ org-persist--normalize-associated (or (buffer-base-buffer associated) associated))) (setq inode (when (and file + ;; Do not store :inode for remote files - it may + ;; be time-consuming on slow connections or even + ;; fail completely when ssh connection is closed. + (not (file-remote-p file)) (fboundp 'file-attribute-inode-number)) (file-attribute-inode-number (file-attributes file)))) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index e5b0fbcf2a9..8eebdbe09b2 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.6.11")) + (let ((org-release "9.6.13")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.6.11")) + (let ((org-git-version "release_9.6.13")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 2f4cfe16866..b94dcd07b9a 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.6.11 +;; Version: 9.6.13 ;; This file is part of GNU Emacs. ;; @@ -19986,7 +19986,7 @@ org-beginning-of-line (if (eq special 'reversed) (when (and (= origin bol) (eq last-command this-command)) (goto-char refpos)) - (when (or (> origin refpos) (= origin bol)) + (when (or (> origin refpos) (<= origin bol)) (goto-char refpos))))) ((and (looking-at org-list-full-item-re) (memq (org-element-type (save-match-data (org-element-at-point))) @@ -20001,7 +20001,7 @@ org-beginning-of-line (if (eq special 'reversed) (when (and (= (point) origin) (eq last-command this-command)) (goto-char after-bullet)) - (when (or (> origin after-bullet) (= (point) origin)) + (when (or (> origin after-bullet) (>= (point) origin)) (goto-char after-bullet))))) ;; No special context. Point is already at beginning of line. (t nil)))) @@ -20056,7 +20056,7 @@ org-end-of-line (goto-char tags) (end-of-line))) (t - (if (or (< origin tags) (= origin (line-end-position))) + (if (or (< origin tags) (>= origin (line-end-position))) (goto-char tags) (end-of-line)))))) ((bound-and-true-p visual-line-mode) diff --git a/lisp/org/ox-beamer.el b/lisp/org/ox-beamer.el index 689bf1559b4..fe1f2ffa572 100644 --- a/lisp/org/ox-beamer.el +++ b/lisp/org/ox-beamer.el @@ -930,7 +930,7 @@ org-beamer-mode '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend)) 'prepend)) -(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40)))) +(defface org-beamer-tag '((t (:box (:line-width 1 :color "grey40")))) "The special face for beamer tags." :group 'org-export-beamer) commit 0da2a4650cdac008ac9a50ec8a7729093632a6a8 Merge: fab48f1a543 2773cf9e013 Author: Eli Zaretskii Date: Sun Dec 10 10:35:54 2023 -0500 Merge from origin/emacs-29 2773cf9e013 ; Fix typos 020aff95fa3 ; Fix typos in ChangeLog files 5e03a621efc ; * lisp/progmodes/c-ts-mode.el (c-ts-mode--else-heuristi... f0734e1c0d1 Fix c-ts-mode indent heuristic (bug#67417) 08fc6bace20 Fix c-ts-mode indentation (bug#67357) 71bc2815ccd Add font-locking for hash-bang lines in typescript-ts-mode. db8347c8c87 Add font-locking for hash-bang lines in js-ts-mode 91f2ade57bb ruby-mode: Better detect regexp vs division (bug#67569) commit fab48f1a543bed74e031d2e2cebac4e1165d7b4b Author: Michael Albinus Date: Sun Dec 10 15:15:12 2023 +0100 ; Fix error in my last commit * lisp/files-x.el (hack-connection-local-variables): Autoload. (connection-local-value): Revert previous fix. diff --git a/lisp/files-x.el b/lisp/files-x.el index 96d49427c81..282cc79f26e 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -791,6 +791,7 @@ connection-local-update-profile-variables (setq variables (nreverse existing-variables))) (connection-local-set-profile-variables profile variables)) +;;;###autoload (defun hack-connection-local-variables (criteria) "Read connection-local variables according to CRITERIA. Store the connection-local variables in buffer local @@ -935,13 +936,8 @@ connection-local-value (unless (symbolp variable) (signal 'wrong-type-argument (list 'symbolp variable))) `(let (connection-local-variables-alist file-local-variables-alist) - ;; This is a macro, so whether it is autoloaded doesn't influence - ;; whether its callers will induce the loading of files-x.el. - ;; - ;; Verify that h-c-l-v is autoloaded before calling it. - (when (fboundp 'hack-connection-local-variables) - (hack-connection-local-variables - (connection-local-criteria-for-default-directory ,application))) + (hack-connection-local-variables + (connection-local-criteria-for-default-directory ,application)) (if-let ((result (assq ',variable connection-local-variables-alist))) (cdr result) ,variable))) commit 79aca35c1f0b77d1c109e3b5526400d92f42a2aa Author: Po Lu Date: Sun Dec 10 22:05:09 2023 +0800 * lisp/files-x.el (connection-local-value): Fix Dired crash. diff --git a/lisp/files-x.el b/lisp/files-x.el index 467981f3f8f..96d49427c81 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -935,8 +935,13 @@ connection-local-value (unless (symbolp variable) (signal 'wrong-type-argument (list 'symbolp variable))) `(let (connection-local-variables-alist file-local-variables-alist) - (hack-connection-local-variables - (connection-local-criteria-for-default-directory ,application)) + ;; This is a macro, so whether it is autoloaded doesn't influence + ;; whether its callers will induce the loading of files-x.el. + ;; + ;; Verify that h-c-l-v is autoloaded before calling it. + (when (fboundp 'hack-connection-local-variables) + (hack-connection-local-variables + (connection-local-criteria-for-default-directory ,application))) (if-let ((result (assq ',variable connection-local-variables-alist))) (cdr result) ,variable))) commit da8fd95cdb9432ba3badcfd3e4345f686e15d593 Author: Stefan Kangas Date: Sun Dec 10 14:44:41 2023 +0100 Update publicsuffix.txt from upstream * etc/publicsuffix.txt: Update from https://publicsuffix.org/list/public_suffix_list.dat dated 2023-12-06 20:17:45 UTC. diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt index 956110851a4..79248a73f04 100644 --- a/etc/publicsuffix.txt +++ b/etc/publicsuffix.txt @@ -6710,7 +6710,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-09-30T15:11:25Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-12-06T15:14:09Z // This list is auto-generated, don't edit it manually. // aaa : American Automobile Association, Inc. // https://www.iana.org/domains/root/db/aaa.html @@ -7400,10 +7400,6 @@ cbn // https://www.iana.org/domains/root/db/cbre.html cbre -// cbs : CBS Domains Inc. -// https://www.iana.org/domains/root/db/cbs.html -cbs - // center : Binky Moon, LLC // https://www.iana.org/domains/root/db/center.html center @@ -7492,10 +7488,6 @@ citic // https://www.iana.org/domains/root/db/city.html city -// cityeats : Lifestyle Domain Holdings, Inc. -// https://www.iana.org/domains/root/db/cityeats.html -cityeats - // claims : Binky Moon, LLC // https://www.iana.org/domains/root/db/claims.html claims @@ -7760,7 +7752,7 @@ dental // https://www.iana.org/domains/root/db/dentist.html dentist -// desi : Desi Networks LLC +// desi // https://www.iana.org/domains/root/db/desi.html desi @@ -7808,7 +7800,7 @@ discover // https://www.iana.org/domains/root/db/dish.html dish -// diy : Lifestyle Domain Holdings, Inc. +// diy : Internet Naming Company LLC // https://www.iana.org/domains/root/db/diy.html diy @@ -7940,10 +7932,6 @@ esq // https://www.iana.org/domains/root/db/estate.html estate -// etisalat : Emirates Telecommunications Corporation (trading as Etisalat) -// https://www.iana.org/domains/root/db/etisalat.html -etisalat - // eurovision : European Broadcasting Union (EBU) // https://www.iana.org/domains/root/db/eurovision.html eurovision @@ -8116,7 +8104,7 @@ fly // https://www.iana.org/domains/root/db/foo.html foo -// food : Lifestyle Domain Holdings, Inc. +// food : Internet Naming Company LLC // https://www.iana.org/domains/root/db/food.html food @@ -8164,10 +8152,6 @@ frl // https://www.iana.org/domains/root/db/frogans.html frogans -// frontdoor : Lifestyle Domain Holdings, Inc. -// https://www.iana.org/domains/root/db/frontdoor.html -frontdoor - // frontier : Frontier Communications Corporation // https://www.iana.org/domains/root/db/frontier.html frontier @@ -8328,7 +8312,7 @@ goldpoint // https://www.iana.org/domains/root/db/golf.html golf -// goo : NTT Resonant Inc. +// goo : NTT DOCOMO, INC. // https://www.iana.org/domains/root/db/goo.html goo @@ -8780,10 +8764,6 @@ kids // https://www.iana.org/domains/root/db/kim.html kim -// kinder : Ferrero Trading Lux S.A. -// https://www.iana.org/domains/root/db/kinder.html -kinder - // kindle : Amazon Registry Services, Inc. // https://www.iana.org/domains/root/db/kindle.html kindle @@ -8928,7 +8908,7 @@ life // https://www.iana.org/domains/root/db/lifeinsurance.html lifeinsurance -// lifestyle : Lifestyle Domain Holdings, Inc. +// lifestyle : Internet Naming Company LLC // https://www.iana.org/domains/root/db/lifestyle.html lifestyle @@ -8968,7 +8948,7 @@ lipsy // https://www.iana.org/domains/root/db/live.html live -// living : Lifestyle Domain Holdings, Inc. +// living : Internet Naming Company LLC // https://www.iana.org/domains/root/db/living.html living @@ -9672,7 +9652,7 @@ promo // https://www.iana.org/domains/root/db/properties.html properties -// property : Internet Naming Company LLC +// property : Digital Property Infrastructure Limited // https://www.iana.org/domains/root/db/property.html property @@ -9836,10 +9816,6 @@ rio // https://www.iana.org/domains/root/db/rip.html rip -// rocher : Ferrero Trading Lux S.A. -// https://www.iana.org/domains/root/db/rocher.html -rocher - // rocks : Dog Beach, LLC // https://www.iana.org/domains/root/db/rocks.html rocks @@ -10088,10 +10064,6 @@ shouji // https://www.iana.org/domains/root/db/show.html show -// showtime : CBS Domains Inc. -// https://www.iana.org/domains/root/db/showtime.html -showtime - // silk : Amazon Registry Services, Inc. // https://www.iana.org/domains/root/db/silk.html silk @@ -10552,7 +10524,7 @@ ups // https://www.iana.org/domains/root/db/vacations.html vacations -// vana : Lifestyle Domain Holdings, Inc. +// vana : Internet Naming Company LLC // https://www.iana.org/domains/root/db/vana.html vana @@ -10636,10 +10608,6 @@ vlaanderen // https://www.iana.org/domains/root/db/vodka.html vodka -// volkswagen : Volkswagen Group of America Inc. -// https://www.iana.org/domains/root/db/volkswagen.html -volkswagen - // volvo : Volvo Holding Sverige Aktiebolag // https://www.iana.org/domains/root/db/volvo.html volvo @@ -10708,6 +10676,10 @@ weber // https://www.iana.org/domains/root/db/website.html website +// wed +// https://www.iana.org/domains/root/db/wed.html +wed + // wedding : Registry Services, LLC // https://www.iana.org/domains/root/db/wedding.html wedding @@ -11040,10 +11012,6 @@ xin // https://www.iana.org/domains/root/db/xn--mgba7c0bbn0a.html العليان -// xn--mgbaakc7dvf : Emirates Telecommunications Corporation (trading as Etisalat) -// https://www.iana.org/domains/root/db/xn--mgbaakc7dvf.html -اتصالات - // xn--mgbab2bd : CORE Association // https://www.iana.org/domains/root/db/xn--mgbab2bd.html بازار @@ -11345,11 +11313,78 @@ myamaze.net // Submitted by AWS Security // Subsections of Amazon/subsidiaries will appear until "concludes" tag +// Amazon API Gateway +// Submitted by AWS Security +// Reference: 4d863337-ff98-4501-a6f2-361eba8445d6 +execute-api.cn-north-1.amazonaws.com.cn +execute-api.cn-northwest-1.amazonaws.com.cn +execute-api.af-south-1.amazonaws.com +execute-api.ap-east-1.amazonaws.com +execute-api.ap-northeast-1.amazonaws.com +execute-api.ap-northeast-2.amazonaws.com +execute-api.ap-northeast-3.amazonaws.com +execute-api.ap-south-1.amazonaws.com +execute-api.ap-south-2.amazonaws.com +execute-api.ap-southeast-1.amazonaws.com +execute-api.ap-southeast-2.amazonaws.com +execute-api.ap-southeast-3.amazonaws.com +execute-api.ap-southeast-4.amazonaws.com +execute-api.ca-central-1.amazonaws.com +execute-api.eu-central-1.amazonaws.com +execute-api.eu-central-2.amazonaws.com +execute-api.eu-north-1.amazonaws.com +execute-api.eu-south-1.amazonaws.com +execute-api.eu-south-2.amazonaws.com +execute-api.eu-west-1.amazonaws.com +execute-api.eu-west-2.amazonaws.com +execute-api.eu-west-3.amazonaws.com +execute-api.il-central-1.amazonaws.com +execute-api.me-central-1.amazonaws.com +execute-api.me-south-1.amazonaws.com +execute-api.sa-east-1.amazonaws.com +execute-api.us-east-1.amazonaws.com +execute-api.us-east-2.amazonaws.com +execute-api.us-gov-east-1.amazonaws.com +execute-api.us-gov-west-1.amazonaws.com +execute-api.us-west-1.amazonaws.com +execute-api.us-west-2.amazonaws.com + // Amazon CloudFront // Submitted by Donavan Miller // Reference: 54144616-fd49-4435-8535-19c6a601bdb3 cloudfront.net +// Amazon Cognito +// Submitted by AWS Security +// Reference: 7bee1013-f456-47df-bfe8-03c78d946d61 +auth.af-south-1.amazoncognito.com +auth.ap-northeast-1.amazoncognito.com +auth.ap-northeast-2.amazoncognito.com +auth.ap-northeast-3.amazoncognito.com +auth.ap-south-1.amazoncognito.com +auth.ap-southeast-1.amazoncognito.com +auth.ap-southeast-2.amazoncognito.com +auth.ap-southeast-3.amazoncognito.com +auth.ca-central-1.amazoncognito.com +auth.eu-central-1.amazoncognito.com +auth.eu-north-1.amazoncognito.com +auth.eu-south-1.amazoncognito.com +auth.eu-west-1.amazoncognito.com +auth.eu-west-2.amazoncognito.com +auth.eu-west-3.amazoncognito.com +auth.il-central-1.amazoncognito.com +auth.me-south-1.amazoncognito.com +auth.sa-east-1.amazoncognito.com +auth.us-east-1.amazoncognito.com +auth-fips.us-east-1.amazoncognito.com +auth.us-east-2.amazoncognito.com +auth-fips.us-east-2.amazoncognito.com +auth-fips.us-gov-west-1.amazoncognito.com +auth.us-west-1.amazoncognito.com +auth-fips.us-west-1.amazoncognito.com +auth.us-west-2.amazoncognito.com +auth-fips.us-west-2.amazoncognito.com + // Amazon EC2 // Submitted by Luke Wells // Reference: 4c38fa71-58ac-4768-99e5-689c1767e537 @@ -11358,47 +11393,307 @@ cloudfront.net *.compute.amazonaws.com.cn us-east-1.amazonaws.com +// Amazon EMR +// Submitted by AWS Security +// Reference: 597f3f8e-9283-4e48-8e32-7ee25a1ff6ab +emrappui-prod.cn-north-1.amazonaws.com.cn +emrnotebooks-prod.cn-north-1.amazonaws.com.cn +emrstudio-prod.cn-north-1.amazonaws.com.cn +emrappui-prod.cn-northwest-1.amazonaws.com.cn +emrnotebooks-prod.cn-northwest-1.amazonaws.com.cn +emrstudio-prod.cn-northwest-1.amazonaws.com.cn +emrappui-prod.af-south-1.amazonaws.com +emrnotebooks-prod.af-south-1.amazonaws.com +emrstudio-prod.af-south-1.amazonaws.com +emrappui-prod.ap-east-1.amazonaws.com +emrnotebooks-prod.ap-east-1.amazonaws.com +emrstudio-prod.ap-east-1.amazonaws.com +emrappui-prod.ap-northeast-1.amazonaws.com +emrnotebooks-prod.ap-northeast-1.amazonaws.com +emrstudio-prod.ap-northeast-1.amazonaws.com +emrappui-prod.ap-northeast-2.amazonaws.com +emrnotebooks-prod.ap-northeast-2.amazonaws.com +emrstudio-prod.ap-northeast-2.amazonaws.com +emrappui-prod.ap-northeast-3.amazonaws.com +emrnotebooks-prod.ap-northeast-3.amazonaws.com +emrstudio-prod.ap-northeast-3.amazonaws.com +emrappui-prod.ap-south-1.amazonaws.com +emrnotebooks-prod.ap-south-1.amazonaws.com +emrstudio-prod.ap-south-1.amazonaws.com +emrappui-prod.ap-southeast-1.amazonaws.com +emrnotebooks-prod.ap-southeast-1.amazonaws.com +emrstudio-prod.ap-southeast-1.amazonaws.com +emrappui-prod.ap-southeast-2.amazonaws.com +emrnotebooks-prod.ap-southeast-2.amazonaws.com +emrstudio-prod.ap-southeast-2.amazonaws.com +emrappui-prod.ap-southeast-3.amazonaws.com +emrnotebooks-prod.ap-southeast-3.amazonaws.com +emrstudio-prod.ap-southeast-3.amazonaws.com +emrappui-prod.ca-central-1.amazonaws.com +emrnotebooks-prod.ca-central-1.amazonaws.com +emrstudio-prod.ca-central-1.amazonaws.com +emrappui-prod.eu-central-1.amazonaws.com +emrnotebooks-prod.eu-central-1.amazonaws.com +emrstudio-prod.eu-central-1.amazonaws.com +emrappui-prod.eu-north-1.amazonaws.com +emrnotebooks-prod.eu-north-1.amazonaws.com +emrstudio-prod.eu-north-1.amazonaws.com +emrappui-prod.eu-south-1.amazonaws.com +emrnotebooks-prod.eu-south-1.amazonaws.com +emrstudio-prod.eu-south-1.amazonaws.com +emrappui-prod.eu-west-1.amazonaws.com +emrnotebooks-prod.eu-west-1.amazonaws.com +emrstudio-prod.eu-west-1.amazonaws.com +emrappui-prod.eu-west-2.amazonaws.com +emrnotebooks-prod.eu-west-2.amazonaws.com +emrstudio-prod.eu-west-2.amazonaws.com +emrappui-prod.eu-west-3.amazonaws.com +emrnotebooks-prod.eu-west-3.amazonaws.com +emrstudio-prod.eu-west-3.amazonaws.com +emrappui-prod.me-central-1.amazonaws.com +emrnotebooks-prod.me-central-1.amazonaws.com +emrstudio-prod.me-central-1.amazonaws.com +emrappui-prod.me-south-1.amazonaws.com +emrnotebooks-prod.me-south-1.amazonaws.com +emrstudio-prod.me-south-1.amazonaws.com +emrappui-prod.sa-east-1.amazonaws.com +emrnotebooks-prod.sa-east-1.amazonaws.com +emrstudio-prod.sa-east-1.amazonaws.com +emrappui-prod.us-east-1.amazonaws.com +emrnotebooks-prod.us-east-1.amazonaws.com +emrstudio-prod.us-east-1.amazonaws.com +emrappui-prod.us-east-2.amazonaws.com +emrnotebooks-prod.us-east-2.amazonaws.com +emrstudio-prod.us-east-2.amazonaws.com +emrappui-prod.us-gov-east-1.amazonaws.com +emrnotebooks-prod.us-gov-east-1.amazonaws.com +emrstudio-prod.us-gov-east-1.amazonaws.com +emrappui-prod.us-gov-west-1.amazonaws.com +emrnotebooks-prod.us-gov-west-1.amazonaws.com +emrstudio-prod.us-gov-west-1.amazonaws.com +emrappui-prod.us-west-1.amazonaws.com +emrnotebooks-prod.us-west-1.amazonaws.com +emrstudio-prod.us-west-1.amazonaws.com +emrappui-prod.us-west-2.amazonaws.com +emrnotebooks-prod.us-west-2.amazonaws.com +emrstudio-prod.us-west-2.amazonaws.com + +// Amazon Managed Workflows for Apache Airflow +// Submitted by AWS Security +// Reference: 4ab55e6f-90c0-4a8d-b6a0-52ca5dbb1c2e +*.cn-north-1.airflow.amazonaws.com.cn +*.cn-northwest-1.airflow.amazonaws.com.cn +*.ap-northeast-1.airflow.amazonaws.com +*.ap-northeast-2.airflow.amazonaws.com +*.ap-south-1.airflow.amazonaws.com +*.ap-southeast-1.airflow.amazonaws.com +*.ap-southeast-2.airflow.amazonaws.com +*.ca-central-1.airflow.amazonaws.com +*.eu-central-1.airflow.amazonaws.com +*.eu-north-1.airflow.amazonaws.com +*.eu-west-1.airflow.amazonaws.com +*.eu-west-2.airflow.amazonaws.com +*.eu-west-3.airflow.amazonaws.com +*.sa-east-1.airflow.amazonaws.com +*.us-east-1.airflow.amazonaws.com +*.us-east-2.airflow.amazonaws.com +*.us-west-2.airflow.amazonaws.com + // Amazon S3 -// Submitted by Luke Wells -// Reference: d068bd97-f0a9-4838-a6d8-954b622ef4ae +// Submitted by AWS Security +// Reference: 0e801048-08f2-4064-9cb8-e7373e0b57f4 +s3.dualstack.cn-north-1.amazonaws.com.cn +s3-accesspoint.dualstack.cn-north-1.amazonaws.com.cn +s3-website.dualstack.cn-north-1.amazonaws.com.cn s3.cn-north-1.amazonaws.com.cn +s3-accesspoint.cn-north-1.amazonaws.com.cn +s3-deprecated.cn-north-1.amazonaws.com.cn +s3-object-lambda.cn-north-1.amazonaws.com.cn +s3-website.cn-north-1.amazonaws.com.cn +s3.dualstack.cn-northwest-1.amazonaws.com.cn +s3-accesspoint.dualstack.cn-northwest-1.amazonaws.com.cn +s3.cn-northwest-1.amazonaws.com.cn +s3-accesspoint.cn-northwest-1.amazonaws.com.cn +s3-object-lambda.cn-northwest-1.amazonaws.com.cn +s3-website.cn-northwest-1.amazonaws.com.cn +s3.dualstack.af-south-1.amazonaws.com +s3-accesspoint.dualstack.af-south-1.amazonaws.com +s3-website.dualstack.af-south-1.amazonaws.com +s3.af-south-1.amazonaws.com +s3-accesspoint.af-south-1.amazonaws.com +s3-object-lambda.af-south-1.amazonaws.com +s3-website.af-south-1.amazonaws.com +s3.dualstack.ap-east-1.amazonaws.com +s3-accesspoint.dualstack.ap-east-1.amazonaws.com +s3.ap-east-1.amazonaws.com +s3-accesspoint.ap-east-1.amazonaws.com +s3-object-lambda.ap-east-1.amazonaws.com +s3-website.ap-east-1.amazonaws.com s3.dualstack.ap-northeast-1.amazonaws.com +s3-accesspoint.dualstack.ap-northeast-1.amazonaws.com +s3-website.dualstack.ap-northeast-1.amazonaws.com +s3.ap-northeast-1.amazonaws.com +s3-accesspoint.ap-northeast-1.amazonaws.com +s3-object-lambda.ap-northeast-1.amazonaws.com +s3-website.ap-northeast-1.amazonaws.com s3.dualstack.ap-northeast-2.amazonaws.com +s3-accesspoint.dualstack.ap-northeast-2.amazonaws.com +s3-website.dualstack.ap-northeast-2.amazonaws.com s3.ap-northeast-2.amazonaws.com +s3-accesspoint.ap-northeast-2.amazonaws.com +s3-object-lambda.ap-northeast-2.amazonaws.com s3-website.ap-northeast-2.amazonaws.com +s3.dualstack.ap-northeast-3.amazonaws.com +s3-accesspoint.dualstack.ap-northeast-3.amazonaws.com +s3-website.dualstack.ap-northeast-3.amazonaws.com +s3.ap-northeast-3.amazonaws.com +s3-accesspoint.ap-northeast-3.amazonaws.com +s3-object-lambda.ap-northeast-3.amazonaws.com +s3-website.ap-northeast-3.amazonaws.com s3.dualstack.ap-south-1.amazonaws.com +s3-accesspoint.dualstack.ap-south-1.amazonaws.com +s3-website.dualstack.ap-south-1.amazonaws.com s3.ap-south-1.amazonaws.com +s3-accesspoint.ap-south-1.amazonaws.com +s3-object-lambda.ap-south-1.amazonaws.com s3-website.ap-south-1.amazonaws.com +s3.dualstack.ap-south-2.amazonaws.com +s3-accesspoint.dualstack.ap-south-2.amazonaws.com +s3.ap-south-2.amazonaws.com +s3-accesspoint.ap-south-2.amazonaws.com +s3-object-lambda.ap-south-2.amazonaws.com +s3-website.ap-south-2.amazonaws.com s3.dualstack.ap-southeast-1.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-1.amazonaws.com +s3-website.dualstack.ap-southeast-1.amazonaws.com +s3.ap-southeast-1.amazonaws.com +s3-accesspoint.ap-southeast-1.amazonaws.com +s3-object-lambda.ap-southeast-1.amazonaws.com +s3-website.ap-southeast-1.amazonaws.com s3.dualstack.ap-southeast-2.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-2.amazonaws.com +s3-website.dualstack.ap-southeast-2.amazonaws.com +s3.ap-southeast-2.amazonaws.com +s3-accesspoint.ap-southeast-2.amazonaws.com +s3-object-lambda.ap-southeast-2.amazonaws.com +s3-website.ap-southeast-2.amazonaws.com +s3.dualstack.ap-southeast-3.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-3.amazonaws.com +s3.ap-southeast-3.amazonaws.com +s3-accesspoint.ap-southeast-3.amazonaws.com +s3-object-lambda.ap-southeast-3.amazonaws.com +s3-website.ap-southeast-3.amazonaws.com +s3.dualstack.ap-southeast-4.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-4.amazonaws.com +s3.ap-southeast-4.amazonaws.com +s3-accesspoint.ap-southeast-4.amazonaws.com +s3-object-lambda.ap-southeast-4.amazonaws.com +s3-website.ap-southeast-4.amazonaws.com s3.dualstack.ca-central-1.amazonaws.com +s3-accesspoint.dualstack.ca-central-1.amazonaws.com +s3-accesspoint-fips.dualstack.ca-central-1.amazonaws.com +s3-fips.dualstack.ca-central-1.amazonaws.com +s3-website.dualstack.ca-central-1.amazonaws.com s3.ca-central-1.amazonaws.com +s3-accesspoint.ca-central-1.amazonaws.com +s3-accesspoint-fips.ca-central-1.amazonaws.com +s3-fips.ca-central-1.amazonaws.com +s3-object-lambda.ca-central-1.amazonaws.com s3-website.ca-central-1.amazonaws.com s3.dualstack.eu-central-1.amazonaws.com +s3-accesspoint.dualstack.eu-central-1.amazonaws.com +s3-website.dualstack.eu-central-1.amazonaws.com s3.eu-central-1.amazonaws.com +s3-accesspoint.eu-central-1.amazonaws.com +s3-object-lambda.eu-central-1.amazonaws.com s3-website.eu-central-1.amazonaws.com +s3.dualstack.eu-central-2.amazonaws.com +s3-accesspoint.dualstack.eu-central-2.amazonaws.com +s3.eu-central-2.amazonaws.com +s3-accesspoint.eu-central-2.amazonaws.com +s3-object-lambda.eu-central-2.amazonaws.com +s3-website.eu-central-2.amazonaws.com +s3.dualstack.eu-north-1.amazonaws.com +s3-accesspoint.dualstack.eu-north-1.amazonaws.com +s3.eu-north-1.amazonaws.com +s3-accesspoint.eu-north-1.amazonaws.com +s3-object-lambda.eu-north-1.amazonaws.com +s3-website.eu-north-1.amazonaws.com +s3.dualstack.eu-south-1.amazonaws.com +s3-accesspoint.dualstack.eu-south-1.amazonaws.com +s3-website.dualstack.eu-south-1.amazonaws.com +s3.eu-south-1.amazonaws.com +s3-accesspoint.eu-south-1.amazonaws.com +s3-object-lambda.eu-south-1.amazonaws.com +s3-website.eu-south-1.amazonaws.com +s3.dualstack.eu-south-2.amazonaws.com +s3-accesspoint.dualstack.eu-south-2.amazonaws.com +s3.eu-south-2.amazonaws.com +s3-accesspoint.eu-south-2.amazonaws.com +s3-object-lambda.eu-south-2.amazonaws.com +s3-website.eu-south-2.amazonaws.com s3.dualstack.eu-west-1.amazonaws.com +s3-accesspoint.dualstack.eu-west-1.amazonaws.com +s3-website.dualstack.eu-west-1.amazonaws.com +s3.eu-west-1.amazonaws.com +s3-accesspoint.eu-west-1.amazonaws.com +s3-deprecated.eu-west-1.amazonaws.com +s3-object-lambda.eu-west-1.amazonaws.com +s3-website.eu-west-1.amazonaws.com s3.dualstack.eu-west-2.amazonaws.com +s3-accesspoint.dualstack.eu-west-2.amazonaws.com s3.eu-west-2.amazonaws.com +s3-accesspoint.eu-west-2.amazonaws.com +s3-object-lambda.eu-west-2.amazonaws.com s3-website.eu-west-2.amazonaws.com s3.dualstack.eu-west-3.amazonaws.com +s3-accesspoint.dualstack.eu-west-3.amazonaws.com +s3-website.dualstack.eu-west-3.amazonaws.com s3.eu-west-3.amazonaws.com +s3-accesspoint.eu-west-3.amazonaws.com +s3-object-lambda.eu-west-3.amazonaws.com s3-website.eu-west-3.amazonaws.com +s3.dualstack.il-central-1.amazonaws.com +s3-accesspoint.dualstack.il-central-1.amazonaws.com +s3.il-central-1.amazonaws.com +s3-accesspoint.il-central-1.amazonaws.com +s3-object-lambda.il-central-1.amazonaws.com +s3-website.il-central-1.amazonaws.com +s3.dualstack.me-central-1.amazonaws.com +s3-accesspoint.dualstack.me-central-1.amazonaws.com +s3.me-central-1.amazonaws.com +s3-accesspoint.me-central-1.amazonaws.com +s3-object-lambda.me-central-1.amazonaws.com +s3-website.me-central-1.amazonaws.com +s3.dualstack.me-south-1.amazonaws.com +s3-accesspoint.dualstack.me-south-1.amazonaws.com +s3.me-south-1.amazonaws.com +s3-accesspoint.me-south-1.amazonaws.com +s3-object-lambda.me-south-1.amazonaws.com +s3-website.me-south-1.amazonaws.com s3.amazonaws.com +s3-1.amazonaws.com +s3-ap-east-1.amazonaws.com s3-ap-northeast-1.amazonaws.com s3-ap-northeast-2.amazonaws.com +s3-ap-northeast-3.amazonaws.com s3-ap-south-1.amazonaws.com s3-ap-southeast-1.amazonaws.com s3-ap-southeast-2.amazonaws.com s3-ca-central-1.amazonaws.com s3-eu-central-1.amazonaws.com +s3-eu-north-1.amazonaws.com s3-eu-west-1.amazonaws.com s3-eu-west-2.amazonaws.com s3-eu-west-3.amazonaws.com s3-external-1.amazonaws.com +s3-fips-us-gov-east-1.amazonaws.com s3-fips-us-gov-west-1.amazonaws.com +mrap.accesspoint.s3-global.amazonaws.com +s3-me-south-1.amazonaws.com s3-sa-east-1.amazonaws.com s3-us-east-2.amazonaws.com +s3-us-gov-east-1.amazonaws.com s3-us-gov-west-1.amazonaws.com s3-us-west-1.amazonaws.com s3-us-west-2.amazonaws.com @@ -11408,23 +11703,182 @@ s3-website-ap-southeast-2.amazonaws.com s3-website-eu-west-1.amazonaws.com s3-website-sa-east-1.amazonaws.com s3-website-us-east-1.amazonaws.com +s3-website-us-gov-west-1.amazonaws.com s3-website-us-west-1.amazonaws.com s3-website-us-west-2.amazonaws.com s3.dualstack.sa-east-1.amazonaws.com +s3-accesspoint.dualstack.sa-east-1.amazonaws.com +s3-website.dualstack.sa-east-1.amazonaws.com +s3.sa-east-1.amazonaws.com +s3-accesspoint.sa-east-1.amazonaws.com +s3-object-lambda.sa-east-1.amazonaws.com +s3-website.sa-east-1.amazonaws.com s3.dualstack.us-east-1.amazonaws.com +s3-accesspoint.dualstack.us-east-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-east-1.amazonaws.com +s3-fips.dualstack.us-east-1.amazonaws.com +s3-website.dualstack.us-east-1.amazonaws.com +s3.us-east-1.amazonaws.com +s3-accesspoint.us-east-1.amazonaws.com +s3-accesspoint-fips.us-east-1.amazonaws.com +s3-deprecated.us-east-1.amazonaws.com +s3-fips.us-east-1.amazonaws.com +s3-object-lambda.us-east-1.amazonaws.com +s3-website.us-east-1.amazonaws.com s3.dualstack.us-east-2.amazonaws.com +s3-accesspoint.dualstack.us-east-2.amazonaws.com +s3-accesspoint-fips.dualstack.us-east-2.amazonaws.com +s3-fips.dualstack.us-east-2.amazonaws.com s3.us-east-2.amazonaws.com +s3-accesspoint.us-east-2.amazonaws.com +s3-accesspoint-fips.us-east-2.amazonaws.com +s3-deprecated.us-east-2.amazonaws.com +s3-fips.us-east-2.amazonaws.com +s3-object-lambda.us-east-2.amazonaws.com s3-website.us-east-2.amazonaws.com +s3.dualstack.us-gov-east-1.amazonaws.com +s3-accesspoint.dualstack.us-gov-east-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-gov-east-1.amazonaws.com +s3-fips.dualstack.us-gov-east-1.amazonaws.com +s3.us-gov-east-1.amazonaws.com +s3-accesspoint.us-gov-east-1.amazonaws.com +s3-accesspoint-fips.us-gov-east-1.amazonaws.com +s3-fips.us-gov-east-1.amazonaws.com +s3-object-lambda.us-gov-east-1.amazonaws.com +s3-website.us-gov-east-1.amazonaws.com +s3.dualstack.us-gov-west-1.amazonaws.com +s3-accesspoint.dualstack.us-gov-west-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-gov-west-1.amazonaws.com +s3-fips.dualstack.us-gov-west-1.amazonaws.com +s3.us-gov-west-1.amazonaws.com +s3-accesspoint.us-gov-west-1.amazonaws.com +s3-accesspoint-fips.us-gov-west-1.amazonaws.com +s3-fips.us-gov-west-1.amazonaws.com +s3-object-lambda.us-gov-west-1.amazonaws.com +s3-website.us-gov-west-1.amazonaws.com +s3.dualstack.us-west-1.amazonaws.com +s3-accesspoint.dualstack.us-west-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-west-1.amazonaws.com +s3-fips.dualstack.us-west-1.amazonaws.com +s3-website.dualstack.us-west-1.amazonaws.com +s3.us-west-1.amazonaws.com +s3-accesspoint.us-west-1.amazonaws.com +s3-accesspoint-fips.us-west-1.amazonaws.com +s3-fips.us-west-1.amazonaws.com +s3-object-lambda.us-west-1.amazonaws.com +s3-website.us-west-1.amazonaws.com +s3.dualstack.us-west-2.amazonaws.com +s3-accesspoint.dualstack.us-west-2.amazonaws.com +s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com +s3-fips.dualstack.us-west-2.amazonaws.com +s3-website.dualstack.us-west-2.amazonaws.com +s3.us-west-2.amazonaws.com +s3-accesspoint.us-west-2.amazonaws.com +s3-accesspoint-fips.us-west-2.amazonaws.com +s3-deprecated.us-west-2.amazonaws.com +s3-fips.us-west-2.amazonaws.com +s3-object-lambda.us-west-2.amazonaws.com +s3-website.us-west-2.amazonaws.com + +// Amazon SageMaker Notebook Instances +// Submitted by AWS Security +// Reference: fe8c9e94-5a22-486d-8750-991a3a9b13c6 +notebook.af-south-1.sagemaker.aws +notebook.ap-east-1.sagemaker.aws +notebook.ap-northeast-1.sagemaker.aws +notebook.ap-northeast-2.sagemaker.aws +notebook.ap-northeast-3.sagemaker.aws +notebook.ap-south-1.sagemaker.aws +notebook.ap-south-2.sagemaker.aws +notebook.ap-southeast-1.sagemaker.aws +notebook.ap-southeast-2.sagemaker.aws +notebook.ap-southeast-3.sagemaker.aws +notebook.ap-southeast-4.sagemaker.aws +notebook.ca-central-1.sagemaker.aws +notebook.eu-central-1.sagemaker.aws +notebook.eu-central-2.sagemaker.aws +notebook.eu-north-1.sagemaker.aws +notebook.eu-south-1.sagemaker.aws +notebook.eu-south-2.sagemaker.aws +notebook.eu-west-1.sagemaker.aws +notebook.eu-west-2.sagemaker.aws +notebook.eu-west-3.sagemaker.aws +notebook.il-central-1.sagemaker.aws +notebook.me-central-1.sagemaker.aws +notebook.me-south-1.sagemaker.aws +notebook.sa-east-1.sagemaker.aws +notebook.us-east-1.sagemaker.aws +notebook-fips.us-east-1.sagemaker.aws +notebook.us-east-2.sagemaker.aws +notebook-fips.us-east-2.sagemaker.aws +notebook.us-gov-east-1.sagemaker.aws +notebook-fips.us-gov-east-1.sagemaker.aws +notebook.us-gov-west-1.sagemaker.aws +notebook-fips.us-gov-west-1.sagemaker.aws +notebook.us-west-1.sagemaker.aws +notebook.us-west-2.sagemaker.aws +notebook-fips.us-west-2.sagemaker.aws +notebook.cn-north-1.sagemaker.com.cn +notebook.cn-northwest-1.sagemaker.com.cn + +// Amazon SageMaker Studio +// Submitted by AWS Security +// Reference: 057ee397-6bf8-4f20-b807-d7bc145ac980 +studio.af-south-1.sagemaker.aws +studio.ap-east-1.sagemaker.aws +studio.ap-northeast-1.sagemaker.aws +studio.ap-northeast-2.sagemaker.aws +studio.ap-northeast-3.sagemaker.aws +studio.ap-south-1.sagemaker.aws +studio.ap-southeast-1.sagemaker.aws +studio.ap-southeast-2.sagemaker.aws +studio.ap-southeast-3.sagemaker.aws +studio.ca-central-1.sagemaker.aws +studio.eu-central-1.sagemaker.aws +studio.eu-north-1.sagemaker.aws +studio.eu-south-1.sagemaker.aws +studio.eu-west-1.sagemaker.aws +studio.eu-west-2.sagemaker.aws +studio.eu-west-3.sagemaker.aws +studio.il-central-1.sagemaker.aws +studio.me-central-1.sagemaker.aws +studio.me-south-1.sagemaker.aws +studio.sa-east-1.sagemaker.aws +studio.us-east-1.sagemaker.aws +studio.us-east-2.sagemaker.aws +studio.us-gov-east-1.sagemaker.aws +studio-fips.us-gov-east-1.sagemaker.aws +studio.us-gov-west-1.sagemaker.aws +studio-fips.us-gov-west-1.sagemaker.aws +studio.us-west-1.sagemaker.aws +studio.us-west-2.sagemaker.aws +studio.cn-north-1.sagemaker.com.cn +studio.cn-northwest-1.sagemaker.com.cn // Analytics on AWS // Submitted by AWS Security -// Reference: c02c3a80-f8a0-4fd2-b719-48ea8b7c28de +// Reference: 955f9f40-a495-4e73-ae85-67b77ac9cadd analytics-gateway.ap-northeast-1.amazonaws.com +analytics-gateway.ap-northeast-2.amazonaws.com +analytics-gateway.ap-south-1.amazonaws.com +analytics-gateway.ap-southeast-1.amazonaws.com +analytics-gateway.ap-southeast-2.amazonaws.com +analytics-gateway.eu-central-1.amazonaws.com analytics-gateway.eu-west-1.amazonaws.com analytics-gateway.us-east-1.amazonaws.com analytics-gateway.us-east-2.amazonaws.com analytics-gateway.us-west-2.amazonaws.com +// AWS Amplify +// Submitted by AWS Security +// Reference: 5ecce854-c033-4fc4-a755-1a9916d9a9bb +*.amplifyapp.com + +// AWS App Runner +// Submitted by AWS Security +// Reference: 6828c008-ba5d-442f-ade5-48da4e7c2316 +*.awsapprunner.com + // AWS Cloud9 // Submitted by: AWS Security // Reference: 05c44955-977c-4b57-938a-f2af92733f9f @@ -11493,25 +11947,33 @@ vfs.cloud9.us-west-2.amazonaws.com webview-assets.cloud9.us-west-2.amazonaws.com // AWS Elastic Beanstalk -// Submitted by Luke Wells -// Reference: aa202394-43a0-4857-b245-8db04549137e +// Submitted by AWS Security +// Reference: bb5a965c-dec3-4967-aa22-e306ad064797 cn-north-1.eb.amazonaws.com.cn cn-northwest-1.eb.amazonaws.com.cn elasticbeanstalk.com +af-south-1.elasticbeanstalk.com +ap-east-1.elasticbeanstalk.com ap-northeast-1.elasticbeanstalk.com ap-northeast-2.elasticbeanstalk.com ap-northeast-3.elasticbeanstalk.com ap-south-1.elasticbeanstalk.com ap-southeast-1.elasticbeanstalk.com ap-southeast-2.elasticbeanstalk.com +ap-southeast-3.elasticbeanstalk.com ca-central-1.elasticbeanstalk.com eu-central-1.elasticbeanstalk.com +eu-north-1.elasticbeanstalk.com +eu-south-1.elasticbeanstalk.com eu-west-1.elasticbeanstalk.com eu-west-2.elasticbeanstalk.com eu-west-3.elasticbeanstalk.com +il-central-1.elasticbeanstalk.com +me-south-1.elasticbeanstalk.com sa-east-1.elasticbeanstalk.com us-east-1.elasticbeanstalk.com us-east-2.elasticbeanstalk.com +us-gov-east-1.elasticbeanstalk.com us-gov-west-1.elasticbeanstalk.com us-west-1.elasticbeanstalk.com us-west-2.elasticbeanstalk.com @@ -12727,7 +13189,7 @@ shw.io // Submitted by Jonathan Rudenberg flynnhosting.net -// Forgerock : https://www.forgerock.com +// Forgerock : https://www.forgerock.com // Submitted by Roderick Parr forgeblocks.com id.forgerock.io @@ -12774,7 +13236,7 @@ freemyip.com // Submitted by Daniel A. Maierhofer wien.funkfeuer.at -// Futureweb OG : http://www.futureweb.at +// Futureweb GmbH : https://www.futureweb.at // Submitted by Andreas Schnederle-Wagner *.futurecms.at *.ex.futurecms.at @@ -13619,6 +14081,10 @@ azurestaticapps.net 1.azurestaticapps.net 2.azurestaticapps.net 3.azurestaticapps.net +4.azurestaticapps.net +5.azurestaticapps.net +6.azurestaticapps.net +7.azurestaticapps.net centralus.azurestaticapps.net eastasia.azurestaticapps.net eastus2.azurestaticapps.net @@ -13699,6 +14165,9 @@ sa.ngrok.io us.ngrok.io ngrok.pizza +// Nicolaus Copernicus University in Torun - MSK TORMAN (https://www.man.torun.pl) +torun.pl + // Nimbus Hosting Ltd. : https://www.nimbushosting.co.uk/ // Submitted by Nicholas Ford nh-serv.co.uk commit 7d283ca1a32d1005ab3b7986692d91ee071ebde7 Author: Stefan Kangas Date: Sun Dec 10 14:05:34 2023 +0100 ; Fix a few more typos diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index f09ee0afbf4..f6f9e56e0c7 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -4514,7 +4514,7 @@ Other Selections Selections under such window systems as MS-Windows, Nextstep, Haiku and Android are not aligned with those under X@. Each of these window system improvises its own selection mechanism without employing the -``selection converter'' mechanism illustrated in the preceeding node. +``selection converter'' mechanism illustrated in the preceding node. Only the @code{PRIMARY}, @code{CLIPBOARD}, and @code{SECONDARY} selections are generally supported, with the @code{XdndSelection} selection that records drag-and-drop data also available under @@ -4852,7 +4852,7 @@ Drag and Drop sometimes distinct from those provided by the ICCCM and conforming clipboard or primary selection owners. Frequently, the name of a MIME type, such as @code{"text/plain;charset=utf-8"} (with discrepant -capitalization of the ``utf-8''), is substitued for a standard X +capitalization of the ``utf-8''), is substituted for a standard X selection name such as @code{UTF8_STRING}. @cindex XDS diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 2c446913eba..3c9e6eb215f 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -428,7 +428,7 @@ private static class Coordinate manager = EmacsWindowAttachmentManager.MANAGER; /* If parent is the root window, notice that there are new - children available for interested activites to pick + children available for interested activities to pick up. */ manager.registerWindow (EmacsWindow.this); diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 616129bf780..62fdc0ad6e8 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2189,7 +2189,7 @@ erc-modules move-to-prompt) (const :tag "netsplit: Detect netsplits" netsplit) (const :tag "networks: Provide data about IRC networks" networks) - (const :tag "nickbar: Show nicknames in a dyamic side window" nickbar) + (const :tag "nickbar: Show nicknames in a dynamic side window" nickbar) (const :tag "nicks: Uniquely colorize nicknames in target buffers" nicks) (const :tag "noncommands: Deprecated. See module `command-indicator'." noncommands) diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 509b2d31819..67e5bda021b 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -92,7 +92,7 @@ eshell-rm-removes-directories :group 'eshell-unix) (define-widget 'eshell-interactive-query 'radio - "When to interatively query the user about a particular operation. + "When to interactively query the user about a particular operation. If t, always query. If nil, never query. If `root', query when the user is logged in as root (including when `default-directory' is remote with a root user)." diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 660b5f53a5f..a7ead1f2997 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1239,7 +1239,7 @@ tramp-sh-handle-file-truename (with-current-buffer (tramp-get-connection-buffer v) (goto-char (point-min)) (tramp-set-file-property v localname "file-symlink-marker" (read (current-buffer))) - ;; We cannote call `read', the file name isn't quoted. + ;; We cannot call `read', the file name isn't quoted. (forward-line) (buffer-substring (point) (line-end-position)))) diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 836db83c2f3..e913d37371a 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -1801,7 +1801,7 @@ hif-macro-supply-arguments actual-parms nil))) (t - (error "Interal error: impossible case.")))) + (error "Internal error: impossible case")))) (pop actual-parms) while actual-parms) ; end cl-loop diff --git a/lisp/transient.el b/lisp/transient.el index ebf6f23f6cd..93c68f8162b 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3566,7 +3566,7 @@ transient--separator-line (propertize "\n" 'face face 'line-height t)))) (defmacro transient-with-shadowed-buffer (&rest body) - "While in the transient buffer, temporarly make the shadowed buffer current." + "While in the transient buffer, temporarily make the shadowed buffer current." (declare (indent 0) (debug t)) `(with-current-buffer (or transient--shadowed-buffer (current-buffer)) ,@body)) diff --git a/src/sfnt.c b/src/sfnt.c index 238e7f48420..44906b12ce9 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -2783,7 +2783,7 @@ sfnt_decompose_compound_glyph (struct sfnt_glyph *glyph, else { /* The offset is determined by matching a point location in - a preceeding component with a point location in the + a preceding component with a point location in the current component. The index of the point in the previous component can be determined by adding component->argument1.a or component->argument1.c to @@ -11880,7 +11880,7 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, else { /* The offset is determined by matching a point location in - a preceeding component with a point location in the + a preceding component with a point location in the current component. The index of the point in the previous component is established by adding component->argument1.a or component->argument1.c to diff --git a/src/treesit.c b/src/treesit.c index 912f4ed47cc..b8de95ec691 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3286,7 +3286,7 @@ treesit_traverse_get_predicate (Lisp_Object thing, Lisp_Object language) there's an error, set SIGNAL_DATA to (ERR . DATA), where ERR is an error symbol, and DATA is something signal accepts, and return false, otherwise return true. This function also check for - recusion levels: we place a arbitrary 100 level limit on recursive + recursion levels: we place a arbitrary 100 level limit on recursive predicates. RECURSION_LEVEL is the current recursion level (that starts at 0), if it goes over 99, return false and set SIGNAL_DATA. LANGUAGE is a LANGUAGE symbol. */ commit 06a12b0cccbda419752f3388346be7d302ebcbeb Author: Stefan Kangas Date: Sun Dec 10 13:22:04 2023 +0100 ; Fix typos diff --git a/ChangeLog.android b/ChangeLog.android index 8cc66c4d7ea..96419ebe351 100644 --- a/ChangeLog.android +++ b/ChangeLog.android @@ -700,7 +700,7 @@ (build-counter.c): New target. Generate this file using makecounter.sh upon changes to lisp.mk or shortlisp. (lisp.mk): Make and load relative to abs_top_builddir. - (emacs$(EXEEXT)): Adjust acordingly. + (emacs$(EXEEXT)): Adjust accordingly. (mostlyclean): Remove build-counter.c. 2023-07-18 Po Lu @@ -735,7 +735,7 @@ prototypes. * java/org/gnu/emacs/EmacsWindow.java (motionEvent): Set - cancelation flag in events sent where appropriate. + cancellation flag in events sent where appropriate. * lisp/touch-screen.el (touch-screen-handle-point-update): Improve treatment of horizontal scrolling near window edges. @@ -749,7 +749,7 @@ (struct android_touch_event): New field `flags'. * src/androidterm.c (handle_one_android_event): Report - cancelation in TOUCHSCREEN_END_EVENTs. + cancellation in TOUCHSCREEN_END_EVENTs. * src/keyboard.c (make_lispy_event): Fix botched merge. @@ -1005,7 +1005,7 @@ * java/org/gnu/emacs/EmacsWindow.java (Coordinate): New fields `button' and `id'. - (): Add new arguments to the construtor. + (): Add new arguments to the constructor. (whatButtonWasIt): Return 0 if the button state has not changed. (buttonForEvent): New function. (figureChange): Return the Coordinate object associated to EVENT. @@ -2384,7 +2384,7 @@ (sfnt_read_avar_table): Fix sequencing problem. * src/sfntfont.c (sfntfont_setup_interpreter): Don't create - interpreter for blatently broken fonts. + interpreter for blatantly broken fonts. (sfntfont_open): Avoid specifying redundant blends. * src/sfnt.c (sfnt_validate_gs): Fix validation of projection @@ -3466,7 +3466,7 @@ (src/verbose.mk): Depend on verbose.mk.android in srcdir. (lib/Makefile): Edit srcdir and VPATH to LIB_SRCDIR. (src/Makefile): Edit -I$$(top_srcdir) to -I../$(srcdir)/lib, - instead of ommitting it. + instead of omitting it. (clean): Allow ndk-build clean to fail. * java/Makefile.in (builddir): New variable. @@ -3714,7 +3714,7 @@ module detection. * src/android.c (android_run_select_thread): Fix typos. - (android_run_select_thread): Lock select_mutex before signalling + (android_run_select_thread): Lock select_mutex before signaling condition variable. (android_select): Unlock event queue mutex prior to waiting for it. @@ -4663,7 +4663,7 @@ (ndk_CONFIG_FILES): Export NDK_BUILD_CFLAGS. * java/AndroidManifest.xml.in: Prevent the Emacs activity from - being overlayed by the emacsclient wrapper. + being overlaid by the emacsclient wrapper. * java/org/gnu/emacs/EmacsOpenActivity.java (run): Likewise. (onCreate): Set an appropriate theme on ICS and up. @@ -5151,7 +5151,7 @@ * m4/ndk-build.m4 (ndk_package_mape): Add package mapping for sqlite3. - * src/Makefile.in (SQLITE3_CFLAGS): New substition. + * src/Makefile.in (SQLITE3_CFLAGS): New substitution. (EMACS_CFLAGS): Add that variable. * src/android.c (android_api_level): New variable. @@ -5532,7 +5532,7 @@ (touch-screen-precision-scroll): New user option. (touch-screen-handle-scroll): Use traditional scrolling by default. - (touch-screen-handle-touch): Adust format of + (touch-screen-handle-touch): Adjust format of touch-screen-current-tool. (touch-screen-track-tap): Don't print waiting for events. (touch-screen-track-drag): Likewise. Also, don't call UPDATE @@ -5555,7 +5555,7 @@ * lisp/ls-lisp.el (ls-lisp-use-insert-directory-program): Default to off on Android. - * src/android.c (android_is_directory): New fucntion. + * src/android.c (android_is_directory): New function. (android_fstatat): Handle directories created by `android_opendir'. (android_open): Return meaningful file mode. @@ -5645,7 +5645,7 @@ * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Make all event sending functions return long. - * java/org/gnu/emacs/EmacsPreferencesActivity.java: New fle. + * java/org/gnu/emacs/EmacsPreferencesActivity.java: New file. * java/org/gnu/emacs/EmacsService.java (EmacsService) (onStartCommand, onCreate, startEmacsService): Start as a @@ -6310,7 +6310,7 @@ and `detectMouse'. (struct android_event_queue, android_init_events) (android_next_event, android_write_event): Remove write limit. - (android_file_access_p): Handle directories correcty. + (android_file_access_p): Handle directories correctly. (android_close): Fix coding style. (android_fclose): New function. (android_init_emacs_service): Initialize new methods. diff --git a/admin/notes/java b/admin/notes/java index 125ac0aad67..6a66d1aa765 100644 --- a/admin/notes/java +++ b/admin/notes/java @@ -15,7 +15,7 @@ Java is required because the entire Android runtime is based around Java, and there is no way to write an Android program which runs without Java. -This text exists to prime other Emacs developers, already familar with +This text exists to prime other Emacs developers, already familiar with C, on the basic architecture of the Android port, and to teach them how to read and write the Java code found in this directory. @@ -570,7 +570,7 @@ Let us go back and review the definition of ``startEmacsService'': context.startService (new Intent (context, EmacsService.class)); else - /* Display the permanant notification and start Emacs as a + /* Display the permanent notification and start Emacs as a foreground service. */ context.startForegroundService (new Intent (context, EmacsService.class)); @@ -796,7 +796,7 @@ Next, `max_handle' is saved, and a new handle is allocated for if (!window) error ("Out of window handles!"); -An error is signalled if Emacs runs out of available handles. +An error is signaled if Emacs runs out of available handles. if (!class) { diff --git a/configure.ac b/configure.ac index 759dcd14d50..a279f78a0ea 100644 --- a/configure.ac +++ b/configure.ac @@ -306,7 +306,7 @@ AC_DEFUN dnl OPTION_DEFAULT_IFAVAILABLE(NAME, HELP-STRING) dnl Create a new --with option that defaults to 'ifavailable', -dnl unless it is overriden by $with_features being equal to 'no'. +dnl unless it is overridden by $with_features being equal to 'no'. dnl NAME is the base name of the option. The shell variable with_NAME dnl will be set to either the user's value (if the option is dnl specified; 'yes' for a plain --with-NAME) or to 'ifavailable' (if the diff --git a/cross/ndk-build/README b/cross/ndk-build/README index aca2e7230bf..d6cf2908014 100644 --- a/cross/ndk-build/README +++ b/cross/ndk-build/README @@ -86,7 +86,7 @@ $(ANDROID_MAKEFILE), the ``Android.mk'' file, for the first time. The purpose of this evaluation is to establish a list of packages (or modules) provided by the ``Android.mk'' file, and the corresponding Makefile targets and compiler and linker flags required to build and -link to those tagets. +link to those targets. Before doing so, build-aux/ndk-build-helper.mk will define several variables and functions required by all ``Android.mk'' files. The @@ -164,7 +164,7 @@ module_cxx_deps="" module_imports="" which is then evaluated by `configure'. Once the variable -`module_name' is set, configure apends the remaining +`module_name' is set, configure appends the remaining $(module_includes), $(module_cflags) and $(module_ldflags) to the module's CFLAGS and LIBS variables, and appends the list of Makefile targets specified to the variable NDK_BUILD_MODULES. diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index 52912d045eb..fe73bc09d67 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -234,7 +234,7 @@ Android File System the (normally read-only) root directory named @file{content} or @file{assets}, you may want to access real files by these names if the Android installation in use has been customized. These files will -conflict with the aformentioned special directories, but can +conflict with the aforementioned special directories, but can nevertheless be accessed by writing their names relative to the ``parent'' directory of the root directory, as so illustrated: @file{/../content}, @file{/../assets}. @@ -258,7 +258,7 @@ Android File System traditional location within the parent of the app data directory. If Emacs is reinstalled and the location of the app library -directory consequentially changes, that symlink will also be updated +directory consequently changes, that symlink will also be updated to point to its new location the next time Emacs is started by the system. @@ -340,7 +340,7 @@ Android Environment System}.)@footnote{Except in cases where a ``shared user ID'' is specified and other applications signed using the same ``package signing key'' are installed, in which case Emacs runs as the same user -and has access to the same files as each of the aformentioned +and has access to the same files as each of the aforementioned applications.} Each application is also prohibited from accessing many system diff --git a/doc/emacs/haiku.texi b/doc/emacs/haiku.texi index 0bb216c14ae..e129fd6f33f 100644 --- a/doc/emacs/haiku.texi +++ b/doc/emacs/haiku.texi @@ -10,7 +10,7 @@ Haiku This appendix describes the peculiarities of using Emacs built with the Application Kit, the windowing system indigenous to Haiku. The -idiosyncracies illustrated here do not apply to Emacs on Haiku built +idiosyncrasies illustrated here do not apply to Emacs on Haiku built without windowing support, or configured with X11. @menu diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index f6462a9e50b..b4226a9ec6f 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2151,7 +2151,7 @@ Touchscreen Events translation if @code{down-mouse-1} is bound to a keymap, making it a prefix key. In lieu of simple translation, it translates the closing @code{touchscreen-end} to a @code{down-mouse-1} event with the -starting position of the touch sequence, consequentially displaying +starting position of the touch sequence, consequently displaying the mouse menu. @cindex @code{mouse-1-menu-command}, a symbol property @@ -2205,7 +2205,7 @@ Touchscreen Events @item (touchscreen-restart-drag @var{posn}) This event is sent upon the start of a touch sequence resulting in the continuation of a ``drag-to-select'' gesture (subject to the -aformentioned user option) with @var{posn} set to the position list of +aforementioned user option) with @var{posn} set to the position list of the initial @code{touchscreen-begin} event within that touch sequence. @cindex @code{touchscreen-pinch} event diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index ec6f7fd9462..f09ee0afbf4 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -4160,7 +4160,7 @@ X Selections server, owner and requestor. @end itemize - The selection owner responds by tranferring to the requestor a + The selection owner responds by transferring to the requestor a series of bytes, 16 bit words, or 32 bit words, along with another atom identifying the type of those words. After requesting a selection, Emacs then applies its own interpretation of the data diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index ba7f1ca692e..03c221c6cf6 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1564,7 +1564,7 @@ High-Level Completion value is also displayed in the echo area. The optional arguments @var{foreground} and @var{face} control the -appearence of the completion candidates in the @file{*Completions*} +appearance of the completion candidates in the @file{*Completions*} buffer. The candidates are displayed in the specified @var{face} but with different colors: if @var{foreground} is non-@code{nil}, the foreground color is changed to be the color of the candidate, diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index cb269fcacc5..1a898828eb1 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -2990,7 +2990,7 @@ POSIX Regexps @section Emacs versus POSIX Regular Expressions @cindex POSIX regular expressions -Regular expression syntax varies signficantly among computer programs. +Regular expression syntax varies significantly among computer programs. When writing Elisp code that generates regular expressions for use by other programs, it is helpful to know how syntax variants differ. To give a feel for the variation, this section discusses how diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 5d05ef18d4f..b17eb087f42 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6205,7 +6205,7 @@ Atomic Changes If @code{buffer-undo-list} no longer contains that cons, Emacs will lose track of any change groups, resulting in an error when the change -group is cancelled. To avoid this, do not call any functions which +group is canceled. To avoid this, do not call any functions which may edit the undo list in such a manner, when a change group is active: notably, ``amalgamating'' commands such as @code{delete-char}, which call @code{undo-auto-amalgamate}. diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 892ff4dd5e4..a0adb5fea2c 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -954,7 +954,7 @@ Syntax Highlighting Tests Test assertion parser extracts tests from comment-only lines. Every comment assertion line starts either with a caret (@samp{^}) or an -arrow (@samp{<-}). A caret/arrow should be followed immedately by the +arrow (@samp{<-}). A caret/arrow should be followed immediately by the name of a face to be checked. The test then checks if the first non-assertion column above the caret diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 7eedc97ab04..bdcb0793098 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -90,7 +90,7 @@ The Modus themes consist of eight themes, divided into four subgroups. are variants of the two main themes. They slightly tone down the intensity of the background and provide a bit more color variety. ~modus-operandi-tinted~ has a set of base tones that are shades of - light ochre (earthly colors), while ~modus-vivendi-tinted~ gives a + light ocher (earthly colors), while ~modus-vivendi-tinted~ gives a night sky impression. - Deuteranopia themes :: ~modus-operandi-deuteranopia~ and its @@ -2518,7 +2518,7 @@ manual, here is what Protesilaos uses: ;; Add a nuanced background as well. (bg-prompt bg-magenta-nuanced) (fg-prompt magenta-cooler) - ;; Tweak some more constructs for stylistic constistency. + ;; Tweak some more constructs for stylistic consistency. (name blue-warmer) (identifier magenta-faint) (keybind magenta-cooler) @@ -2717,7 +2717,7 @@ For a more elaborate design, it is better to inspect the source code of [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. #+findex: modus-themes-get-color-value -The fuction ~modus-themes-get-color-value~ can be called from Lisp to +The function ~modus-themes-get-color-value~ can be called from Lisp to return the value of a color from the active Modus theme palette. It takea a =COLOR= argument and an optional =OVERRIDES=. @@ -2886,7 +2886,7 @@ above: The reason we no longer provide this option is because it depends on a non-~nil~ value for ~x-underline-at-descent-line~. That variable affects ALL underlines, including those of links. The effect is -intrusive and looks awkard in prose. +intrusive and looks awkward in prose. As such, the Modus themes no longer provide that option but instead offer this piece of documentation to make the user fully aware of the @@ -3229,7 +3229,7 @@ specification of that variable looks like this: With the exception of ~org-verbatim~ and ~org-code~ faces, everything else uses the corresponding type of emphasis: a bold typographic weight, or -italicised, underlined, and struck through text. +italicized, underlined, and struck through text. The best way for users to add some extra attributes, such as a foreground color, is to define their own faces and assign them to the @@ -5132,7 +5132,7 @@ it is already understood that one must follow the indicator or headline to view its contents and (ii) underlining everything would make the interface virtually unusable. -Again, one must exercise judgement in order to avoid discrimination, +Again, one must exercise judgment in order to avoid discrimination, where "discrimination" refers to: + The treatment of substantially different magnitudes as if they were of @@ -5206,7 +5206,7 @@ the themes, which is partially fleshed out in this manual. With regard to the artistic aspect (where "art" qua skill may amount to an imprecise science), there is no hard-and-fast rule in effect as it -requires one to exercize discretion and make decisions based on +requires one to exercise discretion and make decisions based on context-dependent information or constraints. As is true with most things in life, when in doubt, do not cling on to the letter of the law but try to understand its spirit. diff --git a/etc/DEBUG b/etc/DEBUG index 5aeb38c6460..86bff45e7d9 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -1142,7 +1142,7 @@ one to upload, like so: ../java/debug.sh --gdbserver /path/to/gdbserver This Gdbserver should be statically linked or compiled using the -Android NDK, and must target the same architecture as the debugee +Android NDK, and must target the same architecture as the debugged Emacs binary. Older versions of the Android NDK (such as r24) distribute suitable Gdbserver binaries, usually located within diff --git a/etc/NEWS b/etc/NEWS index fbfe1084b8f..33afb34b029 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1224,7 +1224,7 @@ This user option has been obsoleted in Emacs 27, use --- ** User options 'eshell-NAME-unload-hook' are now obsolete. These hooks were named incorrectly, and so they never actually ran -when unloading the correspending feature. Instead, you should use +when unloading the corresponding feature. Instead, you should use hooks named after the feature name, like 'esh-mode-unload-hook'. +++ diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 7159fe32c1c..e42e3c4d87a 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3539,7 +3539,7 @@ The Microsoft scaler and FreeType promptly disregard such points. Nothing in the TrueType specifications implies that points "hidden" in this fashion should be afforded any special treatment, and thus Emacs -eschews doing so. Consequentially, black streaks are displayed as +eschews doing so. Consequently, black streaks are displayed as Emacs interpolates glyph edges between points within the glyph and points the test font attempts to hide. diff --git a/etc/themes/modus-operandi-tinted-theme.el b/etc/themes/modus-operandi-tinted-theme.el index e66a030650c..1ef7af8f165 100644 --- a/etc/themes/modus-operandi-tinted-theme.el +++ b/etc/themes/modus-operandi-tinted-theme.el @@ -1,4 +1,4 @@ -;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ochre background -*- lexical-binding:t -*- +;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ocher background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -44,7 +44,7 @@ ;;;###theme-autoload (deftheme modus-operandi-tinted - "Elegant, highly legible theme with a light ochre background. + "Elegant, highly legible theme with a light ocher background. Conforms with the highest legibility standard for color contrast between background and foreground in any given piece of text, which corresponds to a minimum contrast in relative luminance of diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index 34130a05515..0f7bc025b72 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -1535,7 +1535,7 @@ modus-themes--prompt :foreground fg :weight ;; If we have `bold' specifically, we inherit the face of - ;; the same name. This allows the user to customise that + ;; the same name. This allows the user to customize that ;; face, such as to change its font family. (if (and weight (not (eq weight 'bold))) weight diff --git a/exec/exec1.c b/exec/exec1.c index d77ca8adf54..6ec4b3ecaae 100644 --- a/exec/exec1.c +++ b/exec/exec1.c @@ -53,7 +53,7 @@ main (int argc, char **argv) tracing_execve (argv[2], argv + 2, environ); - /* An error occured. Exit with failure. */ + /* An error occurred. Exit with failure. */ exit (127); } else diff --git a/exec/trace.c b/exec/trace.c index f9deef8eb2d..ccf498f39fe 100644 --- a/exec/trace.c +++ b/exec/trace.c @@ -1028,7 +1028,7 @@ process_system_call (struct exec_tracee *tracee) break; case 1: - /* An error has occured; errno is set to the error. */ + /* An error has occurred; errno is set to the error. */ goto report_syscall_error; } diff --git a/java/INSTALL b/java/INSTALL index fb221c5e2b4..60171ada57c 100644 --- a/java/INSTALL +++ b/java/INSTALL @@ -167,7 +167,7 @@ than a compressed package for a newer version of Android. BUILDING C++ DEPENDENCIES With a new version of the NDK, dependencies containing C++ code should -build without any futher configuration. However, older versions +build without any further configuration. However, older versions require that you use the ``make_standalone_toolchain.py'' script in the NDK distribution to create a ``standalone toolchain'', and use that instead, in order for C++ headers to be found. @@ -309,7 +309,7 @@ work, along with what has to be patched to make them work: Many of these dependencies have been migrated over to the ``Android.bp'' build system now used to build Android itself. However, the old ``Android.mk'' Makefiles are still present in older -branches, and can be easily adapte to newer versions. +branches, and can be easily adapted to newer versions. In addition, some Emacs dependencies provide `ndk-build' support themselves: diff --git a/java/org/gnu/emacs/EmacsContextMenu.java b/java/org/gnu/emacs/EmacsContextMenu.java index c415ba59c79..2652f35b545 100644 --- a/java/org/gnu/emacs/EmacsContextMenu.java +++ b/java/org/gnu/emacs/EmacsContextMenu.java @@ -36,7 +36,7 @@ import android.util.Log; /* Context menu implementation. This object is built from JNI and - describes a menu hiearchy. Then, `inflate' can turn it into an + describes a menu hierarchy. Then, `inflate' can turn it into an Android menu, which can be turned into a popup (or other kind of) menu. */ diff --git a/java/org/gnu/emacs/EmacsInputConnection.java b/java/org/gnu/emacs/EmacsInputConnection.java index 7f6331205cb..4b493dcc456 100644 --- a/java/org/gnu/emacs/EmacsInputConnection.java +++ b/java/org/gnu/emacs/EmacsInputConnection.java @@ -60,7 +60,7 @@ public final class EmacsInputConnection implements InputConnection This helps with on screen keyboard programs found in some vendor versions of Android, which rely on immediate updates to the point - position after text is commited in order to place the cursor + position after text is committed in order to place the cursor within that text. */ private static boolean syncAfterCommit; diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java index 32a79d1a797..b4fd68146be 100644 --- a/java/org/gnu/emacs/EmacsOpenActivity.java +++ b/java/org/gnu/emacs/EmacsOpenActivity.java @@ -636,7 +636,7 @@ private class EmacsClientThread extends Thread { /* This means Emacs lacks the rights to open this file. Display the error message and exit. */ - displayFailureDialog ("Error openining file", + displayFailureDialog ("Error opening file", exception.toString ()); return; } diff --git a/java/org/gnu/emacs/EmacsSafThread.java b/java/org/gnu/emacs/EmacsSafThread.java index 7917e2d4880..8bb84126b07 100644 --- a/java/org/gnu/emacs/EmacsSafThread.java +++ b/java/org/gnu/emacs/EmacsSafThread.java @@ -767,7 +767,7 @@ Call this when the contents of a file (i.e. the constituents of a private abstract class SafIntFunction { - /* The ``throws Throwable'' here is a Java idiosyncracy that tells + /* The ``throws Throwable'' here is a Java idiosyncrasy that tells the compiler to allow arbitrary error objects to be signaled from within this function. @@ -782,7 +782,7 @@ public abstract int runInt (CancellationSignal signal) private abstract class SafObjectFunction { - /* The ``throws Throwable'' here is a Java idiosyncracy that tells + /* The ``throws Throwable'' here is a Java idiosyncrasy that tells the compiler to allow arbitrary error objects to be signaled from within this function. @@ -1216,7 +1216,7 @@ type is either NULL (in which case id should also be NULL) or }); } - /* The bulk of `statDocument'. SIGNAL should be a cancelation + /* The bulk of `statDocument'. SIGNAL should be a cancellation signal. */ private long[] diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 33832505333..c71670b3e47 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -612,7 +612,7 @@ invocation of app_process (through android-emacs) can context.startService (new Intent (context, EmacsService.class)); else - /* Display the permanant notification and start Emacs as a + /* Display the permanent notification and start Emacs as a foreground service. */ context.startForegroundService (new Intent (context, EmacsService.class)); @@ -679,7 +679,7 @@ invocation of app_process (through android-emacs) can /* Display a list of programs able to send this URL. */ intent = Intent.createChooser (intent, "Send"); - /* Apparently flags need to be set after a choser is + /* Apparently flags need to be set after a chooser is created. */ intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); } @@ -927,7 +927,7 @@ invocation of app_process (through android-emacs) can if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) /* Since the system predates drag and drop, return this resolver - to avoid any unforseen difficulties. */ + to avoid any unforeseen difficulties. */ return resolver; activity = EmacsActivity.lastFocusedActivity; @@ -947,7 +947,7 @@ invocation of app_process (through android-emacs) can if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) /* Since the system predates drag and drop, return this resolver - to avoid any unforseen difficulties. */ + to avoid any unforeseen difficulties. */ return this; activity = EmacsActivity.lastFocusedActivity; diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 2d53231fbf9..5795f476f63 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java @@ -388,7 +388,7 @@ else if (MeasureSpec.getMode (heightMeasureSpec) == MeasureSpec.AT_MOST && !rootWindowInsets.isVisible (WindowInsets.Type.ime ()) /* N.B. that the keyboard is dismissed during gesture navigation under Android 30, but the system is - quite tempermental regarding whether the window is + quite temperamental regarding whether the window is focused at that point. Ideally isCurrentlyTextEditor shouldn't be reset in that case, but detecting that situation appears to be diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 7d161fdcf88..2c446913eba 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -1399,7 +1399,7 @@ else if (EmacsWindow.this.isMapped) } /* Effect the same adjustment upon the view - hiearchy. */ + hierarchy. */ EmacsService.SERVICE.runOnUiThread (new Runnable () { @Override diff --git a/lisp/button.el b/lisp/button.el index ed11c9583d8..4d66fc57d87 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -494,7 +494,7 @@ push-button (button-activate str t) (if (eq (car-safe pos) 'touchscreen-down) ;; If touch-screen-track tap returns nil, then the - ;; tap was cancelled. + ;; tap was canceled. (when (touch-screen-track-tap pos nil nil t) (push-button (posn-point posn) t)) (push-button (posn-point posn) t)))))) diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 7a61a8fce7e..5a72011c609 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -440,7 +440,7 @@ byte-optimize-form-code-walker (`(unwind-protect ,protected-expr :fun-body ,unwind-fun) ;; FIXME: The return value of UNWIND-FUN is never used so we - ;; could potentially optimise it for-effect, but we don't do + ;; could potentially optimize it for-effect, but we don't do ;; that right no. `(,fn ,(byte-optimize-form protected-expr for-effect) :fun-body ,(byte-optimize-form unwind-fun))) @@ -973,7 +973,7 @@ byte-optimize-binary-predicate (list (car form) (nth 2 form) (nth 1 form))))) (defun byte-opt--nary-comparison (form) - "Optimise n-ary comparisons such as `=', `<' etc." + "Optimize n-ary comparisons such as `=', `<' etc." (let ((nargs (length (cdr form)))) (cond ((= nargs 1) @@ -988,7 +988,7 @@ byte-opt--nary-comparison (if (memq nil (mapcar #'macroexp-copyable-p (cddr form))) ;; At least one arg beyond the first is non-constant non-variable: ;; create temporaries for all args to guard against side-effects. - ;; The optimiser will eliminate trivial bindings later. + ;; The optimizer will eliminate trivial bindings later. (let ((i 1)) (dolist (arg (cdr form)) (let ((var (make-symbol (format "arg%d" i)))) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 64fd4f6b3f3..950ae77803c 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3566,7 +3566,7 @@ byte-compile-form (cond ((and sef (or (eq sef 'error-free) byte-compile-delete-errors)) - ;; This transform is normally done in the Lisp optimiser, + ;; This transform is normally done in the Lisp optimizer, ;; so maybe we don't need to bother about it here? (setq form (cons 'progn (cdr form))) (setq handler #'byte-compile-progn)) @@ -3603,7 +3603,7 @@ byte-compile-form (let ((important-return-value-fns '( ;; These functions are side-effect-free except for the - ;; behaviour of functions passed as argument. + ;; behavior of functions passed as argument. mapcar mapcan mapconcat assoc plist-get plist-member @@ -4148,7 +4148,7 @@ byte-compile-cmp (byte-compile-two-args (if (macroexp-const-p (nth 1 form)) ;; First argument is constant: flip it so that the constant - ;; is last, which may allow more lapcode optimisations. + ;; is last, which may allow more lapcode optimizations. (let* ((op (car form)) (flipped-op (cdr (assq op '((< . >) (<= . >=) (> . <) (>= . <=) (= . =)))))) @@ -4312,7 +4312,7 @@ byte-compile-variadic-numeric (arg2 (nth 2 form))) (when (and (memq (car form) '(+ *)) (macroexp-const-p arg1)) - ;; Put constant argument last for better LAP optimisation. + ;; Put constant argument last for better LAP optimization. (cl-rotatef arg1 arg2)) (byte-compile-form arg1) (byte-compile-form arg2) @@ -5326,7 +5326,7 @@ bytecomp--check-cus-type "Warn about common mistakes in the `defcustom' type TYPE." (let ((invalid-types '( - ;; Lisp type predicates, often confused with customisation types: + ;; Lisp type predicates, often confused with customization types: functionp numberp integerp fixnump natnump floatp booleanp characterp listp stringp consp vectorp symbolp keywordp hash-table-p facep diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 2431e658368..7b69404cfac 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3739,7 +3739,7 @@ cl--compiler-macro-get (mapc (lambda (x) (function-put x 'important-return-value t)) '( ;; Functions that are side-effect-free except for the - ;; behaviour of functions passed as argument. + ;; behavior of functions passed as argument. cl-mapcar cl-mapcan cl-maplist cl-map cl-mapcon cl-reduce cl-assoc cl-assoc-if cl-assoc-if-not diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index e28d73c3555..4ee825136c9 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -607,7 +607,7 @@ eldoc--echo-area-prefer-doc-buffer-p (defun eldoc-display-in-echo-area (docs interactive) "Display DOCS in echo area. -INTERACTIVE is non-nil if user explictly invoked ElDoc. Honor +INTERACTIVE is non-nil if user explicitly invoked ElDoc. Honor `eldoc-echo-area-use-multiline-p' and `eldoc-echo-area-prefer-doc-buffer'." (cond @@ -933,7 +933,7 @@ eldoc--invoke-strategy (let* ((eldoc--make-callback #'make-callback) (res (funcall eldoc-documentation-strategy))) ;; Observe the old and the new protocol: - (cond (;; Old protocol: got string, e-d-strategy is iself the + (cond (;; Old protocol: got string, e-d-strategy is itself the ;; origin function, and we output immediately; (stringp res) (register-doc 0 res nil eldoc-documentation-strategy) diff --git a/lisp/emacs-lisp/ert-font-lock.el b/lisp/emacs-lisp/ert-font-lock.el index 6a02cf7acc4..8bde83bf278 100644 --- a/lisp/emacs-lisp/ert-font-lock.el +++ b/lisp/emacs-lisp/ert-font-lock.el @@ -28,7 +28,7 @@ ;; ;; ert-font-lock entry points are functions ;; `ert-font-lock-test-string' and `ert-font-lock-test-file' and -;; covenience macros: `ert-font-lock-deftest' and +;; convenience macros: `ert-font-lock-deftest' and ;; `ert-font-lock-deftest-file'. ;; ;; See unit tests in ert-font-lock-tests.el for usage examples. diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 5d31253fe2d..9f40c1f3c93 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -638,7 +638,7 @@ gv-deref ;;; Generalized variables. -;; You'd think noone would write `(setf (error ...) ..)' but it +;; You'd think no one would write `(setf (error ...) ..)' but it ;; appears naturally as the result of macroexpansion of things like ;; (setf (pcase-exhaustive ...)). ;; We could generalize this to `throw' and `signal', but it seems diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index bc36762cb2d..bef498f997c 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -863,7 +863,7 @@ package-vc-install name, otherwise NAME is the package name as a symbol. PACKAGE can also be a cons cell (PNAME . SPEC) where PNAME is the -package name as a symbol, and SPEC is a plist that specifes how +package name as a symbol, and SPEC is a plist that specifies how to fetch and build the package. For possible values, see the subsection \"Specifying Package Sources\" in the Info node `(emacs)Fetching Package Sources'. diff --git a/lisp/erc/erc-status-sidebar.el b/lisp/erc/erc-status-sidebar.el index d2ecce94bcd..98d5a321385 100644 --- a/lisp/erc/erc-status-sidebar.el +++ b/lisp/erc/erc-status-sidebar.el @@ -130,7 +130,7 @@ erc-status-sidebar-style `erc-status-sidebar-pad-hierarchy' for the above-mentioned purposes. ERC also accepts a list of -functions to preform these roles a la carte. Since the members +functions to perform these roles a la carte. Since the members of the above sets aren't really interoperable, we don't offer them here as customization choices, but you can still specify them manually. See doc strings for a description of their diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 79336204847..9b1bc009079 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -399,7 +399,7 @@ eshell-add-input-to-history ('nil t) ; Always add to history ('erase ; Add, removing any old occurrences (when-let ((old-index (ring-member eshell-history-ring input))) - ;; Remove the old occurence of this input so we can + ;; Remove the old occurrence of this input so we can ;; add it to the end. FIXME: Should we try to ;; remove multiple old occurrences, e.g. if the user ;; recently changed to using `erase'? diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 849a8d8eaee..7726712d056 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -158,7 +158,7 @@ jsonrpc-forget-pending-continuations (defvar jsonrpc-inhibit-debug-on-error nil "Inhibit `debug-on-error' when answering requests. Some extensions, notably ert.el, set `debug-on-error' to non-nil, -which makes it hard to test the behaviour of catching the Elisp +which makes it hard to test the behavior of catching the Elisp error and replying to the endpoint with an JSONRPC-error. This variable can be set around calls like `jsonrpc-request' to circumvent that.") diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e5c5fd62f8c..a9814fb0bac 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1685,7 +1685,7 @@ minibuffer-sort-by-history "Sort COMPLETIONS by their position in `minibuffer-history-variable'. COMPLETIONS are sorted first by `minibuffer-sort-alphbetically', -then any elements occuring in the minibuffer history list are +then any elements occurring in the minibuffer history list are moved to the front based on the chronological order they occur in the history. If a history variable hasn't been specified for this call of `completing-read', COMPLETIONS are sorted only by @@ -4942,7 +4942,7 @@ minibuffer-setup-on-screen-keyboard (defun minibuffer-exit-on-screen-keyboard () "Hide the on-screen keyboard if it was displayed. Hide the on-screen keyboard in a timer set to run in 0.1 seconds. -It will be cancelled if the minibuffer is displayed again within +It will be canceled if the minibuffer is displayed again within that timeframe. Do not hide the on screen keyboard inside a recursive edit. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 9f030b4c743..e0888c61496 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -200,7 +200,7 @@ shr-max-inline-image-size HEIGHT can be also be an integer or a floating point number. If it is an integer and the pixel height of an image exceeds it, the image image is -displyed on a separate line. If it is a float number , the limit is +displayed on a separate line. If it is a float number , the limit is interpreted as a multiple of the height of default font." :version "30.1" :type '(choice (const nil) (cons number number))) diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 379b8b70656..0d79f88f10c 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -856,7 +856,7 @@ tramp-crypt-handle-unlock-file 'unlock-file (tramp-crypt-encrypt-file-name filename)))) (defun tramp-crypt-cleanup-connection (vec) - "Cleanup crypt ressources determined by VEC." + "Cleanup crypt resources determined by VEC." (let ((tramp-cleanup-connection-hook (remove #'tramp-crypt-cleanup-connection tramp-cleanup-connection-hook))) diff --git a/lisp/net/tramp-message.el b/lisp/net/tramp-message.el index 8afc8d5fd87..e05357f1f4f 100644 --- a/lisp/net/tramp-message.el +++ b/lisp/net/tramp-message.el @@ -515,7 +515,7 @@ tramp-debug-message-fnh-function Bound in `tramp-*-file-name-handler' functions.") (defun tramp-debug-message-buttonize (position) - "Buttonize function in current buffer, at next line starting after POSTION." + "Buttonize function in current buffer, at next line starting after POSITION." (declare (tramp-suppress-trace t)) (save-excursion (goto-char position) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 018a194ac14..6154253e6b3 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -7554,7 +7554,7 @@ c-ml-string-opener-around-point (defun c-ml-string-opener-intersects-region (&optional start finish) ;; If any part of the region [START FINISH] is inside an ml-string opener, ;; return a dotted list of the start, end and double-quote position of the - ;; first such opener. That list wlll not include any "context characters" + ;; first such opener. That list will not include any "context characters" ;; before or after the opener. If an opener is found, the match-data will ;; indicate it, with (match-string 1) being the entire delimiter, and ;; (match-string 2) the "main" double-quote. Otherwise, the match-data is @@ -9891,7 +9891,7 @@ c-forward-primary-expression ;; Note that this function is incomplete, handling only those cases expected ;; to be common in a C++20 requires clause. ;; - ;; Note also that (...) is not recognised as a primary expression if the + ;; Note also that (...) is not recognized as a primary expression if the ;; next token is an open brace. (let ((here (point)) (c-restricted-<>-arglists t) @@ -13021,7 +13021,7 @@ c-laomib-cache (defun c-laomib-get-cache (containing-sexp start) ;; Get an element from `c-laomib-cache' matching CONTAINING-SEXP, and which - ;; is suitable for start postiion START. + ;; is suitable for start position START. ;; Return that element or nil if one wasn't found. (let ((ptr c-laomib-cache) elt) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 02185972bfe..58cf2728f61 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -4206,7 +4206,7 @@ cperl-find-pods-heres (setq tmpend tb)) (put-text-property b (point) 'syntax-type 'format)) ;; quotelike operator or regexp: capture groups 10 or 11 - ;; matches some false postives, to be eliminated here + ;; matches some false positives, to be eliminated here ((or (match-beginning 10) (match-beginning 11)) (setq b1 (if (match-beginning 10) 10 11) argument (buffer-substring @@ -5877,7 +5877,7 @@ cperl-init-faces (eval cperl--ws*-rx)) ;; ... or the start of a "sloppy" signature (sequence (eval cperl--sloppy-signature-rx) - ;; arbtrarily continue "a few lines" + ;; arbitrarily continue "a few lines" (repeat 0 200 (not (in "{")))) ;; make sure we have a reasonably ;; short match for an incomplete sub diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index eb35287cabe..0f0bb73ae77 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3974,11 +3974,11 @@ gud--lldb-python-init-string print(f'\"{string_list.GetStringAtIndex(i)}\" ') print(')##') " - "Python code sent to LLDB for gud-specific initialisation.") + "Python code sent to LLDB for gud-specific initialization.") (defun gud-lldb-fetch-completions (context command) "Return the data to complete the LLDB command before point. -This is what the Python function we installed at initialzation +This is what the Python function we installed at initialization time returns, as a Lisp list. Maximum number of completions requested from LLDB is controlled by `gud-lldb-max-completions', which see." diff --git a/lisp/simple.el b/lisp/simple.el index d60acf5477a..cee1ddac52f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -11178,7 +11178,7 @@ analyze-text-conversion enabled. - Look for the deletion of a single electric pair character, - and delete the adjascent pair if + and delete the adjacent pair if `electric-pair-delete-adjacent-pairs'. - Run `post-self-insert-hook' for the last character of diff --git a/lisp/term/android-win.el b/lisp/term/android-win.el index 36470097b40..3e759a37a71 100644 --- a/lisp/term/android-win.el +++ b/lisp/term/android-win.el @@ -340,7 +340,7 @@ android-deactivate-mark-command ;; Splash screen notice. Users are frequently left scratching their -;; heads when they overlook the Android appendex in the Emacs manual +;; heads when they overlook the Android appendix in the Emacs manual ;; and discover that external storage is not accessible; worse yet, ;; Android 11 and later veil the settings panel controlling such ;; permissions behind layer upon layer of largely immaterial settings diff --git a/lisp/touch-screen.el b/lisp/touch-screen.el index bae0e097688..a10bdea8994 100644 --- a/lisp/touch-screen.el +++ b/lisp/touch-screen.el @@ -57,7 +57,7 @@ touch-screen-aux-tool cons holding the initial position of the touch point, and the last known position of the touch point, all in the same format as in `touch-screen-current-tool', the distance in pixels between -the current tool and the aformentioned initial position, the +the current tool and the aforementioned initial position, the center of the line formed between those two points, the ratio between the present distance between both tools and the aforesaid initial distance when a pinch gesture was last sent, and three @@ -1927,7 +1927,7 @@ touch-screen-track-tap If THRESHOLD is non-nil, enforce a threshold of movement that is either itself or 10 pixels when it is not a number. If the -aformentioned touch point moves beyond that threshold on any +aforementioned touch point moves beyond that threshold on any axis, return nil immediately, and further resume mouse event translation for the touch point at hand. diff --git a/lisp/transient.el b/lisp/transient.el index 94f7700ddaf..ebf6f23f6cd 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1514,7 +1514,7 @@ transient-prefix-object Regular suffix commands, which are not prefixes, do not have to concern themselves with this distinction, so they can use this function instead. In the context of a plain suffix, it always -returns the value of the appropiate variable." +returns the value of the appropriate variable." (or transient--prefix transient-current-prefix)) (defun transient-suffix-object (&optional command) diff --git a/lisp/treesit.el b/lisp/treesit.el index da8226f7d8a..9f885985f3b 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -690,7 +690,7 @@ treesit-local-parsers-on (defun treesit--update-ranges-local (query embedded-lang &optional beg end) - "Update range for local parsers betwwen BEG and END. + "Update range for local parsers between BEG and END. Use QUERY to get the ranges, and make sure each range has a local parser for EMBEDDED-LANG." ;; Clean up. diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 34c45b7aec3..2897b60b2f9 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -1619,7 +1619,7 @@ use-package-handler/:vc the `use-package-normalize/:vc' function. REST is a plist of other (following) keywords and their -arguments, each having already been normalised by the respective +arguments, each having already been normalized by the respective function. STATE is a plist of any state that keywords processed before @@ -1690,7 +1690,7 @@ use-package-normalize/:vc (`(,(pred symbolp) . ,(or (pred plistp) ; plist/version string + name (pred stringp))) (use-package-normalize--vc-arg arg)) - (_ (use-package-error "Unrecognised argument to :vc.\ + (_ (use-package-error "Unrecognized argument to :vc.\ The keyword wants an argument of nil, t, a name of a package,\ or a cons-cell as accepted by `package-vc-selected-packages', where \ the accepted plist is augmented by a `:rev' keyword."))))) diff --git a/src/android.c b/src/android.c index 51622f16230..7a393f8f56d 100644 --- a/src/android.c +++ b/src/android.c @@ -2779,7 +2779,7 @@ android_destroy_handle (android_handle handle) /* Just clear any exception thrown. If destroying the handle fails from an out-of-memory error, then Emacs loses some - resources, but that is not as big deal as signalling. */ + resources, but that is not as big deal as signaling. */ (*android_java_env)->ExceptionClear (android_java_env); /* Delete the global reference regardless of any error. */ @@ -5797,7 +5797,7 @@ android_check_string (Lisp_Object text) better represent the UCS-16 based Java String format, and to let strings contain NULL characters while remaining valid C strings: NULL bytes are encoded as two-byte sequences, and Unicode surrogate - pairs encoded as two-byte sequences are prefered to four-byte + pairs encoded as two-byte sequences are preferred to four-byte sequences when encoding characters above the BMP. */ int diff --git a/src/androidselect.c b/src/androidselect.c index f7988db0520..e7a6ee258a8 100644 --- a/src/androidselect.c +++ b/src/androidselect.c @@ -299,7 +299,7 @@ DEFUN ("android-get-clipboard-targets", Fandroid_get_clipboard_targets, bytes_array); for (i = 0; i < length; ++i) { - /* Retireve the MIME type. */ + /* Retrieve the MIME type. */ bytes = (*android_java_env)->GetObjectArrayElement (android_java_env, bytes_array, i); diff --git a/src/androidterm.c b/src/androidterm.c index cfb64cd69a0..c3a04fd3cfb 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -6101,7 +6101,7 @@ android_update_selection (struct frame *f, struct window *w) else start = -1, end = -1; - /* Now constrain START and END to the maximium size of a Java + /* Now constrain START and END to the maximum size of a Java integer. */ start = min (start, TYPE_MAXIMUM (jint)); end = min (end, TYPE_MAXIMUM (jint)); @@ -6238,7 +6238,7 @@ android_reset_conversion (struct frame *f) android_reset_ic (FRAME_ANDROID_WINDOW (f), mode); - /* Clear extracted text flags. Since the IM has been reinitialised, + /* Clear extracted text flags. Since the IM has been reinitialized, it should no longer be displaying extracted text. */ FRAME_ANDROID_OUTPUT (f)->extracted_text_flags = 0; diff --git a/src/androidterm.h b/src/androidterm.h index e75d46b1dfb..9830cc4364d 100644 --- a/src/androidterm.h +++ b/src/androidterm.h @@ -262,7 +262,7 @@ #define _ANDROID_TERM_H_ text''. */ int extracted_text_flags; - /* Token asssociated with that request. */ + /* Token associated with that request. */ int extracted_text_token; /* The number of characters of extracted text wanted by the IM. */ diff --git a/src/androidvfs.c b/src/androidvfs.c index 51558d2a375..3b7fb731e86 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -407,7 +407,7 @@ #define FIND_METHOD(c_name, name, signature) \ values are prohibitively slow, but smaller values can't face up to some long file names within several nested layers of directories. - Buffers holding components or other similar file name constitutents + Buffers holding components or other similar file name constituents which don't represent SAF files must continue to use PATH_MAX, for that is the restriction imposed by the Unix file system. */ @@ -4179,7 +4179,7 @@ android_saf_stat (const char *uri_name, const char *id_name, } /* Detect if Emacs has access to the document designated by the the - documen ID ID_NAME within the tree URI_NAME. If ID_NAME is NULL, + document ID ID_NAME within the tree URI_NAME. If ID_NAME is NULL, use the document ID in URI_NAME itself. If WRITABLE, also check that the file is writable, which is true @@ -6427,7 +6427,7 @@ android_root_name (struct android_vnode *vnode, char *name, if (!component_end) component_end = name + length; else - /* Move past the spearator character. */ + /* Move past the separator character. */ component_end++; /* Now, find out if the first component is a special vnode; if so, @@ -7172,7 +7172,7 @@ android_readlinkat (int dirfd, const char *restrict pathname, while file streams also require ownership over file descriptors they are created on behalf of. - Detaching the parcel file descriptor linked to FD consequentially + Detaching the parcel file descriptor linked to FD consequently prevents the owner from being notified when it is eventually closed, but for now that hasn't been demonstrated to be problematic yet, as Emacs doesn't write to file streams. */ diff --git a/src/fileio.c b/src/fileio.c index 51937e6d765..64f255a355b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -203,7 +203,7 @@ check_vfs_filename (Lisp_Object encoded, const char *reason) #ifdef HAVE_LIBSELINUX /* Return whether SELinux is enabled and pertinent to FILE. Provide - for cases where FILE is or is a constitutent of a special + for cases where FILE is or is a constituent of a special directory, such as /assets or /content on Android. */ static bool diff --git a/src/image.c b/src/image.c index 29ec6d5381b..38744fc1cce 100644 --- a/src/image.c +++ b/src/image.c @@ -11785,7 +11785,7 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size) If we do set explicit width and height values in the image spec, this will work out correctly as librsvg will still - honour the percentage sizes in its final rendering no matter + honor the percentage sizes in its final rendering no matter what size we make the image. */ value = 0; break; diff --git a/src/process.c b/src/process.c index bde87b78701..8bc922ab509 100644 --- a/src/process.c +++ b/src/process.c @@ -7520,7 +7520,7 @@ handle_child_signal (int sig) emacs_unlink is not async signal safe because deleting files from content providers must proceed - through Java code. Consequentially, if XCDR (head) + through Java code. Consequently, if XCDR (head) lies on a content provider it will not be removed, which is a bug. */ unlink (SSDATA (XCDR (head))); diff --git a/src/regex-emacs.c b/src/regex-emacs.c index cb4fbd58faa..19bec537130 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -2824,7 +2824,7 @@ group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum) /* Iterate through all the char-matching operations directly reachable from P. This is the inner loop of `forall_firstchar`, which see. - LOOP_BEG..LOOP_END delimit the currentl "block" of code (we assume + LOOP_BEG..LOOP_END delimit the currently "block" of code (we assume the code is made of syntactically nested loops). LOOP_END is blindly assumed to be "safe". To guarantee termination, at each iteration, either LOOP_BEG should diff --git a/src/sfnt.c b/src/sfnt.c index bc2ffdea9dc..238e7f48420 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -4762,7 +4762,7 @@ sfnt_get_scale (struct sfnt_head_table *head, int ppem) /* Figure out how to convert from font unit-space to pixel space. To turn one unit to its corresponding pixel size given a ppem of 1, the unit must be divided by head->units_per_em. Then, it must - be multipled by the ppem. So, + be multiplied by the ppem. So, PIXEL = UNIT / UPEM * PPEM @@ -4902,7 +4902,7 @@ sfnt_read_name_table (int fd, struct sfnt_offset_subtable *subtable) return NULL; } - /* Read REQURIED bytes into the string data. */ + /* Read REQUIRED bytes into the string data. */ name->data = (unsigned char *) (name->name_records + name->count); rc = read (fd, name->data, required); @@ -14256,7 +14256,7 @@ sfnt_infer_deltas_1 (struct sfnt_glyph *glyph, size_t start, } else { - /* ... otheriwse, move point j by the delta of the + /* ... otherwise, move point j by the delta of the nearest touched point. */ if (x[j] >= max_pos) @@ -14320,7 +14320,7 @@ sfnt_infer_deltas_1 (struct sfnt_glyph *glyph, size_t start, } else { - /* ... otheriwse, move point j by the delta of the + /* ... otherwise, move point j by the delta of the nearest touched point. */ if (y[j] >= max_pos) @@ -14404,7 +14404,7 @@ sfnt_infer_deltas_1 (struct sfnt_glyph *glyph, size_t start, } else { - /* ... otheriwse, move point j by the delta of the + /* ... otherwise, move point j by the delta of the nearest touched point. */ if (x[j] >= max_pos) @@ -14468,7 +14468,7 @@ sfnt_infer_deltas_1 (struct sfnt_glyph *glyph, size_t start, } else { - /* ... otheriwse, move point j by the delta of the + /* ... otherwise, move point j by the delta of the nearest touched point. */ if (y[j] >= max_pos) @@ -14557,7 +14557,7 @@ sfnt_infer_deltas (struct sfnt_glyph *glyph, bool *touched, of one or two coordinates for each axis. Each such list is referred to as a ``tuple''. - The deltas, one for each point, are multipled by the normalized + The deltas, one for each point, are multiplied by the normalized value of each axis and applied to those points for each tuple that is found to be applicable. diff --git a/src/sfnt.h b/src/sfnt.h index f6ab6a6eebd..42ae64c362b 100644 --- a/src/sfnt.h +++ b/src/sfnt.h @@ -1283,7 +1283,7 @@ #define sfnt_coerce_fixed(fixed) ((sfnt_fixed) (fixed) / 65535.0) unsigned char *glyph_variation_data; }; -/* Structure repesenting a set of axis coordinates and their +/* Structure representing a set of axis coordinates and their normalized equivalents. To use this structure, call diff --git a/src/sfntfont.c b/src/sfntfont.c index 68e850779fc..f002712dc10 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c @@ -1348,7 +1348,7 @@ sfntfont_charset_for_cmap (struct sfnt_cmap_encoding_subtable subtable) subtable in *SUBTABLE upon success, NULL otherwise. If FORMAT14 is non-NULL, return any associated format 14 variation - selection context in *FORMAT14 should the selected charcter map be + selection context in *FORMAT14 should the selected character map be a Unicode character map. */ static struct sfnt_cmap_encoding_subtable_data * @@ -1371,7 +1371,7 @@ sfntfont_select_cmap (struct sfnt_cmap_table *cmap, if (!format14) return data[i]; - /* Search for a correspoinding format 14 character map. + /* Search for a corresponding format 14 character map. This is used in conjunction with the selected character map to map variation sequences. */ @@ -1400,7 +1400,7 @@ sfntfont_select_cmap (struct sfnt_cmap_table *cmap, if (!format14) return data[i]; - /* Search for a correspoinding format 14 character map. + /* Search for a corresponding format 14 character map. This is used in conjunction with the selected character map to map variation sequences. */ diff --git a/src/textconv.c b/src/textconv.c index bd72562317f..fb1c66bb2c2 100644 --- a/src/textconv.c +++ b/src/textconv.c @@ -23,7 +23,7 @@ Copyright (C) 2023 Free Software Foundation, Inc. They may then request that the text editor remove or substitute that text for something else, for example when providing the ability to ``undo'' or ``edit'' previously composed text. This is - most commonly seen in input methods for CJK laguages for X Windows, + most commonly seen in input methods for CJK languages for X Windows, and is extensively used throughout Android by input methods for all kinds of scripts. @@ -1311,7 +1311,7 @@ complete_edit (void *token) /* Convert PTR to CONTEXT. If CONTEXT->check is false, then update CONTEXT->w's ephemeral last point and give it to the input method, - the assumption being that an editing operation signalled. */ + the assumption being that an editing operation signaled. */ static void complete_edit_check (void *ptr) @@ -1379,7 +1379,7 @@ handle_pending_conversion_events_1 (struct frame *f, or not the editing operation completed successfully. */ context.check = false; - /* Make sure completion is signalled. */ + /* Make sure completion is signaled. */ count = SPECPDL_INDEX (); record_unwind_protect_ptr (complete_edit, &token); w = NULL; diff --git a/src/treesit.c b/src/treesit.c index 69b59fca111..912f4ed47cc 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3335,7 +3335,7 @@ treesit_traverse_validate_predicate (Lisp_Object pred, if (!CONSP (cdr)) { *signal_data = list3 (Qtreesit_invalid_predicate, - build_string ("Invalide `not' " + build_string ("Invalid `not' " "predicate"), pred); return false; diff --git a/src/window.h b/src/window.h index 9ef8434af18..346dc70ea98 100644 --- a/src/window.h +++ b/src/window.h @@ -292,7 +292,7 @@ #define WINDOW_H_INCLUDED `last_point' is normally used during redisplay to indicate the position of point as seem by the input method. However, it is - not updated if consequtive conversions are processed at the + not updated if consecutive conversions are processed at the same time. This `ephemeral_last_point' field is either the last point as diff --git a/src/xselect.c b/src/xselect.c index c38a1f8b6a9..5ffa0fd24fc 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -897,7 +897,7 @@ x_start_selection_transfer (struct x_display_info *dpyinfo, Window requestor, /* Find a valid (non-zero) serial for the selection transfer. Any asynchronously trapped errors will then cause the - selection transfer to be cancelled. */ + selection transfer to be canceled. */ transfer->serial = (++selection_serial ? selection_serial : ++selection_serial); diff --git a/src/xterm.c b/src/xterm.c index 75ac8d0d555..79648a6d6e5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -616,9 +616,9 @@ Copyright (C) 1989, 1993-2023 Free Software Foundation, Inc. - x_clear_errors Callers using this set should consult the comment(s) on top of the - aformentioned functions. They should not be used when the requests + aforementioned functions. They should not be used when the requests being made do not require roundtrips to the X server, and obtaining - the details of any error generated is unecessary, as + the details of any error generated is unnecessary, as `x_uncatch_errors' will always synchronize with the X server, which is a potentially slow operation. */ @@ -5173,7 +5173,7 @@ record_event (char *locus, int type) -/* Miscelaneous event handling functions. */ +/* Miscellaneous event handling functions. */ static void x_toolkit_position (struct frame *f, int x, int y, @@ -11296,7 +11296,7 @@ x_clear_frame (struct frame *f) /* Send a message to frame F telling the event loop to track whether or not an hourglass is being displayed. This is required to ignore - the right events when the hourglass is mapped without callig XSync + the right events when the hourglass is mapped without calling XSync after displaying or hiding the hourglass. */ static void @@ -32094,7 +32094,7 @@ x_initialize (void) #ifdef HAVE_X_I18N -/* Notice that a change has occured on F that requires its input +/* Notice that a change has occurred on F that requires its input method state to be reset. */ static void diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 27056c99a50..8fbe48bbb9a 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -717,7 +717,7 @@ bytecomp-tests--test-cases (set (make-local-variable 'bytecomp-tests--xx) 2) bytecomp-tests--xx) - ;; Check for-effect optimisation of `condition-case' body form. + ;; Check for-effect optimization of `condition-case' body form. ;; With `condition-case' in for-effect context: (let ((x (bytecomp-test-identity ?A)) (r nil)) @@ -797,7 +797,7 @@ bytecomp-tests--test-cases (let ((x 0)) (list (= (setq x 1)) x)) - ;; Aristotelian identity optimisation + ;; Aristotelian identity optimization (let ((x (bytecomp-test-identity 1))) (list (eq x x) (eql x x) (equal x x))) ) @@ -2120,7 +2120,7 @@ bytecomp-tests--byte-op-error-cases )) (ert-deftest bytecomp--byte-op-error-backtrace () - "Check that signalling byte ops show up in the backtrace." + "Check that signaling byte ops show up in the backtrace." (dolist (case bytecomp-tests--byte-op-error-cases) (ert-info ((prin1-to-string case) :prefix "case: ") (let* ((call (nth 0 case)) @@ -2151,7 +2151,7 @@ bytecomp--byte-op-error-backtrace call)))))))))) (ert-deftest bytecomp--eq-symbols-with-pos-enabled () - ;; Verify that we don't optimise away a binding of + ;; Verify that we don't optimize away a binding of ;; `symbols-with-pos-enabled' around an application of `eq' (bug#65017). (let* ((sym-with-pos1 (read-positioning-symbols "sym")) (sym-with-pos2 (read-positioning-symbols " sym")) ; <- space! diff --git a/test/lisp/erc/erc-scenarios-base-attach.el b/test/lisp/erc/erc-scenarios-base-attach.el index ccf5d1f9582..29f5bd2ddd8 100644 --- a/test/lisp/erc/erc-scenarios-base-attach.el +++ b/test/lisp/erc/erc-scenarios-base-attach.el @@ -47,11 +47,11 @@ ;; Author: Mario Lang ;; AuthorDate: Mon Nov 26 18:33:19 2001 +0000 ;; -;; * new function erc-BBDB-NICK to handle nickname anotation ... +;; * new function erc-BBDB-NICK to handle nickname annotation ... ;; * Applied antifuchs/mhp patches, the latest on erc-help, unmodified ;; * New variable: erc-reuse-buffers default to t. ;; * Modified erc-generate-new-buffer-name to use it. it checks if -;; server and port are the same, then one can assume thats the same +;; server and port are the same, then one can assume that's the same ;; channel/query target again. ;;; Code: diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 912a85ad5e0..e9bca2a3ac3 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -657,7 +657,7 @@ erc--parsed-prefix (setq erc--isupport-params (make-hash-table)) ;; Uses fallback values when no PREFIX parameter yet received, thus - ;; ensuring caller can use slot accessors immediately intead of + ;; ensuring caller can use slot accessors immediately instead of ;; checking if null beforehand. (should-not erc--parsed-prefix) (should (equal (erc--parsed-prefix) @@ -2918,7 +2918,7 @@ erc-tests--assert-printed-in-subprocess (while (accept-process-output proc 10)) (goto-char (point-min)) (unless (equal (read (current-buffer)) expected) - (message "Exepcted: %S\nGot: %s" expected (buffer-string)) + (message "Expected: %S\nGot: %s" expected (buffer-string)) (ert-fail "Mismatch")))) ;; Worrying about which library a module comes from is mostly not diff --git a/test/lisp/eshell/em-hist-tests.el b/test/lisp/eshell/em-hist-tests.el index 466d19cc6f7..078bcb490e5 100644 --- a/test/lisp/eshell/em-hist-tests.el +++ b/test/lisp/eshell/em-hist-tests.el @@ -35,7 +35,7 @@ (cl-defun em-hist-test/check-history-file (file-name expected &optional (expected-ring t)) "Check that the contents of FILE-NAME match the EXPECTED history entries. -Additonally, check that after loading the file, the history ring +Additionally, check that after loading the file, the history ring matches too. If EXPECTED-RING is a list, compare the ring elements against that; if t (the default), check against EXPECTED." (when (eq expected-ring t) (setq expected-ring expected)) diff --git a/test/lisp/eshell/esh-io-tests.el b/test/lisp/eshell/esh-io-tests.el index 0201b6ab650..bc3d9c6e5d5 100644 --- a/test/lisp/eshell/esh-io-tests.el +++ b/test/lisp/eshell/esh-io-tests.el @@ -328,7 +328,7 @@ esh-io-test/pipeline/all "tuodts\nrredts\n")) (ert-deftest esh-io-test/pipeline/subcommands () - "Chek that all commands in a subcommand are properly piped." + "Check that all commands in a subcommand are properly piped." (skip-unless (executable-find "rev")) (with-temp-eshell (eshell-match-command-output "{echo foo; echo bar} | rev" diff --git a/test/lisp/proced-tests.el b/test/lisp/proced-tests.el index 44596f92490..58d97f46c4f 100644 --- a/test/lisp/proced-tests.el +++ b/test/lisp/proced-tests.el @@ -46,7 +46,7 @@ proced--move-to-column (move-to-column (string-match attribute proced-header-line))) (defun proced--assert-process-valid-pid-refinement (pid) - "Fail unless the process at point could be present after a refinment using PID." + "Fail unless the process at point could be present after a refinement using PID." (proced--move-to-column "PID") (let ((pid-equal (string= pid (word-at-point)))) (should diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 7cf41d2817b..98ebf771717 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -85,16 +85,16 @@ thing-at-point-test-data ("" 5 email "") ("" 16 email "") ("" 17 email "") - ;; email adresses containing numbers + ;; email addresses containing numbers ("foo1@example.com" 1 email "foo1@example.com") ("1foo@example.com" 1 email "1foo@example.com") ("11@example.com" 1 email "11@example.com") ("1@example.com" 1 email "1@example.com") - ;; email adresses user portion containing dots + ;; email addresses user portion containing dots ("foo.bar@example.com" 1 email "foo.bar@example.com") (".foobar@example.com" 1 email nil) (".foobar@example.com" 2 email "foobar@example.com") - ;; email adresses domain portion containing dots and dashes + ;; email addresses domain portion containing dots and dashes ("foobar@.example.com" 1 email nil) ("foobar@-example.com" 1 email "foobar@-example.com") ;; These are illegal, but thingatpt doesn't yet handle them diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index 615d905e140..2912ce8a571 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el @@ -912,7 +912,7 @@ regexp-tests-backtrack-optimization )) (ert-deftest regexp-tests-zero-width-assertion-repetition () - ;; Check compatibility behaviour with repetition operators after + ;; Check compatibility behavior with repetition operators after ;; certain zero-width assertions (bug#64128). ;; This function is just to hide ugly regexps from relint so that it commit 2773cf9e013a989df99a689317de941bde2cbf29 Author: Stefan Kangas Date: Sun Dec 10 12:39:54 2023 +0100 ; Fix typos diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index db7655e692c..d71316a3ba7 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -5824,7 +5824,7 @@ each of the three channels of light (red, green, blue). For example: : xrandr --output LVDS1 --brightness 1.0 --gamma 0.76:0.75:0.68 Typography is another variable. Some font families are blurry at small -point sizes. Others may have a regular weight that is lighter (thiner) +point sizes. Others may have a regular weight that is lighter (thinner) than that of their peers which may, under certain circumstances, cause a halo effect around each glyph. diff --git a/src/pgtkterm.c b/src/pgtkterm.c index e767e15cc07..b010b486e30 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -6256,7 +6256,7 @@ symbol_to_drag_action (Lisp_Object act) if (NILP (act)) return GDK_ACTION_DEFAULT; - signal_error ("Invalid drag acction", act); + signal_error ("Invalid drag action", act); } static Lisp_Object commit 020aff95fa3e503387a7f9b240e0f7e9f2f054ae Author: Stefan Kangas Date: Sun Dec 10 12:38:19 2023 +0100 ; Fix typos in ChangeLog files diff --git a/ChangeLog.2 b/ChangeLog.2 index d40401093c5..ee816281427 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -8956,10 +8956,10 @@ 2016-02-04 Carlos Pita (tiny change) - Make complection in erc use consistent casing + Make completion in erc use consistent casing * lisp/erc/erc-pcomplete.el (pcomplete-erc-all-nicks): Make - case in the complection consistent (bug#18509). + case in the completion consistent (bug#18509). 2016-02-04 Francis Litterio @@ -17094,11 +17094,11 @@ * lisp/json.el (json-encoding-object-sort-predicate): New variable for specifying a sorting predicate for JSON objects during encoding. (json--plist-to-alist): New utility function. - (json-encode-hash-table): Re-use `json-encode-alist' when object keys + (json-encode-hash-table): Reuse `json-encode-alist' when object keys are to be sorted. (json-encode-alist): Sort output by `json-encoding-object-sort-predicate, when set. - (json-encode-plist): Re-use `json-encode-alist' when object keys are + (json-encode-plist): Reuse `json-encode-alist' when object keys are to be sorted. (json-pretty-print-buffer-ordered): New command to pretty print the buffer with object keys sorted alphabetically. @@ -19542,7 +19542,7 @@ calling low-level functions. * test/automated/file-notify-tests.el (file-notify--test-timeout): - Decrase to 6 seconds for remote directories. + Decrease to 6 seconds for remote directories. (file-notify-test02-events): Expect different number of `attribute-changed' events for the local and remote cases. Apply short delays between the operations, in order to receive all @@ -32624,7 +32624,7 @@ (verilog-set-auto-endcomments): Fix end comments for functions of type void, etc. Reported by Alex Reed. (verilog-do-indent): Fix electric tab deleting form-feeds. Note - caused by indent-line-to deleting tabls pre 24.5. + caused by indent-line-to deleting tables pre 24.5. (verilog-nameable-item-re): Fix nameable items that can have an end-identifier to include endchecker, endgroup, endprogram, endproperty, and endsequence. Reported by Alex Reed. diff --git a/ChangeLog.3 b/ChangeLog.3 index 4401dd10920..9bc5232ba46 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -146,7 +146,7 @@ 2022-10-04 Andreas Schwab - * src/emacs.c (load_pdump): Propery handle case when executable + * src/emacs.c (load_pdump): Properly handle case when executable wasn't found. 2022-10-04 Eli Zaretskii @@ -6570,7 +6570,7 @@ 2021-10-04 Lars Ingebrigtsen - Mention ffap-file-name-with-spaces in the ffap doc strin + Mention ffap-file-name-with-spaces in the ffap doc string * lisp/ffap.el (find-file-at-point): Mention ffap-file-name-with-spaces in the doc string. @@ -7174,7 +7174,7 @@ (ess-eval-visibly-p): Declare. (org-babel-julia-assign-elisp): Remove unused vars `header` and - `row-names` and corespondingly remove now unused args `colnames-p` and + `row-names` and correspondingly remove now unused args `colnames-p` and `rownames-p`. (org-babel-variable-assignments:julia): Adjust call to `org-babel-julia-assign-elisp` accordingly. @@ -10203,7 +10203,7 @@ 2021-09-17 Lars Ingebrigtsen - Mention that the garbage collection is convervative + Mention that the garbage collection is conservative * doc/lispref/internals.texi (Garbage Collection): Mention that we're using a conservative gc (bug#42013). @@ -21832,7 +21832,7 @@ * src/doprnt.c (exprintf, evxprintf): * src/lisp.h (exprintf, evxprintf): Don't use a pointer-to-const type for the `nonheapbuf` argument: although it is never dereferenced, GCC - will warn when passing a pointer to uninitialised memory otherwise. + will warn when passing a pointer to uninitialized memory otherwise. * src/fns.c (sort_vector_copy, realize_face, realize_gui_face) (realize_tty_face): Use the same signatures in the prototypes as in the actual function definitions. @@ -23755,7 +23755,7 @@ 2021-05-29 Lars Ingebrigtsen - Improve the file-accessible-directory-p doc strin + Improve the file-accessible-directory-p doc string * src/fileio.c (Ffile_accessible_directory_p): Don't use the phrase "directory name spec", which isn't defined (bug#18201). @@ -44752,7 +44752,7 @@ (nxml-prefer-utf-16-little-to-big-endian-flag) (nxml-default-buffer-file-coding-system) (nxml-auto-insert-xml-declaration-flag): Add :safe to allow easier - cusomization (bug#45969). + customization (bug#45969). 2021-01-19 Lars Ingebrigtsen @@ -47582,10 +47582,10 @@ 2020-12-30 Andrea Corallo - Order function types in aphabetical order + Order function types in alphabetical order * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Reorder in - aphabetical order and comment. + alphabetical order and comment. 2020-12-30 Andrea Corallo @@ -55395,7 +55395,7 @@ 2020-11-18 Andrea Corallo - Fix eln file hasing for symlink paths (bug#44701) + Fix eln file hashing for symlink paths (bug#44701) * src/comp.c (Fcomp_el_to_eln_filename): Call `file-truename' in place of `expand-file-name' when available. @@ -55928,7 +55928,7 @@ Fix debug symbol emission * src/comp.c (Fcomp__compile_ctxt_to_file): Now that we do not - rely anymore on globlal variables move logic in from + rely anymore on global variables move logic in from 'Fcomp__init_ctxt' so comp.debug is already set correctly. 2020-11-14 Andrea Corallo @@ -59251,7 +59251,7 @@ 2020-10-26 Andrea Corallo - Make native compiler tollerant to redefined primitives (bug#44221). + Make native compiler tolerant to redefined primitives (bug#44221). * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Rework based on the fact that the subr can now be redefined. @@ -59833,7 +59833,7 @@ Fix error in tramp-sh-handle-make-process * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't use heredoc - script whent the argument contains a string. + script when the argument contains a string. 2020-10-23 Stefan Kangas @@ -64846,7 +64846,7 @@ 2020-09-24 Andrea Corallo - Add a test for primitive advicing effectiveness + Add a test for primitive advising effectiveness * test/src/comp-test-funcs.el (comp-test-primitive-advice-f): New function. @@ -64903,7 +64903,7 @@ install a subr trampoline into the function relocation table. Once this is done any call from native compiled Lisp to the related primitive will go through the `funcall' trampoline - making advicing effective. + making advising effective. 2020-09-23 Andrea Corallo @@ -70385,7 +70385,7 @@ (MD5_BLOCKSIZE): New macro. (accumulate_and_process_md5, final_process_md5, md5_gz_stream) (comp_hash_source_file): New functions. - (Fcomp_el_to_eln_filename): Rework for hasing using also source + (Fcomp_el_to_eln_filename): Rework for hashing using also source file content. * src/lread.c (maybe_swap_for_eln): Rename el_name -> src_name as @@ -73450,7 +73450,7 @@ 2020-08-11 Paul Eggert - pdumper speed tweeks for hash tables + pdumper speed tweaks for hash tables * src/pdumper.c (dump_queue_empty_p): Avoid unnecessary call to Fhash_table_count on a known hash table. @@ -77752,7 +77752,7 @@ 2020-06-22 Andrea Corallo - Handle correctly pure delaration specifier. + Handle correctly pure declaration specifier. * lisp/emacs-lisp/comp.el (comp-func): New slot 'pure'. (comp-spill-decl-spec): New function. @@ -81415,7 +81415,7 @@ 2020-05-14 Andrea Corallo - Dump log and intemediate GCC IRs only at comp-debug 3 + Dump log and intermediate GCC IRs only at comp-debug 3 * src/comp.c (Fcomp__init_ctxt): Increase threshold for dumping really everything to 'comp-debug' 3. @@ -84459,7 +84459,7 @@ either be encoding a string without NL, or decoding without CR. * src/coding.c (string_ascii_p): Revert to a pure predicate. - (code_convert_string): Fix logic. Don't use uninitialised + (code_convert_string): Fix logic. Don't use uninitialized ascii_p (removed). Use memchr to detect CR or LF in string when needed. * test/src/coding-tests.el (coding-nocopy-ascii): Update tests to include encodings with explicit EOL conversions. @@ -86579,7 +86579,7 @@ Merge remote-tracking branch 'savannah/master' into HEAD - * Fix regexp instroduced by f055f52321 + * Fix regexp introduced by f055f52321 2020-03-09 Paul Eggert @@ -86613,7 +86613,7 @@ * lisp/term/rxvt.el: Enable backeted paste and window title - rxvt-unicode uses the same escape sequences as xterm so just re-use + rxvt-unicode uses the same escape sequences as xterm so just reuse the xterm functions to enable them. The `xterm-rxvt-function-map` keymap already has @@ -94009,7 +94009,7 @@ Fix an error in tramp-sh-handle-make-process. Don't merge with master * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't use heredoc - script whent the argument contains a string. + script when the argument contains a string. 2021-02-03 Stefan Kangas @@ -97511,7 +97511,7 @@ * lisp/subr.el (cancel-change-group): Fix bug#39680 - Don't re-use an existing `pending-undo-list` even if (eq last-command 'undo) + Don't reuse an existing `pending-undo-list` even if (eq last-command 'undo) since there might have been changes to the buffer since that `undo` command and the `pending-undo-list` can hence be invalid for the current buffer contents. @@ -110510,7 +110510,7 @@ 2019-10-01 Lars Ingebrigtsen - Make the help page mention the customizeable global mode variable + Make the help page mention the customizable global mode variable * lisp/help-fns.el (help-fns--customize-variable): Factor out into own function for reuse. @@ -117135,7 +117135,7 @@ Use timer-convert with t rather than doing it by hand. * src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp): Remove; no longer needed. - (decode_lisp_time): Rturn the form instead of having a *PFORM arg. + (decode_lisp_time): Return the form instead of having a *PFORM arg. All uses changed. (time_arith): Just return TICKS if HZ is 1. (Fencode_time): Remove argument FORM. All callers changed. @@ -131090,7 +131090,7 @@ Make shr-rescale-image respect get-buffer-window again * lisp/net/shr.el (shr-rescale-image): Partially revert previous - change -- ressurrect the check for `get-buffer-window'. + change -- resurrect the check for `get-buffer-window'. 2019-05-16 Ivan Shmakov @@ -135103,7 +135103,7 @@ (help-fns--var-ignored-local, help-fns--var-file-local) (help-fns--var-watchpoints, help-fns--var-obsolete) (help-fns--var-alias, help-fns--var-bufferlocal): New functions, - extacted from describe-variable. + extracted from describe-variable. (describe-variable): Run help-fns-describe-variable-functions instead. 2019-04-12 Glenn Morris @@ -163190,7 +163190,7 @@ Quieten eshell compilation * lisp/eshell/em-tramp.el: Require esh-cmd. - * lisp/eshell/esh-ext.el: Requie esh-io at runtime too. + * lisp/eshell/esh-ext.el: Require esh-io at runtime too. 2018-02-28 Glenn Morris @@ -164098,7 +164098,7 @@ (server-socket-dir): Compute socket dir from `get-external-sockname'. (server-start): Don't check for existing server when an - uninitialised external socket has been passed to Emacs. + uninitialized external socket has been passed to Emacs. * src/emacs.c: (main): Obtain socket name via getsockname and pass to `init_process_emacs'. * src/lisp.h: (init_process_emacs): Add second parameter. @@ -165010,7 +165010,7 @@ Merge from origin/emacs-26 - 6415b2d Allow read-passwd to hide characters inserted by C-y. (Secur... + 6415b2d Allow read-passwd to hide characters inserted by C-y. (Secure... 8cb4ffb * etc/PROBLEMS: Document issues with double-buffering. (Bug#... fd10070 * lisp/window.el (window-largest-empty-rectangle): Fix grammar. e1a4403 Minor changes in the Emacs manual @@ -165500,7 +165500,7 @@ 1fc98ed073 ; Spelling fix bb396a369c Update Org to v9.1.6 fa582153f7 Use text-pixels values only when saving framesets (Bug#30141) - 6b01b9475d Minor improvement in section "Pages" of the usere manual + 6b01b9475d Minor improvement in section "Pages" of the user manual e8c8bd3de2 Minor improvements in user manual 26b8b92e63 Improve the "Mark" chapter of the user manual 759569fe40 Improve the "Buffers" chapter of the user manual @@ -167643,7 +167643,7 @@ 2017-12-12 Glenn Morris - Fix gitmerge handling of automatic conflict reslution + Fix gitmerge handling of automatic conflict resolution * admin/gitmerge.el (gitmerge-resolve): Reenable NEWS handling. (gitmerge-resolve-unmerged): Commit after successful resolution. @@ -172441,11 +172441,11 @@ * src/window.c (Fset_window_margins, Fset_window_fringes) (Fset_window_scroll_bars): In doc-strings tell that a window - must be large enough to accommodate fringes, sroll bars and + must be large enough to accommodate fringes, scroll bars and margins of the desired size. * doc/lispref/display.texi (Fringe Size/Pos, Scroll Bars) (Display Margins): Tell that windows must be large enough to - accommodate fringes, sroll bars and margins of the desired + accommodate fringes, scroll bars and margins of the desired size. 2019-03-10 Eli Zaretskii @@ -175963,7 +175963,7 @@ Save the server alias on reconnect (Bug#29657) rcirc does not retain the server alias on reconnect. As a result, rcirc - fails to re-use server and channel buffers when an alias is used. Further + fails to reuse server and channel buffers when an alias is used. Further problems may ensue when aliases are used to differentiate multiple connections to the same host, for example when using a single IRC bouncer or proxy to connect to multiple IRC networks. @@ -180914,7 +180914,7 @@ 2018-01-21 Eli Zaretskii - Minor improvement in section "Pages" of the usere manual + Minor improvement in section "Pages" of the user manual * doc/emacs/text.texi (Pages): Improve wording. Suggested by Will Korteland in emacs-manual-bugs@gnu.org. @@ -184512,7 +184512,7 @@ * src/lisp.h (GCALIGNMENT): Change it back to a macro that expands to a literal integer constant, for older GCC. I had mistakenly thought that only MSVC had the problem. - Problem repored by Eli Zaretskii (Bug#29040#69). + Problem reported by Eli Zaretskii (Bug#29040#69). 2017-11-03 Paul Eggert @@ -186856,7 +186856,7 @@ * doc/misc/flymake.texi (Overview of Flymake): Rewrite a bit. (Installing Flymake): Mostly scratch. Flymake comes with Emacs. (Running the syntax check): Simplify. - (Viewing error messages): Dekete, + (Viewing error messages): Delete. (Syntax check statuses): Rewrite. (Troubleshooting): Simplify. (Customizable variables): Rewrite. @@ -188461,7 +188461,7 @@ Loosen strict parsing requirement for desktop files There are other desktop-looking files, for instance those having to do - with MIME typess, that would benefit from being able to be read by this + with MIME types, that would benefit from being able to be read by this function. It helps to have some flexibility. * lisp/xdg.el (xdg-desktop-read-file): Remove an error condition. * test/lisp/xdg-tests.el: Remove a test. @@ -219622,7 +219622,7 @@ for 0x80 ⪬ c < 0x100. In other words, the loop never executes for c ≥ 0x80 and RE_CHAR_TO_MULTIBYTE call is unnecessary for c < 0x80. - * src/regex.c (regex_compile): Simplyfy a for loop by eliminating + * src/regex.c (regex_compile): Simplify a for loop by eliminating dead iterations and unnecessary macro calls. 2016-09-08 Michal Nazarewicz @@ -229115,7 +229115,7 @@ 6da3a6d Port to strict C99 offsetof de7601f Port to GTK with strict C11 compiler 658aa2d Port to GTK with strict C99 compiler - 1df7173 Avoid screen artifacts with new OS X visible bell after scrol... + 1df7173 Avoid screen artifacts with new OS X visible bell after scroll... 7a2edd3 Merge branch 'emacs-25' of git.sv.gnu.org:/srv/git/emacs into... dca240a Suppress some Tramp tests for OSX, do not merge with master 9094304 * lisp/progmodes/xref.el (xref-buffer-name, xref--window): Mo... @@ -233746,7 +233746,7 @@ ee73997 Make erc work better when encountering unknown prefix chars b99141d Make erc completion case-insensitive again - 66c4620 Make complection in erc use consistent casing + 66c4620 Make completion in erc use consistent casing 8c562b2 Make /QUIT in erc more robust d93d2c5 Make tracking faces in Emacs work more reliably af6ab7e Make shr not bug out on images on non-graphical displays @@ -234944,7 +234944,7 @@ (rng-complete-attribute-value): Don't perform completion, but return completion data instead. (rng-complete-qname-function, rng-generate-qname-list): Add a few - arguments, previously passed via dynamic coping. + arguments, previously passed via dynamic copying. (rng-strings-to-completion-table): Rename from rng-strings-to-completion-alist. Don't return an alist. Don't both sorting and uniquifying. @@ -235280,7 +235280,7 @@ d400753 * src/buffer.c: Stick with ASCII in doc string. 221240c Reword transient-mark-mode doc string 977d3ea Update doc string of 'selective-display' - 229c3fa Make C++ buffers writeable when writing their initial text + 229c3fa Make C++ buffers writable when writing their initial text properties. f5c762c Additional changes for "make check-expensive" 1729cf3 ; * admin/MAINTAINERS: Remove myself. diff --git a/ChangeLog.4 b/ChangeLog.4 index 64f7f87f9ad..9e22f2a6c33 100644 --- a/ChangeLog.4 +++ b/ChangeLog.4 @@ -374,7 +374,7 @@ Ensure ucs-names is consistent with Unicode names * lisp/international/mule-cmds.el (ucs-names): Skip adding an old-name - if it conflicts with the offical name of a codepoint. Adjust the + if it conflicts with the official name of a codepoint. Adjust the ranges iterated over to account for new Unicode codepoints. * test/lisp/international/mule-tests.el (mule-cmds-tests--ucs-names-old-name-override, @@ -1705,7 +1705,7 @@ (tramp-archive-test47-auto-load): Adapt test. * test/lisp/net/tramp-tests.el (tramp-display-escape-sequence-regexp): - Dont't declare. + Don't declare. (tramp-action-yesno): Suppress run in tests. (tramp-test02-file-name-dissect): (tramp-test02-file-name-dissect-simplified) @@ -2155,7 +2155,7 @@ selection from hanging owner, we will proceed to take ownership of the selection as normal, resolving the problem. - (One example of a selction owner that might not be responding to + (One example of a selection owner that might not be responding to selection requests is another instance of Emacs itself; while Emacs is blocked in call-process or Lisp execution, it currently does not respond to selection requests.) @@ -3050,7 +3050,7 @@ Revert changes to the order in which package descs are loaded * lisp/emacs-lisp/package.el (package-load-all-descriptors): Remove - NOSORT argument to 'directory-files', reverting back to the behaviour + NOSORT argument to 'directory-files', reverting back to the behavior as of Emacs 28. (Bug#63757) 2023-06-04 Spencer Baugh @@ -3233,7 +3233,7 @@ (plstore-save, plstore--encode, plstore--decode) (plstore--write-contents-functions, plstore-mode-decoded) (plstore-mode): Brush up doc strings and documentation in general. - Fix terminology, in particular spurious occurences of all uppercase + Fix terminology, in particular spurious occurrences of all uppercase "PLSTORE". (Bug#63627) 2023-05-31 Jens Schmidt @@ -4198,7 +4198,7 @@ Prevent generating empty autoload files * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Remove - optimisation that would mistakenly discard old loaddefs in case a file + optimization that would mistakenly discard old loaddefs in case a file was not modified by EXTRA-DATA is non-nil. (Bug#62734) 2023-04-30 Stefan Monnier @@ -5415,7 +5415,7 @@ 2023-03-29 Andrea Corallo - Comp fix calls to redefined primtives with op-bytecode (bug#61917) + Comp fix calls to redefined primitives with op-bytecode (bug#61917) * test/src/comp-tests.el (61917-1): New test. * src/comp.c (syms_of_comp): New variable. @@ -5453,7 +5453,7 @@ 2023-03-28 Andrea Corallo - Revert "Comp fix calls to redefined primtives with op-bytecode (bug#61917)" + Revert "Comp fix calls to redefined primitives with op-bytecode (bug#61917)" This reverts commit 263d6c38539691c954f4c3057cbe8d5468499b91. @@ -5791,10 +5791,10 @@ 2023-03-20 Andrea Corallo - Comp fix calls to redefined primtives with op-bytecode (bug#61917) + Comp fix calls to redefined primitives with op-bytecode (bug#61917) * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Fix compilation - of calls to redefined primtives with dedicated op-bytecode. + of calls to redefined primitives with dedicated op-bytecode. * test/src/comp-tests.el (61917-1): New test. 2023-03-20 Robert Pluim @@ -5914,7 +5914,7 @@ CC Mode: Eliminate duplicate function c-list-of-strings Replace it with the existing c-string-list-p. Also put an autoload cookie in - front of c-string-list-p so that it will not be signalled as undefined by + front of c-string-list-p so that it will not be signaled as undefined by loaddefs.el. lisp/progmodes/cc-vars.el (c-string-list-p): Make this autoload. @@ -5932,7 +5932,7 @@ (c-font-lock-extra-types, c++-font-lock-extra-types) (objc-font-lock-extra-types, java-font-lock-extra-types) (idl-font-lock-extra-types, pike-font-lock-extra-types): Add a :safe entry - into each of thes defcustoms for c-list-of-string. + into each of these defcustoms for c-list-of-string. (Top level): Add an autoload entry for each of the above. 2023-03-18 Robert Pluim @@ -5955,7 +5955,7 @@ Enhance section about troubleshooting in Eglot manual. - * doc/misc/eglot.texi (Troubleshooting Eglot): Parially rewrite. + * doc/misc/eglot.texi (Troubleshooting Eglot): Partially rewrite. 2023-03-17 João Távora @@ -5965,8 +5965,8 @@ Before this change, it would only work if the user happened to have manually activated it before with 'yas-global-mode' or somesuch. - This makes Eglot's Yasnippet-activating behaviour similar to its - Flymake-activating behaviour. + This makes Eglot's Yasnippet-activating behavior similar to its + Flymake-activating behavior. * lisp/progmodes/eglot.el (eglot-client-capabilities): Consult eglot--stay-out-of. @@ -6405,7 +6405,7 @@ 2023-03-09 João Távora - Autoload Eglot helper funtion eglot--debbugs-or-github-bug-uri + Autoload Eglot helper function eglot--debbugs-or-github-bug-uri This isn't a typical autoload: the progn block is plced in the autoloads file, but the eglot.el file itself isn't loaded as a result @@ -6619,7 +6619,7 @@ For example, in the 'buffer' category, the default value has the styles list '(basic substring)'. This means that if a pattern matches - accoring to the 'basic' style, 'substring' will not be tried. And + according to the 'basic' style, 'substring' will not be tried. And neither will 'completion-styles' which in Fido mode's case happens to be 'flex'. @@ -6635,7 +6635,7 @@ * Fix `emacs-lisp-native-compile-and-load' for (bug#61917) * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load): - Don't load if no compialtion happened. + Don't load if no compilation happened. 2023-03-06 Andrea Corallo @@ -6750,7 +6750,7 @@ "unspoffing" HOME just for the invocations of LSP server but it stopped working a while back. So make it more robust. - Eventually, we'll want to decide wether these local servers should be + Eventually, we'll want to decide whether these local servers should be considered in 'make check' runs at all, or whether there is a way to use them with a spoofed HOME. @@ -6835,7 +6835,7 @@ Fix go-ts-mode multi-line string indentation (bug#61923) * lisp/progmodes/go-ts-mode.el: - (go-ts-mode--indent-rules): Add indent rule for multi-line sting. + (go-ts-mode--indent-rules): Add indent rule for multi-line string. 2023-03-03 João Távora @@ -6935,7 +6935,7 @@ Originally our c-ts-mode--anchor-prev-sibling only specially handled labeled_statements, now we add special case for preproc in the similar - fasion: instead of using the preproc directive as anchor, use the last + fashion: instead of using the preproc directive as anchor, use the last statement in that preproc as the anchor. Thus effectively ignore the preproc. @@ -6988,7 +6988,7 @@ ([XwWebView initWithFrame:configuration:xwidget:]) (nsxwidget_init): Fixed memory leaks: when sending an alloc message to an object, send an autorelease message to any objects - we won't explictly release. + we won't explicitly release. ([XwWebView webView:didFinishNavigation:]): Second string to store in 'store_xwidget_event_string' is "load finished" rather than empty string. @@ -7658,7 +7658,7 @@ Eglot doesn't always show the LSP :label property of a CompletionItem in the completion candidates. That is because label is sometimes not what should be inserted in the buffer in the end, the :insertText - property supercedes it. + property supersedes it. But the label is usually more suitable for display nevertheless and if the LSP CompletionItem contains either a snippet or a textEdit, it's @@ -7720,7 +7720,7 @@ occurs. This is a much simpler mode of operation which may avoid problems, but is also likely much slower in large buffers. - Also, because the inlay feature is probably visually suprising to + Also, because the inlay feature is probably visually surprising to some, it is turned OFF by default, which is not the usual practice of Eglot (at least not when the necessary infrastructure is present). This decision may be changed soon. Here's a good one-liner for @@ -7731,7 +7731,7 @@ I haven't tested inlay hints extensively across many LSP servers, so I would appreciate any testing, both for functional edge cases and regarding performance. There are possibly more optimization - oportunities in the "lazy" mode of operation, like more aggressively + opportunities in the "lazy" mode of operation, like more aggressively deleting buffer overlays that are not in visible parts of the buffer. Though I ended up writing this one from scratch, I want to thank @@ -7803,9 +7803,9 @@ In that commit, I did what many longstanding issues and users were suggesting and removed Eglot's override of two Eldoc user - configuration varibles. + configuration variables. - I verified that Eglot's behaviour would stay mostly unaltered but my + I verified that Eglot's behavior would stay mostly unaltered but my tests were very incomplete. In short there is no way that Eglot can work acceptably with the default setting of 'eldoc-documentation-strategy', which is @@ -8208,7 +8208,7 @@ Fix 'display-buffer-use-least-recent-window' * src/window.c (Fwindow_use_time): Doc fix. - (Fwindow_bump_use_time): Bump use time of the seleceted window as + (Fwindow_bump_use_time): Bump use time of the selected window as well. Doc fix. * lisp/window.el (display-buffer-avoid-small-windows): Remove. @@ -8478,7 +8478,7 @@ 2023-02-16 Philip Kaludercic - Attempt to recognise if a VC package has no Elisp files + Attempt to recognize if a VC package has no Elisp files * lisp/emacs-lisp/package-vc.el (package-vc-non-code-file-names): Add new variable used to avoid false-positives. @@ -8792,7 +8792,7 @@ package specifications have been having issues with package-vc, when toggle-on-error is enabled. In their case, package-vc would raise an error in its first invocation, but it would go on working normally - afterwards. As this behaviour is confusing and the user can't do much + afterwards. As this behavior is confusing and the user can't do much about a missing elpa-packages.eld to begin with, we satisfy ourselves with printing out a message and continuing on. @@ -10316,7 +10316,7 @@ Fix typo in c-ts-mode (bug#60932) * lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-block-type-regexp): - enumerator, not enumeratior. + enumerator, not enumerator. 2023-01-20 Mike Kupfer @@ -11160,7 +11160,7 @@ (treesit_load_language): (Ftreesit_pattern_expand): (Ftreesit_query_expand): - (treesit_eval_predicates): Use new varaibles. + (treesit_eval_predicates): Use new variables. (treesit_check_buffer_size): (treesit_compose_query_signal_data): @@ -11899,7 +11899,7 @@ * lisp/progmodes/ruby-ts-mode.el (ruby-ts-add-log-current-function): Fix the case when point is - between two methods. 'treesit-node-at' returs the 'def' node of + between two methods. 'treesit-node-at' returns the 'def' node of the method after point in such case, so it behaved like point was inside the method below. @@ -12575,7 +12575,7 @@ * doc/lispref/modes.texi (Imenu): Add manual. * doc/lispref/parsing.texi (Tree-sitter major modes): Update manual. - * lisp/treesit.el (treesit-simple-imenu-settings): New varaible. + * lisp/treesit.el (treesit-simple-imenu-settings): New variable. (treesit--simple-imenu-1) (treesit-simple-imenu): New functions. (treesit-major-mode-setup): Setup Imenu. @@ -12840,7 +12840,7 @@ (treesit--top-level-defun): Generalize into treesit--top-level-thing. (treesit--navigate-defun): Generalize into treesit--navigate-thing. (treesit-thing-at-point): Generalized from treesit-defun-at-point. - (treesit-defun-at-point): Use treesit-thing-at-point to do tht work. + (treesit-defun-at-point): Use treesit-thing-at-point to do the work. 2022-12-25 Philip Kaludercic @@ -13035,7 +13035,7 @@ One way to solve it is to go back up the tree if we are at a leaf node and still haven't matched the target node. That's too ugly and finicky so I resorted to recursion. Now one more functions will - return give up (treesit_node_parent) if we are in a werid parse tree + return give up (treesit_node_parent) if we are in a weird parse tree that is super deep. But since we already kind of give up on this kind of parse trees (bug#59426), it doesn't really hurt. @@ -13287,7 +13287,7 @@ 2022-12-21 Andrea Corallo - * Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208) + * Invoke spawned Emacs processes with '-Q' when native compiling (bug#60208) * lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'. (comp-run-async-workers): Likewise. @@ -13455,7 +13455,7 @@ Repair setopt test after error demotion to warning * test/lisp/cus-edit-tests.el (test-setopt): - Check for a warrning instead of an error in attempt to call `setopt` + Check for a warning instead of an error in attempt to call `setopt` with a value that does not match the declared type (bug#60162). 2022-12-18 Dmitry Gutov @@ -13523,13 +13523,13 @@ 2022-12-18 Philip Kaludercic - * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error + * lisp/cus-edit.el (setopt--set): Warn instead of raising an error (Bug#60162) 2022-12-18 Philip Kaludercic - Allow customising windmove user options with an empty prefix + Allow customizing windmove user options with an empty prefix * lisp/windmove.el (windmove--default-keybindings-type): Handle nil as a prefix value. (Bug#60161) @@ -13676,7 +13676,7 @@ Add treesit_assume_true and treesit_cursor_helper This is part 1 of the change to change node API to cursor API. See - the second part for more detail. (I splitted the change to make the + the second part for more detail. (I split the change to make the diff more sane.) * src/treesit.c (treesit_assume_true) @@ -13860,7 +13860,7 @@ 2022-12-16 Eli Zaretskii - Revert "Elide broken but unnecessary `if` optimisations" + Revert "Elide broken but unnecessary `if` optimizations" This reverts commit 13aa376e93564a8cf2ddbbcf0968c6666620db89. @@ -13874,7 +13874,7 @@ This reverts commit f4b430140f0866f98bbf18b7094348dc64032813. Please don't install anything on the release branch that is not - strictly necessary fro Emacs 29. + strictly necessary for Emacs 29. 2022-12-16 Mattias Engdegård @@ -13896,7 +13896,7 @@ 2022-12-16 Mattias Engdegård - Elide broken but unnecessary `if` optimisations + Elide broken but unnecessary `if` optimizations * lisp/emacs-lisp/byte-opt.el (byte-optimize-if): Remove explicit clauses purposing to simplify @@ -14026,7 +14026,7 @@ 1. the client code invoked by its jsonrpc--connection-receive inside the process filter callee immediately sends follow-up input to process within the same Lisp stack. This is a common scenario, - especially during LSP initialiation sequence used by Eglot, a + especially during LSP initialization sequence used by Eglot, a jsonrpc.el client. 2. that follow-up message is large enough for process-send-string to @@ -14442,7 +14442,7 @@ * lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): If the parameter of :eval is a string then read, evaluate and print - the result. This was always the intention and is documented behaviour. + the result. This was always the intention and is documented behavior. 2022-12-14 Michael Albinus @@ -14560,7 +14560,7 @@ This new set of functions (and tests) should eliminate defun-navigation bugs and limitations we currently have. This commit - doesn't change any existing bahavior: treesit-beginning/end-of-defun + doesn't change any existing behavior: treesit-beginning/end-of-defun and friends are unchanged. The plan is to later switch gear and replace the current functions with the new ones introduced in this change. @@ -14777,7 +14777,7 @@ Eglot: allow skipping compile-time warnings about LSP interfaces * lisp/progmodes/eglot.el (eglot-strict-mode): Add 'no-unknown-interfaces'. - (eglot--check-object): Honour new eglot-strict-mode value. + (eglot--check-object): Honor new eglot-strict-mode value. 2022-12-11 Yuan Fu @@ -15023,7 +15023,7 @@ Bring back the project--value-in-dir logic - Essentialy revert commit 2389158a31b4a12, restoring the changes + Essentially revert commit 2389158a31b4a12, restoring the changes and fixing the conflicts. Motivated by the problem brought up in bug#59722 (behavior of project-find-files/regexp when switching projects). We should find other ways to improve performance. @@ -15400,10 +15400,10 @@ table. When the 'external' is in use, the usual styles configured by the user - or other in 'completion-styles' are completely overriden. This + or other in 'completion-styles' are completely overridden. This relatively minor inconvenience is the price to pay for responsive completion where the full set of completion candidates doesn't need to - be transfered into Emacs's address space. + be transferred into Emacs's address space. * lisp/external-completion.el: New file. @@ -15521,7 +15521,7 @@ 2022-12-06 Mattias Engdegård - Lisp reader undefined behaviour excision + Lisp reader undefined behavior excision * src/lread.c (read_bool_vector, skip_lazy_string): Replace `|` with `||` to explicitly introduce sequence points since @@ -15668,7 +15668,7 @@ 2022-12-03 Mattias Engdegård - Speed up Unicode normalisation tests by a factor of 5 + Speed up Unicode normalization tests by a factor of 5 After this change, ucs-normalize-tests are still very slow but somewhat less disastrously so (from 100 to 20 min on this machine). @@ -15828,10 +15828,10 @@ be as correct as possible we enable using both. * lisp/progmodes/typescript-ts-mode.el - (typescript-ts-mode--indent-rules): Change to a function to accomodate + (typescript-ts-mode--indent-rules): Change to a function to accommodate the two languages. (typescript-ts-mode--font-lock-settings): Change to a function to - accomodate the two languages. + accommodate the two languages. (typescript-ts-base-mode): Parent mode for typescript-ts-mode and tsx-ts-mode. (typescript-ts-mode): Derive from typescript-ts-base-mode and @@ -16842,7 +16842,7 @@ reverting the current buffer. It made working in remote buffers with enable-remote-dir-locals non-nil slower, which doesn't seem worth it for a minor improvement of an infrequent operation. Also less - compexity overall. + complexity overall. * lisp/progmodes/project.el (project-try-vc, project-files) (project--vc-list-files, project-ignores, project-buffers): @@ -16929,7 +16929,7 @@ This fixes bug #59427. We now handle correctly the case when a parenthesis follows the * which is ambiguously a multiplication or indirection operator. - Also, we don't recognise a type thus found as a found type - the evidence is + Also, we don't recognize a type thus found as a found type - the evidence is too weak. * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Fix CASE 17.5 as @@ -17846,7 +17846,7 @@ Previously applied heuristic 2 sometimes invalidates heuristic 1, add a guard so it doesn't. - The new function is just for clearity of the code and has nothing to + The new function is just for clarity of the code and has nothing to do with the change itself. * lisp/treesit.el (treesit--node-length): New function @@ -18380,7 +18380,7 @@ * test/lisp/simple-tests.el (simple-execute-extended-command--describe-binding-msg): - Bind text-quoting-style explicitly to ensure consistent behaviour + Bind text-quoting-style explicitly to ensure consistent behavior whether or not the test is run interactively. 2022-11-18 Stefan Kangas @@ -18531,7 +18531,7 @@ 2022-11-17 Philip Kaludercic - Fix the behaviour of 'byte-compile-ignore-files' + Fix the behavior of 'byte-compile-ignore-files' * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Negate the 'string-match-p' check. (Bug#59139) @@ -18694,7 +18694,7 @@ * lisp/emacs-lisp/package-vc.el (package-vc-repository-store): Unmention 'package-vc--unpack'. - (package-vc-install): Unmention 'package-vc--guess-backend' in favour + (package-vc-install): Unmention 'package-vc--guess-backend' in favor of 'package-vc-heuristic-alist'. 2022-11-17 Philip Kaludercic @@ -18736,7 +18736,7 @@ Mark 'package-vc-update' as interactive * lisp/emacs-lisp/package-vc.el (package-vc--sourced-packages-list): - Remove function in favour of 'package-vc--read-package-name'. + Remove function in favor of 'package-vc--read-package-name'. (package-vc--read-package-name): Extract out common functionality. (package-vc--read-package-desc): Add auxiliary function based on @@ -18745,7 +18745,7 @@ 'package-vc--read-package-desc'. (package-vc-install): Use 'package-vc--read-package-desc'. (package-vc-checkout): Use 'package-vc--read-package-desc'. - (package-vc--read-pkg): Remove in favour of 'package-vc--read-package-desc'. + (package-vc--read-pkg): Remove in favor of 'package-vc--read-package-desc'. (package-vc-refresh): Use 'package-vc--read-package-desc'. (package-vc-prepare-patch): Use 'package-vc--read-package-desc'. @@ -18779,7 +18779,7 @@ Handle strings as keys in 'package-vc-ensure-packages' * lisp/emacs-lisp/package-vc.el (package-vc-ensure-packages): Inter - sting keys while processing 'package-vc-selected-packages'. + string keys while processing 'package-vc-selected-packages'. As requested by Rudolf Adamkovič. @@ -20734,10 +20734,10 @@ * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/progmodes/js.el (js--treesit-indent-rules): Change all - occurance of ,js-indent-level to js-indent-level. + occurrence of ,js-indent-level to js-indent-level. * lisp/progmodes/ts-mode.el (ts-mode--indent-rules): Change all - occurance of ,ts-mode-indent-offset to ts-mode-indent-offset. + occurrence of ,ts-mode-indent-offset to ts-mode-indent-offset. * lisp/treesit.el (treesit-simple-indent-rules): Change docstring. (treesit-simple-indent): Allow offset to be a variable. @@ -21031,7 +21031,7 @@ Print "decrypted" rot13 text is buffer is read-only * lisp/rot13.el (rot13-region): Add fallback if buffer is read-only - * doc/emacs/rmail.texi (Rmail Rot13): Document new behaviour. + * doc/emacs/rmail.texi (Rmail Rot13): Document new behavior. 2022-11-04 Philip Kaludercic @@ -21315,7 +21315,7 @@ * lisp/progmodes/js.el (js--treesit-font-lock-settings) * lisp/progmodes/ts-mode.el (ts-mode--font-lock-settings): Capture - commend and strings. Add empty lines. + comment and strings. Add empty lines. 2022-11-03 Jim Porter @@ -21739,7 +21739,7 @@ 2022-11-01 Gerd Möllmann - Preven a buffer-overflow (bug#58850) + Prevent a buffer-overflow (bug#58850) * src/print.c (print_vectorlike): Don't use sprintf. @@ -21831,7 +21831,7 @@ * doc/lispref/modes.texi (Parser-based Font Lock): Reflect the change in manual. * lisp/font-lock.el (font-lock-fontify-syntactically-function): New - varaible. + variable. (font-lock-default-fontify-region): Call font-lock-fontify-syntactically-function rather. (font-lock-fontify-syntactically-region): Rename to @@ -21984,7 +21984,7 @@ Unmention :release-rev (package-vc-desc->spec): Fall back on other archives if a specification is missing. - (package-vc-main-file): Add new function, copying the behaviour of + (package-vc-main-file): Add new function, copying the behavior of elpa-admin.el. (package-vc-generate-description-file): Use 'package-vc-main-file'. (package-vc-unpack): Handle special value ':last-release'. @@ -21996,7 +21996,7 @@ * lisp/vc/vc.el (vc-default-last-change): Add default 'last-change' implementation. - This attempts to replicate the behaviour of elpa-admin.el's + This attempts to replicate the behavior of elpa-admin.el's "elpaa--get-last-release-commit". 2022-10-30 Damien Cassou @@ -23428,10 +23428,10 @@ 2022-10-24 Mattias Engdegård - Fix regexp matching with atomic strings and optimised backtracking + Fix regexp matching with atomic strings and optimized backtracking This bug occurs when an atomic pattern is matched at the end of - a string and the on-failure-keep-string-jump optimisation is + a string and the on-failure-keep-string-jump optimization is in effect, as in: (string-match "\\'\\(?:ab\\)*\\'" "a") @@ -23533,7 +23533,7 @@ 2022-10-23 Yuan Fu - Change function signiture of treesit search functions + Change function signature of treesit search functions Justification: We want to make the SIDE argument in treesit-search-forward-goto optional, so I changed it to START. @@ -23549,7 +23549,7 @@ will probably be used more frequently than ALL anyway. * doc/lispref/parsing.texi (Retrieving Node): Resolve FIXME and update - function signitures. + function signatures. * lisp/treesit.el (treesit-search-forward-goto): Change SIDE to START, swap BACKWARD and ALL. (treesit-beginning-of-defun) @@ -23581,7 +23581,7 @@ 2022-10-23 Philip Kaludercic - ;Fix typo "pacakge" -> "package" + ; Fix typo for "package" 2022-10-23 Philip Kaludercic @@ -23595,7 +23595,7 @@ 2022-10-23 Philip Kaludercic - ;Fix typo "heusitic" -> "heuristic" + ; Fix typo for "heuristic" 2022-10-23 Philip Kaludercic @@ -24301,7 +24301,7 @@ from an identifier before passing it to c-add-type. (c-forward-decl-or-cast-1): CASE 3: Do not recognize two consecutive identifiers as type + variable/function unless certain conditions are met. - CASE 10: Do not recognize the "type" as a found type unless certain condtions + CASE 10: Do not recognize the "type" as a found type unless certain conditions are met. (Near end): Do not recognize the identifier in a cast as a type unless certain conditions are met. @@ -24919,9 +24919,9 @@ Delete the itree_null sentinel node, use NULL everywhere. - This effort caught a few (already commited) places that were + This effort caught a few (already committed) places that were dereferencing through ITREE_NULL in a confusing way. It makes some - functions have to check for NULL in more places, but in my experinece + functions have to check for NULL in more places, but in my experience this is worth it from a code clarity point of view. In doing this I rewrote `interval_tree_remove` completely. There @@ -25979,7 +25979,7 @@ * src/itree.c (itree_null): Statically initialize itree_null.parent to NULL. It is never accessed. (null_is_sane): Assert parent == NULL. - (interval_tree_remove_fix): Remove unecessary assignments to parent + (interval_tree_remove_fix): Remove unnecessary assignments to parent from node->parent. These were the last places itree_null.parent were read. (interval_tree_remove): Avoid an assignment to itree_null.parent @@ -26142,7 +26142,7 @@ 2022-10-10 Yuan Fu - Improve treesit-search-forward-goto so it doens't stuck at EOF + Improve treesit-search-forward-goto so it doesn't stuck at EOF * lisp/treesit.el (treesit-search-forward-goto): Handle the edge case. @@ -26198,7 +26198,7 @@ Fix tree-sitter build script in admin/notes - * admin/notes/tree-sitter/build-module/README: Add explaination. + * admin/notes/tree-sitter/build-module/README: Add explanation. * admin/notes/tree-sitter/build-module/build.sh: change typescript to tsx. @@ -26304,14 +26304,14 @@ Remove redundant check of the `limit` value. (interval_node_init): Remove `begin` and `end` args. (interval_tree_insert): Mark it as static. - Assert that the new node's `otick` should already be uptodate and its + Assert that the new node's `otick` should already be up-to-date and its new parent as well. (itree_insert_node): New function. (interval_tree_insert_gap): Assert the otick of the removed+added nodes - were uptodate and mark them as uptodate again after adjusting + were up-to-date and mark them as up-to-date again after adjusting their positions. (interval_tree_inherit_offset): Check that the parent is at least as - uptodate as the child. + up-to-date as the child. * src/lisp.h (build_overlay): Move to `buffer.h`. @@ -26336,7 +26336,7 @@ * lisp/simple.el (execute-extended-command--shorter): Compute a complete list of `commandp' symbols once. This significantly speeds up complicated cases while the slowdown of simple cases is still - accetable. + acceptable. 2022-10-09 समीर सिंह Sameer Singh @@ -26419,7 +26419,7 @@ 2022-10-08 Mattias Engdegård - Restrict string-lessp vectorisation to safe architectures + Restrict string-lessp vectorization to safe architectures * src/fns.c (HAVE_FAST_UNALIGNED_ACCESS): New. (Fstring_lessp): Only use word operations where safe, because string @@ -27109,7 +27109,7 @@ (interval_tree_propagate_limit): Use it. (null_is_sane): Remove `inline` annotation; it's not needed. (interval_tree_inherit_offset): Sanity check that `offset` is 0 when - `otick` is uptodate. Skip the unneeded increments when the offset is 0. + `otick` is up-to-date. Skip the unneeded increments when the offset is 0. (interval_tree_insert_fix): Add sanity check that we indeed have 2 reds. 2022-10-05 Po Lu @@ -27258,7 +27258,7 @@ Fix bug in "macintization" of x_draw_glyph_string * src/nsterm.m (ns_draw_stretch_glyph_string): Restore text decoration - drawing code ommitted during "macintization" to convert the X function + drawing code omitted during "macintization" to convert the X function into NS code. Reported by Qiantan Hong . 2022-10-04 Filipp Gunbin @@ -27393,7 +27393,7 @@ Merge from origin/emacs-28 - a78af3018e * src/emacs.c (load_pdump): Propery handle case when execu... + a78af3018e * src/emacs.c (load_pdump): Properly handle case when execu... # Conflicts: # src/emacs.c @@ -27429,7 +27429,7 @@ 2022-10-04 Andreas Schwab - * src/emacs.c (load_pdump): Propery handle case when executable + * src/emacs.c (load_pdump): Properly handle case when executable wasn't found. 2022-10-04 Alan Mackenzie @@ -27626,7 +27626,7 @@ * src/xterm.c (x_handle_wm_state): New function. (handle_one_xevent): Handle window state changes in WM_STATE - messages, and use them for signalling deiconification. + messages, and use them for signaling deiconification. (bug#58164) 2022-10-03 Stefan Kangas @@ -28386,7 +28386,7 @@ Rectify string= documentation * doc/lispref/strings.texi (Text Comparison): Describe the current - behaviour since about 20 years back. + behavior since about 20 years back. 2022-09-30 Mattias Engdegård @@ -28400,7 +28400,7 @@ Speed up string-lessp further * src/fns.c (Fstring_lessp): Use the memcmp fast path for ASCII-only - multibyte strings as well. Specialise loops on argument + multibyte strings as well. Specialize loops on argument multibyteness. 2022-09-30 Lars Ingebrigtsen @@ -28470,7 +28470,7 @@ Remove the per-tree null node - "make check" shows 0 unexpcted. + "make check" shows 0 unexpected. * src/itree.h (itree_null): Declare extern. (ITREE_NULL): New macro @@ -29344,7 +29344,7 @@ "c++-or-c-but-not-both-at-once" server, this commit now breaks that person's configuration. - After analysing the entries of this variable, an educated guess was + After analyzing the entries of this variable, an educated guess was made that this situation is rare. If it's not rare, then some change to the syntax of eglot-server-programs will have to ensue. @@ -29902,7 +29902,7 @@ variable. (c-after-change-mark-abnormal-strings): Set c-open-string-opener when an unbalanced string is detected. - (c-before-change): Initilize c-open-string-opener to nil, each buffer change. + (c-before-change): Initialize c-open-string-opener to nil, each buffer change. (c-electric-pair-inhibit-predicate): Use the value of c-open-string-opener to flag an unbalaced string rather than trying to calculate it again. @@ -30203,7 +30203,7 @@ Make bounding box of 'image-crop' more noticeable * lisp/image/image-crop.el (image-crop--crop-image-1): Darken the - selected region to make the bounding-box more noticable in images + selected region to make the bounding-box more noticeable in images which are mostly white (bug#58004). 2022-09-23 Lars Ingebrigtsen @@ -30445,7 +30445,7 @@ Work around rare crash when turning scroll wheel * src/xterm.c (handle_one_xevent): Don't allow devices to be - added twice handling hierarcy events. + added twice handling hierarchy events. 2022-09-21 Sean Whitton @@ -31133,7 +31133,7 @@ 2022-09-19 Po Lu - * Makefile.in: Readd warnings about "git clean -fdx" + * Makefile.in: Re-add warnings about "git clean -fdx" 2022-09-19 Po Lu @@ -34162,7 +34162,7 @@ Fix (mostly multibyte) issues in sieve-manage.el (Bug#54154) - The managesieve protocol (s. RFC5804) requires support for (a sightly + The managesieve protocol (s. RFC5804) requires support for (a slightly restricted variant of) UTF-8 in script content and script names. This commit fixes/improves the handling of multibyte characters. @@ -34210,7 +34210,7 @@ 2022-09-06 Kai Tetzlaff - Improve robustnes of `sieve-manage-quit' in case of errors + Improve robustness of `sieve-manage-quit' in case of errors * lisp/net/sieve.el (sieve-manage-quit): Avoid killing buffers it's not supposed to touch (bug#54154). @@ -34304,7 +34304,7 @@ * lisp/ffap.el (find-file-at-point): Allow people to set ffap-file-finder again (bug#50279). - * lisp/ido.el (ido-everywhere): Add an interstitial to fulfil + * lisp/ido.el (ido-everywhere): Add an interstitial to fulfill ffap-file-handler semantics. 2022-09-06 Stefan Kangas @@ -35482,7 +35482,7 @@ * lisp/t-mouse.el (gpm-mouse-tty-setup): New function. (gpm-mouse-mode): Use it as well as `tty-setup-hook`. * lisp/term/linux.el (terminal-init-linux): Remove gpm-specific code, - not neded any more. + not needed any more. 2022-08-30 Gregory Heytings @@ -36843,7 +36843,7 @@ 2022-08-21 Mattias Engdegård - Fix eshell-pipe-broken signalling + Fix eshell-pipe-broken signaling * lisp/eshell/esh-io.el (eshell-output-object-to-target): Second argument to `signal` should be a list. @@ -36927,12 +36927,12 @@ 2022-08-21 Mattias Engdegård - Update function properties and optimisations + Update function properties and optimizations * lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form): - Recognise boolean identity in aset, put, function-put and puthash. + Recognize boolean identity in aset, put, function-put and puthash. * lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): - Mark more functins as non-nil-returning, including the new + Mark more functions as non-nil-returning, including the new pos-bol and pos-eol. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark pos-bol and pos-eol as side-effect-free. @@ -37065,7 +37065,7 @@ 2022-08-19 Mattias Engdegård - Move `while` syntax check from optimiser to macroexpand + Move `while` syntax check from optimizer to macroexpand * lisp/emacs-lisp/byte-opt.el (byte-optimize-while): Move check... * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): ...here. @@ -37226,7 +37226,7 @@ python.el: Adjustments to Flymake backend * lisp/progmodes/python.el (python-flymake-command): Advertise - possiblity to use pylint. + possibility to use pylint. (python-flymake-command-output-pattern): Make compatible with recent versions of pyflakes. (Bug#53913) @@ -37477,7 +37477,7 @@ 2022-08-18 Mattias Engdegård - More non-nil-returning functions in source optimisation + More non-nil-returning functions in source optimization This change was partially generated and mechanically cross-validated with function type information from comp-known-type-specifiers in @@ -37785,7 +37785,7 @@ 2022-08-16 Mattias Engdegård - Improved `null` (alias `not`) optimisation + Improved `null` (alias `not`) optimization Take static boolean information of the argument into account. @@ -37793,7 +37793,7 @@ 2022-08-16 Mattias Engdegård - Improved `and` and `or` optimisation + Improved `and` and `or` optimization * lisp/emacs-lisp/byte-opt.el (byte-optimize-and, byte-optimize-or): Rewrite. Avoid branching on arguments statically known to be true or @@ -37801,9 +37801,9 @@ 2022-08-16 Mattias Engdegård - Improved `if` and `while` optimisation + Improved `if` and `while` optimization - Recognise some more special cases: + Recognize some more special cases: (if X nil t) -> (not X) (if X t) -> (not (not X)) @@ -38519,7 +38519,7 @@ Make htmlfontify-version variable obsolete - * lisp/htmlfontify.el (htmlfontify-version): Make obolete. + * lisp/htmlfontify.el (htmlfontify-version): Make obsolete. (hfy-meta-tags): Don't use above obsolete variable. 2022-08-13 Stefan Kangas @@ -38545,7 +38545,7 @@ 2022-08-13 Po Lu - Prevent selection converter from signalling if buffer is narrowed + Prevent selection converter from signaling if buffer is narrowed * lisp/select.el (xselect-convert-to-string): If positions are outside the accessible portion of the buffer, don't return @@ -38980,7 +38980,7 @@ Add "send patches" note to package-vc TODO section - * package.el (describe-package-1): Add news if avaliable + * package.el (describe-package-1): Add news if available * package.el (package--get-activatable-pkg): Prefer source packages @@ -39101,14 +39101,14 @@ 2022-08-10 Mattias Engdegård - Extend LAP optimisations to more operations + Extend LAP optimizations to more operations Extend the set of eligible opcodes for certain peephole - transformations, which then provide further optimisation + transformations, which then provide further optimization opportunities. * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): - Optimise empty save-current-buffer in the same way as we already + Optimize empty save-current-buffer in the same way as we already do for save-excursion and save-restriction. This is safe because (save-current-buffer) is a no-op. (byte-compile-side-effect-and-error-free-ops): Add list3, list4 and @@ -40884,7 +40884,7 @@ * lisp/auth-source.el (auth-source-netrc-parse-all): New function (bug#56976). - (auth-source-netrc-parse): Partially revert behaviour in previous + (auth-source-netrc-parse): Partially revert behavior in previous change -- require :allow-null to match. 2022-08-04 Lars Ingebrigtsen @@ -40900,7 +40900,7 @@ * lisp/emacs-lisp/package.el (package-autoload-ensure-default-file): Don't warn about - soon-to-be obsolete functon. + soon-to-be obsolete function. 2022-08-04 Lars Ingebrigtsen @@ -41190,7 +41190,7 @@ Adjust src/Makefile.in comments about make-docfile - * src/Makefile.in ($(etc)/DOC): Remove comment aboout make-docfile + * src/Makefile.in ($(etc)/DOC): Remove comment about make-docfile being run twice (because it no longer is). 2022-08-04 Po Lu @@ -41244,7 +41244,7 @@ Avoid redundant calls to XFlush in x_make_frame_visible * src/xterm.c (x_make_frame_visible): Keep track of whether or - not the output buffer was implictly flushed before issuing + not the output buffer was implicitly flushed before issuing XFlush. 2022-08-03 Stefan Monnier @@ -41787,7 +41787,7 @@ same key is specified twice. (Bug#56873) * doc/lispref/keymaps.texi (Creating Keymaps): Document error - signaling behaviour. + signaling behavior. * test/src/keymap-tests.el (keymap-test-duplicate-definitions): Test duplicate definition detection. @@ -42498,7 +42498,7 @@ Remove loaddefs debug code * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): - Remove code inadvertantly checked in. + Remove code inadvertently checked in. 2022-07-31 Lars Ingebrigtsen @@ -42829,7 +42829,7 @@ Minor improvements to precision scroll interpolation * lisp/pixel-scroll.el (pixel-scroll-start-momentum): Bump GC - cons threshold temporarily. This leads to a very noticable + cons threshold temporarily. This leads to a very noticeable improvement to animation speed. 2022-07-29 Po Lu @@ -42954,7 +42954,7 @@ (XTframe_up_to_date): Set FRAME_X_WAITING_FOR_DRAW if bumped. (handle_one_xevent): Handle frame drawn events. - * src/xterm.h (struct x_output): New fields for frame dirtyness + * src/xterm.h (struct x_output): New fields for frame dirtiness and vsync. 2022-07-29 Gregory Heytings @@ -43774,7 +43774,7 @@ 2022-07-25 Robert Pluim - Make package-archives URL treatment slighty laxer + Make package-archives URL treatment slightly laxer 'package-archives' URLs are expected to end in '/', but we can cater for people typoing that by using 'url-expand-file-name'. @@ -44540,7 +44540,7 @@ Merge from origin/emacs-28 - ea44d7ddfc ; * lisp/mail/smtpmail.el (smtpmail-via-smtp): Explain wit... + ea44d7ddfc ; * lisp/mail/smtpmail.el (smtpmail-via-smtp): Explain with... 2022-07-20 Po Lu @@ -45294,7 +45294,7 @@ 2022-07-16 Mattias Engdegård - Optimise `append` calls + Optimize `append` calls Add the transforms @@ -45317,7 +45317,7 @@ 2022-07-16 Mattias Engdegård - Improved cons optimisation + Improved cons optimization * lisp/emacs-lisp/byte-opt.el (byte-optimize-cons): Add the transform @@ -45326,10 +45326,10 @@ 2022-07-16 Mattias Engdegård - Transform (list) -> nil in source optimiser + Transform (list) -> nil in source optimizer - This optimisation is already done in the code generator but performing - it at this earlier stage is a useful normalising step that uncovers + This optimization is already done in the code generator but performing + it at this earlier stage is a useful normalizing step that uncovers more opportunities. * lisp/emacs-lisp/byte-opt.el (byte-optimize-list): New. @@ -45702,7 +45702,7 @@ (xref-backend-definitions): Complicate. (completion-category-overrides): Register a category and a style here. (completion-styles-alist): Add eglot--lsp-backend-style style - (eglot--lsp-backend-style-call): New funtion. + (eglot--lsp-backend-style-call): New function. (eglot--lsp-backend-style-all-completions): New function. (eglot--lsp-backend-style-try-completion): New function. @@ -46131,7 +46131,7 @@ 2022-07-12 Mattias Engdegård - Better gomoku X colour with bright background + Better gomoku X color with bright background * lisp/play/gomoku.el (gomoku-X): Use blue rather than green for crosses on bright background for better legibility. @@ -46155,7 +46155,7 @@ * src/pgtkmenu.c (set_frame_menubar) * src/xdisp.c (update_menu_bar) * src/xmenu.c (set_frame_menubar): Remove calls to Qrecompute_lucid_menubar - contitional on Vlucid_menu_bar_dirty_flag. + conditional on Vlucid_menu_bar_dirty_flag. 2022-07-12 Po Lu @@ -46929,7 +46929,7 @@ * src/dispextern.h (WITH_NARROWED_BEGV): New macro. * src/xdisp.c (get_narrowed_begv): New function. - (init_iterator): Initilize the 'narrowed_begv' field. + (init_iterator): Initialize the 'narrowed_begv' field. (back_to_previous_line_start, get_visually_first_element, move_it_vertically_backward): Use the new macro. @@ -47342,7 +47342,7 @@ * src/fns.c (concat_strings): Rename to... (concat_to_string): ...this. (concat): Split into concat_to_list and concat_to_vector. - (concat_to_list, concat_to_vector): New, specialised and + (concat_to_list, concat_to_vector): New, specialized and streamlined from earlier combined code. (concat2, concat3, Fappend, Fconcat, Fvconcat): Adjust calls. @@ -48036,7 +48036,7 @@ 2022-07-05 Lars Ingebrigtsen - Documnt left/right mwheel events + Document left/right mwheel events * doc/lispref/commands.texi (Misc Events): Document left/right mwheel events (bug#41722). @@ -48727,7 +48727,7 @@ 2022-07-03 Eli Zaretskii - Implement pseudo-value 'reset' of face attrributes + Implement pseudo-value 'reset' of face attributes * doc/lispref/display.texi (Face Attributes): * etc/NEWS: Document the new pseudo-value 'reset'. @@ -49171,7 +49171,7 @@ 2022-07-01 Lars Ingebrigtsen - Make time-stamp-tests.el work in a Norwegian language enviroment + Make time-stamp-tests.el work in a Norwegian language environment The short version of names for days/month is not necessary the same as limiting the string with a #n operator. For instance: @@ -50159,7 +50159,7 @@ 2022-06-30 Lars Ingebrigtsen - Restore temp-buffer-resize-mode behaviour wrt. [back] buttons + Restore temp-buffer-resize-mode behavior wrt. [back] buttons * lisp/help.el (help--window-setup): If temp-buffer-resize-mode, do the window setup after adding [back] buttons (bug#56306). @@ -50962,7 +50962,7 @@ 2022-06-26 Mattias Engdegård - Optimise away functions in for-effect context + Optimize away functions in for-effect context * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Turn functions into nil when compiled for-effect since they have no @@ -50970,7 +50970,7 @@ as the elimination of variable bindings. `unwind-protect` forms can be treated as plain function call at this point. In particular, their unwind function argument should be - not optimised for effect since it's a function. + not optimized for effect since it's a function. 2022-06-26 Stefan Monnier @@ -51141,7 +51141,7 @@ * lisp/files.el (locate-user-emacs-file): Don't create HOME if it doesn't exist (bug#47298). This returns us to Emacs 26.3 - behaviour here. + behavior here. 2022-06-26 Michael Albinus @@ -51524,7 +51524,7 @@ Bytecode opcode comments update - This is a cosmetic change only; there is no change in behaviour. + This is a cosmetic change only; there is no change in behavior. * lisp/emacs-lisp/bytecomp.el: * src/bytecode.c (BYTE_CODES, exec_byte_code): @@ -51999,7 +51999,7 @@ A trivial optimization and a formatting fix - * lisp/subr.el (internal--compiler-macro-cXXr): Re-use `head' for `n'. + * lisp/subr.el (internal--compiler-macro-cXXr): Reuse `head' for `n'. Fix indentation and line length. 2022-06-21 Tassilo Horn @@ -53548,7 +53548,7 @@ 2022-06-16 Mattias Engdegård - * src/fns.c (mapcar1): Test types in rough order of likelyhood. + * src/fns.c (mapcar1): Test types in rough order of likelihood. 2022-06-16 Mattias Engdegård @@ -53786,7 +53786,7 @@ Improve drag atom computation - * src/xterm.c (xm_get_drag_window): Avoid leak if error occured + * src/xterm.c (xm_get_drag_window): Avoid leak if error occurred creating drag window. Also use StructureNotifyMask instead of ButtonPressMask. (xm_get_drag_atom_1): Update. Make EMACS_DRAG_ATOM a list of @@ -54110,7 +54110,7 @@ (Ftreesit_query_compile): New function. (Ftreesit_query_capture): Remove code that creates a query object and instead either use make_ts_query or use the give compiled query. Free - the query object conditonally. + the query object conditionally. (syms_of_treesit): New symbol. 2022-06-14 Yuan Fu @@ -54121,7 +54121,7 @@ Add new type treesit-compiled-query - No intergration/interaction with the new type, just adding it. + No integration/interaction with the new type, just adding it. * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add new type. * src/alloc.c (cleanup_vector): Add gc for the new type. @@ -54142,8 +54142,8 @@ * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker) (byte-optimize-let-form, byte-optimize-letX): * lisp/emacs-lisp/bytecomp.el (byte-compile-unwind-protect): - Simplify source optimisation and codegen code that can now rely on - normalised let/let* and unwind-protect forms. + Simplify source optimization and codegen code that can now rely on + normalized let/let* and unwind-protect forms. 2022-06-14 Mattias Engdegård @@ -54161,14 +54161,14 @@ 2022-06-14 Mattias Engdegård - Normalise setq during macro-expansion + Normalize setq during macro-expansion - Early normalisation of setq during macroexpand-all allows later + Early normalization of setq during macroexpand-all allows later stages, cconv, byte-opt and codegen, to be simplified and duplicated checks to be eliminated. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): - Normalise all setq forms to a sequence of (setq VAR EXPR). + Normalize all setq forms to a sequence of (setq VAR EXPR). Emit warnings if necessary. * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form): * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): @@ -55015,7 +55015,7 @@ 2022-06-10 Po Lu - Fix cancelling DND upon a regular X error + Fix canceling DND upon a regular X error * src/xterm.c (x_connection_closed): The display isn't dead upon a non-IO error, so don't avoid sending messages to clean stuff @@ -55553,7 +55553,7 @@ Add more super and subscript characters to latin input methods * lisp/leim/quail/latin-post.el ("latin-postfix", "latin-prefix"): Add - mssing super and subscript characters. (Bug#55722) + missing super and subscript characters. (Bug#55722) 2022-06-08 Robert Pluim @@ -55887,7 +55887,7 @@ * src/xterm.c (x_defer_selection_requests) (x_release_selection_requests): New functions. (x_dnd_begin_drag_and_drop): Use those functions to defer - selections instead. Fix error signalled when ownership of + selections instead. Fix error signaled when ownership of XdndSelection is lost. (handle_one_xevent): Likewise. @@ -56712,7 +56712,7 @@ (dnd-remove-last-dragged-remote-file): Handle list values. (dnd-begin-file-drag): Fix file name expansion. (dnd-begin-drag-files): New function. - * lisp/select.el (xselect-convert-to-filename): Handle mutiple + * lisp/select.el (xselect-convert-to-filename): Handle multiple files (a vector of file names):. @@ -56750,7 +56750,7 @@ Use a space since that is clearly what was meant. ?\ at the end of a line (ie, ?\LF) never was well-defined and produced -1 most of the time, but will soon raise an error (bug#55738). - This doesn't matter much becaue this variable is unused. + This doesn't matter much because this variable is unused. 2022-06-03 Po Lu @@ -56813,7 +56813,7 @@ 2022-06-02 Po Lu - Don't call XSelectInput on a dying display when cancelling drag-and-drop + Don't call XSelectInput on a dying display when canceling drag-and-drop * src/xterm.c (x_dnd_free_toplevels): New argument `display_alive'. @@ -56841,7 +56841,7 @@ Make ?\LF generate 10, not -1 (bug#55738) - The old -1 value was an artefact of the reader implementation. + The old -1 value was an artifact of the reader implementation. * src/lread.c (read_escape): Remove the `stringp` argument; assume character literal syntax. Never return -1. @@ -56851,7 +56851,7 @@ 2022-06-02 Mattias Engdegård - * src/lread.c (skip_lazy_string): Fix uninitialised variable. + * src/lread.c (skip_lazy_string): Fix uninitialized variable. 2022-06-02 Stefan Kangas @@ -58114,7 +58114,7 @@ This fixes bug#55684. There, with a minibuffer-only frame at start up, Emacs tried to switch to this frame, whose selected window was the mini-window. There is no other active window in this frame, so the - attempt to swith to another window failed. + attempt to switch to another window failed. * src/frame.c (do_switch_frame): On switching to a frame whose selected window is as above, before selecting the most recently used window, check @@ -58617,7 +58617,7 @@ * lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos) (byte-compile--warning-source-offset): - Remove recursion for cdr-traversal of lists, and optimise (bug#55414). + Remove recursion for cdr-traversal of lists, and optimize (bug#55414). 2022-05-26 Po Lu @@ -59668,7 +59668,7 @@ * src/haiku_support.cc (movement_locker, class EmacsWindow) (MouseMoved): Delete `movement_locker' and associated hack, - since it's superseeded by some code in haiku_read_socket. + since it's superseded by some code in haiku_read_socket. (key_map, key_chars, dpy_color_space, popup_track_message) (alert_popup_value, grab_view, grab_view_locker) (drag_and_drop_in_progress): Write comments and fix @@ -60302,7 +60302,7 @@ Also per https://github.com/joaotavora/eglot/issues/957. - Only actually and eagerly report LSP diagnotics if the user has + Only actually and eagerly report LSP diagnostics if the user has Flymake starting automatically on a timer (flymake-no-changes-timeout is a number). @@ -60659,7 +60659,7 @@ decorator dimensions. Update prototypes. * src/haikufns.c (haiku_update_after_decoration_change): Ask for - a move frame event and don't do anything if configury is not yet + a move frame event and don't do anything if configurable is not yet complete. * src/haikuterm.c (haiku_read_socket): Adjust accordingly. @@ -61050,7 +61050,7 @@ 2022-05-15 Lars Ingebrigtsen - Don't freeze Emacs on colour codes in sccs-mode + Don't freeze Emacs on color codes in sccs-mode * lisp/textmodes/css-mode.el (css--font-lock-keywords): Don't freeze Emacs on #ffffff #ffffff, and be more strict in parsing @@ -62208,7 +62208,7 @@ 2022-05-11 Yoav Marco (tiny change) - (sqlite-mode--column-names): Suppport nested parens + (sqlite-mode--column-names): Support nested parens * lisp/sqlite-mode.el (sqlite-mode--column-names): Make parsing more resilient (bug#55363). @@ -62404,7 +62404,7 @@ 2022-05-10 Lars Ingebrigtsen - Use fields on log-edit headers (which changes `C-a' behaviour) + Use fields on log-edit headers (which changes `C-a' behavior) * lisp/vc/log-edit.el (log-edit-insert-message-template): Fieldify headers so that `C-a' takes us to the start of the string, not the @@ -63316,7 +63316,7 @@ 2022-05-07 Lars Ingebrigtsen - Improve inferior-python-mode scroll behaviour + Improve inferior-python-mode scroll behavior * lisp/progmodes/python.el (inferior-python-mode): Use scroll-convervatively instead of trying to do this with a comint @@ -63381,7 +63381,7 @@ 2022-05-07 Yuan Fu - Add tree-sitter intergration + Add tree-sitter integration * configure.ac (HAVE_TREE_SITTER, TREE_SITTER_OBJ): New variables. (DYNAMIC_LIB_SUFFIX): new variable, I copied code from MODULES_SUFFIX @@ -66795,7 +66795,7 @@ * doc/misc/info.texi (Search Index): Mention it. - * lisp/info.el (Info-find-node): Allow not signalling errors. + * lisp/info.el (Info-find-node): Allow not signaling errors. (Info-apropos-matches): Allow taking a regexp. (info-apropos): Prefix now means looking for a regexp. @@ -66803,7 +66803,7 @@ Fix indentation in copy-region-as-kill - * lisp/simple.el (copy-region-as-kill): Fix indendation. + * lisp/simple.el (copy-region-as-kill): Fix indentation. 2022-04-21 Lars Ingebrigtsen @@ -67303,11 +67303,11 @@ 2022-04-18 Nacho Barrientos (tiny change) - Unify local variable initialisation in url-http + Unify local variable initialization in url-http * lisp/url/url-http.el (url-http-chunked-last-crlf-missing): Treat url-http-chunked-last-crlf-missing as any other buffer variable by - declaring and initialising it the same way as the other related + declaring and initializing it the same way as the other related ones (bug#54989). 2022-04-18 Lars Ingebrigtsen @@ -67848,7 +67848,7 @@ Make sure the ftcr font driver is used on Haiku when Cairo is enabled * src/haikufont.c (syms_of_haikufont): [USE_BE_CAIRO]: Make sure - `ftcr' superseeds `haiku'. + `ftcr' supersedes `haiku'. 2022-04-16 Paul Eggert @@ -68453,7 +68453,7 @@ 2022-04-15 Philip Kaludercic - Generalise buffer matching from project.el + Generalize buffer matching from project.el * subr.el (buffer-match): Add function to check if a buffer satisfies a condition. @@ -68622,7 +68622,7 @@ * lisp/net/ldap.el (ldap-ldapsearch-args): Change -LL to -LLL to suppress ldif version output. (ldap-search-internal): Remove skipping of version output. Remove - redundand ws skipping. + redundant ws skipping. 2022-04-14 Filipp Gunbin @@ -68938,7 +68938,7 @@ This reverts commit 78f76fe16e2737b40694f82af28d17a90a21ed7b. The commit made calls to cl-concatenate bug out, since - autoloading defalises doesn't work very well (bug#54901). + autoloading defaliases doesn't work very well (bug#54901). 2022-04-12 Po Lu @@ -69158,10 +69158,10 @@ 2022-04-12 Olaf Trygve Berglihn (tiny change) - Add biblatex alias entry types for compability with bibtex + Add biblatex alias entry types for compatibility with bibtex * lisp/textmodes/bibtex.el (bibtex-biblatex-entry-alist): Add - biblatex alias entry types for compability with bibtex (bug#54877). + biblatex alias entry types for compatibility with bibtex (bug#54877). 2022-04-12 Lars Ingebrigtsen @@ -69178,7 +69178,7 @@ * src/xterm.c (x_dnd_cleanup_drag_and_drop): Always free DND targets even if waiting for finish. (x_dnd_begin_drag_and_drop): Free targets correctly when - signalling error and prevent activating drag-and-drop inside a + signaling error and prevent activating drag-and-drop inside a menu or popup. (It doesn't work.) 2022-04-12 Michael Albinus @@ -69301,10 +69301,10 @@ 2022-04-11 Mattias Engdegård - Recognise hybrid IPv6/IPv4 addresses in textsec (bug#54624) + Recognize hybrid IPv6/IPv4 addresses in textsec (bug#54624) * lisp/international/textsec.el (textsec--ipvx-address-p): - Recognise hybrid addresses like "::ffff:129.55.2.201". + Recognize hybrid addresses like "::ffff:129.55.2.201". Combine to a single regexp and translate to rx. Remove some regexp ambiguity (relint complaint). * test/lisp/international/textsec-tests.el (test-suspiction-domain): @@ -69628,7 +69628,7 @@ Fix DND leave events not being sent to toplevel after returning frame * src/xterm.c (x_dnd_update_state, handle_one_xevent): Make sure - to send leave events to the previous toplevel when cancelling to + to send leave events to the previous toplevel when canceling to return a frame. 2022-04-08 Po Lu @@ -70147,7 +70147,7 @@ * src/xterm.c (x_dnd_begin_drag_and_drop): Verify x_dnd_movement_x and x_dnd_movement_y are wholenums before - caling posn-at-x-y. + calling posn-at-x-y. 2022-04-07 Po Lu @@ -70240,7 +70240,7 @@ like server latency), then Flymake sometimes doesn't request any diagnostics at all. - The reason for the Flymake behaviour wasn't investigated, but that + The reason for the Flymake behavior wasn't investigated, but that wasn't a very good solution either Rather this change makes it so that when such a Flymake request comes @@ -70735,7 +70735,7 @@ Reduce GC mark-phase recursion by using explicit stack (bug#54698) - An explict stack of objects to be traversed for marking replaces + An explicit stack of objects to be traversed for marking replaces recursion for most common object types: conses, vectors, records, hash tables, symbols, functions etc. Recursion is still used for other types but those are less common and thus not as likely to cause a @@ -70859,7 +70859,7 @@ Rework eglot's mode-line Mimic flymake by replacing the old menus of the mode-line with - "context menus". List all usefull commands under the main menu + "context menus". List all useful commands under the main menu (eglot-menu-map), and commands related to LSP debugging under the project menu (eglot-debug-map). @@ -70903,7 +70903,7 @@ Since <, <=, > and >= have their own byte-ops, the corresponding functions are mostly used as arguments to higher-order functions. - This optimisation is particularly beneficial for sorting, where the + This optimization is particularly beneficial for sorting, where the comparison function is time-critical. * src/data.c (Flss, Fgtr, Fleq, Fgeq): @@ -70926,7 +70926,7 @@ Faster `string-lessp` for unibyte arguments Since this function is commonly used as a sorting predicate - where it is time-critical, this is a useful optimisation. + where it is time-critical, this is a useful optimization. * src/fns.c (Fstring_lessp): Add fast path for the common case when both arguments are unibyte. @@ -71030,7 +71030,7 @@ echo "\\" * lisp/eshell/esh-util.el (eshell-find-delimiter): Correct docstring - and treat '\' as an escapeable character when using backslash escapes. + and treat '\' as an escapable character when using backslash escapes. * test/lisp/eshell/eshell-tests.el (eshell-test/escape-special-quoted): Adapt test. @@ -71158,7 +71158,7 @@ Fix incorrect usage of XM_DRAG_SIDE_EFFECT * src/xterm.c (xm_send_top_level_leave_message) - (handle_one_xevent): Pass corret alt side effects and flags to + (handle_one_xevent): Pass correct alt side effects and flags to XM_DRAG_SIDE_EFFECT. 2022-04-02 Lars Ingebrigtsen @@ -71441,10 +71441,10 @@ * etc/themes/modus-operandi-theme.el: * etc/themes/modus-vivendi-theme.el: Ensure that the theme is reified - as expected both at compiletime and runtime. + as expected both at compile time and runtime. * etc/themes/modus-themes.el (require): Require 'cl-lib' and 'subr-x' - at compiletime. + at compile time. (seq): Require the 'seq' library. (modus-themes-completion-standard-first-match) (modus-themes-completion-standard-selected) @@ -71683,7 +71683,7 @@ * src/pdumper.c (dump_get_max_page_size): Rename from 'dump_get_page_size'. - * src/pdumper.c: Remove getpagesize.h dependecy. + * src/pdumper.c: Remove getpagesize.h dependency. 2022-03-30 Michael Albinus @@ -72118,7 +72118,7 @@ Make sure that the value added to the `read_objects_completed` set is the one we actually return; previously this wasn't the case for conses - because of an optimisation (bug#54501). + because of an optimization (bug#54501). Also add a check for vacuous self-references such as #1=#1# instead of returning a nonsense value from thin air. @@ -72848,7 +72848,7 @@ by RFC 5322. When eudc-inline-expansion-format remains set to a list as previously, - the old behaviour is fully retained. + the old behavior is fully retained. 2022-03-22 Lars Ingebrigtsen @@ -73369,7 +73369,7 @@ 2022-03-19 Po Lu - Improve behaviour of drag-n-drop during window manager operations + Improve behavior of drag-n-drop during window manager operations * src/xterm.c (x_dnd_begin_drag_and_drop): Select for some events on the root window. @@ -74070,7 +74070,7 @@ generation of random bignums without using Frem etc. * src/fns.c (get_random_fixnum): New function. (Frandom): Use it, and get_random_bignum. - Be consistent about signalling nonpositive integer arguments; + Be consistent about signaling nonpositive integer arguments; since zero is invalid, Qnatnump is not quite right here. * src/sysdep.c (get_random_ulong): New function. @@ -74684,7 +74684,7 @@ This results in better performance, and bytecode recursion is no longer limited by the size of the C stack. The bytecode stack is currently of fixed size but overflow is handled gracefully by - signalling a Lisp error instead of the hard crash that we get now. + signaling a Lisp error instead of the hard crash that we get now. In addition, GC marking of the stack is now faster and more precise. Full precision could be attained if desired. @@ -74911,7 +74911,7 @@ Return the same file from locate-file in nativecomp and non * lisp/files.el (locate-file): Return the .elc file (if it exists) - in nativecomp, too, to mimic the behaviour from non-nativecomp + in nativecomp, too, to mimic the behavior from non-nativecomp builds (bug#51308). 2022-03-12 Lars Ingebrigtsen @@ -74931,7 +74931,7 @@ 2022-03-12 Alexander Adolf - Facilitate Customisation of Message-Mode Header Completion Behaviour + Facilitate Customization of Message-Mode Header Completion Behavior * lisp/gnus/message.el (message-email-recipient-header-regexp): New user option. @@ -74966,7 +74966,7 @@ * src/bytecode.c (FETCH2): Use `|` instead of `+` to combine the bytes forming a 16-bit immediate - argument so that GCC (prior to version 12) recognises the idiom and + argument so that GCC (prior to version 12) recognizes the idiom and generates a 16-bit load. This applies for little-endian machines with cheap unaligned accesses such as x86[-64], arm64 and power64le. @@ -74974,7 +74974,7 @@ kinds of Lisp code, as 16-bit immediates are used by all jump instructions. - Clang performs this optimisation for both `+` and `|` from version 10. + Clang performs this optimization for both `+` and `|` from version 10. 2022-03-12 Mattias Engdegård @@ -75284,7 +75284,7 @@ Support remote home directories via connection property * doc/misc/tramp.texi (Home directories): New section. - (Top, Usage): Add it to the menue. + (Top, Usage): Add it to the menu. (Predefined connection information): Mention "~". (Multi-hops, File name syntax): Fix typos. @@ -75704,7 +75704,7 @@ Merge from origin/emacs-28 73f28fbde8 Add a comment for previous browse-url-of-dired-file change - 9b74e84857 Restore documented Emacs 27.2 behaviour of browse-url-of-d... + 9b74e84857 Restore documented Emacs 27.2 behavior of browse-url-of-d... cd77fd3b85 Update to Org 9.5.2-24-g668205 2022-03-07 Manuel Giraud @@ -75867,7 +75867,7 @@ 2022-03-06 Mattias Engdegård - Don't accept whitespace or hex floats in rgbi: colour specs + Don't accept whitespace or hex floats in rgbi: color specs `color-values-from-color-spec` (new in Emacs 28) erroneously accepted leading whitespace and hex floats in rgbi: components. @@ -78381,7 +78381,7 @@ Fix SIGFPE on some fonts when calculating their average width on Haiku - * src/haiku_font_support.cc (estimate_font_ascii): Avoid divison + * src/haiku_font_support.cc (estimate_font_ascii): Avoid division by zero. 2022-02-16 Po Lu @@ -78466,7 +78466,7 @@ * src/character.c (count_size_as_multibyte): Move the overflow test outside the loop, which makes it much faster. Standard compilers - will even vectorise it if asked to (-O2 in Clang, -O3 in GCC). + will even vectorize it if asked to (-O2 in Clang, -O3 in GCC). 2022-02-16 Mattias Engdegård @@ -78694,7 +78694,7 @@ (vc-clone): Declare function for package-unpack. (package-unpack): Handle source packages. (package-generate-description-file): Handle source packages by - ommiting a version number. + omitting a version number. (package-install-from-archive): Check if a package is a source package. (package-fetch): Add new command @@ -78791,7 +78791,7 @@ 2022-02-14 Po Lu - * etc/TODO: Update some entires related to macOS and NS. + * etc/TODO: Update some entries related to macOS and NS. Xwidgets have worked on NS for a long time, "smooth scrolling" is now available as `pixel-scroll-precision-mode' for all GUI @@ -78821,7 +78821,7 @@ 2022-02-13 Po Lu - Improve efficency of handling DeviceChanged events + Improve efficiency of handling DeviceChanged events * src/xterm.c (handle_one_xevent): Just update the device that was changed on DeviceChanged and only do hierarchy recalculation @@ -78974,7 +78974,7 @@ 2022-02-12 Po Lu - Stop quering for Xinerama inside x_get_monitor_attributes + Stop querying for Xinerama inside x_get_monitor_attributes * src/xfns.c (x_get_monitor_attributes): Remove Xinerama check and use xinerama_supported_p instead. @@ -79096,7 +79096,7 @@ specpdl refs has been converted. We only do this on 64-bit platforms, since those tend to have modern - ABIs where small structs are optimised as scalars. In other words, + ABIs where small structs are optimized as scalars. In other words, this change should not affect the compiled code. * src/lisp.h (specpdl_ref): Now a struct on 64-bit platforms. @@ -79332,7 +79332,7 @@ 2022-02-11 Mattias Engdegård - Modernise byte-compilation chapters in manual + Modernize byte-compilation chapters in manual * doc/lispref/compile.texi (Speed of Byte-Code): More representative numbers for byte code; the difference is much greater today. @@ -79484,7 +79484,7 @@ Restore command-line--load-script messaging * lisp/startup.el (command-line--load-script): Restore previous - non-messaging behaviour. + non-messaging behavior. 2022-02-10 Michael Albinus @@ -79681,14 +79681,14 @@ 2022-02-09 Po Lu - Explictly specify whether or not to respect alpha-background on Cairo + Explicitly specify whether or not to respect alpha-background on Cairo * src/ftcrfont.c (ftcrfont_draw): Don't respect `alpha-background' if drawing cursor. (bug#53890) * src/xterm.c (x_set_cr_source_with_gc_foreground): (x_set_cr_source_with_gc_background): New parameters `respect_alpha_background'. All callers changed. - * src/xterm.h: Update protoypes. + * src/xterm.h: Update prototypes. 2022-02-09 Tassilo Horn @@ -79945,7 +79945,7 @@ * src/widget.c (update_wm_hints): Accept frame separately from the shell widget. - (widget_update_wm_size_hints): Require WM shell to be explictly + (widget_update_wm_size_hints): Require WM shell to be explicitly specified. (EmacsFrameRealize): (EmacsFrameResize): Update callers to `update_wm_hints'. @@ -80411,7 +80411,7 @@ Add a :distant-foreground to the lazy-highlight face * lisp/isearch.el (lazy-highlight): Add a :distant-foreground - colour so that the text is always legible (bug#16969). + color so that the text is always legible (bug#16969). 2022-02-05 Lars Ingebrigtsen @@ -80841,7 +80841,7 @@ error will occur in x_composite_image as libXpm will load pixmaps of depth 16 instead of depth 32. - * src/image.c (x_create_x_image_and_pixmap): Explictly specify + * src/image.c (x_create_x_image_and_pixmap): Explicitly specify display depth. (x_create_xrender_picture): (xpm_load): @@ -81097,7 +81097,7 @@ of not being in dumping or bootstrap, since it is no longer needed. Test that 'debug-early's symbol-function is bound. Ensure there is enough working space in specpdl and eval_depth. - (syms_of_eval): New DEFSYM for Qdebug_early. Initialise Vdebugger to + (syms_of_eval): New DEFSYM for Qdebug_early. Initialize Vdebugger to Qdebug_early rather than Qnil. 2022-02-02 Juri Linkov @@ -81169,7 +81169,7 @@ 2022-02-02 Po Lu - Make behaviour of `mouse-autoselect-window' consistent with X on NS + Make behavior of `mouse-autoselect-window' consistent with X on NS * src/nsterm.m ([EmacsView mouseMoved:]): Ignore if `selected_window' is a minibuffer window. @@ -81185,7 +81185,7 @@ 2022-02-01 Po Lu - Improve behaviour of `mouse-autoselect-window' on Haiku + Improve behavior of `mouse-autoselect-window' on Haiku * src/haikuterm.c (haiku_read_socket): Don't select windows if the selected window is a minibuffer window or a popup is @@ -81445,7 +81445,7 @@ We used to store in `load-history` when an autoload is redefined as a non-autoload and in the `autoload` symbol property we used to store - the autoload data that used to be used before it got overriden. + the autoload data that used to be used before it got overridden. Instead, store the history of the function definition of a symbol in its `function-history` symbol property. @@ -81839,7 +81839,7 @@ 2022-01-29 Lars Ingebrigtsen - Modernise the security section in the efaq a bit + Modernize the security section in the efaq a bit * doc/misc/efaq.texi (Security risks with Emacs): Remove the X bit, and add a bit about browsing the web (bug#24489). @@ -82477,7 +82477,7 @@ Minor `concat` tweaks * src/fns.c (concat): Do things in the right order for speed. - (concat_strings): Initialise variable. + (concat_strings): Initialize variable. 2022-01-26 Lars Ingebrigtsen @@ -82648,7 +82648,7 @@ (Fappend, Fvconcat): Adapt to changed signature of concat. (Fcopy_sequence): Faster implementation for lists, strings, and vectors. (concat_strings): New. - (concat): Strip code for string target, simplify, optimise. + (concat): Strip code for string target, simplify, optimize. (Fcopy_alist): Use Fcopy_sequence. 2022-01-25 Lars Ingebrigtsen @@ -83912,7 +83912,7 @@ Make diff--iterate-hunks more resilient * lisp/vc/diff-mode.el (diff--iterate-hunks): Ignore malformed - hunks instead of signalling errors (bug#53343). + hunks instead of signaling errors (bug#53343). 2022-01-21 Shuguang Sun @@ -83936,7 +83936,7 @@ than before, for example when a subcommand is concatenated in an argument. - * lisp/eshell/esh-cmd.el (eshell--find-subcommands): New fuction. + * lisp/eshell/esh-cmd.el (eshell--find-subcommands): New function. (eshell--invoke-command-directly): Use 'eshell-find-subcommands'. * test/lisp/eshell/eshell-tests.el @@ -84662,7 +84662,7 @@ Fix event timestamp generation on Haiku - * src/haikuterm.c (haiku_read_socket): Use miliseconds for event + * src/haikuterm.c (haiku_read_socket): Use milliseconds for event time. 2022-01-18 Stefan Monnier @@ -84849,7 +84849,7 @@ This fixes several issues: tooltips having no right internal border, reusing tooltips occasionally freezing Emacs, and - inconsistent behaviour when compared to X. + inconsistent behavior when compared to X. * src/haiku_support.cc (BWindow_resize): Revert a recent change. (BView_move_frame): @@ -85295,7 +85295,7 @@ * src/haiku_support.c (be_popup_file_dialog): Reduce idle processor load by increasing timeout. The timeout is still too - low to be noticable by the user. + low to be noticeable by the user. 2022-01-16 Po Lu @@ -85419,7 +85419,7 @@ mechanism. (byte-compile-function-warn): Replace byte-compile-last-position by a symbol-with-pos-pos call. - (compile-defun): Use local variable start-read-position to fulfil purpose of + (compile-defun): Use local variable start-read-position to fulfill purpose of old byte-compile-read-position. Push the just read FORM onto byte-compile-form-stack. @@ -85640,7 +85640,7 @@ No longer strip positions from symbols before each use of a form, instead relying on the low level C routines to do the right thing. Instead strip them - from miscellaneous places where this is needed. Stip them alson in + from miscellaneous places where this is needed. Strip them also in `function-put'. Push forms onto byte-compile-form-stack and pop them "by hand" rather than by @@ -85816,7 +85816,7 @@ * lisp/battery.el (battery-status-function): In Termux, neither /sys/ or /proc/ are readable on phones that are not rooted. This - patch makes Emacs verify if they are readable before it attemps + patch makes Emacs verify if they are readable before it attempts reading them (bug#53026). 2022-01-14 Robert Pluim @@ -85875,7 +85875,7 @@ * lisp/progmodes/python.el (python-shell-send-string-no-output): Don't let-bind comint-preoutput-filter-functions globally for all comint - processes. Modify the behaviour of only the current python + processes. Modify the behavior of only the current python process (bug#53219). 2022-01-14 Robert Pluim @@ -85904,7 +85904,7 @@ Merge from origin/emacs-28 34ca4ff9a5 Fix Edebug specification for inline functions (Bug#53068). - 3c06c37a8b Remove mention of removed `gnus-treat-play-sounds' variabl... + 3c06c37a8b Remove mention of removed `gnus-treat-play-sounds' variable... 2022-01-13 Po Lu @@ -86777,7 +86777,7 @@ This was found during the investigation surrounding bug#53136, but is not directly related. - * src/filelock.c (lock_if_free): Explictly test err against -1 + * src/filelock.c (lock_if_free): Explicitly test err against -1 or -2, and reverse sign of system errors on Haiku. (No Haiku error occupies -1 or -2.) @@ -87231,7 +87231,7 @@ 2022-01-07 Po Lu - Disable new input method behaviour by default on X + Disable new input method behavior by default on X * src/xfns.c (supported_xim_styles): Default to STYLE_NONE. @@ -87818,7 +87818,7 @@ here. * src/haikufns.c (haiku_visualize_frame): - (haiku_unvisualize_frame): Sychronize after visibility changes. + (haiku_unvisualize_frame): Synchronize after visibility changes. 2022-01-03 Po Lu @@ -88558,9 +88558,9 @@ (emit_ctxt_code): Export the global F_SYMBOLS_WITH_POS_ENABLED_RELOC_SYM. (define_lisp_symbol_with_position, define_GET_SYMBOL_WITH_POSITION): New functions. - (Fcomp__init_ctxt): Initialise comp.bool_ptr_type, call the two new + (Fcomp__init_ctxt): Initialize comp.bool_ptr_type, call the two new define_.... functions. - (load_comp_unit): Initialise **f_symbols_with_pos_enabled_reloc. + (load_comp_unit): Initialize **f_symbols_with_pos_enabled_reloc. * src/fns.c (Fput): Strip positions from symbols in PROPNAME and VALUE. @@ -89045,7 +89045,7 @@ 2021-12-27 Michael Albinus - The temprary "session" collection might not exist in Secret Service + The temporary "session" collection might not exist in Secret Service * doc/misc/auth.texi (Secret Service API): * test/lisp/net/secrets-tests.el (secrets--test-delete-all-session-items) @@ -89600,7 +89600,7 @@ Changes: - structure the result of mm-dissect-buffer of application/pkcs7-mime - like a multipart mail so there is no loosing of information of + like a multipart mail so there is no losing of information of verification and decryption results which can now be displayed by gnus-mime-display-security @@ -89616,7 +89616,7 @@ to print "Encrypted" or "Signed" accordingly in the security button - adjust mm-possibly-verify-or-decrypt to check for smime-type to ask - wether to verify or decrypt the part and not to always ask to decrypt + whether to verify or decrypt the part and not to always ask to decrypt - adjust mm-view-pkcs7-decrypt and verify to call mm-sec-status so success information can be displayed by gnus-mime-display-security @@ -89992,7 +89992,7 @@ * src/xfns.c (Fx_set_mouse_absolute_pixel_position): * src/xterm.c (frame_set_mouse_pixel_position): Replace calls to XWarpPointer with calls to XIWarpPointer with - the client pointer explictly specified. This avoids the + the client pointer explicitly specified. This avoids the odd situation where the client pointer of the root window is not the client pointer of the frame. @@ -90655,7 +90655,7 @@ Remove incorrect byte-hunk-handler for `eval` - This optimisation is of very limited utility and miscompiles top-level + This optimization is of very limited utility and miscompiles top-level code having the form (eval 'CODE t) by replacing it with CODE which will then, as things currently stand, be evaluated with dynamic binding. @@ -92005,7 +92005,7 @@ be860c1385 Fix manual entry of 'quit-restore-window' (Bug#52328) 35a96139df Clarify a comment in xdisp.c 6ba2f028cf Revert "Grep alias `all' shall not match parent directory" - eb9e33e238 ; * etc/NEWS: Non-nil repeat-keep-prefix is not the defaul... + eb9e33e238 ; * etc/NEWS: Non-nil repeat-keep-prefix is not the default... 538fc1d0e0 Fix mode-line display in Calendar mode # Conflicts: @@ -93530,14 +93530,14 @@ Remove separators at the beginning and end of the context menu * lisp/mouse.el (context-menu-map): Remove beginning/end - seperators (bug#52237). + separators (bug#52237). 2021-12-03 Lars Ingebrigtsen Improve how dired-mark-sexp interprets file sizes in non-C locales * lisp/dired-x.el (dired-x--string-to-number): Try to understand - localised numbers (with "." separators or the like) (bug#23373). + localized numbers (with "." separators or the like) (bug#23373). 2021-12-03 Stefan Kangas @@ -93572,7 +93572,7 @@ 2021-12-03 Stefan Kangas - image-mode: Advertize viewing as text less eagerly + image-mode: Advertise viewing as text less eagerly * lisp/image-mode.el (image-text-based-formats): New defcustom. (image-mode--setup-mode): Don't show message to show image as text @@ -93716,7 +93716,7 @@ 2be090d5d3 ; * ChangeLog.3: Minor fixes. 9963b11bf7 ; * admin/authors.el (authors-aliases): Further updates. 50b40e1d4f ; * lisp/org/ob-julia.el: Fix Author header for authors.el. - 84166ea2e6 CC Mode: Recognise "struct foo {" as introducing a type de... + 84166ea2e6 CC Mode: Recognize "struct foo {" as introducing a type de... 2021-12-02 Lars Ingebrigtsen @@ -93943,7 +93943,7 @@ * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down) (pixel-scroll-precision-scroll-up): Take scroll margin into - accout. + account. 2021-12-01 Po Lu @@ -94360,7 +94360,7 @@ 2021-11-30 Andrea Corallo - Improve native compiler startup circular dependecy prevention mechanism + Improve native compiler startup circular dependency prevention mechanism * src/comp.c (maybe_defer_native_compilation): Update to accumulate delayed objects in `comp--delayed-sources'. @@ -94382,7 +94382,7 @@ 2021-11-30 Mattias Engdegård - Generalise CPS-conversion let optimisation + Generalize CPS-conversion let optimization * lisp/emacs-lisp/generator.el (cps--transform-1): Eliminate a temporary for the last of any `let` form, not just for @@ -94452,7 +94452,7 @@ 30553d889d Merge branch 'emacs-28' of git.savannah.gnu.org:/srv/git/e... ecf3bf66ba Remove problematic characters from modus-themes.org (bug#5... - de9d27f679 Avoid undefined behaviour when copying part of structure + de9d27f679 Avoid undefined behavior when copying part of structure # Conflicts: # doc/misc/modus-themes.org @@ -94925,7 +94925,7 @@ 2021-11-29 Andreas Schwab - Avoid undefined behaviour when copying part of structure + Avoid undefined behavior when copying part of structure * src/dispnew.c (copy_row_except_pointers): Don't use address of subobject as starting point. @@ -97333,7 +97333,7 @@ * lisp/emacs-lisp/ert.el (ert-batch-backtrace-line-length): Fix docstring. - (ert-run-tests-batch): Remove redundand let-binding. + (ert-run-tests-batch): Remove redundant let-binding. (ert-run-tests-interactively): Fix interactive spec. 2021-11-18 Mattias Engdegård @@ -98175,7 +98175,7 @@ Merge from origin/emacs-28 5dbad52 gnus-summary-line-format doc string clarification - d4536ff Fix follow-scroll-down in a small buffer which starts slightl... + d4536ff Fix follow-scroll-down in a small buffer which starts slightly... 2021-11-14 Eli Zaretskii @@ -98335,7 +98335,7 @@ 2021-11-13 Michael Albinus - Revert accidential commit in icomplete.el + Revert accidental commit in icomplete.el 2021-11-13 Michael Albinus @@ -98401,7 +98401,7 @@ Where c-record-found-types gets "bound" to itself, we postpone the calling of c-fontify-new-type on possible new found types until these are confirmed by - the return from the function tentatively finding these types, for exmaple + the return from the function tentatively finding these types, for example c-forward-<>-arglist. We check this "binding" by testing the value of c-record-found-types. @@ -100934,7 +100934,7 @@ 5e9b4e70ab Fix dbus-test04-register-method on CentOS (Bug#51369) d96de23510 * lisp/transient.el: Update to package version v0.3.7-11-g... 7343b0d0e4 ; * etc/NEWS: Native compilation is more picky about missi... - 0d6b2b0b9d ; * etc/PROBLEMS: Move entry about LLVM plugin to the righ... + 0d6b2b0b9d ; * etc/PROBLEMS: Move entry about LLVM plugin to the right... # Conflicts: # etc/NEWS @@ -100991,7 +100991,7 @@ (ns_glyph_metrics): Stop escaping names. (ns_spec_to_descriptor): Fix font descriptor creation for symbolic - font spec entires. + font spec entries. (ns_descriptor_to_entity): Create entries with the correct symbolic styles. @@ -101763,11 +101763,11 @@ 2021-11-02 Mattias Engdegård - Optimise (cond) => nil at source level + Optimize (cond) => nil at source level * lisp/emacs-lisp/byte-opt.el (byte-optimize-cond): - Optimise clause-free `cond`, which can arise from earlier - transformations. This enables further optimisations. + Optimize clause-free `cond`, which can arise from earlier + transformations. This enables further optimizations. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases. @@ -102644,10 +102644,10 @@ 2021-10-26 Stefan Kangas - image-dired: Improve mouse behaviour + image-dired: Improve mouse behavior * lisp/image-dired.el (image-dired-thumbnail-mode-map): Improve mouse - behaviour: ignore dragging, as it currently doesn't do anything + behavior: ignore dragging, as it currently doesn't do anything useful, and make all clicks just select the thumbnail. (image-dired-mouse-display-image) (image-dired-mouse-select-thumbnail): Move point to closest image @@ -102758,7 +102758,7 @@ strings. The code originally set that charset for any server with literal+ capability, borking all searches on an Exchange server. This code only sets utf-8 for multibyte search strings in particular, which - would be borken for Exchange anyway. + would be broken for Exchange anyway. * lisp/gnus/gnus-search.el (gnus-search-imap-search-command): Ensure we're only doing the literal+ dance for multibyte strings (multibyte @@ -102933,7 +102933,7 @@ 2021-10-24 Lars Ingebrigtsen - Display a message if HMTL rendering takes a long time + Display a message if HTML rendering takes a long time * lisp/net/eww.el (eww-display-html): Display a message if HTML rendering takes a long time (bug#19776). @@ -102956,7 +102956,7 @@ This aims to fix the scenario where on jit-lock's first scan of a type, it is not recognized as such, and only later does this happen. The fontification of such found types is now done by background scanning in short time slices - immediately after initialising the mode. + immediately after initializing the mode. * lisp/progmodes/cc-engine.el (c-add-type-1): New function. (c-add-type): Extract c-add-type-1 from it, and reformulate the mechanism for @@ -103172,7 +103172,7 @@ Make dired-x-guess-file-name-at-point obsolete * lisp/dired-x.el (dired-x-guess-file-name-at-point): Make - obsolete in favour of 'thing-at-point'. + obsolete in favor of 'thing-at-point'. (dired-x-read-filename-at-point): Use 'thing-at-point' instead of above obsolete function. @@ -103209,7 +103209,7 @@ * lisp/image-dired.el (exif): Require. (image-dired-cmd-read-exif-data-program) (image-dired-cmd-read-exif-data-options) - (image-dired-get-exif-data): Make obsolete in favour of using + (image-dired-get-exif-data): Make obsolete in favor of using exif.el. This removes a dependency on external exiftool for some operations. (image-dired-get-exif-file-name) @@ -103254,7 +103254,7 @@ This aims to fix the scenario where on jit-lock's first scan of a type, it is not recognized as such, and only later does this happen. The fontification of such found types is now done by background scanning in short time slices - immediately after initialising the mode. + immediately after initializing the mode. * lisp/progmodes/cc-engine.el (c-add-type-1): New function. (c-add-type): Extract c-add-type-1 from it, and reformulate the mechanism for @@ -104586,7 +104586,7 @@ Merge from origin/emacs-28 - 47e09d1855 Copy parent face attributes to tab-line-tab-current instea... + 47e09d1855 Copy parent face attributes to tab-line-tab-current instead... d96f8b22c0 Another fix for 'ibuffer-shrink-to-fit' (Bug#7218, Bug#51029) 2021-10-12 Glenn Morris @@ -104918,7 +104918,7 @@ 315fe20086 ; * src/Makefile.in (../native-lisp): Add comment. 47cbd103f5 * lisp/bindings.el (mode-line-position): Improve tooltip. 35a752863a * lisp/progmodes/xref.el: Bump the version. - bbcd8cc1a9 Slight simplificaiton + bbcd8cc1a9 Slight simplification e139dd1b1e Fix doc strings of 2 categories 59782839cb (xref--collect-matches-1): Remove some intermediate alloca... 1c7d056f4d ; Fix two typos where em dash was written as en dash @@ -105585,7 +105585,7 @@ (term-ansi-face-already-done): Make obsolete (term--maybe-brighten-color): Remove (term--color-as-hex): New function - (term-handle-colors-array): Make obsolete in favour of the new + (term-handle-colors-array): Make obsolete in favor of the new function 'term--handle-colors-list'. (term--handle-colors-list): New function, that can also handle ANSI codes 38 and 48. @@ -106426,7 +106426,7 @@ Use project-files to know which directory watchers to skip The directory-finding logic is probably a bit slower than using - eglot--directories-recursively, but since it honours `.gitignores` and + eglot--directories-recursively, but since it honors `.gitignores` and ignores more directories it's much faster overall. And guaranteed to create less watchers. @@ -106438,7 +106438,7 @@ 2021-05-26 João Távora - Hard code an exception to "node_modules" directores + Hard code an exception to "node_modules" directories * eglot.el (eglot--directories-recursively): Fix. @@ -106833,7 +106833,7 @@ tremendeously slow down the process. But this is only a suspicion. This commit tries some simple optimizations: if a directory is known - to be watch-worthy becasue one of its files matched a single glob, no + to be watch-worthy because one of its files matched a single glob, no more files under that directory are tried. This should help somewhat. Also fixed a bug in 'eglot--files-recursively', though I suspect that @@ -107246,7 +107246,7 @@ Simplify dir-watching strategy of w/didchangewatchedfiles Instead of massaging the globPattern to match directories instead of - files, which is fragile, gather the list of directoris to watch by + files, which is fragile, gather the list of directories to watch by matching the globPattern against every file recursively (except hidden files and dirs). @@ -107783,7 +107783,7 @@ Only makes two changes: a deletion of the "// " and a replacement of a newline with a space character. The second change fooled Eglot's fix for https://github.com/joaotavora/eglot/issues/259, by making a change similar to the one it is made to detect - and correct. That fix should taget things that happen on the same + and correct. That fix should target things that happen on the same line, this not being one of those things. * eglot.el (eglot--after-change): Only apply fix to https://github.com/joaotavora/eglot/issues/259 if @@ -107897,7 +107897,7 @@ * src/pgtkselect.c: * src/pgtkselect.h: * src/pgtkterm.c: - * src/pgtkterm.h: Update copyright dates - No Funtional Changes + * src/pgtkterm.h: Update copyright dates - No Functional Changes 2020-11-23 Yuuki Harano @@ -108296,7 +108296,7 @@ minimize gtkutil.c differences. - * src/pgtkterm.h: remove compiletime ifdefs + * src/pgtkterm.h: remove compile time ifdefs * src/gtkutil.h: block out unused decl @@ -108345,7 +108345,7 @@ * src/gtkutil.c (xg_create_frame_widgets): - hacky GTK offsets taht will need better calculations + hacky GTK offsets that will need better calculations Get parent frame's editor widget allocation for the offset @@ -108511,7 +108511,7 @@ 2020-11-21 Yuuki Harano - Make multipdisplay work by limiting selection while enabed + Make multipdisplay work by limiting selection while enabled * src/pgtkterm.c (pgtk_mouse_position): @@ -108528,12 +108528,12 @@ 2020-11-21 Yuuki Harano - Improve drawing efficency by refactoring code + Improve drawing efficiency by refactoring code * ../src/pgtkterm.c (fill_background, fill_background_by_face) (x_draw_glyph_string_background, x_draw_glyph_string_bg_rect) (x_draw_image_glyph_string, x_draw_stretch_glyph_string) - (pgtk_clear_under_internal_border): Refator duplcate code + (pgtk_clear_under_internal_border): Refator duplicate code 更に効率化。 @@ -108849,7 +108849,7 @@ 2020-11-21 Yuuki Harano - Simplify compilaiton condtion + Simplify compilation condition * ../src/menu.c (single_menu_item): @@ -109221,7 +109221,7 @@ Uses Eldoc's eldoc-documentation-functions variable. In Eldoc v1.0.0 that variable was already available as a way of handling/composing multiple docstrings from different sources, but it didn't work - practically with mutiple concurrent async sources. This was fixed in + practically with multiple concurrent async sources. This was fixed in 1.1.0, which Eglot now requires. This fixes the synchronization problems reported in https://github.com/joaotavora/eglot/issues/494 and also @@ -109467,7 +109467,7 @@ use-package--foo--post-config-hook This should make config customisations more predictable (for example, spacemacs - uses these hooks extensively to allow 'layers' to be customised). + uses these hooks extensively to allow 'layers' to be customized). I got rid of the "special" default value for :config, because it doesn't seem to be treated any differently than nil. @@ -109565,14 +109565,14 @@ 2020-05-02 João Távora - Kind of honour eldoc-echo-area-use-multiline-p + Kind of honor eldoc-echo-area-use-multiline-p A reworking of an idea and original implementation by Andrii Kolomoiets . It doesn't honor it completely because the semantics for a non-t, non-nil value are tricky. And we don't always exactly know what the symbol prefix reliably. - * eglot.el (eglot--update-doc): Kind of honour + * eglot.el (eglot--update-doc): Kind of honor eldoc-echo-area-use-multiline-p. GitHub-reference: close https://github.com/joaotavora/eglot/issues/443 @@ -110204,7 +110204,7 @@ Support markdown for textdocument/hover () - * eglot.el (eglot-client-capabilities): annouce markdown support for hover. + * eglot.el (eglot-client-capabilities): announce markdown support for hover. (eglot--format-markup): Format hover info with Markdown. Fixes: https://github.com/joaotavora/eglot/issues/328 @@ -110401,7 +110401,7 @@ completion. When the completion is close to done, the :exit-function is called, to potentially rework the inserted text so that the final result might be quite different from the proxy (it might be a snippet, - or even a suprising text edit). + or even a surprising text edit). The most important change in this commit reworks the way the completion "bounds" are calculated in the buffer. This is the region @@ -110418,7 +110418,7 @@ https://github.com/microsoft/language-server-protocol/issues/651, we have no choice but to play along with that inneficient and grotesque strategy to implement flex-style matching. Like ever in LSP, we do so - while being backward-compatible to all previously supported behaviour. + while being backward-compatible to all previously supported behavior. * eglot.el (eglot-completion-at-point): rework. @@ -110429,8 +110429,8 @@ Always filter completions client-side by prefix Prefix completion is all we get in LSP because there are some servers - that send *all* completions everytime. This is horrible, but it's the - currently defined behaviour. See + that send *all* completions every time. This is horrible, but it's the + currently defined behavior. See https://github.com/microsoft/language-server-protocol/issues/651. * eglot.el (eglot-completion-at-point): Use all-completions. @@ -110584,7 +110584,7 @@ Unbreak elm language server which does use :triggercharacters Only query completionProvider -> triggerCharacter information if the - server has provided it. Elm's, and probaly other's, do not provide + server has provided it. Elm's, and probably other's, do not provide it, which doesn't mean they don't support completion. * eglot.el (eglot-completion-at-point): Check that completion @@ -111371,7 +111371,7 @@ Use eglot--dbind and eglot--lambda throughout - The default behaviour of these macros is to be lenient towards servers + The default behavior of these macros is to be lenient towards servers sending unknown keys, which should fix the issue. * eglot.el (eglot--lsp-interface-alist): Add a bunch of new interfaces. @@ -111456,7 +111456,7 @@ Support completioncontext to help servers like ccls - * eglot.el (eglot-client-capabilities): Annouce + * eglot.el (eglot-client-capabilities): Announce textDocument/completion/contextSupport. (eglot--CompletionParams): New helper. (eglot-completion-at-point): Use it. @@ -112024,7 +112024,7 @@ :ensure-system-package was installing packages by running system-packages-get-command via async-shell-command. This meant that - system-packages-use-sudo wasn't being honoured. + system-packages-use-sudo wasn't being honored. This patch makes :ensure-system-package use system-packages-install for all cases, except where a custom install command is supplied, in @@ -112032,7 +112032,7 @@ This issue was introduced in 9f034a0bcfdd8c4 [https://github.com/jwiegley/use-package/issues/673], as a fix for [https://github.com/jwiegley/use-package/issues/661]. Prior to that commit, system-packages-use-sudo was being - honoured. + honored. This patch also fixes a bug where a cons containing a lone symbol in a list of conses causes nil to used as the package to install. @@ -112117,7 +112117,7 @@ Ignore extra keys in textdocument/publishdiagnostics () - Accoding to the "discussion" in https://reviews.llvm.org/D50571, it + According to the "discussion" in https://reviews.llvm.org/D50571, it was deemed sufficient that VSCode is fine with the non-standard extension -- jt @@ -112277,7 +112277,7 @@ * eglot.el (eglot-sync-connect): New defcustom. (eglot-ensure, eglot): Simplify. - (eglot--connect): Honour eglot-sync-connect. Complicate + (eglot--connect): Honor eglot-sync-connect. Complicate considerably. (eglot-connect-timeout): New defcustom. (Package-requires): Require jsonrpc 1.0.6 @@ -112364,7 +112364,7 @@ requiring command-line invocations that depend on the specific momentary environment. - * eglot.el (eglot-server-programs): CONTACT can be a fucntion of no + * eglot.el (eglot-server-programs): CONTACT can be a function of no arguments. (eglot--guess-contact, eglot--connect): Accept function CONTACTs. @@ -112565,7 +112565,7 @@ 2018-07-09 João Távora - Jsonrpc.el is now a gnu elpa depedency + Jsonrpc.el is now a gnu elpa dependency * Makefile (ELFILES): Don't include jsonrpc. (jsonrpc-check): Remove target. @@ -113035,7 +113035,7 @@ Fix indentation f@#$%^ by previous commit - Courtesy of aggressive-indent-mode... Agressive it is... + Courtesy of aggressive-indent-mode... Aggressive it is... 2018-06-09 João Távora @@ -113175,7 +113175,7 @@ 2018-06-04 João Távora - Support purposedly ignoring a server capability + Support purposely ignoring a server capability * eglot.el (eglot-ignored-server-capabilites): New defcustom. (eglot--server-capable): Use it. @@ -113472,7 +113472,7 @@ 2018-05-26 João Távora - Simpify eglot--server-receive + Simplify eglot--server-receive * eglot.el (eglot--obj): Cleanup whitespace. (eglot--server-receive): Simplify. @@ -113854,16 +113854,16 @@ Robustify timer handling for eglot--async-request - This basically cherry-picks an ealier commit for the jsonrpc-refactor + This basically cherry-picks an earlier commit for the jsonrpc-refactor branch: a2aa1ed..: João Távora 2018-05-18 Robustify timer handling for jrpc-async-request * jrpc.el (jrpc--async-request): Improve timeout handling. Return a list (ID TIMER) - (jrpc--request): Protect against user-quits, cancelling timer + (jrpc--request): Protect against user-quits, canceling timer 2018-05-19 João Távora - Simplify some infrastructure fucntions + Simplify some infrastructure functions * eglot.el (eglot--contact): Simplify docstring. (eglot--make-process): Simplify. @@ -113974,7 +113974,7 @@ Instead of introspecting the :params or :result object to discover if an object is present, and changing the Elisp function call type - (funcall vs apply) accordingly, alway funcall. It's up to the + (funcall vs apply) accordingly, always funcall. It's up to the application to destructure if it wishes. jrpc-lambda can help with that and keep the application code simple. @@ -114273,7 +114273,7 @@ 2018-05-10 João Távora - Prepare to sumbit to gnu elpa + Prepare to submit to gnu elpa * eglot.el: Update headers. @@ -114314,7 +114314,7 @@ (eglot--TextDocumentIdentifier) (eglot--VersionedTextDocumentIdentifier) (eglot--TextDocumentPositionParams, eglot--TextDocumentItem): - Renamed from the more verbose eglot--current-buffer-* variante. + Renamed from the more verbose eglot--current-buffer-* variant. (eglot-rename, eglot-imenu, eglot-eldoc-function) (eglot-completion-at-point, xref-backend-definitions) (xref-backend-identifier-at-point) @@ -114407,7 +114407,7 @@ Adjust flymake integration - When opening a new file (signalling textDocument/didOpen) it makes + When opening a new file (signaling textDocument/didOpen) it makes sense to call the flymake callback (if it exists) with no diagnostics, just to get rid of that "Wait", since we don't know if later in this callback cycle the server will ever report new diagnostics. @@ -114822,9 +114822,9 @@ 2018-05-04 João Távora - Honour textdocumentsync + Honor textdocumentsync - * eglot.el (eglot--signal-textDocument/didChange): Honour textDocumentSync + * eglot.el (eglot--signal-textDocument/didChange): Honor textDocumentSync 2018-05-04 João Távora @@ -115224,7 +115224,7 @@ 2018-05-02 João Távora - Change status to error everytime an error is found + Change status to error every time an error is found * eglot.el (eglot--process-receive): Also set error status. (eglot--request): Fix a compilation warning. @@ -116556,7 +116556,7 @@ (next-overlay-change, previous-overlay-change, overlay-put) (overlay-get, report_overlay_modification, evaporate_overlays) (init_buffer_once): Adapt to changes and tree data-structure. - (overlay-lists, overlay-recenter): Funtions are now obsolete, but + (overlay-lists, overlay-recenter): Functions are now obsolete, but kept anyway. (set_buffer_overlays_before, set_buffer_overlays_after) (recenter_overlay_lists,fix_start_end_in_overlays,fix_overlays_before) @@ -117210,7 +117210,7 @@ This means (use-package foopkg :mode (".foo")) will add (".foo" . foopkg) into auto-mode-alist instead of the broken (".foo" . nil), - this is more consistent with the behaviour of (use-package foopkg + this is more consistent with the behavior of (use-package foopkg :mode (".foo" ".bar")). 2016-10-31 Noam Postavsky @@ -117678,12 +117678,12 @@ Merge pull request from waymondo/extend-bind-handler - Pass in symbol of bind macro, for more extensible re-use of same handler + Pass in symbol of bind macro, for more extensible reuse of same handler GitHub-reference: https://github.com/jwiegley/use-package/issues/259 2015-09-23 Justin Talbott - pass in symbol of bind macro, for more extensible re-use of same handler + pass in symbol of bind macro, for more extensible reuse of same handler related to https://github.com/jwiegley/use-package/issues/258 @@ -118474,7 +118474,7 @@ Lower-priority idle functions are run first. Idle functions with no specified priority default to 5 and all functions with the same priority - are run in the order in which they are evaluated, meaning the behaviour + are run in the order in which they are evaluated, meaning the behavior is backwards compatible. Updated documentation as well. @@ -118606,7 +118606,7 @@ Merge pull request from aspiers/docs - Synchronise docs and then remove one copy to prevent future issues. + Synchronize docs and then remove one copy to prevent future issues. GitHub-reference: https://github.com/jwiegley/use-package/issues/78 2014-01-06 Adam Spiers diff --git a/doc/emacs/ChangeLog.1 b/doc/emacs/ChangeLog.1 index 16afa073169..bca543036d5 100644 --- a/doc/emacs/ChangeLog.1 +++ b/doc/emacs/ChangeLog.1 @@ -1294,7 +1294,7 @@ * display.texi (Visual Line Mode): Fix index entry. - * buffers.texi (Several Buffers): List Buffer Menu command anmes, + * buffers.texi (Several Buffers): List Buffer Menu command names, and index the keybindings. Document tabulated-list-sort. (Kill Buffer): Capitalize Buffer Menu. @@ -6443,7 +6443,7 @@ 2007-01-01 Richard Stallman - * commands.texi (User Input): Document keys stolen by window mangers. + * commands.texi (User Input): Document keys stolen by window managers. 2006-12-31 Richard Stallman diff --git a/doc/misc/ChangeLog.1 b/doc/misc/ChangeLog.1 index 2cd3c3f6b54..1157aaab01b 100644 --- a/doc/misc/ChangeLog.1 +++ b/doc/misc/ChangeLog.1 @@ -6011,7 +6011,7 @@ (RSS Feeds): New section. (Built-in table editor): Document M-e and M-a navigate inside table field. - (Stuck projects): Docment that projects identified as + (Stuck projects): Document that projects identified as un-stuck will still be searched for stuck sub-projects. (Paragraphs): Document centering. (Creating timestamps, Agenda commands): Document new diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12 index 88d3a41461c..9de45ef0605 100644 --- a/lisp/ChangeLog.12 +++ b/lisp/ChangeLog.12 @@ -10678,7 +10678,7 @@ for root variables. * progmodes/gdb-ui.el (gdb-pc-address): Rename from gdb-frame-address. - (gdb-frame-address): Re-use to identify frame for watch expression. + (gdb-frame-address): Reuse to identify frame for watch expression. (gdb-var-list, gdb-var-create-handler): Add frame address for root variables. (gdb-init-1, gdb-source, gdb-post-prompt) diff --git a/lisp/ChangeLog.13 b/lisp/ChangeLog.13 index 820110e2fba..8c3eaa38b10 100644 --- a/lisp/ChangeLog.13 +++ b/lisp/ChangeLog.13 @@ -12592,7 +12592,7 @@ * textmodes/org.el (org-agenda-skip): Allow a form for `org-agenda-skip-function'. - (org-agenda-redo): Re-use local settings. + (org-agenda-redo): Reuse local settings. (org-agenda): Store local settings. (org-agenda-deadline-faces): New option. (org-agenda-deadline-face): New function. diff --git a/lisp/ChangeLog.14 b/lisp/ChangeLog.14 index bdf5948e748..d6e2a87056d 100644 --- a/lisp/ChangeLog.14 +++ b/lisp/ChangeLog.14 @@ -16505,7 +16505,7 @@ (diary-list-entries-2): Simplify finding start of date. (diary-show-all-entries, make-diary-entry): Respect non-nil values of pop-up-frames. - (diary-mark-entries-1): Re-use offset in abbreviated-year case. + (diary-mark-entries-1): Reuse offset in abbreviated-year case. (mark-sexp-diary-entries): Remove superfluous call to diary-pull-attrs. 2008-03-27 Dan Nicolaescu @@ -17072,14 +17072,14 @@ * calendar/cal-bahai.el (calendar-bahai-leap-year-p) (calendar-bahai-leap-base, calendar-bahai-from-absolute): Doc fixes. (calendar-absolute-from-bahai): Fix the leap-year case. - (calendar-bahai-from-absolute): Re-use the Gregorian month. + (calendar-bahai-from-absolute): Reuse the Gregorian month. (calendar-bahai-date-string, calendar-bahai-print-date): Handle pre-Bahai dates. * calendar/cal-china.el (chinese-calendar-celestial-stem) (chinese-calendar-terrestrial-branch): Make defcustoms. - * calendar/cal-menu.el (calendar-mouse-holidays): Re-use the title. + * calendar/cal-menu.el (calendar-mouse-holidays): Reuse the title. (calendar-mouse-view-diary-entries): Use or. (calendar-mouse-chinese-date): Remove unused command. (cal-menu-load-hook): Mark as obsolete. diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15 index 3c75ab8ce88..6e346504e08 100644 --- a/lisp/ChangeLog.15 +++ b/lisp/ChangeLog.15 @@ -7702,7 +7702,7 @@ * finder.el: Load finder-inf using `require'. (finder-list-matches): Sorting by status is now the default. - (finder-compile-keywords): Simpify printing. + (finder-compile-keywords): Simplify printing. 2010-08-30 Stefan Monnier diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16 index c898eb61d47..88dcbc77b87 100644 --- a/lisp/ChangeLog.16 +++ b/lisp/ChangeLog.16 @@ -1770,7 +1770,7 @@ (jit-lock--debug-fontifying): New var. (jit-lock--debug-fontify): New function. * subr.el (condition-case-unless-debug): Don't prevent catching the - error, just let the debbugger run. + error, just let the debugger run. * emacs-lisp/timer.el (timer-event-handler): Don't prevent debugging timer code and don't drop errors silently. @@ -4784,7 +4784,7 @@ Convert to defcustom. (gdb-get-source-file): Don't bind pop-up-windows. - * progmodes/gud.el (gud-display-line): Don't specially re-use + * progmodes/gud.el (gud-display-line): Don't specially reuse other frames for the gdb-mi case (Bug#12648). 2012-10-18 Stefan Monnier diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17 index 5036eabf0fd..46f1b973c1e 100644 --- a/lisp/ChangeLog.17 +++ b/lisp/ChangeLog.17 @@ -4339,7 +4339,7 @@ (verilog-beg-of-statement-1, verilog-at-constraint-p): Fix hanging with many curly-bracket pairs, bug663. (verilog-do-indent): Fix electric tab deleting form-feeds. - Note caused by indent-line-to deleting tabls pre 24.5. + Note caused by indent-line-to deleting tables pre 24.5. (verilog-auto-output, verilog-auto-input, verilog-auto-inout) (verilog-auto-inout-module, verilog-auto-inout-in): Doc fixes. (verilog-read-always-signals, verilog-auto-sense-sigs) diff --git a/lisp/ChangeLog.7 b/lisp/ChangeLog.7 index 667cd5e850a..fcf3e53fe04 100644 --- a/lisp/ChangeLog.7 +++ b/lisp/ChangeLog.7 @@ -5232,7 +5232,7 @@ 1998-03-29 Ralph Schleicher - * battery.el (battery-linux-proc-apm): Re-use the temporary + * battery.el (battery-linux-proc-apm): Reuse the temporary buffer. * battery.el (battery-insert-file-contents): Disable code diff --git a/lisp/cedet/ChangeLog.1 b/lisp/cedet/ChangeLog.1 index 5242c73062b..ce6544dcc88 100644 --- a/lisp/cedet/ChangeLog.1 +++ b/lisp/cedet/ChangeLog.1 @@ -1515,7 +1515,7 @@ * semantic/complete.el (semantic-complete-post-command-hook): Exit completion when user has deleted all characters from the prefix. (semantic-displayor-focus-request): Return to previous window when - focussing tags. + focusing tags. * semantic/db-el.el (semanticdb-normalize-one-tag): Make obsolete. (semanticdb-elisp-sym->tag): Use help-function-arglist instead. diff --git a/lisp/gnus/ChangeLog.1 b/lisp/gnus/ChangeLog.1 index 2ce954cca99..d4d5a819c9f 100644 --- a/lisp/gnus/ChangeLog.1 +++ b/lisp/gnus/ChangeLog.1 @@ -663,7 +663,7 @@ 1998-08-07 Gareth Jones * gnus-score.el (gnus-summary-increase-score): Don't downcase - before lookin in char-to-header. + before looking in char-to-header. 1998-08-07 Lars Magne Ingebrigtsen @@ -2745,7 +2745,7 @@ 1997-12-05 Dave Love - * gnus-nocem.el (gnus-nocem-message-wanted-p): Fix paren typpo. + * gnus-nocem.el (gnus-nocem-message-wanted-p): Fix paren typo. (gnus-nocem-issuers): Allow sexp alternative in :type for alists. 1997-12-05 Dave Love diff --git a/lisp/gnus/ChangeLog.2 b/lisp/gnus/ChangeLog.2 index 2d7aeabd8cf..ffa94b739fa 100644 --- a/lisp/gnus/ChangeLog.2 +++ b/lisp/gnus/ChangeLog.2 @@ -6215,7 +6215,7 @@ * pop3.el (pop3-retr): Wait 500 msecs. (pop3-read-response): Ditto. - * gnus-msg.el (gnus-setup-message): Get the evaliation order + * gnus-msg.el (gnus-setup-message): Get the evaluation order right. (gnus-inews-make-draft): New function. (gnus-setup-message): Use it. @@ -9474,7 +9474,7 @@ 2002-03-01 Paul Jarc * message.el (message-get-reply-headers): Downcase email addresses - for comaparisons for duplicate removal. + for comparisons for duplicate removal. 2002-03-01 ShengHuo ZHU diff --git a/lisp/gnus/ChangeLog.3 b/lisp/gnus/ChangeLog.3 index 0fc5c093371..5005e56f5e9 100644 --- a/lisp/gnus/ChangeLog.3 +++ b/lisp/gnus/ChangeLog.3 @@ -13,7 +13,7 @@ 2015-04-01 Eric Abrahamsen - * registry.el (registry-prune): Re-use `registry-full' in + * registry.el (registry-prune): Reuse `registry-full' in `registry-prune'. It's a bit of redundant work, but safer. Also ensure that target-size is an integer. @@ -78,7 +78,7 @@ * gnus-notifications.el (gnus-notifications-action): Raise window frame. (gnus-notifications-action): Allow mark as read. - (gnus-notifications-notify): Show uption to mark as read. + (gnus-notifications-notify): Show option to mark as read. 2015-03-08 Adam Sjøgren diff --git a/lisp/mh-e/ChangeLog.1 b/lisp/mh-e/ChangeLog.1 index f918ab8fe74..011ed123986 100644 --- a/lisp/mh-e/ChangeLog.1 +++ b/lisp/mh-e/ChangeLog.1 @@ -7534,7 +7534,7 @@ (mh-yank-cur-msg): Add a space between sexprs. * mh-utils.el (mh-mark-active-p): New macro which papers over - diffences between GNU Emacs and XEmacs. The variables mark-active + differences between GNU Emacs and XEmacs. The variables mark-active and transient-mark-mode are used in GNU Emacs while zmacs-regions and region-active-p are used in XEmacs. diff --git a/lisp/mh-e/ChangeLog.2 b/lisp/mh-e/ChangeLog.2 index f0032e9db19..d4f650be5f4 100644 --- a/lisp/mh-e/ChangeLog.2 +++ b/lisp/mh-e/ChangeLog.2 @@ -2576,7 +2576,7 @@ use function mh-variants instead. (mh-variant-info, mh-variant-mh-info, mh-variant-mu-mh-info) (mh-variant-nmh-info): Co-locate next to mh-variants, which uses - them. Updated to use mh-file-command-p which is more accurrate + them. Updated to use mh-file-command-p which is more accurate than file-executable-p which returns t for directories. (mh-file-command-p): Move here from mh-utils, since mh-variant-*-info are the only functions to use it. diff --git a/lisp/org/ChangeLog.1 b/lisp/org/ChangeLog.1 index 82b1c832c40..ea3a0424c3c 100644 --- a/lisp/org/ChangeLog.1 +++ b/lisp/org/ChangeLog.1 @@ -12523,7 +12523,7 @@ 2012-01-03 Carsten Dominik (tiny change) * org-clock.el (org-clock-in, org-clock-find-position): - Remove erraneous space in regexp. + Remove erroneous space in regexp. 2012-01-03 Eric Schulte @@ -12700,7 +12700,7 @@ 2012-01-03 Carsten Dominik (tiny change) * org-clock.el (org-clock-in, org-clock-find-position): - Remove erraneous space in regexp. + Remove erroneous space in regexp. 2012-01-03 Jambunathan K @@ -14573,7 +14573,7 @@ 2012-01-03 Nicolas Goaziou - * org-footnote.el (org-footnote-at-definition-p): Re-use + * org-footnote.el (org-footnote-at-definition-p): Reuse `org-footnote-definition-re'. 2012-01-03 Nicolas Goaziou @@ -18471,7 +18471,7 @@ * org-list.el (org-in-item-p): When point was just after org-list-end-re, check wouldn't be done for starting line. So, if - the first line was an item, it wouln't be noticed and function + the first line was an item, it wouldn't be noticed and function would return nil. Simplify and comment code. 2011-07-28 Nicolas Goaziou @@ -19554,7 +19554,7 @@ 2011-07-28 Julien Danjou - * org-agenda.el (org-format-agenda-item): Simplify time comuting. + * org-agenda.el (org-format-agenda-item): Simplify time computing. 2011-07-28 Nicolas Goaziou @@ -22539,7 +22539,7 @@ 2010-11-11 Dan Davison - * org-src.el (org-src-font-lock-fontify-block): Re-use hidden + * org-src.el (org-src-font-lock-fontify-block): Reuse hidden language major mode buffers during fontification. 2010-11-11 Dan Davison @@ -26729,7 +26729,7 @@ 2009-11-20 Eric Schulte * org-exp-blocks.el (org-export-blocks-format-ditaa): Use sha1 - hash keys to cache and re-use images generated by the + hash keys to cache and reuse images generated by the org-exp-blocks interface to ditaa and dot. * org.el (org-format-latex): Latex images are now saved to files @@ -29300,7 +29300,7 @@ statistics. (org-hierarchical-checkbox-statistics): New option. - * org.el (org-cycle): Remove erraneous space character. + * org.el (org-cycle): Remove erroneous space character. * org-icalendar.el (org-icalendar-timezone): Initialize from environment. diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index b2b776d491f..5d05094dff2 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -2029,7 +2029,7 @@ (update_frame_tool_bar): Calculate tool-bar style once per call. Instead of hiding text labels, omit them. Don't use xg_show_toolbar_item; create new GtkToolItems from scratch if - necessary, instead of trying to re-use them. This avoids an + necessary, instead of trying to reuse them. This avoids an annoying animation when changing tool-bars. 2010-12-31 Jan Djärv @@ -2048,7 +2048,7 @@ (ns_set_name): Call ns_set_name_internal. (x_explicitly_set_name): Remove call to ns_set_name_iconic. (x_implicitly_set_name): Ditto. - (x_set_title): Remove commet about EXPLICIT. Call ns_set_name_internal. + (x_set_title): Remove comment about EXPLICIT. Call ns_set_name_internal. (ns_set_name_as_filename): Encode name with ENCODE_UTF_8 (Bug#7517). 2010-12-29 Štěpán Němec (tiny change) @@ -9435,7 +9435,7 @@ continuation line, and start looking for a suitable row from there. - * term.c (append_glyph): Reverse glyphs by pre-pending them, + * term.c (append_glyph): Reverse glyphs by prepending them, rather than appending, if the glyph_row's reversed_p flag is set. Set the resolved_level and bidi_type members of each glyph. diff --git a/src/ChangeLog.13 b/src/ChangeLog.13 index d9736479a04..2f44ba02d98 100644 --- a/src/ChangeLog.13 +++ b/src/ChangeLog.13 @@ -5464,7 +5464,7 @@ (set_horizontal_scroll_bar): New function. (redisplay_window): Set ignore_mouse_drag_p when tool bar has more than one line. Handle horizontal scroll bars. - (note_mouse_highlight): Handle horizontal scrol bars. + (note_mouse_highlight): Handle horizontal scroll bars. (expose_frame): Set dimensions of XRectangle from frame's text sizes. (Vvoid_text_area_pointer): Update doc-string. @@ -8437,7 +8437,7 @@ * xdisp.c (syms_of_xdisp): Doc clarification (bug#15657). - * keyboard.c (Frecursive_edit): Say more precicely how throwing + * keyboard.c (Frecursive_edit): Say more precisely how throwing `exit' works (bug#15865). 2014-02-07 Martin Rudalics @@ -16678,7 +16678,7 @@ 2013-05-27 Eli Zaretskii - * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a + * xdisp.c (pos_visible_p): When CHARPOS is displayed from a display vector, and we backtrack, handle the case that the previous character position is also displayed from a display vector or covered by a display string or image. (Bug#14476) diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index 1f479a89ed8..f50b8d134c3 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -10802,7 +10802,7 @@ (display_mode_element): Ditto. (echo_area_display): Don't display if frame has no pools yet. (echo_area_display): Work with window matrix for mini window. - (redisplay_window): Use window marix for mini window. + (redisplay_window): Use window matrix for mini window. (display_text_line): Assume HPOS and VPOS are window relative and use that for DISPLAY_STRING. diff --git a/src/ChangeLog.9 b/src/ChangeLog.9 index d005b51604b..09210f8eea9 100644 --- a/src/ChangeLog.9 +++ b/src/ChangeLog.9 @@ -11622,7 +11622,7 @@ (set_font_frame_param): If `font' is specified in lface, use it. (Finternal_get_lisp_face_attribute): Handle `font' slot in lface. (lface_same_font_attributes_p): Likewise. - (make_realized_face): Arguent changed. Caller changed. Set + (make_realized_face): Argument changed. Caller changed. Set face->ascii_face to face itself. (free_realized_face): Free face->fontset if face is for ASCII. (face_suitable_for_iso8859_1_p, face_suitable_for_charset_p) commit 1d5028ad0414cad458aac1102d3612e4956068c5 Author: Michael Albinus Date: Sun Dec 10 12:26:38 2023 +0100 dired-listing-switches handles connection-local values if exist * doc/emacs/dired.texi (Dired Enter): * doc/misc/tramp.texi (Frequently Asked Questions): * etc/NEWS: 'dired-listing-switches' handles connection-local values if exist. * doc/lispref/variables.texi (Applying Connection Local Variables): Fix decription of connection-local-default-application. * lisp/dired.el (dired-listing-switches): Adapt docstring. (dired-internal-noselect, dired-mode): * lisp/dired-x.el (dired-virtual): * lisp/files.el (recover-file, recover-session): * lisp/net/ange-ftp.el (ange-ftp-get-files): Use connection-local value of `dired-listing-switches'. * lisp/files-x.el (connection-local-value): Adapt docstring. * lisp/man.el (Man-shell-file-name): Use `connection-local-value'. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 87124e962ca..6089cfe833d 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -142,6 +142,10 @@ Dired Enter special characters and allow Dired to handle them better. (You can also use the @kbd{C-u C-x d} command to add @samp{-b} temporarily.) +@code{dired-listing-switches} can be declared as connection-local +variable to adjust it to match what a remote system expects +(@pxref{Connection Variables}). + @vindex dired-switches-in-mode-line Dired displays in the mode line an indication of what were the switches used to invoke @command{ls}. By default, Dired will try to diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index bf5fbe84407..36468bddffa 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2487,9 +2487,10 @@ Applying Connection Local Variables @defvar connection-local-default-application The default application, a symbol, to be applied in -@code{with-connection-local-variables}. It defaults to @code{tramp}, -but you can let-bind it to change the application temporarily -(@pxref{Local Variables}). +@code{with-connection-local-variables} and +@code{connection-local-value}. It defaults to @code{tramp}, but you +can let-bind it to change the application temporarily (@pxref{Local +Variables}). This variable must not be changed globally. @end defvar @@ -2547,7 +2548,10 @@ Applying Connection Local Variables @defmac connection-local-value symbol &optional application This macro returns the connection-local value of @var{symbol} for -@var{application}. If @var{symbol} does not have a connection-local +@var{application}. If @var{application} is @code{nil}, the value of +@code{connection-local-default-application} is used. + +If @var{symbol} does not have a connection-local binding, the value is the default binding of the variable. @end defmac diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 5f79c195e42..7a95a6dbc98 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -5322,17 +5322,39 @@ Frequently Asked Questions @item Remote host does not understand default options for directory listing -Emacs computes the @command{dired} options based on the local host but -if the remote host cannot understand the same @command{ls} command, -then set them with a hook as follows: +@vindex dired-listing-switches +Emacs computes the @command{dired} options based on the local host. +Since @w{Emacs 30}, these options can be set connection-local. +@ifinfo +@xref{Connection Variables, , , emacs}. +@end ifinfo + +@lisp +@group +(connection-local-set-profile-variables + 'my-dired-profile + '((dired-listing-switches . "-ahl"))) +@end group + +@group +(connection-local-set-profiles + '(:application tramp :machine "remotehost") + 'my-dired-profile) +@end group +@end lisp + +@vindex dired-actual-switches +In older Emacsen, you can set the @command{dired} options with a hook +as follows: @lisp @group (add-hook 'dired-before-readin-hook (lambda () - (when (file-remote-p default-directory) - (setq dired-actual-switches "-al")))) + (when (string-equal + (file-remote-p default-directory 'host) "remotehost") + (setq dired-actual-switches "-ahl")))) @end group @end lisp diff --git a/etc/NEWS b/etc/NEWS index 60391cfb22e..fbfe1084b8f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -517,6 +517,10 @@ marked or clicked on files according to the OS conventions. For example, on systems supporting XDG, this runs 'xdg-open' on the files. ++++ +*** 'dired-listing-switches' handles connection-local values if exist. +This allows to customize different switches for different remote machines. + ** Ediff --- diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 04b3c783084..e094c0b4ca7 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -613,7 +613,8 @@ dired-virtual (insert " " (directory-file-name (file-name-directory default-directory)) ":\n")) - (dired-mode dirname (or switches dired-listing-switches)) + (dired-mode + dirname (or switches (connection-local-value dired-listing-switches))) (setq mode-name "Virtual Dired" revert-buffer-function 'dired-virtual-revert dired-subdir-alist nil) diff --git a/lisp/dired.el b/lisp/dired.el index 36ca54efc37..33e38ed2c1c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -75,7 +75,9 @@ dired-listing-switches On systems such as MS-DOS and MS-Windows, which use `ls' emulation in Lisp, some of the `ls' switches are not supported; see the doc string of -`insert-directory' in `ls-lisp.el' for more details." +`insert-directory' in `ls-lisp.el' for more details. + +For remote Dired buffers, this option supports connection-local values." :type 'string :group 'dired) @@ -1383,7 +1385,8 @@ dired-internal-noselect ;; is passed in directory name syntax ;; if it was the name of a directory at all. (file-name-directory dirname))) - (or switches (setq switches dired-listing-switches)) + (or switches + (setq switches (connection-local-value dired-listing-switches))) (if mode (funcall mode) (dired-mode dir-or-list switches)) ;; default-directory and dired-actual-switches are set now @@ -2714,7 +2717,8 @@ dired-mode (expand-file-name (if (listp dired-directory) (car dired-directory) dired-directory))) - (setq-local dired-actual-switches (or switches dired-listing-switches)) + (setq-local dired-actual-switches + (or switches (connection-local-value dired-listing-switches))) (setq-local font-lock-defaults '(dired-font-lock-keywords t nil nil beginning-of-line)) (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data) diff --git a/lisp/files-x.el b/lisp/files-x.el index b2a9cf9bc5e..467981f3f8f 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -928,8 +928,10 @@ setq-connection-local ;;;###autoload (defmacro connection-local-value (variable &optional application) "Return connection-local VARIABLE for APPLICATION in `default-directory'. -If VARIABLE does not have a connection-local binding, the value -is the default binding of the variable." +If APPLICATION is nil, the value of +`connection-local-default-application' is used. +If VARIABLE does not have a connection-local binding, the return +value is the default binding of the variable." (unless (symbolp variable) (signal 'wrong-type-argument (list 'symbolp variable))) `(let (connection-local-variables-alist file-local-variables-alist) diff --git a/lisp/files.el b/lisp/files.el index 1cdcec23b11..f87e7807301 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7087,7 +7087,7 @@ recover-file (when (window-live-p window) (quit-restore-window window 'kill))))) (with-current-buffer standard-output - (let ((switches dired-listing-switches)) + (let ((switches (connection-local-value dired-listing-switches))) (if (file-symlink-p file) (setq switches (concat switches " -L"))) ;; Use insert-directory-safely, not insert-directory, @@ -7139,7 +7139,7 @@ recover-session ;; hook. (dired-mode-hook (delete 'dired-omit-mode dired-mode-hook))) (dired (concat auto-save-list-file-prefix "*") - (concat dired-listing-switches " -t"))) + (concat (connection-local-value dired-listing-switches) " -t"))) (use-local-map (nconc (make-sparse-keymap) (current-local-map))) (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish) (save-excursion diff --git a/lisp/man.el b/lisp/man.el index 3efa29d7aad..1a5512c74f4 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -579,7 +579,7 @@ Man-default-directory (defun Man-shell-file-name () "Return a proper shell file name, respecting remote directories." (or ; This works also in the local case. - (with-connection-local-variables shell-file-name) + (connection-local-value shell-file-name) "/bin/sh")) (defun Man-header-file-path () diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 3d64b7976b3..4e4db34a78d 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2850,7 +2850,8 @@ ange-ftp-get-files (ange-ftp-switches-ok dired-actual-switches)) (and (boundp 'dired-listing-switches) (ange-ftp-switches-ok - dired-listing-switches)) + (connection-local-value + dired-listing-switches))) "-al") t no-error) (gethash directory ange-ftp-files-hashtable))))) commit 5e03a621efc00b3cfe52442670175dd3564c4e1e Author: Eli Zaretskii Date: Sun Dec 10 11:41:35 2023 +0200 ; * lisp/progmodes/c-ts-mode.el (c-ts-mode--else-heuristic): Doc fix. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 05758d48f52..e708420148a 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -357,8 +357,8 @@ c-ts-mode--standalone-grandparent parent (treesit-node-parent parent) bol args)) (defun c-ts-mode--else-heuristic (node parent bol &rest _) - "Heuristic matcher for when else is followed by a closing bracket. -NODE, PARENT, BOL are the same as other matchers." + "Heuristic matcher for when \"else\" is followed by a closing bracket. +NODE, PARENT, and BOL are the same as in other matchers." (and (null node) (save-excursion (forward-line -1) commit f0734e1c0d19d9f244b7ab60dcd98f8d031e3d38 Author: Yuan Fu Date: Sun Dec 10 01:24:25 2023 -0800 Fix c-ts-mode indent heuristic (bug#67417) This is a continuation of the first two patches for bug#67417. The c-ts-mode--prev-line-match heuristic we added is too broad, so for now we are just adding a very specific heuristic for the else case. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--prev-line-match): Remove function. (c-ts-mode--else-heuristic): New function. (c-ts-mode--indent-styles): Use c-ts-mode--else-heuristic. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 677273afaac..05758d48f52 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -356,14 +356,15 @@ c-ts-mode--standalone-grandparent (apply (alist-get 'standalone-parent treesit-simple-indent-presets) parent (treesit-node-parent parent) bol args)) -(defun c-ts-mode--prev-line-match (regexp) - "An indentation matcher that matches if previous line matches REGEXP." - (lambda (_n _p bol &rest _) - (save-excursion - (goto-char bol) - (forward-line -1) - (back-to-indentation) - (looking-at-p regexp)))) +(defun c-ts-mode--else-heuristic (node parent bol &rest _) + "Heuristic matcher for when else is followed by a closing bracket. +NODE, PARENT, BOL are the same as other matchers." + (and (null node) + (save-excursion + (forward-line -1) + (looking-at (rx (* whitespace) "else" (* whitespace) eol))) + (let ((next-node (treesit-node-first-child-for-pos parent bol))) + (equal (treesit-node-type next-node) "}")))) (defun c-ts-mode--first-sibling (node parent &rest _) "Matches when NODE is the \"first sibling\". @@ -383,13 +384,12 @@ c-ts-mode--indent-styles MODE is either `c' or `cpp'." (let ((common `((c-ts-mode--for-each-tail-body-matcher prev-line c-ts-mode-indent-offset) - ;; If the user types "if (...)" and hits RET, they expect - ;; point on the empty line to be indented; this rule - ;; does that. - ((and no-node - (c-ts-mode--prev-line-match - ,(rx (or "if" "else" "while" "do" "for")))) - prev-line c-ts-mode-indent-offset) + ;; If the user types "else" and hits RET, they expect point + ;; on the empty line to be indented; this rule does that. + ;; This heuristic is intentionally very specific because + ;; more general heuristic is very error-prone, see + ;; discussion in bug#67417. + (c-ts-mode--else-heuristic prev-line c-ts-mode-indent-offset) ((parent-is "translation_unit") column-0 0) ((query "(ERROR (ERROR)) @indent") column-0 0) commit 08fc6bace202a13d93fc76943c41f19acaab9c73 Author: nverno Date: Tue Nov 21 16:33:04 2023 -0800 Fix c-ts-mode indentation (bug#67357) 1. In a compund_statement, we indent the first sibling against the parent, and the rest siblings against their previous sibling. But this strategy falls apart when the first sibling is not on its own line. We should regard the first sibling that is on its own line as the "first sibling"", and indent it against the parent. 2. In linux style, in a do-while statement, if the do-body is bracket-less, the "while" keyword is indented to the same level as the do-body. It should be indented to align with the "do" keyword instead. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--no-prev-standalone-sibling): New function. (c-ts-mode--indent-styles): Use c-ts-mode--no-prev-standalone-sibling. Add while keyword indent rule. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New tests. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 21fb0ca9e53..677273afaac 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -321,7 +321,8 @@ c-ts-mode--anchor-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. + ;; right, go a step further. (E.g., comment after a + ;; statement.) (_ (goto-char (treesit-node-start prev-sibling)) (if (looking-back (rx bol (* whitespace)) (line-beginning-position)) @@ -364,6 +365,19 @@ c-ts-mode--prev-line-match (back-to-indentation) (looking-at-p regexp)))) +(defun c-ts-mode--first-sibling (node parent &rest _) + "Matches when NODE is the \"first sibling\". +\"First sibling\" is defined as: the first child node of PARENT +such that it's on its own line. NODE is the node to match and +PARENT is its parent." + (let ((prev-sibling (treesit-node-prev-sibling node t))) + (or (null prev-sibling) + (save-excursion + (goto-char (treesit-node-start prev-sibling)) + (<= (line-beginning-position) + (treesit-node-start parent) + (line-end-position)))))) + (defun c-ts-mode--indent-styles (mode) "Indent rules supported by `c-ts-mode'. MODE is either `c' or `cpp'." @@ -457,7 +471,11 @@ c-ts-mode--indent-styles ((parent-is "field_declaration_list") c-ts-mode--anchor-prev-sibling 0) ;; Statement in {} blocks. - ((or (match nil "compound_statement" nil 1 1) + ((or (and (parent-is "compound_statement") + ;; If the previous sibling(s) are not on their + ;; own line, indent as if this node is the first + ;; sibling (Bug#67357) + c-ts-mode--first-sibling) (match null "compound_statement")) standalone-parent c-ts-mode-indent-offset) ((parent-is "compound_statement") c-ts-mode--anchor-prev-sibling 0) @@ -470,6 +488,7 @@ c-ts-mode--indent-styles ((parent-is "if_statement") standalone-parent c-ts-mode-indent-offset) ((parent-is "else_clause") standalone-parent c-ts-mode-indent-offset) ((parent-is "for_statement") standalone-parent c-ts-mode-indent-offset) + ((match "while" "do_statement") parent-bol 0) ; (do_statement "while") ((parent-is "while_statement") standalone-parent c-ts-mode-indent-offset) ((parent-is "do_statement") standalone-parent c-ts-mode-indent-offset) diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index bac76fb7378..2fd26d75844 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -330,7 +330,7 @@ label: Name: Bracket-less Block-Statement (Linux Style) (bug#61026) -=-=-= +=-= int main() { while (true) if (true) { @@ -351,6 +351,8 @@ int main() { if (true) { puts ("Hello"); } + else + puts("Hello"); } =-=-= @@ -399,6 +401,34 @@ void foo( } =-=-= +Name: Block-Statement where first siblings are comments (Linux Style) + +=-= +int main() { + while (true) { /* foo */ + if (true) { // bar + puts ("Hello"); + } + } + for (;;) { // 1. fooo + /* 2. baaa */ + /* 3. rrr */ + if (true) + // 2. baaa + puts ("Hello"); + } + if (1) { // 1 + /* + * 2 + */ + if (1) /*3*/ { + /* 4 */ + puts("Hello"); + } + } +} +=-=-= + Name: Initializer List (Linux Style) (Bug#61398) =-= @@ -498,3 +528,19 @@ main (void) { | =-=-= + +Code: + (lambda () + (c-ts-mode) + (setq-local indent-tabs-mode nil) + (goto-line 3) + (indent-for-tab-command)) + +Name: Block-Statement where previous sibling is comment + +=-= +int main() { + puts ("Hello"); // unusual indent and has trailing comment. + return true; // Should align with previous non-comment sibling (rather than one level up against parent). +} +=-=-= commit 71bc2815ccdf443d49865ea913048658a6634823 Author: nverno Date: Sat Dec 9 11:35:44 2023 -0800 Add font-locking for hash-bang lines in typescript-ts-mode. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Add font-lock for hash bang line. diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 0fbac709c63..bcc08511337 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -205,7 +205,7 @@ typescript-ts-mode--font-lock-settings (treesit-font-lock-rules :language language :feature 'comment - `((comment) @font-lock-comment-face) + `([(comment) (hash_bang_line)] @font-lock-comment-face) :language language :feature 'constant commit db8347c8c87c774f2d60ee9fce65b20ef5743a44 Author: nverno Date: Sat Dec 9 11:28:15 2023 -0800 Add font-locking for hash-bang lines in js-ts-mode * lisp/progmodes/js.el (js--treesit-font-lock-settings): Add font-lock for hash bang line. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 07d12cb7b4b..71aa5cbea68 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3506,7 +3506,7 @@ js--treesit-font-lock-settings :language 'javascript :feature 'comment - '((comment) @font-lock-comment-face) + '([(comment) (hash_bang_line)] @font-lock-comment-face) :language 'javascript :feature 'constant commit 213d30b3eaad4ffbe9685005ecc92201ab8cb806 Author: Stefan Monnier Date: Sat Dec 9 18:03:48 2023 -0500 Tweak doc of `analyze-text-conversion` vs `post-self-insert-hook` * lisp/simple.el (analyze-text-conversion): Fix typo. * lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Add comment about `post-text-conversion-hook`. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 227a6af2a6b..4842de15164 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -256,6 +256,9 @@ c-initialize-cc-mode (put 'c-initialize-cc-mode initprop c-initialization-ok)))) ;; Set up text conversion, for Emacs >= 30.0 + ;; This is needed here because CC-mode's implementation of + ;; electricity does not rely on `post-self-insert-hook' (which is + ;; already handled adequately by `analyze-text-conversion'). (when (boundp 'post-text-conversion-hook) (add-hook 'post-text-conversion-hook #'c-post-text-conversion nil t)) diff --git a/lisp/simple.el b/lisp/simple.el index fab6b279189..d60acf5477a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -11181,7 +11181,7 @@ analyze-text-conversion and delete the adjascent pair if `electric-pair-delete-adjacent-pairs'. - - Run `post-self-insert-functions' for the last character of + - Run `post-self-insert-hook' for the last character of any inserted text so that modes such as `electric-pair-mode' can work. commit 91f2ade57bb72e9bb4a44da44e5dc69adb3c7584 Author: Dmitry Gutov Date: Sat Dec 9 19:04:55 2023 +0200 ruby-mode: Better detect regexp vs division (bug#67569) * lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re): Add grouping around methods from the whitelist. (ruby-syntax-propertize): Also look for spaces around the slash. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index b252826680c..0ecb3579278 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2124,7 +2124,7 @@ ruby-find-library-file "or" "not" "&&" "||")) ;; Method name from the list. "\\|\\_<" - (regexp-opt ruby-syntax-methods-before-regexp) + (regexp-opt ruby-syntax-methods-before-regexp t) "\\)\\s *") "Regexp to match text that can be followed by a regular expression.")) @@ -2182,14 +2182,20 @@ ruby-syntax-propertize (when (save-excursion (forward-char -1) (cl-evenp (skip-chars-backward "\\\\"))) - (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) + (let ((state (save-excursion (syntax-ppss (match-beginning 1)))) + division-like) (when (or ;; Beginning of a regexp. (and (null (nth 8 state)) (save-excursion + (setq division-like + (or (eql (char-after) ?\s) + (not (eql (char-before (1- (point))) ?\s)))) (forward-char -1) (looking-back ruby-syntax-before-regexp-re - (line-beginning-position)))) + (line-beginning-position))) + (not (and division-like + (match-beginning 2)))) ;; End of regexp. We don't match the whole ;; regexp at once because it can have ;; string interpolation inside, or span diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 117385ea3e8..a931541ba35 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -157,6 +157,18 @@ ruby-slash-char-literal-is-not-mistaken-for-regexp (ert-deftest ruby-regexp-is-not-mistaken-for-slash-symbol () (ruby-assert-state "x = /foo:/" 3 nil)) +(ert-deftest ruby-slash-not-regexp-when-surrounded-by-spaces () + (ruby-assert-state "x = index / 3" 3 nil)) + +(ert-deftest ruby-slash-not-regexp-when-no-spaces () + (ruby-assert-state "x = index/3" 3 nil)) + +(ert-deftest ruby-regexp-not-division-when-only-space-before () + (ruby-assert-state "x = index /3" 3 ?/)) + +(ert-deftest ruby-slash-not-regexp-when-only-space-after () + (ruby-assert-state "x = index/ 3" 3 nil)) + (ert-deftest ruby-indent-simple () (ruby-should-indent-buffer "if foo commit 127de202b83f841b9f73ed6142c9e369addb18f3 Author: Manuel Giraud Date: Sat Dec 9 13:02:19 2023 +0100 Fix desktop-save for dired buffers (bug#66697) * lisp/dired.el (dired-desktop-save-p): Move all logic here. Carry on when 'desktop-files-not-to-save' is nil. (dired-desktop-buffer-misc-data): Use it. diff --git a/lisp/dired.el b/lisp/dired.el index 7f4b96353ee..36ca54efc37 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4989,14 +4989,15 @@ dired-dnd-handle-file (defun dired-desktop-save-p () "Should `dired-directory' be desktop saved?" - (if (consp dired-directory) - (not (string-match-p desktop-files-not-to-save (car dired-directory))) - (not (string-match-p desktop-files-not-to-save dired-directory)))) + (or (null desktop-files-not-to-save) + (and (stringp desktop-files-not-to-save) + (if (consp dired-directory) + (not (string-match-p desktop-files-not-to-save (car dired-directory))) + (not (string-match-p desktop-files-not-to-save dired-directory)))))) (defun dired-desktop-buffer-misc-data (dirname) "Auxiliary information to be saved in desktop file." - (when (and (stringp desktop-files-not-to-save) - (dired-desktop-save-p)) + (when (dired-desktop-save-p) (cons ;; Value of `dired-directory'. (if (consp dired-directory) commit 20be8ed61fa07d73b356e74a7986aa05e091faa3 Author: Eli Zaretskii Date: Sat Dec 9 07:59:08 2023 -0500 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index f062f3bf8de..814507b3d04 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -302,7 +302,7 @@ ad-default-compilation-action (fn FUNCTION ARGS &rest BODY)" nil t) (function-put 'defadvice 'doc-string-elt 3) (function-put 'defadvice 'lisp-indent-function 2) -(make-obsolete 'defadvice '"use advice-add or define-advice" "30.1") +(make-obsolete 'defadvice '"use `advice-add' or `define-advice'" "30.1") (register-definition-prefixes "advice" '("ad-")) @@ -1946,7 +1946,7 @@ "bibtex" (register-definition-prefixes "bibtex-style" '("bibtex-style-")) -;;; Generated autoloads from use-package/bind-key.el +;;; Generated autoloads from bind-key.el (push (purecopy '(bind-key 2 4 1)) package--builtin-versions) (autoload 'bind-key "bind-key" "\ @@ -2608,7 +2608,7 @@ browse-url-default-handlers (fn URL &optional NEW-WINDOW)" t) (make-obsolete 'browse-url-w3 'nil "29.1") (autoload 'browse-url-w3-gnudoit "browse-url" "\ -Ask another Emacs running gnuserv to load the URL using the W3 browser. +Ask another Emacs running emacsclient to load the URL using the W3 browser. The `browse-url-gnudoit-program' program is used with options given by `browse-url-gnudoit-args'. Default to the URL around or before point. @@ -4668,14 +4668,14 @@ "cl-macs" (autoload 'cl-print-to-string-with-limit "cl-print" "\ Return a string containing a printed representation of VALUE. Attempt to get the length of the returned string under LIMIT -characters with appropriate settings of `print-level' and -`print-length.' Use PRINT-FUNCTION to print, which should take -the arguments VALUE and STREAM and which should respect -`print-length' and `print-level'. LIMIT may be nil or zero in -which case PRINT-FUNCTION will be called with `print-level' and -`print-length' bound to nil, and it can also be t in which case -PRINT-FUNCTION will be called with the current values of `print-level' -and `print-length'. +characters with appropriate settings of `print-level', +`print-length', and `cl-print-string-length'. Use +PRINT-FUNCTION to print, which should take the arguments VALUE +and STREAM and which should respect `print-length', +`print-level', and `cl-print-string-length'. LIMIT may be nil or +zero in which case PRINT-FUNCTION will be called with these +settings bound to nil, and it can also be t in which case +PRINT-FUNCTION will be called with their current values. Use this function with `cl-prin1' to print an object, abbreviating it with ellipses to fit within a size limit. @@ -4857,10 +4857,6 @@ "comint" ;;; Generated autoloads from emacs-lisp/comp.el (put 'no-native-compile 'safe-local-variable 'booleanp) -(autoload 'comp-subr-trampoline-install "comp" "\ -Make SUBR-NAME effectively advice-able when called from native code. - -(fn SUBR-NAME)") (autoload 'comp-c-func-name "comp" "\ Given NAME, return a name suitable for the native code. Add PREFIX in front of it. If FIRST is not nil, pick the first @@ -4868,42 +4864,16 @@ "comint" clashes. (fn NAME PREFIX &optional FIRST)") +(autoload 'comp-trampoline-compile "comp" "\ +Synthesize compile and return a trampoline for SUBR-NAME. + +(fn SUBR-NAME)") (autoload 'comp-clean-up-stale-eln "comp" "\ Remove all FILE*.eln* files found in `native-comp-eln-load-path'. The files to be removed are those produced from the original source filename (including FILE). (fn FILE)") -(autoload 'native--compile-async "comp" "\ -Compile FILES asynchronously. -FILES is one filename or a list of filenames or directories. - -If optional argument RECURSIVELY is non-nil, recurse into -subdirectories of given directories. - -If optional argument LOAD is non-nil, request to load the file -after compiling. - -The optional argument SELECTOR has the following valid values: - -nil -- Select all files. -a string -- A regular expression selecting files with matching names. -a function -- A function selecting files with matching names. - -The variable `native-comp-async-jobs-number' specifies the number -of (commands) to run simultaneously. - -LOAD can also be the symbol `late'. This is used internally if -the byte code has already been loaded when this function is -called. It means that we request the special kind of load -necessary in that situation, called \"late\" loading. - -During a \"late\" load, instead of executing all top-level forms -of the original files, only function definitions are -loaded (paying attention to have these effective only if the -bytecode definition was not changed in the meantime). - -(fn FILES &optional RECURSIVELY LOAD SELECTOR)") (autoload 'comp-lookup-eln "comp" "\ Given a Lisp source FILENAME return the corresponding .eln file if found. Search happens in `native-comp-eln-load-path'. @@ -4940,9 +4910,43 @@ "comint" directory (the last entry in `native-comp-eln-load-path') unless `native-compile-target-directory' is non-nil. If the environment variable \"NATIVE_DISABLED\" is set, only byte compile.") -(autoload 'native-compile-async "comp" "\ +(register-definition-prefixes "comp" '("comp-" "native-comp" "no-native-compile")) + + +;;; Generated autoloads from cedet/semantic/wisent/comp.el + +(register-definition-prefixes "semantic/wisent/comp" '("wisent-")) + + +;;; Generated autoloads from emacs-lisp/comp-common.el + +(autoload 'comp-function-type-spec "comp-common" "\ +Return the type specifier of FUNCTION. + +This function returns a cons cell whose car is the function +specifier, and cdr is a symbol, either `inferred' or `know'. +If the symbol is `inferred', the type specifier is automatically +inferred from the code itself by the native compiler; if it is +`know', the type specifier comes from `comp-known-type-specifiers'. + +(fn FUNCTION)") +(register-definition-prefixes "comp-common" '("comp-" "native-comp-")) + + +;;; Generated autoloads from emacs-lisp/comp-cstr.el + +(register-definition-prefixes "comp-cstr" '("comp-" "with-comp-cstr-accessors")) + + +;;; Generated autoloads from emacs-lisp/comp-run.el + +(autoload 'comp-subr-trampoline-install "comp-run" "\ +Make SUBR-NAME effectively advice-able when called from native code. + +(fn SUBR-NAME)") +(autoload 'native--compile-async "comp-run" "\ Compile FILES asynchronously. -FILES is one file or a list of filenames or directories. +FILES is one filename or a list of filenames or directories. If optional argument RECURSIVELY is non-nil, recurse into subdirectories of given directories. @@ -4959,28 +4963,38 @@ "comint" The variable `native-comp-async-jobs-number' specifies the number of (commands) to run simultaneously. +LOAD can also be the symbol `late'. This is used internally if +the byte code has already been loaded when this function is +called. It means that we request the special kind of load +necessary in that situation, called \"late\" loading. + +During a \"late\" load, instead of executing all top-level forms +of the original files, only function definitions are +loaded (paying attention to have these effective only if the +bytecode definition was not changed in the meantime). + (fn FILES &optional RECURSIVELY LOAD SELECTOR)") -(autoload 'comp-function-type-spec "comp" "\ -Return the type specifier of FUNCTION. +(autoload 'native-compile-async "comp-run" "\ +Compile FILES asynchronously. +FILES is one file or a list of filenames or directories. -This function returns a cons cell whose car is the function -specifier, and cdr is a symbol, either `inferred' or `know'. -If the symbol is `inferred', the type specifier is automatically -inferred from the code itself by the native compiler; if it is -`know', the type specifier comes from `comp-known-type-specifiers'. +If optional argument RECURSIVELY is non-nil, recurse into +subdirectories of given directories. -(fn FUNCTION)") -(register-definition-prefixes "comp" '("comp-" "make-comp-edge" "native-comp" "no-native-compile")) +If optional argument LOAD is non-nil, request to load the file +after compiling. - -;;; Generated autoloads from cedet/semantic/wisent/comp.el +The optional argument SELECTOR has the following valid values: -(register-definition-prefixes "semantic/wisent/comp" '("wisent-")) +nil -- Select all files. +a string -- A regular expression selecting files with matching names. +a function -- A function selecting files with matching names. - -;;; Generated autoloads from emacs-lisp/comp-cstr.el +The variable `native-comp-async-jobs-number' specifies the number +of (commands) to run simultaneously. -(register-definition-prefixes "comp-cstr" '("comp-" "with-comp-cstr-accessors")) +(fn FILES &optional RECURSIVELY LOAD SELECTOR)") +(register-definition-prefixes "comp-run" '("comp-" "native-comp")) ;;; Generated autoloads from vc/compare-w.el @@ -5239,6 +5253,24 @@ dynamic-completion-mode (autoload 'dynamic-completion-mode "completion" "\ Toggle dynamic word-completion on or off. +When this minor mode is turned on, typing \\`M-RET' or \\`C-RET' +invokes the command `complete', which completes the word or +symbol at point using the record of words/symbols you used +previously and the previously-inserted completions. Typing +a word or moving point across it constitutes \"using\" the +word. + +By default, the database of all the dynamic completions that +were inserted by \\[complete] is saved on the file specified +by `save-completions-file-name' when you exit Emacs, and will +be loaded from that file when this mode is enabled in a future +Emacs session. + +The following important options control the various aspects of +this mode: `enable-completion', `save-completions-flag', and +`save-completions-retention-time'. Few other less important +options can be found in the `completion' group. + This is a global minor mode. If called interactively, toggle the `Dynamic-Completion mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable @@ -5257,6 +5289,38 @@ dynamic-completion-mode (fn &optional ARG)" t) (register-definition-prefixes "completion" '("*c-def-regexp*" "*lisp-def-regexp*" "accept-completion" "add-" "cdabbrev-" "check-completion-length" "clear-all-completions" "cmpl-" "complet" "current-completion-source" "delete-completion" "enable-completion" "find-" "inside-locate-completion-entry" "interactive-completion-string-reader" "kill-" "list-all-completions" "load-completions-from-file" "make-c" "next-cdabbrev" "num-cmpl-sources" "reset-cdabbrev" "save" "set-c" "symbol-" "use-completion-")) + +;;; Generated autoloads from completion-preview.el + +(autoload 'completion-preview-mode "completion-preview" "\ +Show in-buffer completion suggestions in a preview as you type. + +This mode automatically shows and updates the completion preview +according to the text around point. +\\When the preview is visible, \\[completion-preview-insert] +accepts the completion suggestion, +\\[completion-preview-next-candidate] cycles forward to the next +completion suggestion, and \\[completion-preview-prev-candidate] +cycles backward. + +This is a minor mode. If called interactively, toggle the +`Completion-Preview mode' mode. If the prefix argument is +positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. +Disable the mode if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `completion-preview-mode'. + +The mode's hook is called both when the mode is enabled and when +it is disabled. + +(fn &optional ARG)" t) +(register-definition-prefixes "completion-preview" '("completion-preview-")) + ;;; Generated autoloads from textmodes/conf-mode.el @@ -5569,16 +5633,8 @@ "copyright" whitespace inserted by semis and braces in `auto-newline'-mode by consequent \\[cperl-electric-backspace]. -If your site has perl5 documentation in info format, you can use commands -\\[cperl-info-on-current-command] and \\[cperl-info-on-command] to access it. -These keys run commands `cperl-info-on-current-command' and -`cperl-info-on-command', which one is which is controlled by variable -`cperl-info-on-command-no-prompt' and `cperl-clobber-lisp-bindings' -(in turn affected by `cperl-hairy'). - -Even if you have no info-format documentation, short one-liner-style -help is available on \\[cperl-get-help], and one can run perldoc or -man via menu. +Short one-liner-style help is available on \\[cperl-get-help], +and one can run perldoc or man via menu. It is possible to show this help automatically after some idle time. This is regulated by variable `cperl-lazy-help-time'. Default with @@ -5669,7 +5725,7 @@ "copyright" (fn WORD)" t) (autoload 'cperl-perldoc-at-point "cperl-mode" "\ Run a `perldoc' on the word around point." t) -(register-definition-prefixes "cperl-mode" '("cperl-" "imenu-max-items")) +(register-definition-prefixes "cperl-mode" '("cperl-")) ;;; Generated autoloads from progmodes/cpp.el @@ -6249,6 +6305,13 @@ custom-file (fn &rest ARGS)") (autoload 'custom-save-icons "cus-edit" "\ Save all customized icons in `custom-file'.") +(autoload 'customize-dirlocals "cus-edit" "\ +Customize Directory Local Variables in the current directory. + +With optional argument FILENAME non-nil, customize the `.dir-locals.el' file +that FILENAME specifies. + +(fn &optional FILENAME)" t) (register-definition-prefixes "cus-edit" '("Custom-" "cus" "widget-")) @@ -6278,7 +6341,7 @@ "cus-edit" omitted, a buffer named *Custom Themes* is used. (fn &optional BUFFER)" t) -(register-definition-prefixes "cus-theme" '("custom-" "describe-theme-1")) +(register-definition-prefixes "cus-theme" '("custom-" "describe-theme-")) ;;; Generated autoloads from cedet/ede/custom.el @@ -6632,6 +6695,13 @@ "dcl-mode" (setq debugger 'debug) (autoload 'debug "debug" "\ Enter debugger. \\`\\[debugger-continue]' returns from the debugger. + +In interactive sessions, this switches to a backtrace buffer and shows +the Lisp backtrace of function calls there. In batch mode (more accurately, +when `noninteractive' is non-nil), it shows the Lisp backtrace on the +standard error stream (unless `backtrace-on-error-noninteractive' is nil), +and then kills Emacs, causing it to exit with a negative exit code. + Arguments are mainly for use when this is called from the internals of the evaluator. @@ -7261,29 +7331,36 @@ "diary-lib" (autoload 'dictionary-mode "dictionary" "\ Mode for searching a dictionary. + This is a mode for searching a dictionary server implementing the protocol defined in RFC 2229. This is a quick reference to this mode describing the default key bindings: \\ -* \\[dictionary-close] close the dictionary buffer -* \\[describe-mode] display this help information -* \\[dictionary-search] ask for a new word to search -* \\[dictionary-lookup-definition] search the word at point -* \\[forward-button] or TAB place point to the next link -* \\[backward-button] or S-TAB place point to the prev link - -* \\[dictionary-match-words] ask for a pattern and list all matching words. -* \\[dictionary-select-dictionary] select the default dictionary -* \\[dictionary-select-strategy] select the default search strategy - -* \\`RET' or \\`' visit that link") + \\[dictionary-close] close the dictionary buffer + \\[describe-mode] display this help + \\[dictionary-search] ask for a new word to search + \\[dictionary-lookup-definition] search for word at point + \\[forward-button] or \\`TAB' move point to the next link + \\[backward-button] or \\`S-TAB' move point to the previous link + + \\[dictionary-match-words] ask for a pattern and list all matching words + \\[dictionary-select-dictionary] select the default dictionary + \\[dictionary-select-strategy] select the default search strategy + + \\`RET' visit link at point + \\`' visit clicked link + +(fn)" t) (autoload 'dictionary "dictionary" "\ Create a new dictionary buffer and install `dictionary-mode'." t) (autoload 'dictionary-search "dictionary" "\ -Search the WORD in DICTIONARY if given or in all if nil. -It presents the selection or word at point as default input and -allows editing it. +Search for WORD in all the known dictionaries. +Interactively, prompt for WORD, and offer the word at point as default. + +Optional argument DICTIONARY means restrict the search to only +that one dictionary. Interactively, with prefix argument, +prompt for DICTIONARY. (fn WORD &optional DICTIONARY)" t) (autoload 'dictionary-lookup-definition "dictionary" "\ @@ -7620,7 +7697,7 @@ "dired" ;;; Generated autoloads from dired-aux.el -(register-definition-prefixes "dired-aux" '("dired-")) +(register-definition-prefixes "dired-aux" '("dired-" "shell-command-guess")) ;;; Generated autoloads from dired-x.el @@ -7677,7 +7754,7 @@ "dirtrack" redefine OBJECT if it is a symbol. (fn OBJECT &optional BUFFER INDENT INTERACTIVE-P)" t) -(register-definition-prefixes "disass" '("disassemble-")) +(register-definition-prefixes "disass" '("disassemble-" "re-disassemble")) ;;; Generated autoloads from disp-table.el @@ -8022,13 +8099,15 @@ "display-line-numbers" ;;; Generated autoloads from dnd.el -(defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://") . dnd-open-file) (,(purecopy "^file:") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|file\\|nfs\\)://") . dnd-open-file)) "\ +(defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://[^/]") . dnd-open-file) (,(purecopy "^file:/[^/]") . dnd-open-local-file) (,(purecopy "^file:[^/]") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|nfs\\)://") . dnd-open-file)) "\ The functions to call for different protocols when a drop is made. -This variable is used by `dnd-handle-one-url' and `dnd-handle-file-name'. +This variable is used by `dnd-handle-multiple-urls'. The list contains of (REGEXP . FUNCTION) pairs. The functions shall take two arguments, URL, which is the URL dropped and ACTION which is the action to be performed for the drop (move, copy, link, private or ask). +If a function's `dnd-multiple-handler' property is set, it is provided +a list of each URI dropped instead. If no match is found here, and the value of `browse-url-browser-function' is a pair of (REGEXP . FUNCTION), those regexps are tried for a match. If no match is found, the URL is inserted as text by calling `dnd-insert-text'. @@ -8667,7 +8746,7 @@ "ebnf2ps" A call with prefix PREFIX reads the symbol to insert from the minibuffer with completion. -(fn PREFIX)" t) +(fn PREFIX)" '("P")) (autoload 'ebrowse-tags-loop-continue "ebrowse" "\ Repeat last operation on files in tree. FIRST-TIME non-nil means this is not a repetition, but the first time. @@ -8977,7 +9056,7 @@ 'edirs-merge-with-ancestor (autoload 'ediff-windows-wordwise "ediff" "\ Compare WIND-A and WIND-B, which are selected by clicking, wordwise. This compares the portions of text visible in each of the two windows. -With prefix argument, DUMB-MODE, or on a non-windowing display, works as +With prefix argument, DUMB-MODE, or on a non-graphical display, works as follows: If WIND-A is nil, use selected window. If WIND-B is nil, use window next to WIND-A. @@ -8988,7 +9067,7 @@ 'edirs-merge-with-ancestor (autoload 'ediff-windows-linewise "ediff" "\ Compare WIND-A and WIND-B, which are selected by clicking, linewise. This compares the portions of text visible in each of the two windows. -With prefix argument, DUMB-MODE, or on a non-windowing display, works as +With prefix argument, DUMB-MODE, or on a non-graphical display, works as follows: If WIND-A is nil, use selected window. If WIND-B is nil, use window next to WIND-A. @@ -9222,14 +9301,14 @@ "semantic/edit" (fn &optional PREFIX)" t) (autoload 'read-kbd-macro "edmacro" "\ Read the region as a keyboard macro definition. -The region is interpreted as spelled-out keystrokes, e.g., \"M-x abc RET\". -See documentation for `edmacro-mode' for details. +The region between START and END is interpreted as spelled-out keystrokes, +e.g., \"M-x abc RET\". See documentation for `edmacro-mode' for details. Leading/trailing \"C-x (\" and \"C-x )\" in the text are allowed and ignored. The resulting macro is installed as the \"current\" keyboard macro. In Lisp, may also be called with a single STRING argument in which case the result is returned rather than being installed as the current macro. -The result will be a string if possible, otherwise an event vector. +The result is a vector of input events. Second argument NEED-VECTOR means to return an event vector always. (fn START &optional END)" t) @@ -9280,6 +9359,7 @@ "edt-vt100" ;;; Generated autoloads from progmodes/eglot.el (push (purecopy '(eglot 1 15)) package--builtin-versions) +(define-obsolete-function-alias 'eglot-update 'eglot-upgrade-eglot "29.1") (autoload 'eglot "eglot" "\ Start LSP server for PROJECT's buffers under MANAGED-MAJOR-MODES. @@ -9322,12 +9402,22 @@ "edt-vt100" (fn MANAGED-MAJOR-MODES PROJECT CLASS CONTACT LANGUAGE-IDS &optional INTERACTIVE)" t) (autoload 'eglot-ensure "eglot" "\ -Start Eglot session for current buffer if there isn't one.") +Start Eglot session for current buffer if there isn't one. + +Only use this function (in major mode hooks, etc) if you are +confident that Eglot can be started safely and efficiently for +*every* buffer visited where these hooks may execute. + +Since it is difficult to establish this confidence fully, it's +often wise to use the interactive command `eglot' instead. This +command only needs to be invoked once per project, as all other +files of a given major mode visited within the same project will +automatically become managed with no further user intervention +needed.") (autoload 'eglot-upgrade-eglot "eglot" "\ Update Eglot to latest version. (fn &rest _)" t) -(define-obsolete-function-alias 'eglot-update 'eglot-upgrade-eglot "29.1") (put 'eglot-workspace-configuration 'safe-local-variable 'listp) (put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t) (defun eglot--debbugs-or-github-bug-uri nil (format (if (string= (match-string 2) "github") "https://github.com/joaotavora/eglot/issues/%s" "https://debbugs.gnu.org/%s") (match-string 3))) @@ -9455,7 +9545,7 @@ "semantic/bovine/el" ;;; Generated autoloads from emacs-lisp/eldoc.el -(push (purecopy '(eldoc 1 14 0)) package--builtin-versions) +(push (purecopy '(eldoc 1 15 0)) package--builtin-versions) ;;; Generated autoloads from elec-pair.el @@ -9637,7 +9727,7 @@ "em-banner" ;;; Generated autoloads from eshell/em-basic.el -(register-definition-prefixes "em-basic" '("eshell")) +(register-definition-prefixes "em-basic" '("eshell" "pcomplete/eshell-mode/eshell-debug")) ;;; Generated autoloads from eshell/em-cmpl.el @@ -9859,7 +9949,7 @@ "emerge" (autoload 'emoji-recent "emoji" nil t) (autoload 'emoji-search "emoji" nil t) (autoload 'emoji-list "emoji" "\ -List emojis and insert the one that's selected. +List emojis and allow selecting and inserting one of them. Select the emoji by typing \\\\[emoji-list-select] on its picture. The glyph will be inserted into the buffer that was current when the command was invoked." t) @@ -10296,7 +10386,7 @@ "epg-config" See `erc-tls' for the meaning of ID. -(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" t) +(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" '((let ((erc--display-context `((erc-interactive-display . erc) ,@erc--display-context))) (erc-select-read-args)))) (defalias 'erc-select #'erc) (autoload 'erc-tls "erc" "\ ERC is a powerful, modular, and extensible IRC client. @@ -10344,7 +10434,7 @@ 'erc-select CLIENT-CERTIFICATE, this parameter cannot be specified interactively. -(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" t) +(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls) (erc--display-context `((erc-interactive-display . erc-tls) ,@erc--display-context))) (erc-select-read-args)))) (autoload 'erc-handle-irc-url "erc" "\ Use ERC to IRC on HOST:PORT in CHANNEL. If ERC is already connected to HOST:PORT, simply /join CHANNEL. @@ -10544,7 +10634,7 @@ "erc-track" ;;; Generated autoloads from erc/erc-truncate.el -(register-definition-prefixes "erc-truncate" '("erc-max-buffer-size")) +(register-definition-prefixes "erc-truncate" '("erc-")) ;;; Generated autoloads from erc/erc-xdcc.el @@ -10560,8 +10650,8 @@ "erc-xdcc" BODY is evaluated as a `progn' when the test is run. It should signal a condition on failure or just return if the test passes. -`should', `should-not', `should-error' and `skip-unless' are -useful for assertions in BODY. +`should', `should-not', `should-error', `skip-when', and +`skip-unless' are useful for assertions in BODY. Use `ert' to run tests interactively. @@ -10576,9 +10666,7 @@ "erc-xdcc" If NAME is already defined as a test and Emacs is running in batch mode, an error is signaled. -(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil t) -(function-put 'ert-deftest 'doc-string-elt 3) -(function-put 'ert-deftest 'lisp-indent-function 2) +(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil 'macro) (autoload 'ert-run-tests-batch "ert" "\ Run the tests specified by SELECTOR, printing results to the terminal. @@ -10639,7 +10727,7 @@ "esh-arg" ;;; Generated autoloads from eshell/esh-cmd.el -(register-definition-prefixes "esh-cmd" '("eshell" "pcomplete/eshell-mode/eshell-debug")) +(register-definition-prefixes "esh-cmd" '("eshell")) ;;; Generated autoloads from eshell/esh-ext.el @@ -12165,13 +12253,30 @@ "ede/files" (autoload 'add-dir-local-variable "files-x" "\ Add directory-local VARIABLE with its VALUE and MODE to .dir-locals.el. -(fn MODE VARIABLE VALUE)" t) +With a prefix argument, prompt for the file to modify. + +When called from Lisp, FILE may be the expanded name of the dir-locals file +where to add VARIABLE. + +(fn MODE VARIABLE VALUE &optional FILE)" t) (autoload 'delete-dir-local-variable "files-x" "\ -Delete all MODE settings of file-local VARIABLE from .dir-locals.el. +Delete all MODE settings of dir-local VARIABLE from .dir-locals.el. -(fn MODE VARIABLE)" t) +With a prefix argument, prompt for the file to modify. + +When called from Lisp, FILE may be the expanded name of the dir-locals file +from where to delete VARIABLE. + +(fn MODE VARIABLE &optional FILE)" t) (autoload 'copy-file-locals-to-dir-locals "files-x" "\ -Copy file-local variables to .dir-locals.el." t) +Copy file-local variables to .dir-locals.el. + +With a prefix argument, prompt for the file to modify. + +When called from Lisp, FILE may be the expanded name of the dir-locals file +where to copy the file-local variables. + +(fn &optional FILE)" t) (autoload 'copy-dir-locals-to-file-locals "files-x" "\ Copy directory-local variables to the Local Variables list." t) (autoload 'copy-dir-locals-to-file-locals-prop-line "files-x" "\ @@ -12259,11 +12364,17 @@ enable-connection-local-variables `setq-connection-local' form is the value of the last VALUE. (fn [VARIABLE VALUE]...)" nil t) +(autoload 'connection-local-value "files-x" "\ +Return connection-local VARIABLE for APPLICATION in `default-directory'. +If VARIABLE does not have a connection-local binding, the value +is the default binding of the variable. + +(fn VARIABLE &optional APPLICATION)" nil t) (autoload 'path-separator "files-x" "\ The connection-local value of `path-separator'.") (autoload 'null-device "files-x" "\ The connection-local value of `null-device'.") -(register-definition-prefixes "files-x" '("connection-local-" "dir-locals-to-string" "hack-connection-local-variables" "modify-" "read-file-local-variable")) +(register-definition-prefixes "files-x" '("connection-local-" "dir-locals-to-string" "hack-connection-local-variables" "modify-" "read-")) ;;; Generated autoloads from filesets.el @@ -12685,7 +12796,7 @@ "flow-fill" ;;; Generated autoloads from progmodes/flymake.el -(push (purecopy '(flymake 1 3 4)) package--builtin-versions) +(push (purecopy '(flymake 1 3 7)) package--builtin-versions) (autoload 'flymake-log "flymake" "\ Log, at level LEVEL, the message MSG formatted with ARGS. LEVEL is passed to `display-warning', which is used to display @@ -12866,7 +12977,7 @@ flyspell-mode Unconditionally turn on Flyspell mode.") (autoload 'turn-off-flyspell "flyspell" "\ Unconditionally turn off Flyspell mode.") -(autoload 'flyspell-mode-off "flyspell" "\ +(autoload 'flyspell--mode-off "flyspell" "\ Turn Flyspell mode off.") (autoload 'flyspell-region "flyspell" "\ Flyspell text between BEG and END. @@ -15013,6 +15124,29 @@ gud-tooltip-mode it is disabled. (fn &optional ARG)" t) +(autoload 'lldb "gud" "\ +Run LLDB passing it COMMAND-LINE as arguments. +If COMMAND-LINE names a program FILE to debug, LLDB will run in +a buffer named *gud-FILE*, and the directory containing FILE +becomes the initial working directory and source-file directory +for the debug session. If you don't want `default-directory' to +change to the directory of FILE, specify FILE without leading +directories, in which case FILE should reside either in the +directory of the buffer from which this command is invoked, or +it can be found by searching PATH. + +If COMMAND-LINE requests that LLDB attaches to a process PID, LLDB +will run in *gud-PID*, otherwise it will run in *gud*; in these +cases the initial working directory is the `default-directory' of +the buffer in which this command was invoked. + +Please note that completion framework that complete while you +type, like Corfu, do not work well with this mode. You should +consider to turn them off in this mode. + +This command runs functions from `lldb-mode-hook'. + +(fn COMMAND-LINE)" t) (register-definition-prefixes "gud" '("gdb-" "gud-")) @@ -15950,7 +16084,7 @@ "hideif" ;;; Generated autoloads from progmodes/hideshow.el -(defvar hs-special-modes-alist (mapcar #'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c-ts-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (c++-ts-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (java-ts-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (js-ts-mode "{" "}" "/[*/]" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "