Relation of core-level binding energy shifts to proton affinity and Lewis basicity