4. If line $l$ is translated 5 units in the negative direction of the $x$-axis, and then 1 unit in the positive direction of the $y$-axis, and it returns to its original position, then the slope of line $l$ is ( ).
(A) $-\frac{1}{5}$
(B) -5
(C) $\frac{1}{5}$
(D) 5
4.A.

According to the problem, the line $l$ returns to its original position after being translated along the vector $a=(-5,1)$. Let the equation of the line $l$ be $y=a x+b$. After the translation, the equation still has the form $y^{\prime}=a x^{\prime}+b$, where
$$
\left\{\begin{array} { l } 
{ y ^ { \prime } = y + 1 , } \\
{ x ^ { \prime } = x - 5 }
\end{array} \Rightarrow \left\{\begin{array}{l}
y=y^{\prime}-1, \\
x=x^{\prime}+5 .
\end{array}\right.\right.
$$

Therefore, after the translation, the equation of the line $l$ is
$$
y^{\prime}-1=a\left(x^{\prime}+5\right)+b \text {, }
$$

which simplifies to $y^{\prime}=a x^{\prime}+b+5 a+1$.
Thus, $5 a+1=0, a=-\frac{1}{5}$.