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

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

[nongnu] elpa/evil-nerd-commenter 7ec8564adc 082/235: optimize code a li


From: ELPA Syncer
Subject: [nongnu] elpa/evil-nerd-commenter 7ec8564adc 082/235: optimize code a little bit
Date: Thu, 6 Jan 2022 02:59:37 -0500 (EST)

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

    optimize code a little bit
---
 evil-nerd-commenter.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index da64600677..bb933c17fc 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -75,7 +75,7 @@
 (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";
-  (when (string= major-mode "autoconf-mode")
+  (when (eq major-mode 'autoconf-mode)
     ;; since comment-use-syntax is nil in autoconf.el, the comment-start-skip 
need
     ;; make sure the its first parenthesized expression match the string 
exactly before
     ;; the "dnl", check the comment-start-skip in lisp-mode may give you some 
hint.
@@ -111,7 +111,7 @@
           ;; in evil-mode, if we use hot key V `M-x evil-visual-line` to 
select line
           ;; the (line-beginning-position) of the line which is after the last 
selected
           ;; line is always (region-end)! Don't know why.
-          (if (and (> e b) (= e (line-beginning-position)) (boundp 
'evil-state) (string= evil-state 'visual))
+          (if (and (> e b) (= e (line-beginning-position)) (boundp 
'evil-state) (eq evil-state 'visual))
               (setq e (1- e))
             )
           (goto-char b)
@@ -158,8 +158,8 @@
     (delq nil
           (mapcar #'(lambda (f)
                       ;; learn this trick from flyspell
-                      (or (string= f 'font-lock-comment-face)
-                          (string= f 'font-lock-comment-delimiter-face)))
+                      (or (eq f 'font-lock-comment-face)
+                          (eq f 'font-lock-comment-delimiter-face)))
                   fontfaces))))
 
 ;; @return (list beg end)
@@ -219,7 +219,7 @@
         lang
         lang-f
         old-flag)
-    (when (and (string= major-mode "org-mode")
+    (when (and (eq major-mode 'org-mode)
                (fboundp 'org-edit-src-find-region-and-lang))
       (setq info (org-edit-src-find-region-and-lang)))
 
@@ -248,7 +248,7 @@
 
 (defun evilnc--comment-or-uncomment-region (beg end)
   (cond
-   ((string= major-mode "web-mode")
+   ((eq major-mode 'web-mode)
     ;; web-mode comment only works when region selected
     ;; uncomment only works when region not selected
     ;; test three sample point, comment or uncomment



reply via email to

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