  In recent years, high-accuracy data for pionic hydrogen and deuterium have
become the primary source of information on the pion-nucleon scattering
lengths. Matching the experimental precision requires, in particular, the study
of isospin-breaking corrections both in pion-nucleon and pion-deuteron
scattering. We review the mechanisms that lead to the cancellation of
potentially enhanced virtual-photon corrections in the pion-deuteron system,
and discuss the subtleties regarding the definition of the pion-nucleon
scattering lengths in the presence of electromagnetic interactions by comparing
to nucleon-nucleon scattering. Based on the pi^{+/-} p channels we find for the
virtual-photon-subtracted scattering lengths in the isospin basis
a^{1/2}=(170.5 +/- 2.0) x 10^{-3} mpi^{-1} and a^{3/2}=(-86.5 +/- 1.8) x
10^{-3} mpi^{-1}.
