[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/toc-org 4e4b4e6484 057/128: generate correct toc when it's
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/toc-org 4e4b4e6484 057/128: generate correct toc when it's the last heading |
Date: |
Sun, 2 Jan 2022 09:59:09 -0500 (EST) |
branch: elpa/toc-org
commit 4e4b4e6484dab76f627d8211dc768dbbc8c0116c
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: Sergei Nosov <sergei.nosov@gmail.com>
generate correct toc when it's the last heading
---
toc-org.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/toc-org.el b/toc-org.el
index 389cb4fc05..72ffde745c 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -364,7 +364,7 @@ following tag formats:
;; skip drawers
(let ((end
(save-excursion ;; limit to next heading
- (search-forward-regexp "^\\*" (point-max) t))))
+ (search-forward-regexp "^\\*" (point-max)
'skip))))
(while (re-search-forward toc-org-drawer-regexp end t)
(skip-chars-forward "[:space:]")))
(beginning-of-line)
@@ -377,7 +377,7 @@ following tag formats:
(let ((beg (point))
(end
(save-excursion
- (when (search-forward-regexp "^\\*" (point-max) t)
+ (when (search-forward-regexp "^\\*" (point-max)
'skip)
(forward-line -1))
(end-of-line)
(point))))
@@ -442,6 +442,10 @@ following tag formats:
(test-toc-org-insert-toc-gold-test
(concat beg ":TOC:\n:PROPERTIES:\n:VISIBILITY: content\n:END:\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:PROPERTIES:\n:VISIBILITY: content\n:END:\n - [[#abou [...]
+
+ (test-toc-org-insert-toc-gold-test
+ "* H1\n* H2\n* TOC :TOC:\n - [[#header-1][Header 1]]\n -
[[#header-2][Header 2]]\n"
+ "* H1\n* H2\n* TOC :TOC:\n - [[#h1][H1]]\n - [[#h2][H2]]\n")
))
;; Local Variables:
- [nongnu] elpa/toc-org 215d3e41e3 114/128: fix C-c C-o for links with cookies, (continued)
- [nongnu] elpa/toc-org 215d3e41e3 114/128: fix C-c C-o for links with cookies, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org a2cb4c254f 128/128: Merge pull request #84 from skangas/nongnu-elpa, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d66a41f6b7 010/128: strip tags, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org cac667fabd 018/128: Add a small note about global tag setup, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 752fe14c5b 042/128: fix "_1_org"-style suffixes, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 815c6d8c1b 044/128: flatten links when creating raw toc, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org e0cef2c6a1 027/128: print emacs version in travis log, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 8cf236450b 045/128: don't modify and save file on opening, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 114dcc9813 053/128: make GitHub hrefs unique (fixes #16), ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 72883a08b0 049/128: update the TOC only if it's actually different from the current one, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4e4b4e6484 057/128: generate correct toc when it's the last heading,
ELPA Syncer <=
- [nongnu] elpa/toc-org 4380d99113 065/128: add unit test for #31, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 970560a874 069/128: fix travis build, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 39d983c381 074/128: add noexport support, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 663e5ec281 116/128: Correct sample configuration to valid code, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org c83c19ddb4 093/128: Merge pull request #59 from snosov1/add-quote, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 35781c6313 126/128: Merge pull request #82 from skangas/add-license, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 08ed3f0883 061/128: Merge pull request #30 from snosov1/fix-28, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 56b48ec37b 033/128: rename to toc-org, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 11ce8a843f 052/128: strip priorities (fixes #18), ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org a19c3f5f94 091/128: test quote functionality, ELPA Syncer, 2022/01/02