aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2023-02-27 06:30:20 +0100
committerStefan Kangas2023-02-27 06:30:20 +0100
commitc640dc9ef533c1fa68cf7b29f63a3fb32e4c3b06 (patch)
treec15d896782c119376efa5a20f74e729a0fd25c22
parent6c4abbab7999f55792a323e4bb1eb55ef5a7b990 (diff)
parent267fc6d00c4db6f20da3c2d63e48a71ab70505d3 (diff)
downloademacs-c640dc9ef533c1fa68cf7b29f63a3fb32e4c3b06.tar.gz
emacs-c640dc9ef533c1fa68cf7b29f63a3fb32e4c3b06.zip
Merge from origin/emacs-29
267fc6d00c4 ruby-smie-rules: Fix misindentation of a method call afte... 0fde314f6f6 * lib-src/etags.c (process_file_name): Free malloc'ed var... dde9d149af3 ; Improve documentation of loading *.eln files 7c552be89da ; Another doc fix in eglot.el 75c65fcc98e ; Fix last change a3d15c1f749 ; Fix last change ca79b138d42 Eglot: rename and redocument encoding-related functions (... 3e3e6d71be7 Eglot: support positionEncoding LSP capability (bug#61726) b0e87e930e8 Eglot: use faster strategy for moving to LSP positions (b... 5b174b96834 Fix mule-tests in UTF-8 locales 5256392a7ec Fix 'vertical-motion' when display strings are around 0db88d625a7 ; * src/treesit.c (treesit_predicate_match): Fix typo.
-rw-r--r--doc/emacs/building.texi37
-rw-r--r--doc/lispref/loading.texi25
-rw-r--r--lib-src/etags.c2
-rw-r--r--lisp/progmodes/eglot.el146
-rw-r--r--lisp/progmodes/ruby-mode.el4
-rw-r--r--src/indent.c2
-rw-r--r--src/treesit.c2
-rw-r--r--test/lisp/international/mule-tests.el7
-rw-r--r--test/lisp/progmodes/eglot-tests.el10
-rw-r--r--test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb4
10 files changed, 153 insertions, 86 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 3f6a418de1a..f82b605598e 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1556,18 +1556,26 @@ command prompts for a @dfn{library name} rather than a file name; it
1556searches through each directory in the Emacs Lisp load path, trying to 1556searches through each directory in the Emacs Lisp load path, trying to
1557find a file matching that library name. If the library name is 1557find a file matching that library name. If the library name is
1558@samp{@var{foo}}, it tries looking for files named 1558@samp{@var{foo}}, it tries looking for files named
1559@file{@var{foo}.elc}, @file{@var{foo}.el}, and @file{@var{foo}}. The 1559@file{@var{foo}.elc}, @file{@var{foo}.el}, and @file{@var{foo}}. (If
1560default behavior is to load the first file found. This command 1560Emacs was built with native compilation enabled, @code{load-library}
1561prefers @file{.elc} files over @file{.el} files because compiled files 1561looks for a @samp{.eln} file that corresponds to @file{@var{foo}.el}
1562load and run faster. If it finds that @file{@var{lib}.el} is newer 1562and loads it instead of @file{@var{foo}.elc}.) The default behavior
1563than @file{@var{lib}.elc}, it issues a warning, in case someone made 1563is to load the first file found. This command prefers @file{.eln}
1564changes to the @file{.el} file and forgot to recompile it, but loads 1564files over @file{.elc} files, and prefers @file{.elc} files over
1565the @file{.elc} file anyway. (Due to this behavior, you can save 1565@file{.el} files, because compiled files load and run faster. If it
1566unfinished edits to Emacs Lisp source files, and not recompile until 1566finds that @file{@var{lib}.el} is newer than @file{@var{lib}.elc}, it
1567your changes are ready for use.) If you set the option 1567issues a warning, in case someone made changes to the @file{.el} file
1568@code{load-prefer-newer} to a non-@code{nil} value, however, then 1568and forgot to recompile it, but loads the @file{.elc} file anyway.
1569rather than the procedure described above, Emacs loads whichever 1569(Due to this behavior, you can save unfinished edits to Emacs Lisp
1570version of the file is newest. 1570source files, and not recompile until your changes are ready for use.)
1571If you set the option @code{load-prefer-newer} to a non-@code{nil}
1572value, however, then rather than the procedure described above, Emacs
1573loads whichever version of the file is newest. If Emacs was built
1574with native compilation, and it cannot find the @samp{.eln} file
1575corresponding to @file{@var{lib}.el}, it will load a
1576@file{@var{lib}.elc} and start native compilation of
1577@file{@var{lib}.el} in the background, then load the @samp{.eln} file
1578when it finishes compilation.
1571 1579
1572 Emacs Lisp programs usually load Emacs Lisp files using the 1580 Emacs Lisp programs usually load Emacs Lisp files using the
1573@code{load} function. This is similar to @code{load-library}, but is 1581@code{load} function. This is similar to @code{load-library}, but is
@@ -1604,6 +1612,11 @@ It is customary to put locally installed libraries in the
1604@code{load-path}, or in some subdirectory of @file{site-lisp}. This 1612@code{load-path}, or in some subdirectory of @file{site-lisp}. This
1605way, you don't need to modify the default value of @code{load-path}. 1613way, you don't need to modify the default value of @code{load-path}.
1606 1614
1615@vindex native-comp-eln-load-path
1616 Similarly to @code{load-path}, the list of directories where Emacs
1617looks for @file{*.eln} files with natively-compiled Lisp code is
1618specified by the variable @code{native-comp-eln-load-path}.
1619
1607@cindex autoload 1620@cindex autoload
1608 Some commands are @dfn{autoloaded}; when you run them, Emacs 1621 Some commands are @dfn{autoloaded}; when you run them, Emacs
1609automatically loads the associated library first. For instance, the 1622automatically loads the associated library first. For instance, the
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index dbbdc767738..5c84ba4b1eb 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -75,17 +75,20 @@ file exists, and Emacs was compiled with native-compilation support
75(@pxref{Native Compilation}), @code{load} attempts to find a 75(@pxref{Native Compilation}), @code{load} attempts to find a
76corresponding @samp{.eln} file, and if found, loads it instead of 76corresponding @samp{.eln} file, and if found, loads it instead of
77@file{@var{filename}.elc}. Otherwise, it loads 77@file{@var{filename}.elc}. Otherwise, it loads
78@file{@var{filename}.elc}. If there is no file by that name, then 78@file{@var{filename}.elc} (and starts a background native compilation
79@code{load} looks for a file named @file{@var{filename}.el}. If that 79to produce the missing @samp{.eln} file, followed by loading that
80file exists, it is loaded. If Emacs was compiled with support for 80file). If there is no @file{@var{filename}.elc}, then @code{load}
81dynamic modules (@pxref{Dynamic Modules}), @code{load} next looks for 81looks for a file named @file{@var{filename}.el}. If that file exists,
82a file named @file{@var{filename}.@var{ext}}, where @var{ext} is a 82it is loaded. If Emacs was compiled with support for dynamic modules
83system-dependent file-name extension of shared libraries. Finally, if 83(@pxref{Dynamic Modules}), @code{load} next looks for a file named
84neither of those names is found, @code{load} looks for a file named 84@file{@var{filename}.@var{ext}}, where @var{ext} is a system-dependent
85@var{filename} with nothing appended, and loads it if it exists. (The 85file-name extension of shared libraries (@samp{.so} on GNU and Unix
86@code{load} function is not clever about looking at @var{filename}. 86systems). Finally, if neither of those names is found, @code{load}
87In the perverse case of a file named @file{foo.el.el}, evaluation of 87looks for a file named @var{filename} with nothing appended, and loads
88@code{(load "foo.el")} will indeed find it.) 88it if it exists. (The @code{load} function is not clever about
89looking at @var{filename}. In the perverse case of a file named
90@file{foo.el.el}, evaluation of @code{(load "foo.el")} will indeed
91find it.)
89 92
90If Auto Compression mode is enabled, as it is by default, then if 93If Auto Compression mode is enabled, as it is by default, then if
91@code{load} can not find a file, it searches for a compressed version 94@code{load} can not find a file, it searches for a compressed version
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 2628849d78e..cb842dbf669 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1732,6 +1732,8 @@ process_file_name (char *file, language *lang)
1732 char *cmd = xmalloc (buf_len); 1732 char *cmd = xmalloc (buf_len);
1733 snprintf (cmd, buf_len, "%s %s > %s", 1733 snprintf (cmd, buf_len, "%s %s > %s",
1734 compr->command, new_real_name, new_tmp_name); 1734 compr->command, new_real_name, new_tmp_name);
1735 free (new_real_name);
1736 free (new_tmp_name);
1735#endif 1737#endif
1736 inf = (system (cmd) == -1 1738 inf = (system (cmd) == -1
1737 ? NULL 1739 ? NULL
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index d0e899cbed5..4203e4a336e 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -816,6 +816,7 @@ treated as in `eglot--dbind'."
816 `(:valueSet 816 `(:valueSet
817 [,@(mapcar 817 [,@(mapcar
818 #'car eglot--tag-faces)]))) 818 #'car eglot--tag-faces)])))
819 :general (list :positionEncodings ["utf-32" "utf-8" "utf-16"])
819 :experimental eglot--{}))) 820 :experimental eglot--{})))
820 821
821(cl-defgeneric eglot-workspace-folders (server) 822(cl-defgeneric eglot-workspace-folders (server)
@@ -1439,20 +1440,32 @@ CONNECT-ARGS are passed as additional arguments to
1439 (let ((warning-minimum-level :error)) 1440 (let ((warning-minimum-level :error))
1440 (display-warning 'eglot (apply #'format format args) :warning))) 1441 (display-warning 'eglot (apply #'format format args) :warning)))
1441 1442
1442(defun eglot-current-column () (- (point) (line-beginning-position))) 1443
1443 1444;;; Encoding fever
1444(defvar eglot-current-column-function #'eglot-lsp-abiding-column 1445;;;
1445 "Function to calculate the current column. 1446(define-obsolete-function-alias
1446 1447 'eglot-lsp-abiding-column 'eglot-utf-16-linepos "29.1")
1447This is the inverse operation of 1448(define-obsolete-function-alias
1448`eglot-move-to-column-function' (which see). It is a function of 1449 'eglot-current-column 'eglot-utf-32-linepos "29.1")
1449no arguments returning a column number. For buffers managed by 1450(define-obsolete-variable-alias
1450fully LSP-compliant servers, this should be set to 1451 'eglot-current-column-function 'eglot-current-linepos-function "29.1")
1451`eglot-lsp-abiding-column' (the default), and 1452
1452`eglot-current-column' for all others.") 1453(defvar eglot-current-linepos-function #'eglot-utf-16-linepos
1453 1454 "Function calculating position relative to line beginning.
1454(defun eglot-lsp-abiding-column (&optional lbp) 1455
1455 "Calculate current COLUMN as defined by the LSP spec. 1456This is the inverse of `eglot-move-to-linepos-function' (which see).
1457It is a function of no arguments returning the number of code units
1458or bytes or codepoints corresponding to the current position of point,
1459relative to line beginning, as expected by the function that is the
1460value of `eglot-move-to-linepos-function'.")
1461
1462(defun eglot-utf-8-linepos ()
1463 "Calculate number of UTF-8 bytes from line beginning."
1464 (length (encode-coding-region (line-beginning-position) (point)
1465 'utf-8-unix t)))
1466
1467(defun eglot-utf-16-linepos (&optional lbp)
1468 "Calculate number of UTF-16 code units from position given by LBP.
1456LBP defaults to `line-beginning-position'." 1469LBP defaults to `line-beginning-position'."
1457 (/ (- (length (encode-coding-region (or lbp (line-beginning-position)) 1470 (/ (- (length (encode-coding-region (or lbp (line-beginning-position))
1458 ;; Fix github#860 1471 ;; Fix github#860
@@ -1460,51 +1473,71 @@ LBP defaults to `line-beginning-position'."
1460 2) 1473 2)
1461 2)) 1474 2))
1462 1475
1476(defun eglot-utf-32-linepos ()
1477 "Calculate number of Unicode codepoints from line beginning."
1478 (- (point) (line-beginning-position)))
1479
1463(defun eglot--pos-to-lsp-position (&optional pos) 1480(defun eglot--pos-to-lsp-position (&optional pos)
1464 "Convert point POS to LSP position." 1481 "Convert point POS to LSP position."
1465 (eglot--widening 1482 (eglot--widening
1466 ;; LSP line is zero-origin; emacs is one-origin. 1483 ;; LSP line is zero-origin; emacs is one-origin.
1467 (list :line (1- (line-number-at-pos pos t)) 1484 (list :line (1- (line-number-at-pos pos t))
1468 :character (progn (when pos (goto-char pos)) 1485 :character (progn (when pos (goto-char pos))
1469 (funcall eglot-current-column-function))))) 1486 (funcall eglot-current-linepos-function)))))
1470 1487
1471(defvar eglot-move-to-column-function #'eglot-move-to-lsp-abiding-column 1488(define-obsolete-function-alias
1472 "Function to move to a column reported by the LSP server. 1489 'eglot-move-to-current-column 'eglot-move-to-utf-32-linepos "29.1")
1473 1490(define-obsolete-function-alias
1474According to the standard, LSP column/character offsets are based 1491 'eglot-move-to-lsp-abiding-column 'eglot-move-to-utf-16-linepos "29.1")
1475on a count of UTF-16 code units, not actual visual columns. So 1492(define-obsolete-variable-alias
1476when LSP says position 3 of a line containing just \"aXbc\", 1493'eglot-move-to-column-function 'eglot-move-to-linepos-function "29.1")
1477where X is a multi-byte character, it actually means `b', not 1494
1478`c'. However, many servers don't follow the spec this closely. 1495(defvar eglot-move-to-linepos-function #'eglot-move-to-utf-16-linepos
1479 1496 "Function to move to a position within a line reported by the LSP server.
1480For buffers managed by fully LSP-compliant servers, this should 1497
1481be set to `eglot-move-to-lsp-abiding-column' (the default), and 1498Per the LSP spec, character offsets in LSP Position objects count
1482`eglot-move-to-column' for all others.") 1499UTF-16 code units, not actual code points. So when LSP says
1483 1500position 3 of a line containing just \"aXbc\", where X is a funny
1484(defun eglot-move-to-column (column) 1501looking character in the UTF-16 \"supplementary plane\", it
1485 "Move to COLUMN without closely following the LSP spec." 1502actually means `b', not `c'. The default value
1503`eglot-move-to-utf-16-linepos' accounts for this.
1504
1505This variable can also be set to `eglot-move-to-utf-8-linepos' or
1506`eglot-move-to-utf-32-linepos' for servers not closely following
1507the spec. Also, since LSP 3.17 server and client may agree on an
1508encoding and Eglot will set this variable automatically.")
1509
1510(defun eglot-move-to-utf-8-linepos (n)
1511 "Move to line's Nth byte as computed by LSP's UTF-8 criterion."
1512 (let* ((bol (line-beginning-position))
1513 (goal-byte (+ (position-bytes bol) n))
1514 (eol (line-end-position)))
1515 (goto-char bol)
1516 (while (and (< (position-bytes (point)) goal-byte) (< (point) eol))
1517 ;; raw bytes take 2 bytes in the buffer
1518 (when (>= (char-after) #x3fff80) (setq goal-byte (1+ goal-byte)))
1519 (forward-char 1))))
1520
1521(defun eglot-move-to-utf-16-linepos (n)
1522 "Move to line's Nth code unit as computed by LSP's UTF-16 criterion."
1523 (let* ((bol (line-beginning-position))
1524 (goal-char (+ bol n))
1525 (eol (line-end-position)))
1526 (goto-char bol)
1527 (while (and (< (point) goal-char) (< (point) eol))
1528 ;; code points in the "supplementary place" use two code units
1529 (when (<= #x010000 (char-after) #x10ffff) (setq goal-char (1- goal-char)))
1530 (forward-char 1))))
1531
1532(defun eglot-move-to-utf-32-linepos (n)
1533 "Move to line's Nth codepoint as computed by LSP's UTF-32 criterion."
1486 ;; We cannot use `move-to-column' here, because it moves to *visual* 1534 ;; We cannot use `move-to-column' here, because it moves to *visual*
1487 ;; columns, which can be different from LSP columns in case of 1535 ;; columns, which can be different from LSP characters in case of
1488 ;; `whitespace-mode', `prettify-symbols-mode', etc. (github#296, 1536 ;; `whitespace-mode', `prettify-symbols-mode', etc. (github#296,
1489 ;; github#297) 1537 ;; github#297)
1490 (goto-char (min (+ (line-beginning-position) column) 1538 (goto-char (min (+ (line-beginning-position) n)
1491 (line-end-position)))) 1539 (line-end-position))))
1492 1540
1493(defun eglot-move-to-lsp-abiding-column (column)
1494 "Move to COLUMN abiding by the LSP spec."
1495 (save-restriction
1496 (cl-loop
1497 with lbp = (line-beginning-position)
1498 initially
1499 (narrow-to-region lbp (line-end-position))
1500 (move-to-column column)
1501 for diff = (- column
1502 (eglot-lsp-abiding-column lbp))
1503 until (zerop diff)
1504 do (condition-case eob-err
1505 (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
1506 (end-of-buffer (cl-return eob-err))))))
1507
1508(defun eglot--lsp-position-to-point (pos-plist &optional marker) 1541(defun eglot--lsp-position-to-point (pos-plist &optional marker)
1509 "Convert LSP position POS-PLIST to Emacs point. 1542 "Convert LSP position POS-PLIST to Emacs point.
1510If optional MARKER, return a marker instead" 1543If optional MARKER, return a marker instead"
@@ -1515,16 +1548,17 @@ If optional MARKER, return a marker instead"
1515 (forward-line (min most-positive-fixnum 1548 (forward-line (min most-positive-fixnum
1516 (plist-get pos-plist :line))) 1549 (plist-get pos-plist :line)))
1517 (unless (eobp) ;; if line was excessive leave point at eob 1550 (unless (eobp) ;; if line was excessive leave point at eob
1518 (let ((tab-width 1) 1551 (let ((col (plist-get pos-plist :character)))
1519 (col (plist-get pos-plist :character)))
1520 (unless (wholenump col) 1552 (unless (wholenump col)
1521 (eglot--warn 1553 (eglot--warn
1522 "Caution: LSP server sent invalid character position %s. Using 0 instead." 1554 "Caution: LSP server sent invalid character position %s. Using 0 instead."
1523 col) 1555 col)
1524 (setq col 0)) 1556 (setq col 0))
1525 (funcall eglot-move-to-column-function col))) 1557 (funcall eglot-move-to-linepos-function col)))
1526 (if marker (copy-marker (point-marker)) (point))))) 1558 (if marker (copy-marker (point-marker)) (point)))))
1527 1559
1560
1561;;; More helpers
1528(defconst eglot--uri-path-allowed-chars 1562(defconst eglot--uri-path-allowed-chars
1529 (let ((vec (copy-sequence url-path-allowed-chars))) 1563 (let ((vec (copy-sequence url-path-allowed-chars)))
1530 (aset vec ?: nil) ;; see github#639 1564 (aset vec ?: nil) ;; see github#639
@@ -1758,6 +1792,14 @@ Use `eglot-managed-p' to determine if current buffer is managed.")
1758 :init-value nil :lighter nil :keymap eglot-mode-map 1792 :init-value nil :lighter nil :keymap eglot-mode-map
1759 (cond 1793 (cond
1760 (eglot--managed-mode 1794 (eglot--managed-mode
1795 (pcase (plist-get (eglot--capabilities (eglot-current-server))
1796 :positionEncoding)
1797 ("utf-32"
1798 (eglot--setq-saving eglot-current-linepos-function #'eglot-utf-32-linepos)
1799 (eglot--setq-saving eglot-move-to-linepos-function #'eglot-move-to-utf-32-linepos))
1800 ("utf-8"
1801 (eglot--setq-saving eglot-current-linepos-function #'eglot-utf-8-linepos)
1802 (eglot--setq-saving eglot-move-to-linepos-function #'eglot-move-to-utf-8-linepos)))
1761 (add-hook 'after-change-functions 'eglot--after-change nil t) 1803 (add-hook 'after-change-functions 'eglot--after-change nil t)
1762 (add-hook 'before-change-functions 'eglot--before-change nil t) 1804 (add-hook 'before-change-functions 'eglot--before-change nil t)
1763 (add-hook 'kill-buffer-hook #'eglot--managed-mode-off nil t) 1805 (add-hook 'kill-buffer-hook #'eglot--managed-mode-off nil t)
@@ -2591,7 +2633,7 @@ Try to visit the target file for a richer summary line."
2591 (add-face-text-property hi-beg hi-end 'xref-match 2633 (add-face-text-property hi-beg hi-end 'xref-match
2592 t substring) 2634 t substring)
2593 (list substring (line-number-at-pos (point) t) 2635 (list substring (line-number-at-pos (point) t)
2594 (eglot-current-column) (- end beg)))))) 2636 (eglot-utf-32-linepos) (- end beg))))))
2595 (`(,summary ,line ,column ,length) 2637 (`(,summary ,line ,column ,length)
2596 (cond 2638 (cond
2597 (visiting (with-current-buffer visiting (funcall collect))) 2639 (visiting (with-current-buffer visiting (funcall collect)))
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index dba9ff0a846..559b62fef54 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -909,7 +909,9 @@ This only affects the output of the command `ruby-toggle-block'."
909 "<<=" ">>=" "&&=" "||=" "and" "or")) 909 "<<=" ">>=" "&&=" "||=" "and" "or"))
910 (cond 910 (cond
911 ((not ruby-after-operator-indent) 911 ((not ruby-after-operator-indent)
912 (ruby-smie--indent-to-stmt ruby-indent-level)) 912 (ruby-smie--indent-to-stmt (if (smie-indent--hanging-p)
913 ruby-indent-level
914 0)))
913 ((and (smie-rule-parent-p ";" nil) 915 ((and (smie-rule-parent-p ";" nil)
914 (smie-indent--hanging-p)) 916 (smie-indent--hanging-p))
915 ruby-indent-level))) 917 ruby-indent-level)))
diff --git a/src/indent.c b/src/indent.c
index 6de18d749ca..08d2bf5ea28 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2401,7 +2401,7 @@ whether or not it is currently displayed in some window. */)
2401 last line that it occupies. */ 2401 last line that it occupies. */
2402 if (it_start < ZV) 2402 if (it_start < ZV)
2403 { 2403 {
2404 if ((it.bidi_it.scan_dir > 0) 2404 if ((it.bidi_it.scan_dir >= 0 || it.vpos == vpos_init)
2405 ? IT_CHARPOS (it) < it_start 2405 ? IT_CHARPOS (it) < it_start
2406 : IT_CHARPOS (it) > it_start) 2406 : IT_CHARPOS (it) > it_start)
2407 { 2407 {
diff --git a/src/treesit.c b/src/treesit.c
index ef0f2407840..5a4fe3e8803 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -2484,7 +2484,7 @@ treesit_predicate_match (Lisp_Object args, struct capture_range captures)
2484{ 2484{
2485 if (XFIXNUM (Flength (args)) != 2) 2485 if (XFIXNUM (Flength (args)) != 2)
2486 xsignal2 (Qtreesit_query_error, 2486 xsignal2 (Qtreesit_query_error,
2487 build_string ("Predicate `equal' requires two " 2487 build_string ("Predicate `match' requires two "
2488 "arguments but only given"), 2488 "arguments but only given"),
2489 Flength (args)); 2489 Flength (args));
2490 2490
diff --git a/test/lisp/international/mule-tests.el b/test/lisp/international/mule-tests.el
index 6b76e35ae22..3e0c5bf9f4b 100644
--- a/test/lisp/international/mule-tests.el
+++ b/test/lisp/international/mule-tests.el
@@ -119,9 +119,10 @@ provide HTML fragments. Some tests override those variables."
119(ert-deftest sgml-html-meta-no-post-less-than-10lines () 119(ert-deftest sgml-html-meta-no-post-less-than-10lines ()
120 "No '</head>', detect charset in the first 10 lines." 120 "No '</head>', detect charset in the first 10 lines."
121 (let ((sgml-html-meta-post "")) 121 (let ((sgml-html-meta-post ""))
122 (should (eq 'utf-8 (sgml-html-meta-run 122 (should (eq 'utf-8 (coding-system-base
123 (concat "\n\n\n\n\n\n\n\n\n" 123 (sgml-html-meta-run
124 "<meta charset='utf-8'>")))))) 124 (concat "\n\n\n\n\n\n\n\n\n"
125 "<meta charset='utf-8'>")))))))
125 126
126(ert-deftest sgml-html-meta-no-post-10lines () 127(ert-deftest sgml-html-meta-no-post-10lines ()
127 "No '</head>', do not detect charset after the first 10 lines." 128 "No '</head>', do not detect charset after the first 10 lines."
diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
index 4b6528351b2..5d5de59a19a 100644
--- a/test/lisp/progmodes/eglot-tests.el
+++ b/test/lisp/progmodes/eglot-tests.el
@@ -856,8 +856,8 @@ pylsp prefers autopep over yafp, despite its README stating the contrary."
856 '((c-mode . ("clangd"))))) 856 '((c-mode . ("clangd")))))
857 (with-current-buffer 857 (with-current-buffer
858 (eglot--find-file-noselect "project/foo.c") 858 (eglot--find-file-noselect "project/foo.c")
859 (setq-local eglot-move-to-column-function #'eglot-move-to-lsp-abiding-column) 859 (setq-local eglot-move-to-linepos-function #'eglot-move-to-utf-16-linepos)
860 (setq-local eglot-current-column-function #'eglot-lsp-abiding-column) 860 (setq-local eglot-current-linepos-function #'eglot-utf-16-linepos)
861 (eglot--sniffing (:client-notifications c-notifs) 861 (eglot--sniffing (:client-notifications c-notifs)
862 (eglot--tests-connect) 862 (eglot--tests-connect)
863 (end-of-line) 863 (end-of-line)
@@ -866,12 +866,12 @@ pylsp prefers autopep over yafp, despite its README stating the contrary."
866 (eglot--wait-for (c-notifs 2) (&key params &allow-other-keys) 866 (eglot--wait-for (c-notifs 2) (&key params &allow-other-keys)
867 (should (equal 71 (cadddr (cadadr (aref (cadddr params) 0)))))) 867 (should (equal 71 (cadddr (cadadr (aref (cadddr params) 0))))))
868 (beginning-of-line) 868 (beginning-of-line)
869 (should (eq eglot-move-to-column-function #'eglot-move-to-lsp-abiding-column)) 869 (should (eq eglot-move-to-linepos-function #'eglot-move-to-utf-16-linepos))
870 (funcall eglot-move-to-column-function 71) 870 (funcall eglot-move-to-linepos-function 71)
871 (should (looking-at "p"))))))) 871 (should (looking-at "p")))))))
872 872
873(ert-deftest eglot-test-lsp-abiding-column () 873(ert-deftest eglot-test-lsp-abiding-column ()
874 "Test basic `eglot-lsp-abiding-column' and `eglot-move-to-lsp-abiding-column'." 874 "Test basic LSP character counting logic."
875 (skip-unless (executable-find "clangd")) 875 (skip-unless (executable-find "clangd"))
876 (eglot-tests--lsp-abiding-column-1)) 876 (eglot-tests--lsp-abiding-column-1))
877 877
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb b/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
index 25cd8736f97..e339d229d3e 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
@@ -10,6 +10,10 @@ qux = 4 + 5 *
10foo = obj.bar { |m| tee(m) } + 10foo = obj.bar { |m| tee(m) } +
11 obj.qux { |m| hum(m) } 11 obj.qux { |m| hum(m) }
12 12
13some_variable = abc + some_method(
14 some_argument
15)
16
13foo. 17foo.
14 bar 18 bar
15 .baz 19 .baz