[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/toc-org 421956e9cc 078/128: remove opening space in each t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/toc-org 421956e9cc 078/128: remove opening space in each toc item |
Date: |
Sun, 2 Jan 2022 09:59:11 -0500 (EST) |
branch: elpa/toc-org
commit 421956e9cc158e645e7cf88c47caff40099c0e5c
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: Sergei Nosov <sergei.nosov@gmail.com>
remove opening space in each toc item
---
README.org | 32 +++++++++++++++++---------------
toc-org-test.el | 22 +++++++++++-----------
toc-org.el | 2 +-
3 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/README.org b/README.org
index 470cd6df3a..8897bc68d7 100644
--- a/README.org
+++ b/README.org
@@ -11,16 +11,16 @@ It is similar to the
[[https://github.com/ardumont/markdown-toc][markdown-toc]]
name conflict with one of the org contrib modules.
* Table of Contents :TOC:
- - [[#about][About]]
- - [[#installation][Installation]]
- - [[#via-packageel][via package.el]]
- - [[#manual][Manual]]
- - [[#use][Use]]
- - [[#follow-links][Follow links]]
- - [[#exclude-headings][Exclude headings]]
- - [[#shortcut-for-toc-tag][Shortcut for TOC tag]]
- - [[#different-href-styles][Different href styles]]
- - [[#example][Example]]
+- [[#about][About]]
+- [[#installation][Installation]]
+ - [[#via-packageel][via package.el]]
+ - [[#manual][Manual]]
+- [[#use][Use]]
+ - [[#follow-links][Follow links]]
+ - [[#exclude-headings][Exclude headings]]
+ - [[#shortcut-for-toc-tag][Shortcut for TOC tag]]
+- [[#different-href-styles][Different href styles]]
+- [[#example][Example]]
* Installation
** via package.el
@@ -127,11 +127,13 @@ E.g. for =org= style it makes links to be the same as
their visible text:
#+BEGIN_SRC org
* About
* Table of Contents :TOC:
- - [[#about][About]]
- - [[#installation][Installation]]
- - [[#via-packageel][via package.el]]
- - [[#manual][Manual]]
- - [[#use][Use]]
+ - [[#about][About]]
+ - [[#installation][Installation]]
+ - [[#via-packageel][via package.el]]
+ - [[#manual][Manual]]
+ - [[#use][Use]]
+ - [[#example][Example]]
+
* Installation
** via package.el
** Manual
diff --git a/toc-org-test.el b/toc-org-test.el
index 34eb9d7be2..8384f929bf 100644
--- a/toc-org-test.el
+++ b/toc-org-test.el
@@ -136,18 +136,18 @@
(should (equal (toc-org-hrefify-toc "* About\n"
(lambda (str &optional hash) (upcase
str))
hash)
- " - [[ABOUT][About]]\n"))
+ "- [[ABOUT][About]]\n"))
(should (equal (gethash "ABOUT" hash) "About")))
;; check trailing space: https://github.com/snosov1/toc-org/pull/31
(let ((hash (make-hash-table :test 'equal)))
(should (equal (toc-org-hrefify-toc "* About \n"
(lambda (str &optional hash) (upcase
str))
hash)
- " - [[ABOUT][About]]\n"))
+ "- [[ABOUT][About]]\n"))
(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" (lambda
(str &optional hash) (upcase str)) 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"))
@@ -190,33 +190,33 @@
(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 "))
(test-toc-org-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 - [[#g [...]
+ "* 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 - [[#good [...]
(test-toc-org-insert-toc-gold-test
(concat beg ":TOC_1:")
- "* 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_1:\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_1:\n- [[#about][About]]\n- [[#hello][Hello]]\n")
(test-toc-org-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 - [[#go [...]
(test-toc-org-insert-toc-gold-test
(concat beg ":TOC_1_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_1_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_1_org:\n- [[About][About]]\n- [[Hello][Hello]]\n")
(test-toc-org-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 - [[G [...]
(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 [...]
+ "* 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- [[#about [...]
(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")
+ "* H1\n* H2\n* TOC :TOC:\n- [[#h1][H1]]\n- [[#h2][H2]]\n")
(test-toc-org-insert-toc-gold-test
"* H1\n* TODO H2\n* TOC :TOC:\n \n"
- "* H1\n* TODO H2\n* TOC :TOC:\n - [[#h1][H1]]\n -
[[#h2][H2]]\n")
+ "* H1\n* TODO H2\n* TOC :TOC:\n- [[#h1][H1]]\n- [[#h2][H2]]\n")
))
diff --git a/toc-org.el b/toc-org.el
index 18263ceffe..ac912de18b 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -250,8 +250,8 @@ each heading into a link."
(+ 2 (or (bound-and-true-p org-list-indent-offset) 0))
?\s)))
+ (insert "-")
(skip-chars-forward " ")
- (insert "- ")
(save-excursion
(delete-trailing-whitespace (point) (line-end-position)))
- [nongnu] elpa/toc-org 4cd71edc29 082/128: bump emacs25 version, (continued)
- [nongnu] elpa/toc-org 4cd71edc29 082/128: bump emacs25 version, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 827dc448e0 013/128: push .travis.yml, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 11be82816a 019/128: Merge pull request #4 from ardumont/add-tag-setup, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org b4dbeb936c 024/128: simply require ert, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 3dd30029b6 043/128: strip TODO and DONE states, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 7eb2874ed3 041/128: require org, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 3e0bdb5a29 054/128: fix properties handling (see #20), ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 7c54f809d6 058/128: Merge pull request #23 from snosov1/fix-eof-toc, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org b0cac21cdf 059/128: handle statistics cookies and #+OPTIONS: todo:t, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 44c2e17543 070/128: Merge pull request #36 from snosov1/move-tests, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 421956e9cc 078/128: remove opening space in each toc item,
ELPA Syncer <=
- [nongnu] elpa/toc-org 379b457fcf 107/128: fix subheading link in readme, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org f0b94e07bb 075/128: Merge pull request #39 from snosov1/add-noexport-support, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 274e821fd4 079/128: update emacs to 25 for travis testing, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 5deaec41ed 109/128: Update README.org, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org aef220c266 115/128: Merge pull request #71 from snosov1/fix-70, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4798d15365 110/128: WIP Fix stripping of word "Comment" in headlines, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org e76e6d4044 085/128: make toc-org work in derived modes, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d992b1f76a 108/128: Update README.org, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ce9e49303c 089/128: simply use downcase instead of replace-regexp-in-string, ELPA Syncer, 2022/01/02