[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/toc-org ebff38bfa4 094/128: make toc-org a minor mode (#61
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/toc-org ebff38bfa4 094/128: make toc-org a minor mode (#61) |
Date: |
Sun, 2 Jan 2022 09:59:12 -0500 (EST) |
branch: elpa/toc-org
commit ebff38bfa4cc95476a20a349014e2d1862ff4647
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: GitHub <noreply@github.com>
make toc-org a minor mode (#61)
* make toc-org a minor mode
fixes #60
---
README.org | 2 +-
toc-org.el | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index 40934e3848..b510c48a70 100644
--- a/README.org
+++ b/README.org
@@ -36,7 +36,7 @@ repository and then put the following snippet in your
~/.emacs file
#+BEGIN_SRC elisp
(if (require 'toc-org nil t)
- (add-hook 'org-mode-hook 'toc-org-enable)
+ (add-hook 'org-mode-hook 'toc-org-mode)
(warn "toc-org not found"))
#+END_SRC
diff --git a/toc-org.el b/toc-org.el
index 63a35f7db2..ce1cf322aa 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -412,6 +412,17 @@ not :noexport_#:."
(setq org-link-translation-function 'toc-org-unhrefify)
(toc-org-insert-toc t)))
+;;;###autoload
+(define-minor-mode toc-org-mode
+ "Toggle `toc-org' in this buffer."
+ :group toc-org
+ (if toc-org-mode
+ (toc-org-enable)
+ (remove-hook 'before-save-hook 'toc-org-insert-toc t)
+ ;; we would've set `org-link-translation-function' only if it's been nil
+ (when (equal org-link-translation-function 'toc-org-unhrefify)
+ (setq org-link-translation-function nil))))
+
;; Local Variables:
;; compile-command: "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"
;; End:
- [nongnu] elpa/toc-org b1bab4c078 072/128: handle nil that is sometimes returned by (current-word), (continued)
- [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
- [nongnu] elpa/toc-org e33e4cc00a 084/128: Merge pull request #50 from snosov1/handle-custom-keywords, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 7291a3b08d 100/128: Enable link following in markdown mode, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org f455bd4c88 103/128: Call batch compile before running the tests, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 8321d3c76b 120/128: Revert "Respect the file-local value of org-list-indent-offset.", ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 6eca67f9a8 127/128: Merge pull request #83 from skangas/silence-byte-compiler, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org 328d34144f 124/128: Bump version to 1.1, ELPA Syncer, 2022/01/02
- [nongnu] elpa/toc-org ebff38bfa4 094/128: make toc-org a minor mode (#61),
ELPA Syncer <=
- [nongnu] elpa/toc-org aa9aea6d69 102/128: Supress warnings, ELPA Syncer, 2022/01/02
- [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