Hi Zhang,
thank you for your answer and thank you for your great job.
I've definitely moved from Terminal to Aquamacs (I'm on mac os x)
where I don't have this "phenomen"
and I have some super feature like switching meta key from ESC to Alt
with respect to my french keys (|,~,{, etc...) that need Alt key.
BTW,I use yasnippet with auto-insert to create template for my c files.
It's a little bit tricky but if anyone care...
.emacs:
(auto-insert-mode 1)
(add-to-list 'load-path "~/emacs/auto-insert") ;emacs va charger
les .el contenus dans ~/emacs
(load-library "c-header")
(setq auto-insert-alist
(append '((("\\.\\([Cc]\\|cc\\|cpp\\)\\'" . "C / C++
program") . insert-c-header-yasnippet))
auto-insert-alist))
~/emacs/auto-insert/c-header.el:
(defun insert-c-header-yasnippet ()
"Insère l'entête d'un fichier de type c (c/c++/...)"
(interactive)
(insert "c-header")
(yas/expand)
)
~/emacs/snippets/textmode/cc-mode/c-header:
#name : /* ... ... */
# --
/*
* `(file-name-nondirectory (file-name-sans-extension (buffer-file-
name)))`.c ${description}
*
* Bruno Boissonnet `(format-time-string "%A %d %b %Y")`
*
*
* ${remarques}
*/
#include "`(file-name-nondirectory (file-name-sans-extension (buffer-
file-name)))`.h"
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
$0
return EXIT_SUCCESS;
}
/* End of file */
Le 1 déc. 08 à 15:23, Zhang Chiyuan a écrit :