If the factor is known ahead of time:
expr = -1 + E^x + m/(1 + x) + E^x (-m + x);
fac = 1 - m + x;
fac*Simplify[expr/fac]
If the factor is not known and the form of the complementary factor is irrelevant:
Factor[expr]
If the factor is not known and the form of the complementary factor is to be simplified:
fac = (m /. First@Solve[expr == 0, m]) - m;
fac*Simplify[expr/fac]
Alternatively:
root = First@SolveValues[expr == 0, m];
D[-expr, m] (root - m)
Finally, if the factor is known and the form of the complementary factor is known, type it out, as was done in the OP: However, I tend to assume that a question asking for code to achieve a particular output is looking for something more general than typing out a particular, known result. In generalizing, it isn't clear to me what can be assumed about the input and what is the exact form of the output. For instance, I was looking at the input as a linear polynomial in m with a parameter x. Perhaps that's not always the case, because it's a bit annoying (programmatically) that the coefficient of m is to be -1. In any case, if there is a general problem and none of the ad hoc solutions help with it, please add more details.