Skip to content

Commit 8a69f69

Browse files
committed
Use old code style for emacs 23 compat
The new recommended style is to use the "cl-" prefixed versions, but they do not exist in emacs 23. We still want to stay compatible with that, so use plain "loop" rather than "cl-loop" to allow the tests to work with both old and new versions. ALso "pcase" was introduced in emacs 24, so stop using it to remain compatible with emacs 23.
1 parent 04e4b49 commit 8a69f69

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

rust-mode-tests.el

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,10 @@ fn indented_already() {
616616
POS-SYMBOL is a symbol found in `rust-test-positions-alist'.
617617
Convert the line-column information from that list into a buffer position value."
618618
(interactive "P")
619-
(pcase-let ((`(,line ,column) (cadr (assoc pos-symbol rust-test-positions-alist))))
619+
(let* (
620+
(line-and-column (cadr (assoc pos-symbol rust-test-positions-alist)))
621+
(line (nth 0 line-and-column))
622+
(column (nth 1 line-and-column)))
620623
(save-excursion
621624
(goto-line line)
622625
(move-to-column column)
@@ -844,14 +847,14 @@ All positions are position symbols found in `rust-test-positions-alist'."
844847
(defun rust-test-group-str-by-face (str)
845848
"Fontify `STR' in rust-mode and group it by face, returning a
846849
list of substrings of `STR' each followed by its face."
847-
(cl-loop with fontified = (rust-test-fontify-string str)
848-
for start = 0 then end
849-
while start
850-
for end = (next-single-property-change start 'face fontified)
851-
for prop = (get-text-property start 'face fontified)
852-
for text = (substring-no-properties fontified start end)
853-
if prop
854-
append (list text prop)))
850+
(loop with fontified = (rust-test-fontify-string str)
851+
for start = 0 then end
852+
while start
853+
for end = (next-single-property-change start 'face fontified)
854+
for prop = (get-text-property start 'face fontified)
855+
for text = (substring-no-properties fontified start end)
856+
if prop
857+
append (list text prop)))
855858

856859
(defun rust-test-font-lock (source face-groups)
857860
"Test that `SOURCE' fontifies to the expected `FACE-GROUPS'"

0 commit comments

Comments
 (0)