 (defun shorten-directory (dir max-length)
   "Show up to `max-length' characters of a directory name `dir'."
   (let ((path (reverse (split-string (abbreviate-file-name dir) "/")))
-        (output ""))
+         (output ""))
     (when (and path (equal "" (car path)))
       (setq path (cdr path)))
     (while (and path (< (length output) (- max-length 4)))

(defun set-cursor-according-to-mode ()
  "Change cursor color and type according to some minor modes."
  (let ((read-only-color "#CE4045")
        (read-only-cursor-type 'hbar)
        (overwrite-cursor-type 'box)
        (normal-color "yellow")
        (normal-cursor-type 'bar))

    (cond
     (buffer-read-only
      (set-cursor-color read-only-color)
      (setq cursor-type read-only-cursor-type))
     (overwrite-mode
      (set-cursor-color overwrite-color)
      (setq cursor-type overwrite-cursor-type))
     (t 
      (set-cursor-color normal-color)
      (setq cursor-type normal-cursor-type))))
    )
  




    (when (not (eq last-command this-command))
      (put this-command 'state 0))
    (cond
      ((equal 0 (get this-command 'state))
        (upcase-initials-region ξp1 ξp2)
        (put this-command 'state 1))
      ((equal 1  (get this-command 'state))
        (upcase-region ξp1 ξp2)
        (put this-command 'state 2))
      ((equal 2 (get this-command 'state))
        (downcase-region ξp1 ξp2)
        (put this-command 'state 0)))))



