Originally by KragenJavierSitaker.  Probably should use c-basic-offset or something instead of 4.

    ;;; It's kind of sad this doesn't exist normally...
    (defun indent-rigidly-n (n)
      "Indent the region, or otherwise the current line, by N spaces."
      (let* ((use-region (and transient-mark-mode mark-active))
             (rstart (if use-region (region-beginning) (point-at-bol)))
             (rend   (if use-region (region-end)       (point-at-eol)))
             (deactivate-mark "irrelevant")) ; avoid deactivating mark
        (indent-rigidly rstart rend n)))
    (defun indent-rigidly-4 ()
      "Indent the region, or otherwise the current line, by 4 spaces."
      (interactive)
      (indent-rigidly-n 4))
    (defun outdent-rigidly-4 ()
      "Indent the region, or otherwise the current line, by -4 spaces."
      (interactive)
      (indent-rigidly-n -4))
    (global-set-key [(control >)] 'indent-rigidly-4)
    (global-set-key [(control <)] 'outdent-rigidly-4)
