 abc| ghi        <-- point still before white space after calling this function
 abc   |def  ghi <-- point on the right of white space before 'def'
 abc |ghi        <-- point still after white space after calling this function."
-  (interactive)
-  (save-excursion ; maintain the initial position of the point w.r.t. space
+  (save-excursion ; maintain the initial position of the pt with respect to space
     (cond ((looking-back "^ *") ; remove extra space at beginning of line
            (just-one-space 0)
            (indent-according-to-mode))
-          ((looking-at " *$") ; do nothing when point at end of line
-           )
           ((or (looking-at   " ")
                (looking-back " ")) ; adjust space only if it exists
            (just-one-space 1))
-          (t ; do nothing otherwise
+          (t ; do nothing otherwise, includes case where the point is at EOL
            ))))
 ;; Delete extra horizontal white space after `kill-word' and `backward-kill-word'
-(advice-add 'kill-word :after (lambda (arg) (modi/space-as-i-mean)))
+(advice-add 'kill-word :after #'modi/just-one-space-post-kill-word)
 
 ;;; Whole Buffer If Not Region
 (defvar modi/whole-buffer-if-not-region-fns '(indent-region

;; Time-stamp: <2015-09-21 12:58:20 kmodi>

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

(advice-add 'delete-blank-lines :before-until #'modi/delete-blank-lines-in-region)

;;; Space Adjustment After Word Kills
(defun modi/just-one-space-post-kill-word (&rest _)
  "Function to manage white space after `kill-word' operations.

1. If point is at the beginning of the line after possibly some white space,
   remove that white space and re-indent that line.
2. If there is space before or after the point, ensure that there is only
   one white space around the point.
3. Otherwise, do nothing.

During the whole operation do not change the point position with respect to the
surrounding white space.
