-;; Time-stamp: <2016-07-22 18:33:33 kmodi>
+;; Time-stamp: <2016-07-25 17:19:07 kmodi>
 
 (>=e "25.0"
     (setq fast-but-imprecise-scrolling t))

                      (skip-chars-backward (car args))
                      (skip-chars-forward (nth 1 args) pt)
                      (point))))
             ;; If point is in a comment like "//abc" (in `c-mode'), and a
             ;; region is not selected, return the position of 'a'.
             (comment-start-pos (unless region-selected
                                  (save-excursion
                                    (goto-char beg)
                                    (comment-search-forward
                                     (line-end-position) :noerror)
                                    (point))))
             (end (if region-selected
                      (region-end)
                    (save-excursion
                      (skip-chars-forward (car args))
                      (skip-chars-backward (nth 2 args) pt)
                      (point)))))
        (when (and comment-start-pos
                   (> end comment-start-pos))
          (setq beg comment-start-pos))
        ;; (message "comment-start-pos = %d end = %d beg = %d"
        ;;          comment-start-pos end beg)
        (setq ffap-string-at-point
              (buffer-substring-no-properties
               (setcar ffap-string-at-point-region beg)
               (setcar (cdr ffap-string-at-point-region) end)))))
    (advice-add 'ffap-string-at-point :override #'modi/ffap-string-at-point)))

;; Inspired from this emacs.SE question: http://emacs.stackexchange.com/q/4271/115

the comment start characters (especially for major modes that have '//' as
comment start characters).

Sets variables `ffap-string-at-point' and `ffap-string-at-point-region'.

|-----------------------------------+---------------------------------|
| Example string in `c-mode' buffer | Returned `ffap-string-at-point' |
|-----------------------------------+---------------------------------|
| ▮//tmp                            | tmp                             |
| //▮tmp                            | tmp                             |
| ▮///tmp                           | /tmp                            |
| //▮/tmp                           | /tmp                            |
| ▮////tmp                          | //tmp                           |
| ////▮tmp                          | //tmp                           |
| ▮// //tmp                         | (empty string) \"\"             |
| // ▮/tmp                          | /tmp                            |
| // ▮//tmp                         | //tmp                           |
|-----------------------------------+---------------------------------| "
      (let* ((args
              (cdr
               (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
