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

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

[nongnu] elpa/evil-nerd-commenter 8e126cda3d 133/235: workaround haml-mo


From: ELPA Syncer
Subject: [nongnu] elpa/evil-nerd-commenter 8e126cda3d 133/235: workaround haml-mode comment issue
Date: Thu, 6 Jan 2022 02:59:42 -0500 (EST)

branch: elpa/evil-nerd-commenter
commit 8e126cda3d47f87f96d81b5abf76188d3b6316fe
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>

    workaround haml-mode comment issue
---
 evil-nerd-commenter.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 8fba0b4837..ac99b0162d 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -132,7 +132,8 @@ Please note it has NOT effect on evil text object!")
 (defun evilnc--fix-buggy-major-modes ()
   "Fix major modes whose comment regex is buggy.
 See http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-03/msg00891.html.";
-  (if (eq major-mode 'autoconf-mode)
+  (cond
+   ((eq major-mode 'autoconf-mode)
     ;; since comment-use-syntax is nil in autoconf.el, the comment-start-skip 
need
     ;; make sure its first parenthesized expression match the string exactly 
before
     ;; the "dnl", check the comment-start-skip in lisp-mode for sample.
@@ -144,7 +145,13 @@ See 
http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-03/msg00891.html.";
     ;; My regex makes sure (match-end 1) return the position of comment starter
     (if (and (boundp 'comment-use-syntax) (not comment-use-syntax))
         ;; Maybe autoconf.el will (setq comment-use-syntax t) in the future?
-        (setq comment-start-skip "^\\(\\s*\\)\\(dnl\\|#\\) +"))))
+        (setq comment-start-skip "^\\(\\s*\\)\\(dnl\\|#\\) +"))
+    )
+   ((eq major-mode 'haml-mode)
+    (setq comment-use-syntax nil)
+    (setq comment-start "-# ")
+    (setq comment-start-skip "-##*[ \t]*"))
+    ))
 
 (defun evilnc--operation-on-lines-or-region (fn &optional num)
   "Apply FN on NUM lines or selected region."



reply via email to

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