emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/toc-org 5a2d7e58dd 028/128: add org-toc-2 alias


From: ELPA Syncer
Subject: [nongnu] elpa/toc-org 5a2d7e58dd 028/128: add org-toc-2 alias
Date: Sun, 2 Jan 2022 09:59:07 -0500 (EST)

branch: elpa/toc-org
commit 5a2d7e58dd82e11e3e5c1fe114120d801073a943
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: Sergei Nosov <sergei.nosov@gmail.com>

    add org-toc-2 alias
---
 README.org | 38 +++++++++++++++++++++++++++-----------
 org-toc.el |  1 +
 2 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/README.org b/README.org
index 599c2091d5..dcc7fd762b 100644
--- a/README.org
+++ b/README.org
@@ -12,6 +12,7 @@ It is similar to the 
[[https://github.com/ardumont/markdown-toc][markdown-toc]]
  - [[#installation][Installation]]
      - [[#via-packageel][via package.el]]
      - [[#manual][Manual]]
+     - [[#potential-name-conflict][Potential name conflict]]
  - [[#use][Use]]
  - [[#different-href-styles][Different href styles]]
  - [[#example][Example]]
@@ -24,14 +25,15 @@ It is similar to the 
[[https://github.com/ardumont/markdown-toc][markdown-toc]]
 This is the simplest method if you have the package.el module (built-in since
 Emacs 24.1) you can simply use =M-x package-install= after setting up the 
[[http://melpa.org/#/getting-started][MELPA]]
 repository and then put the following snippet in your ~/.emacs file
+
 #+BEGIN_SRC elisp
-  (eval-after-load "org-toc-autoloads"
-    '(progn
-       (if (require 'org-toc nil t)
-           (add-hook 'org-mode-hook 'org-toc-enable)
-         (warn "org-toc not found"))))
+  (if (require 'org-toc-2 nil t)
+      (add-hook 'org-mode-hook 'org-toc-enable)
+    (warn "org-toc not found"))
 #+END_SRC
+
 ** Manual
+
 - Create folder ~/.emacs.d if you don't have it
 - Go to it and clone org-toc there
   #+BEGIN_SRC sh
@@ -40,10 +42,22 @@ repository and then put the following snippet in your 
~/.emacs file
 - Put this in your ~/.emacs file
   #+BEGIN_SRC elisp
     (add-to-list 'load-path "~/.emacs.d/org-toc")
-    (when (require 'org-toc nil t)
-      (add-hook 'org-mode-hook 'org-toc-enable))
+    (if (require 'org-toc-2 nil t)
+        (add-hook 'org-mode-hook 'org-toc-enable)
+      (warn "org-toc not found"))
   #+END_SRC
 
+** Potential name conflict
+
+If you install =contrib= Org modules, you may face a name conflict, since
+there's a package with the same name there. /Current/ package provides both
+=org-toc= and =org-toc-2= features to require. So, you should, probably, use 
the
+latter to avoid potential conflicts. The former is provided for backward
+compatibility.
+
+There still might be issues with autoloading in case both packages are
+installed. But those should be easy to workaround (e.g. don't use autoloads).
+
 * Use
 
 After the installation, every time you'll be saving an org file, the first
@@ -66,10 +80,12 @@ formats:
 You can also use =@= as separator, instead of =_=.
 
 *Note* In your emacs' setup, you can bind a tag =:TOC:= to a binding =T=:
-#+begin_src emacs-lisp
-(add-to-list 'org-tag-alist '("TOC" . ?T))
-#+end_src
-Now `C-c C-q T RET` and you are done putting the =:TOC:= entry.
+
+#+BEGIN_SRC emacs-lisp
+  (add-to-list 'org-tag-alist '("TOC" . ?T))
+#+END_SRC
+
+Now =C-c C-q T RET= and you are done putting the =:TOC:= entry.
 
 * Different href styles
 
diff --git a/org-toc.el b/org-toc.el
index 04a3879066..6b5a97833a 100644
--- a/org-toc.el
+++ b/org-toc.el
@@ -280,5 +280,6 @@ following tag formats:
 ;; 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"
 ;; End:
 
+(provide 'org-toc-2)
 (provide 'org-toc)
 ;;; org-toc.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]