A point about integrals in Residue formula proof I am reading the following proof in Complex Analysis by Stein and Shakarchi, page 76.

They are using the concept of a keyhole contour, with which you are probably familiar. Let's call this keyhole contour $K$ and follow the book's notation for other curves.
Letting the width of the keyhole's corridor tend to zero, we are left with the following (after the corridor walls cancel out):
$$\int_K f(z)dz \; = \int_Cf(z)dz \; + \int_{C_{\epsilon}} f(z)dz \; = \; 0$$
Now, this seemingly contradicts the second equality presented in the image. But I suppose this is just a notation issue, because the book uses $\int_{C_{\epsilon}} f(z)dz$ to denote integral over positively oriented curve $C_\epsilon$, while I use it to denote integral over negatively oriented curve. It makes more sense to me to so because $C_\epsilon$ is a part of a bigger $K$ contour for which the orientation was already chosen.
My only question is whether this is correct?
EDIT:
Here are diagrams of what I mean by $K$, $C$ and $C_\epsilon$:


I took $z_0 = 0$ for simplicity and $\delta$ is the width of the corridor.
First I let $\delta \to 0$ which cancels the corridor and in my understanding leaves me with positively oriented circle $C$ and negatively oriented circle $C_\epsilon$. Also integral over the whole keyhole $K$ shown in the first image must be $0$ because $f(z)$ is holomorphic everywhere except at the point $z_0$.
 A: No.  Once the corridor walls cancel out, no part of the circle $C$ remains in the path.
You seem to be describing the complement of a keyhole contour -- the contour that corresponds to your integrals fails to enclose the pole at $z_0$.
Illustrating, with $z_0 = 0$ for simplicity.

As long as the walls have not squeezed in so far that they exactly cancel out, there is a small arc of $C$ in the path.  But once the two walls coincide, there is no piece of $C$ remaining (and we typically imagine $C_\varepsilon$ to have a tiny radius).
Note that $z_0$ need not be at the origin.  With $z_0 = 1/2 + \mathrm{i}/2$, we see

Putting the first two on the same axes, only a tiny portion of $C$ is used in $K$.  And at the instant the walls collapse together, no part of $C$ remains in the path.

A: I think part of the difficulty here is that the direction of the paths is being changed from that in the book, so let's assume both $C$ and $C_\epsilon$ are counter-clockwise. You have the correct idea: Since $f$ is holomorphic in the shaded region, the integral of $f$ along the entire contour $K$ below is $0$.

As the gap vanishes, the integral along the black segments cancel, and we get
$$
\int_Kf(z)\,\mathrm{d}z=\int_Cf(z)\,\mathrm{d}z-\int_{C_\epsilon}f(z)\,\mathrm{d}z=0
$$
with a minus instead of a plus as in the first equation in the question (after the image from the book).
