File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
2525in 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:
You can’t perform that action at this time.
0 commit comments