I tried following in the scratch buffer:
(defun r-text-indent ()
(interactive)
(indent-line-to 4)) ;; 4 is just for example
(setq indent-line-function 'r-text-indent)
Evaluating those made scratch buffer indent everything 4 spaces. But all other buffers were unaffected.
How do I make this function to be used in all my plain-text buffers?
You can add a hook such that the variable is set for text-mode:
See also http://www.emacswiki.org/emacs/ModeHooks and How to change indentation in text-mode for emacs.