TITLE: When is the completion of a ring a local ring ?
QUESTION [20 upvotes]: Let $R$ be a commutative ring with unit and let $m$ be a maximal ideal of $R$. Are there known conditions on $R$ or $m$ such that the $m$-adic completion $\hat{R}$ of $R$ is a local ring. 
Since the completion of a Noetherian local ring is again local, I'm primarily interested in cases where $R$ itself is not local. 
An example is the polynomial ring $R=k[X_1,...,X_n]$ ($k$ a field) with $m=(X_1,...,X_n)$ where the power series ring $\hat{R}=k[[X_1,...,X_n]]$ is local with maximal ideal $(X_1,...,X_n)$.

REPLY [5 votes]: With Matt E's simple answer, the following answer may be of little help. But I'll post it nevertheless.
Recall that the completion is the inverse limit $\hat{R}=\varprojlim (R/m^i)$ which can be described as a subring of the product $\prod (R/m^i)$. $R/m^i$ is a local ring($m/m^i$ is a nilpotent maximal ideal) in which every element outside $m/m^i$ is a unit (let $w$ be in the complement, together with $m/m^i$ it generates the unit ideal, so $vw+n=1$ for some $n\in m/m^i$ and some $v$; thus, $vw$ being a sum of a unit and nilpotent is itself a unit).
The ideal $M\subseteq \hat{R}$ given by $M=\{(x_1,x_2,...)\in \hat{R}|x_1= 0\}$ is maximal since it is the kernel of the surjective homomorphism $\hat{R}\rightarrow R/m$ onto a field. Further we can see that any element of $\hat{R}$ outside $M$ is a unit as follows. Given $(x_1,x_2,...)$ with $x_1\neq 0$ we have an inverse $y_1\in R/m$. Now $x_2$ is non nilpotent since its homomorphic image $x_1$ is. Hence, $x_2$ is a unit by the observation in the previous answer. Moreover the image of $y_2$ in $R/m$ is $y_1$ (if $\varphi:R/m^2\rightarrow R/m$ is the canonical surjection, $x_1\varphi(y_2)=\varphi(x_2y_2)=1$ so $\varphi(y_2)=y_1x_1\varphi(y_2)=y_1$). Proceeding inductively with the same method, we get $y_i$ as the inverse of $x_i$ with the $y_i$'s satisfying the required compatibility and thus $y=(y_1,y_2,...)\in \hat{R}$  as the inverse of $(x_1,x_2,...)\notin M$.
Thus $M\subseteq\hat{R}$ is a maximal ideal with every element in the complement as a unit, hence $\hat{R}$ is local.