Will another transmission fit in a 1987 4WD Ranger 5 speed or do you have to replace it with the same type?

There are several type of transmissions made for this truck, one by Mazda, the other by another company, I cant remember at the moment. Any who, as long as the transmission is the same length(Yes, the Mazda is somthing like 1.25 inches shorter or longer, its been a while sence I worked on one of these)or i think you can use the shorter driveline as long as the frame bolts line up. However it is best to stick with the original length and avoid any headaches that may arise.