 
 ;;; Scratch-and-Back
 ;; http://emacs.stackexchange.com/a/81/115
-(defun modi/switch-to-scratch-and-back (arg)
+(defun modi/switch-to-scratch-and-back (&optional arg)
   "Toggle between *scratch-MODE* buffer and the current buffer.
 If a scratch buffer does not exist, create it with the major mode set to that
 of the buffer from where this function is called.

    C-u COMMAND -> Open/switch to a scratch buffer in `org-mode'
C-u C-u COMMAND -> Open/switch to a scratch buffer in `emacs-elisp-mode'

PS: Even if the current major mode is a read-only mode (derived from `special-mode')
    we would want to be able to write in the scratch buffer. So the scratch
    major mode is set to `org-mode' for such cases."
  (interactive "p")
  (if (and (= arg 1) ; no prefix
           (string-match-p "\\*scratch" (buffer-name)))
      (switch-to-buffer (other-buffer))
    (let ((mode-str (cl-case arg
                      (0  "fundamental-mode") ; C-0
                      (4  "org-mode") ; C-u
                      (16 "emacs-lisp-mode") ; C-u C-u
                      ;; If the major mode turns out to be a `special-mode'
                      ;; derived mode, a read-only mode like `help-mode', open
                      ;; an `org-mode' scratch buffer instead.
                      (t (if (derived-mode-p 'special-mode) ; no prefix
                             "org-mode"
                           (format "%s" major-mode)))))) ;
      (switch-to-buffer (get-buffer-create
                         (concat "*scratch-" mode-str "*")))
      (funcall (intern mode-str))))) ; http://stackoverflow.com/a/7539787/1219634

;;; Minibuffer and Recursive Edit
;; Quit the minibuffer automatically when focus moves away from it (which could

;; Time-stamp: <2016-09-01 11:26:50 kmodi>

;; Windows and buffers manipulation

