+ if (m->file_name)
+ ds_put_format (&s, "%s", m->file_name);
+
+ if (l1 > 0)
+ {
+ if (!ds_is_empty (&s))
+ ds_put_byte (&s, ':');
+
+ if (l2 > l1)
+ {
+ if (c1 > 0)
+ ds_put_format (&s, "%d.%d-%d.%d", l1, c1, l2, c2);
+ else
+ ds_put_format (&s, "%d-%d", l1, l2);
+ }
+ else
+ {
+ if (c1 > 0)
+ {
+ if (c2 > c1)
+ {
+ /* The GNU coding standards say to use
+ LINENO-1.COLUMN-1-COLUMN-2 for this case, but GNU
+ Emacs interprets COLUMN-2 as LINENO-2 if I do that.
+ I've submitted an Emacs bug report:
+ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7725.
+
+ For now, let's be compatible. */
+ ds_put_format (&s, "%d.%d-%d.%d", l1, c1, l1, c2);
+ }
+ else
+ ds_put_format (&s, "%d.%d", l1, c1);
+ }
+ else
+ ds_put_format (&s, "%d", l1);
+ }
+ }
+ else if (c1 > 0)
+ {
+ if (c2 > c1)
+ ds_put_format (&s, ".%d-%d", c1, c2);
+ else
+ ds_put_format (&s, ".%d", c1);
+ }
+ ds_put_cstr (&s, ": ");