diff options
| author | Stefan Kangas | 2019-10-22 18:02:43 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2019-10-22 18:06:01 +0200 |
| commit | 1f1b2e3da66ecc47bcaae4ea7df0a8ef884b40d0 (patch) | |
| tree | b57da0c7c12e2511b9f9a99d716c95d0ef53e00d | |
| parent | 38021e555961c534c7e386547214ef1eb725dadc (diff) | |
| download | emacs-1f1b2e3da66ecc47bcaae4ea7df0a8ef884b40d0.tar.gz emacs-1f1b2e3da66ecc47bcaae4ea7df0a8ef884b40d0.zip | |
Various doc fixes for auto-insert-mode
* doc/misc/autotype.texi (Autoinserting): Various doc fixes.
* lisp/autoinsert.el (top-level): Recommend 'auto-insert-mode' over
'add-hook'.
| -rw-r--r-- | doc/misc/autotype.texi | 17 | ||||
| -rw-r--r-- | lisp/autoinsert.el | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/doc/misc/autotype.texi b/doc/misc/autotype.texi index 89cba183a25..e36793bf587 100644 --- a/doc/misc/autotype.texi +++ b/doc/misc/autotype.texi | |||
| @@ -268,8 +268,8 @@ certain contexts. For example an escaped character stands for itself. | |||
| 268 | @kbd{M-x auto-insert} will put some predefined text at the beginning of | 268 | @kbd{M-x auto-insert} will put some predefined text at the beginning of |
| 269 | the buffer. The main application for this function, as its name suggests, | 269 | the buffer. The main application for this function, as its name suggests, |
| 270 | is to have it be called automatically every time an empty, and only an | 270 | is to have it be called automatically every time an empty, and only an |
| 271 | empty file is visited. This is accomplished by putting @code{(add-hook | 271 | empty file is visited. This is accomplished by putting |
| 272 | 'find-file-hook 'auto-insert)} into your @file{~/.emacs} file | 272 | @code{(auto-insert-mode t)} into your init file |
| 273 | (@pxref{Init File,,, emacs, The GNU Emacs Manual}). | 273 | (@pxref{Init File,,, emacs, The GNU Emacs Manual}). |
| 274 | 274 | ||
| 275 | @vindex auto-insert-alist | 275 | @vindex auto-insert-alist |
| @@ -300,15 +300,16 @@ the filename to prevent multiple inclusions. C and C++ sources insert an | |||
| 300 | include of the header. Makefiles insert the file makefile.inc if it exists. | 300 | include of the header. Makefiles insert the file makefile.inc if it exists. |
| 301 | 301 | ||
| 302 | TeX and bibTeX mode files insert the file tex-insert.tex if it exists, while | 302 | TeX and bibTeX mode files insert the file tex-insert.tex if it exists, while |
| 303 | LaTeX mode files insert a typical @code{\documentclass} frame. Html | 303 | LaTeX mode files insert a typical @code{\documentclass} frame. HTML |
| 304 | files insert a skeleton with the usual frame. | 304 | files insert a skeleton with the usual frame. |
| 305 | 305 | ||
| 306 | Ada mode files call the Ada header skeleton command. Emacs lisp | 306 | Ada mode files call the Ada header skeleton command. Emacs Lisp |
| 307 | source files insert the usual header, with a copyright of your | 307 | source files insert the usual header, with a copyright of your |
| 308 | environment variable @env{$ORGANIZATION} or else the FSF, and prompt | 308 | environment variable @env{$ORGANIZATION} or else the name of the |
| 309 | for valid keywords describing the contents. Files in a @file{bin} | 309 | current user, and prompt for valid keywords describing the contents. |
| 310 | directory for which Emacs could determine no specialized mode | 310 | Files in a @file{bin} directory for which Emacs could determine no |
| 311 | (@pxref{Choosing Modes,,, emacs, The GNU Emacs Manual}) are set to Shell script mode. | 311 | specialized mode (@pxref{Choosing Modes,,, emacs, The GNU Emacs |
| 312 | Manual}) are set to Shell script mode. | ||
| 312 | 313 | ||
| 313 | @findex define-auto-insert | 314 | @findex define-auto-insert |
| 314 | In Lisp (@pxref{Init File,,, emacs, The GNU Emacs Manual}) you can use the function | 315 | In Lisp (@pxref{Init File,,, emacs, The GNU Emacs Manual}) you can use the function |
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index a77ca091d29..b8c2bfd6068 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | ;; auto-mode-alist. | 32 | ;; auto-mode-alist. |
| 33 | ;; | 33 | ;; |
| 34 | ;; To use: | 34 | ;; To use: |
| 35 | ;; (add-hook 'find-file-hook 'auto-insert) | 35 | ;; (auto-insert-mode t) |
| 36 | ;; setq auto-insert-directory to an appropriate slash-terminated value | 36 | ;; setq auto-insert-directory to an appropriate slash-terminated value |
| 37 | ;; | 37 | ;; |
| 38 | ;; You can also customize the variable `auto-insert-mode' to load the | 38 | ;; You can also customize the variable `auto-insert-mode' to load the |