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

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

[nongnu] elpa/toc-org 4798d15365 110/128: WIP Fix stripping of word "Com


From: ELPA Syncer
Subject: [nongnu] elpa/toc-org 4798d15365 110/128: WIP Fix stripping of word "Comment" in headlines
Date: Sun, 2 Jan 2022 09:59:14 -0500 (EST)

branch: elpa/toc-org
commit 4798d15365bb3801b60b6fc619cca5342571e4c3
Author: Hugo Thiessard <htsr@pm.me>
Commit: Hugo Thiessard <htsr@pm.me>

    WIP Fix stripping of word "Comment" in headlines
    
    The regexp
    search 
(https://github.com/snosov1/toc-org/blob/d52f95fae8c54bdcbd63ba0d394074156d8e4a70/toc-org.el#L186)
    is case-insensitive so it incorrectly ignore heading starting with the
    french word "Comment" (why). This search is now case-sensitive.
---
 toc-org.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/toc-org.el b/toc-org.el
index f519b20f8b..1d7f64a79c 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -183,12 +183,15 @@ 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 (backup-case-fold-search case-fold-search)
+        (setq 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) ""))))))
+        (setq case-fold-search backup-case-fold-search))
 
       ;; strip headings with :noexport: tag
       (goto-char (point-min))



reply via email to

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