Yes, 5 hours is almost allways reachable (depends on the backlightsetting as you can easily add 50% powercunsumption when going from mininum to maximum brightness) and most times I end at 5 1/4 to 5 1/2 hours.
I use a Inspiron 6000 with integrated graphics, 1gb PC533 Ram (2x512), a pinmodded 1.7Ghz/400FSB P-M (which I clock to 1.6 Ghz/533 FSB when on batteries - this also keeps the temps down and fan off 95% of the time. If I really need the power I can switch to 2.26Ghz, but that will considerably shorten runtime), 80GB 5400 HDD, DVD-RW, WSXGA+ Display, wifi and bluetooth enabled (bt costs about 5 minutes batterie time

).
To get to these runtimes you need to undervolt the cpu (which is almost always possible) and use something like nhc (notebook hardware control) to enable more multipliers than just min and max. With that I reduced 6x voltage to 0.7V instead of 0.998 and 12x to 1.036V (you have to make stability tests to find stable undervoltage settings for your cpu).
Also be sure to fetch i8kfangui to change the fanbehaviour (if you idle most the time no fan is needed if you undervolt).
Most of the times my cputemp is in the upper 30°C when idling with fan off all the time, just when starting to compile the fan might spin up until about 2 seconds after compilation finishs.
Brightness is 2 or 3 notches down from maxsetting to reach these values.
And just one more reminder, runtime also depends on hdd and cd/dvd usage as those drives also love power

But usage of those is minimal if you are coding, just compiling takes a bit more power

If you can stably undervolt your M740 to 0.7V@6x (which will work almost always) and ~1.1V at 13x (and voltages between 0.7 and 1.1 for the other multis) and use fangui to keep the fan off when idle (mine starts at 45°C) you should get similar runtime, as long as you have enough ram to kepp your lappy from swapping all the time while coding.