A door lock includes outer assemblies, latch assemblies and inner assemblies. The inner assemblies has a turning switch, fixing bolts, an interior rose and a detent device that includes an inner plate, a stop plate, a stop seat, a rotating spring, a retaining spring and a sprag. By pressing down the stop plate as the latch bolt is in a casing, a protruding block of the stop seat is engaged with a protruding member of the stop plate. The spindle can not rotate backward and maintains in an unlocked state. After the stop plate is pressed upward, the turning switch returns to a locked state and the latch bolt extends out of the casing. Therefore, the detent device can keep the latch bolt in the casing and keep the lock in the unlocked state.