branch: elpa/adoc-mode
commit 8ffcb955ee292e318eb700281877da20d6f969c4
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
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
---
adoc-mode.el | 2 +-
test/adoc-mode-test.el | 23 ++++++++++++-----------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index 0bd8c266e5..455671a6a9 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -34,7 +34,7 @@
;; writing short documents, articles, books and UNIX man pages. AsciiDoc files
;; can be translated to HTML and DocBook markups.
;;
-;; adoc-mode is an Emacs major mode for editing AsciiDoc files. It emphasizes
on
+;; adoc-mode is an Emacs major mode for editing AsciiDoc files. It emphasizes
;; the idea that the document is highlighted so it pretty much looks like the
;; final output. What must be bold is bold, what must be italic is italic etc.
;; Meta characters are naturally still visible, but in a faint way, so they can
diff --git a/test/adoc-mode-test.el b/test/adoc-mode-test.el
index 4ba393ab91..7f70d25b3e 100644
--- a/test/adoc-mode-test.el
+++ b/test/adoc-mode-test.el
@@ -7,9 +7,9 @@
;;; Todo:
;; - test for font lock multiline property
;; - test for presence of adoc-reserved (we do white-box testing here)
-;; - test also with multiple versions of (X)Emacs
-;; - compare adoc-mode fontification with actuall output from AsciiDoc, being
-;; almost the ultimative test for correctness
+;; - test also with multiple versions of Emacs
+;; - compare adoc-mode fontification with actual output from AsciiDoc, being
+;; almost the ultimate test for correctness
;;
;;; Code:
@@ -25,14 +25,15 @@ If PRINT-PROP is non-nil print use that property
in the output instead of PROP."
(let ((buf (current-buffer)))
(with-temp-buffer
- (cl-loop for int being the intervals of buf property prop do
- (insert
- (format "#(%S %s %S)\n"
- (with-current-buffer buf
- (buffer-substring-no-properties (car int) (cdr int)))
- (or print-prop prop)
- (get-text-property (car int) prop buf))
- ))
+ (let ((pos (with-current-buffer buf (point-min)))
+ (end (with-current-buffer buf (point-max))))
+ (while (< pos end)
+ (let* ((next (or (next-single-property-change pos prop buf) end))
+ (text (with-current-buffer buf
+ (buffer-substring-no-properties pos next)))
+ (val (get-text-property pos prop buf)))
+ (insert (format "#(%S %s %S)\n" text (or print-prop prop) val))
+ (setq pos next))))
(buffer-string))))
;; todo: