[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/toc-org 5a8a3f9b3a 080/128: Merge pull request #42 from sn
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/toc-org 5a8a3f9b3a 080/128: Merge pull request #42 from snosov1/remove-opening-space |
Date: |
Sun, 2 Jan 2022 09:59:11 -0500 (EST) |
branch: elpa/toc-org
commit 5a8a3f9b3a1440eb207a031685b7f4d77ef05b76
Merge: d30b57f16d 274e821fd4
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #42 from snosov1/remove-opening-space
remove opening space in each toc item
fix #41
---
.travis.yml | 11 ++++++-----
README.org | 32 +++++++++++++++++---------------
toc-org-test.el | 22 +++++++++++-----------
toc-org.el | 2 +-
4 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 1ea12320d3..55a4eb0f1e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,11 +1,12 @@
language: emacs-lisp
before_install:
# PPA for stable Emacs packages
- - sudo add-apt-repository -y ppa:cassou/emacs
- # PPA for Emacs nightlies
- - sudo add-apt-repository -y ppa:ubuntu-elisp/ppa
+ - sudo add-apt-repository -y ppa:kelleyk/emacs
# Update and install the Emacs for our environment
- sudo apt-get update -qq
- - sudo apt-get install -qq -yy emacs24-nox emacs24-el
+ - sudo apt-get install -qq -yy emacs25-nox
- emacs --version
-script: emacs -batch -l ert -l toc-org.el -l toc-org-test.el -f
ert-run-tests-batch-and-exit && emacs -batch -f batch-byte-compile toc-org.el
2>&1 | sed -n '/Warning\|Error/p' | xargs -r ls
+ - emacs-25.2 --version
+script:
+ - emacs -batch -l ert -l toc-org.el -l toc-org-test.el -f
ert-run-tests-batch-and-exit && emacs -batch -f batch-byte-compile toc-org.el
2>&1 | sed -n '/Warning\|Error/p' | xargs -r ls
+ - emacs-25.2 -batch -l ert -l toc-org.el -l toc-org-test.el -f
ert-run-tests-batch-and-exit && emacs -batch -f batch-byte-compile toc-org.el
2>&1 | sed -n '/Warning\|Error/p' | xargs -r ls
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 40c6754d9f 083/128: replacs string-join with mapconcat, (continued)
- [nongnu] elpa/toc-org 40c6754d9f 083/128: replacs string-join with mapconcat, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 356b3fbb89 101/128: Define fake markdown mode in tests, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 2c4ff18a4e 092/128: document quote functionality, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4315afd2a4 095/128: fix readme, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org cf4a624b78 122/128: Add license file with GPLv3, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 2539b4be40 097/128: add test for parenthesis in custom TODO words declaration, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org f13f79737a 020/128: Wrap test call with `(eval-after-load "ert-autoloads"...), ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org e9cf57041a 008/128: fix heading regexp, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org abbcb67166 011/128: allow _ as seprartor, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ad3424d457 067/128: move tests to a separate file, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 5a8a3f9b3a 080/128: Merge pull request #42 from snosov1/remove-opening-space,
ELPA Syncer <=
- [nongnu] elpa/toc-org aa52bd036d 071/128: handle headlines with COMMENT, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org d30b57f16d 077/128: Merge pull request #40 from alphapapa/update-primary-docstring, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 37f3bf2733 112/128: Add tests for the case-sensitive COMMENT regexp, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 4d259c9cea 086/128: Merge pull request #51 from snosov1/work-in-derived-modes, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org cd1868787c 087/128: Fix Emacs 26 warning, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 3315ef6c96 106/128: Merge pull request #66 from snosov1/enable-toc-org-for-markdown, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 9fefa63d42 119/128: Merge pull request #75 from Alexander-Miller/local-offset, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 7ff7abb015 029/128: update documentation on org-toc-2 in the source, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org df4ad6ff15 121/128: Merge pull request #76 from snosov1/revert-75-local-offset, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org c4c61c5a38 117/128: Merge pull request #73 from syohex/correct-sample, ELPA Syncer, 2022/01/02