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

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

[nongnu] elpa/toc-org ff8d49c2c7 113/128: Merge pull request #69 from ht


From: ELPA Syncer
Subject: [nongnu] elpa/toc-org ff8d49c2c7 113/128: Merge pull request #69 from htsr/comment-stripping
Date: Sun, 2 Jan 2022 09:59:15 -0500 (EST)

branch: elpa/toc-org
commit ff8d49c2c7daab0061250b581d3eebc7265ee267
Merge: 5deaec41ed 37f3bf2733
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #69 from htsr/comment-stripping
    
    fix stripping of word "Comment" in headlines
---
 toc-org-test.el |  8 ++++++++
 toc-org.el      | 13 +++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/toc-org-test.el b/toc-org-test.el
index d927befeea..32aa389b0b 100644
--- a/toc-org-test.el
+++ b/toc-org-test.el
@@ -62,6 +62,14 @@
    "* About\n:TOC:\n drawer\n:END:\n\n* Table of Contents                      
                               :TOC:\n - [[#about][About]]\n - [[#use][Use]]\n 
- [[#different-href-styles][Different href styles]]\n - 
[[#example][Example]]\n\n#+OPTIONS: num: nil todo:t |:t\n\n* Installation\n** 
DONE via package.el\nThis is the simplest method if you have the package.el 
module\n(built-in since Emacs 24.1) you can simply use =M-x 
package-install=\nand then put the following snippet in your ~/. [...]
    "* About\n* Installation\n** DONE via package.el\n*** Rather 
commentious\n** No remove\n* Test ***\n")
 
+  (test-toc-org-raw-toc-gold-test
+   "* About\n:TOC:\n drawer\n:END:\n\n* Table of Contents                      
                               :TOC:\n - [[#about][About]]\n - [[#use][Use]]\n 
- [[#different-href-styles][Different href styles]]\n - 
[[#example][Example]]\n\n#+OPTIONS: num: nil todo:t |:t\n\n* Installation\n** 
DONE via package.el\nThis is the simplest method if you have the package.el 
module\n(built-in since Emacs 24.1) you can simply use =M-x 
package-install=\nand then put the following snippet in your ~/. [...]
+   "* About\n* Installation\n** DONE via package.el\n* Comment faire ?\n")
+
+  (test-toc-org-raw-toc-gold-test
+   "* About\n:TOC:\n drawer\n:END:\n\n* Table of Contents                      
                               :TOC:\n - [[#about][About]]\n - [[#use][Use]]\n 
- [[#different-href-styles][Different href styles]]\n - 
[[#example][Example]]\n\n#+OPTIONS: num: nil todo:t |:t\n\n* Installation\n** 
DONE via package.el\nThis is the simplest method if you have the package.el 
module\n(built-in since Emacs 24.1) you can simply use =M-x 
package-install=\nand then put the following snippet in your ~/. [...]
+   "* About\n* Installation\n** DONE via package.el\n* comment faire ?\n")
+
   ;; test noexport behavior
   (test-toc-org-raw-toc-gold-test
    "* About\n:TOC:\n drawer\n:END:\n\n* Table of Contents                      
                               :TOC:\n - [[#about][About]]\n - [[#use][Use]]\n 
- [[#different-href-styles][Different href styles]]\n - 
[[#example][Example]]\n\n#+OPTIONS: num: nil todo:t |:t\n\n* Installation\n** 
DONE via package.el\nThis is the simplest method if you have the package.el 
module\n(built-in since Emacs 24.1) you can simply use =M-x 
package-install=\nand then put the following snippet in your ~/. [...]
diff --git a/toc-org.el b/toc-org.el
index f519b20f8b..a05196ebb9 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -183,12 +183,13 @@ auxiliary text."
 
       ;; strip COMMENT headlines
       (goto-char (point-min))
-      (while (re-search-forward toc-org-COMMENT-regexp nil t)
-        (let ((skip-depth (concat (match-string 1) "*")))
-          (while (progn
-                   (beginning-of-line)
-                   (delete-region (point) (min (1+ (line-end-position)) 
(point-max)))
-                   (string-prefix-p skip-depth (or (current-word) ""))))))
+      (let ((case-fold-search nil))
+        (while (re-search-forward toc-org-COMMENT-regexp nil t)
+          (let ((skip-depth (concat (match-string 1) "*")))
+            (while (progn
+                     (beginning-of-line)
+                     (delete-region (point) (min (1+ (line-end-position)) 
(point-max)))
+                     (string-prefix-p skip-depth (or (current-word) "")))))))
 
       ;; strip headings with :noexport: tag
       (goto-char (point-min))



reply via email to

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