Skip to content

Commit 8ffcb95

Browse files
committed
Fix typos and clean up minor code issues
- Fix "emphasizes on" grammar in adoc-mode.el Commentary - Fix "actuall" and "ultimative" typos in test comments - Remove outdated XEmacs reference in test comments - Replace `cl-loop being the intervals` with `next-single-property-change` loop to avoid byte-compiler warnings
1 parent 2c7e6f3 commit 8ffcb95

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

adoc-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
;; writing short documents, articles, books and UNIX man pages. AsciiDoc files
3535
;; can be translated to HTML and DocBook markups.
3636
;;
37-
;; adoc-mode is an Emacs major mode for editing AsciiDoc files. It emphasizes on
37+
;; adoc-mode is an Emacs major mode for editing AsciiDoc files. It emphasizes
3838
;; the idea that the document is highlighted so it pretty much looks like the
3939
;; final output. What must be bold is bold, what must be italic is italic etc.
4040
;; Meta characters are naturally still visible, but in a faint way, so they can

test/adoc-mode-test.el

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
;;; Todo:
88
;; - test for font lock multiline property
99
;; - test for presence of adoc-reserved (we do white-box testing here)
10-
;; - test also with multiple versions of (X)Emacs
11-
;; - compare adoc-mode fontification with actuall output from AsciiDoc, being
12-
;; almost the ultimative test for correctness
10+
;; - test also with multiple versions of Emacs
11+
;; - compare adoc-mode fontification with actual output from AsciiDoc, being
12+
;; almost the ultimate test for correctness
1313
;;
1414

1515
;;; Code:
@@ -25,14 +25,15 @@ If PRINT-PROP is non-nil print use that property
2525
in the output instead of PROP."
2626
(let ((buf (current-buffer)))
2727
(with-temp-buffer
28-
(cl-loop for int being the intervals of buf property prop do
29-
(insert
30-
(format "#(%S %s %S)\n"
31-
(with-current-buffer buf
32-
(buffer-substring-no-properties (car int) (cdr int)))
33-
(or print-prop prop)
34-
(get-text-property (car int) prop buf))
35-
))
28+
(let ((pos (with-current-buffer buf (point-min)))
29+
(end (with-current-buffer buf (point-max))))
30+
(while (< pos end)
31+
(let* ((next (or (next-single-property-change pos prop buf) end))
32+
(text (with-current-buffer buf
33+
(buffer-substring-no-properties pos next)))
34+
(val (get-text-property pos prop buf)))
35+
(insert (format "#(%S %s %S)\n" text (or print-prop prop) val))
36+
(setq pos next))))
3637
(buffer-string))))
3738

3839
;; todo:

0 commit comments

Comments
 (0)