branch: externals/doc-toc commit 1602e353b06e95172e8a67c2f132e80a6f8e67cf Author: Daniel Nicolai <dalanico...@gmail.com> Commit: Daniel Nicolai <dalanico...@gmail.com>
Improve parsing djvu outline (prin1-to-string) --- toc-mode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toc-mode.el b/toc-mode.el index e5f15c3d62..3ce807deb5 100644 --- a/toc-mode.el +++ b/toc-mode.el @@ -590,6 +590,7 @@ to `pdfoutline' shell command." ;;; djvu parse tablist to outline (defun toc--tablist-to-djvused () "Parse and prepare djvused outline source form tablist." + (interactive) (let ((source-buffer doc-buffer) (buff (get-buffer-create (concat @@ -607,11 +608,11 @@ to `pdfoutline' shell command." (if level-next (with-current-buffer buff (cond ((= level-next level-current) - (insert (format "(\"%s\" \"%s\") " (car sexp) (nth 1 sexp)))) + (insert (format "(%s \"%s\") " (prin1-to-string (car sexp)) (nth 1 sexp)))) ((> level-next level-current) - (insert (format "(\"%s\" \"%s\" " (car sexp) (nth 1 sexp)))) + (insert (format "(%s \"%s\" " (prin1-to-string (car sexp)) (nth 1 sexp)))) ((< level-next level-current) - (insert (format "(\"%s\" \"%s\")" (car sexp) (nth 1 sexp))) + (insert (format "(%s \"%s\")" (prin1-to-string (car sexp)) (nth 1 sexp))) (let ((level-diff (- level-current level-next))) (while (> level-diff 0) (insert ") ")