Jun 30, 2009
Jun 23, 2009
Jun 22, 2009
How to automatically generate file header using Emacs
When we use emacs to write text files, file headers containing specific information, such as the author, the date of creation, the data of update, can be generated automatically. The following are steps to make it work.
1. Download the file header2.el. from http://www.emacswiki.org/emacs/header2.el
2. Add the following to your .emacs file, which you can find in the $home directory.
(add-to-list 'load-path' "here is the directory where you store the header2.el")
3. Then put the following to your .emacs file:
(add-hook 'write-file-hooks 'auto-update-file-header)
(add-hook 'emacs-lisp-mode-hook 'auto-make-header)
(add-hook 'c-mode-common-hook 'auto-make-header)
(add-hook 'tex-mode-hook 'auto-make-header)
4. To make the header personal, you can change the header2.el by comment or uncomment different variables.
1. Download the file header2.el. from http://www.emacswiki.org/emacs/header2.el
2. Add the following to your .emacs file, which you can find in the $home directory.
(add-to-list 'load-path' "here is the directory where you store the header2.el")
3. Then put the following to your .emacs file:
(add-hook 'write-file-hooks 'auto-update-file-header)
(add-hook 'emacs-lisp-mode-hook 'auto-make-header)
(add-hook 'c-mode-common-hook 'auto-make-header)
(add-hook 'tex-mode-hook 'auto-make-header)
4. To make the header personal, you can change the header2.el by comment or uncomment different variables.
Subscribe to:
Comments (Atom)
