1

I want to use autoinsert with C and headers, the code from http://www.emacswiki.org/emacs/AutoInsertMode works well so I made my own template for header in an elisp funtion, but the insertion repeat to time, asking me twice, it results in :

/**                                                                                                                    
 * test.h -- test                                                                                                      
 *                                                                                                                    
 * Written on Saturday, 28 November 2015.                                                                            
*/                                                                                                                  

#ifndef TEST_H                                                                                                         
#define TEST_H                                                                                                         

int main()                                                                                                             
{                                                                                                                      
  /**                                                                                                                  
   * test.h --                                                                                                           
   *                                                                                                                    
   * Written on Saturday, 28 November 2015.                                                                            
   */                                                                                                                  

   #ifndef TEST_H                                                                                                      
   #define TEST_H                                                                                                      

   int main()                                                                                                           
   {                                                                                                                    

   }                                                                                                                    

  #endif                                                                                                               
}                                                                                                                      
#endif
zck
  • 8,984
  • 2
  • 31
  • 65
user3593232
  • 383
  • 1
  • 8
  • Can you edit in your template, and give the steps you're doing to see the problem? Can you reproduce the problem from `emacs -Q`? – zck Nov 28 '15 at 23:09
  • I forgot to mention that I haven't use template, I have put functions like the ones in the link in a .el and load it at init. – user3593232 Nov 28 '15 at 23:17
  • 1
    Having functions "like the ones in the link" is the problem. Can you add the code you're using to the question? We can't really help you debug code we can't read. – zck Nov 29 '15 at 01:12

0 Answers0