 ;;         C-u C-u C-x C-s -> Unconditionally makes the previous version into
 ;;                            a backup file.
 ;;     C-u C-u C-u C-x C-s -> Does both of what C-u prefix and C-u C-u prefix do.
+;;
+;; (5) The new `comment-line' function in emacs 25.1 is based off the above
+;;     `endless/comment-line-or-region' function. But I do not like `comment-line'
+;;     as it always comments/uncomments *whole* lines only, even when a region is
+;;     selected.
+;;
+;;     Annoyances of `comment-line':
+;;
+;;     - Case where the `mark' is at the BOL. I do not intend to comment the 3rd
+;;       line in the below example.
+;;
+;;       ▮(let ((foo "bar"))                        ;; (let ((foo "bar"))
+;;         (message foo))      -- comment-line -->  ;;   (message foo))
+;;       ▯(let ((baz "cat"))                        ;; (let ((baz "cat"))
+;;         (message baz))                                (message baz))
+;;
+;;     - Case where I intend to comment out *only* the selected sexp, not the whole
+;;       line.
+;;
+;;       (let (▮(foo "bar")▯)  -- comment-line -->  ;; (let ((foo "bar"))
+;;         (message foo))                             (message foo))
+;;
+;;     Above gets fixed by `endless/comment-line-or-region':
+;;
+;;       ▮(let ((foo "bar"))                                          ;; (let ((foo "bar"))
+;;         (message foo))      -- endless/comment-line-or-region -->  ;;   (message foo))
+;;       ▯(let ((baz "cat"))                                          (let ((baz "cat"))
+;;         (message baz))                                                  (message baz))
+;;
+;;       (let (▮(foo "bar")▯)  -- endless/comment-line-or-region -->  (let (;; (foo "bar")
+;;         (message foo))                                                   )
+;;                                                                      (message foo))

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

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

  ("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)


(provide 'setup-editing)
