emacs.rst
changeset 777 e759f98ea3a8
parent 776 48b1ac6283ec
child 782 bfd7453296ca
equal deleted inserted replaced
776:48b1ac6283ec 777:e759f98ea3a8
   297   http://xslt-process.sourceforge.net/
   297   http://xslt-process.sourceforge.net/
   298                 home page
   298                 home page
   299 
   299 
   300 * Useful program logging.
   300 * Useful program logging.
   301 
   301 
   302 Put first line to your log file, you must replace default-directory to dir where you build program:
   302 Put first line to your log file, you must replace 'default-directory' to dir where you build
       
   303 program:
   303 
   304 
   304   -*- mode: compilation-minor; mode: auto-revert-tail; default-directory: "~/devel/proj" -*-
   305   -*- mode: compilation-minor; mode: auto-revert-tail; default-directory: "~/devel/proj" -*-
   305 
   306 
   306 Program must use one of supported by 'compilation-minor-mode' (see
   307 Program must use one of supported by 'compilation-minor-mode' (see
   307 'compilation-error-regexp-alist'), like:
   308 'compilation-error-regexp-alist'), like:
   308 
   309 
   309   printf(__FILE__ ":%d: %s\n", __LINE__, msg);  /* msg - user defined string */
   310   printf(__FILE__ ":%d: %s\n", __LINE__, msg);  /* msg - user defined string */
   310 
   311 
       
   312 or in second form (in this case line number included in format string, so easy searchable in
       
   313 debugger):
       
   314 
       
   315   #define NUM2STR(x) STR(x)
       
   316   #define STR(x) #x
       
   317 
       
   318   printf(__FILE__ ":" NUM2STR(__LINE__) ": %s\n", msg);
       
   319 
       
   320 Or some faster use 'grep-mode', but you restricted with GNU like error format:
       
   321 
       
   322   -*- mode: grep; mode: auto-revert-tail; default-directory: "~/devel/proj" -*-
       
   323