Maris,
I committed your patch to profile.tcl with a few modifications. The window placement is a nice improvement. There was already an error trap for profiles with a 0 length, so I deleted your 2nd trap for this condition. I also moved the trap for elevation range = 0 up a bit to immediately after the spot where the procedure for generating elevation range is called.
I thought of another potential problem but haven’t found a way to trap it. If you send r.profile any coordinates that extend beyond the current region, it will crash and crash the entire GUI—in spite of the fact that the call to r.profile is trapped with a catch statement. The profiler generates correct coordinates for any place on the display, regardless of whether it extends beyond the region boundaries or not. However, r.profile apparently chokes on coordinates outside the region.
I’m not sure if this can really be called a bug in r.profile, but it should probably fail more gracefully.
Michael
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton