   ("M-=" . count-words) ; count words in buffer if no region selected
   ;; Override M-backspace to always do `backward-kill-word' using `modi-mode-map'.
   ;; Below is required so that `verilog-mode' does not bind it to `kill-word'.
+  ;; Override the default binding for `comment-dwim'
+  ("M-;" . endless/comment-line-or-region)
+  ;; Override the default binding for `comment-set-column'
+  ("C-x ;" . comment-dwim)
   ("<M-delete>" . backward-kill-word))
 (bind-to-modi-map "=" #'modi/align-to-equals)
-
-(>=e "25.0" ; `comment-line' was added new in emacs 25.1
-    (bind-keys
-     :map modi-mode-map
-      ;; Swap the M-; and C-x C-; bindings
-      ("M-;" . comment-line) ; was `comment-dwim' by default
-      ("C-x C-;" . comment-dwim))) ; was `comment-line' by default
 
 
 (provide 'setup-editing)

;; Time-stamp: <2016-07-19 16:11:29 kmodi>

;; Functions related to editing text in the buffer
;; Contents:

         ;; and the selected region will be MOVED to the point location.
         ("<S-s-down-mouse-1>" . mouse-drag-secondary-moving)))

;;; Commenting
;; http://stackoverflow.com/questions/9688748/emacs-comment-uncomment-current-line
;; http://endlessparentheses.com/implementing-comment-line.html
(defun endless/comment-line-or-region (n)
  "Comment or uncomment current line and proceed to the next line.
 With positive prefix, apply to N lines including current one.
 With negative prefix, apply to -N lines above.
 If region is active, apply to active region instead."
  (interactive "p")
  (if (use-region-p)
      (comment-or-uncomment-region
       (region-beginning) (region-end))
    (let ((range
           (list (line-beginning-position)
                 (goto-char (line-end-position n)))))
      (comment-or-uncomment-region
       (apply #'min range)
       (apply #'max range)))
    (forward-line 1)
    (back-to-indentation)))

;;; Bindings
(bind-keys
 :map modi-mode-map
