  We describe a simple entangling principle based on the scattering of photons
off single emitters in one-dimensional waveguides (or extremely-lossy
cavities). The scheme can be applied to photonic qubits encoded in polarization
or time-bin, and features a filtering mechanism that works effectively as a
built-in error-correction directive. This automatically maps imperfections from
weak couplings, atomic decay into undesired modes, frequency mismatches, or
finite bandwidths of the incident photonic pulses, into heralded losses instead
of infidelities. The scheme is thus adequate for high-fidelity maximally
entangling gates even in the weak-coupling regime. These, in turn, can be
directly applied to store and retrieve photonic-qubit states, thereby
completing an atom-photon interface toolbox, or to sequential measurement-based
quantum computations with atomic memories.
