[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/toc-org 90894242a6 046/128: treat org-list-indent-offset p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/toc-org 90894242a6 046/128: treat org-list-indent-offset properly |
Date: |
Sun, 2 Jan 2022 09:59:08 -0500 (EST) |
branch: elpa/toc-org
commit 90894242a65dae8c6b8242e1c019a9727bf05187
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: Sergei Nosov <sergei.nosov@gmail.com>
treat org-list-indent-offset properly
Fixes #5
Thanks to @wasamasa for pointing out the issue and proposing the fix
---
README.org | 8 ++++----
toc-org.el | 12 +++++++-----
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/README.org b/README.org
index d53d849db2..9989e17b7d 100644
--- a/README.org
+++ b/README.org
@@ -13,11 +13,11 @@ name conflict with one of the org contrib modules.
* Table of Contents :TOC:
- [[#about][About]]
- [[#installation][Installation]]
- - [[#via-packageel][via package.el]]
- - [[#manual][Manual]]
+ - [[#via-packageel][via package.el]]
+ - [[#manual][Manual]]
- [[#use][Use]]
- - [[#follow-links][Follow links]]
- - [[#shortcut-for-toc-tag][Shortcut for TOC tag]]
+ - [[#follow-links][Follow links]]
+ - [[#shortcut-for-toc-tag][Shortcut for TOC tag]]
- [[#different-href-styles][Different href styles]]
- [[#example][Example]]
diff --git a/toc-org.el b/toc-org.el
index b8ab961a5a..a9ffa1b9b2 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -201,7 +201,9 @@ each heading into a link."
(while (looking-at "\\*")
(delete-char 1)
- (insert " "))
+ (insert (make-string
+ (+ 2 (or (bound-and-true-p org-list-indent-offset) 0))
+ ?\s)))
(skip-chars-forward " ")
(insert "- ")
@@ -232,7 +234,7 @@ each heading into a link."
(should (equal (gethash "ABOUT" hash) "About")))
(let ((hash (make-hash-table :test 'equal)))
(should (equal (toc-org-hrefify-toc "* About\n* Installation\n** via
package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 'upcase
hash)
- " - [[ABOUT][About]]\n - [[INSTALLATION][Installation]]\n
- [[VIA PACKAGE.EL][via package.el]]\n - [[MANUAL][Manual]]\n -
[[USE][Use]]\n - [[DIFFERENT HREF STYLES][Different href styles]]\n -
[[EXAMPLE][Example]]\n"))
+ " - [[ABOUT][About]]\n - [[INSTALLATION][Installation]]\n
- [[VIA PACKAGE.EL][via package.el]]\n - [[MANUAL][Manual]]\n -
[[USE][Use]]\n - [[DIFFERENT HREF STYLES][Different href styles]]\n -
[[EXAMPLE][Example]]\n"))
(should (equal (gethash "ABOUT" hash) "About"))
(should (equal (gethash "INSTALLATION" hash) "Installation"))
(should (equal (gethash "VIA PACKAGE.EL" hash) "via package.el"))
@@ -366,7 +368,7 @@ following tag formats:
(let ((beg "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have
an up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents "))
(toc-org-test-insert-toc-gold-test
(concat beg ":TOC:")
- "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents :TOC:\n -
[[#about][About]]\n - [[#hello][Hello]]\n - [[ [...]
+ "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents :TOC:\n -
[[#about][About]]\n - [[#hello][Hello]]\n - [[#g [...]
(toc-org-test-insert-toc-gold-test
(concat beg ":TOC_1:")
@@ -374,7 +376,7 @@ following tag formats:
(toc-org-test-insert-toc-gold-test
(concat beg ":TOC_3:")
- "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents :TOC_3:\n
- [[#about][About]]\n - [[#hello][Hello]]\n - [...]
+ "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents :TOC_3:\n
- [[#about][About]]\n - [[#hello][Hello]]\n - [[ [...]
(toc-org-test-insert-toc-gold-test
(concat beg ":TOC_1_org:")
@@ -382,7 +384,7 @@ following tag formats:
(toc-org-test-insert-toc-gold-test
(concat beg ":TOC_3_org:")
- "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents
:TOC_3_org:\n - [[About][About]]\n - [[Hello][Hello]]\n [...]
+ "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an
up-to-date table of contents in the\norg files without exporting (useful
primarily for readme files on\nGitHub).\n\nIt is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works
for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n*
Table of Contents
:TOC_3_org:\n - [[About][About]]\n - [[Hello][Hello]]\n - [...]
;; Local Variables:
;; compile-command: "emacs -batch -l ert -l *.el -f
ert-run-tests-batch-and-exit && emacs -batch -f batch-byte-compile *.el 2>&1 |
sed -n '/Warning\|Error/p' | xargs -r ls"
- [nongnu] elpa/toc-org 17c6cf1d1a 060/128: add tests, (continued)
- [nongnu] elpa/toc-org 17c6cf1d1a 060/128: add tests, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 01cb78ead6 063/128: Use `delete-region` instead of kill-line while creating the TOC, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d3d3503b34 062/128: Delete trailing whitespaces from links, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4d076d1e9d 118/128: Respect the file-local value of org-list-indent-offset., ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org f3218fdaf1 123/128: Add license and copyright header to toc-org-test.el, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 501f36db68 021/128: Merge pull request #5 from ardumont/wrap-tests-definition, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 658c03111b 017/128: add some more tests and fix wording, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d3677cd8c8 022/128: make compile-command run the tests, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 0dee7197c8 026/128: fix byte-compilation check, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 242eecba19 034/128: add a note about previous name, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 90894242a6 046/128: treat org-list-indent-offset properly,
ELPA Syncer <=
- [nongnu] elpa/toc-org 4c0b28da59 037/128: add more tags for easier search, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org e38e81af3f 088/128: Merge pull request #57 from JAremko/master, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org cda8f73640 073/128: Merge pull request #37 from snosov1/handle-comment, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ee70dd23e1 104/128: resolve missing functions warnings, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d52f95fae8 105/128: Handle trailing #'s, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 5ce7c24920 096/128: handle paranthesis in #+TODO line (fixes #65), ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org b1bab4c078 072/128: handle nil that is sometimes returned by (current-word), ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 9efeec690c 111/128: Remove the "backup" variable, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ff8d49c2c7 113/128: Merge pull request #69 from htsr/comment-stripping, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 95a558b362 099/128: add tests for markdown-style syntax, ELPA Syncer, 2022/01/02