FIR filter design by the Fourier transform method I am having some problems understanding how the Fourier transform method is used to determine the FIR filter. 

As far as i have understood, you start by using the ideal impulse reponse for the specific filter design you want to have.  Those are given in this table

As the the ideal impulse reponse contains infinite impulses, we truncate the infinite to finite a number by $m$, (which is confusing how this is done).

But my question is how do predetermine the order of the filter, without having to try randomly, using this method?
Some papers provide rule-of-thumb formula for the filter length (and coefficient quantization), for instance:


Accurate estimation of minimum filter length for optimum FIR digital filters, 2000, Ichige et al.
On computational complexity in digital filters, 1981, Bellanger
FIR Digital Filter Design Techniques Using Weighted Chebyshev Approximation, 1975, Rabiner et al.


The one I generally  use in lectures is borrowed from the second paper, for a low-pass filter with the following design:



Then, the estimated filter length $N$ (apparently $2M+1$ for you) is, with sampling frequency $f_s$:

$$ N = \frac{2 f_s}{3(f_2-f_1)}\log_{10} \left(\frac{1}{10\delta_1\delta_2}\right)$$