branch: elpa/toc-org
commit 9fefa63d4231f2fd74b09e83725ca34fa64ccb4a
Merge: c4c61c5a38 4d076d1e9d
Author: Sergei Nosov <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #75 from Alexander-Miller/local-offset
Respect the file-local value of org-list-indent-offset.
---
toc-org.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/toc-org.el b/toc-org.el
index 5ca0f010e9..9d2f194d89 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -285,7 +285,7 @@ rules."
(setq ret-path original-path))))
(cons ret-type ret-path)))
-(defun toc-org-hrefify-toc (toc hrefify markdown-syntax-p &optional hash)
+(defun toc-org-hrefify-toc (toc hrefify markdown-syntax-p list-offset
&optional hash)
"Format the raw `toc' using the `hrefify' function to transform
each heading into a link."
(with-temp-buffer
@@ -298,9 +298,7 @@ each heading into a link."
(while (looking-at "\\*")
(delete-char 1)
- (insert (make-string
- (+ 2 (or (bound-and-true-p org-list-indent-offset) 0))
- ?\s)))
+ (insert (make-string (+ 2 list-offset) ?\s)))
(insert "-")
(skip-chars-forward " ")
@@ -409,6 +407,7 @@ not :noexport_#:."
(toc-org-flush-subheadings (toc-org-raw-toc
markdown-syntax-p) depth)
hrefify
markdown-syntax-p
+ (or (bound-and-true-p org-list-indent-offset) 0)
(when toc-org-hrefify-hash
(clrhash toc-org-hrefify-hash)))
toc-suffix)))