diff options
author | Richard M. Stallman <rms@gnu.org> | 2001-12-18 19:37:37 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2001-12-18 19:37:37 +0000 |
commit | f6ec15321530f9fe630c35067587933ffbd8a6cf (patch) | |
tree | df085be34d4e8548950467bc63e6a9d1dcb46792 /lisp/autoinsert.el | |
parent | b04dcf45eb30771531fe4507cf99c1c1549cb614 (diff) | |
download | emacs-f6ec15321530f9fe630c35067587933ffbd8a6cf.tar.gz emacs-f6ec15321530f9fe630c35067587933ffbd8a6cf.tar.bz2 emacs-f6ec15321530f9fe630c35067587933ffbd8a6cf.zip |
(auto-insert-alist): Redo finding C and C++ headers.
Add a DESCRIPTION for the makefile item.
Diffstat (limited to 'lisp/autoinsert.el')
-rw-r--r-- | lisp/autoinsert.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index ae6e9863097..5ed3db56796 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -103,13 +103,14 @@ If this contains a %s, that will be replaced by the matching rule." (("\\.\\([Cc]\\|cc\\|cpp\\)\\'" . "C / C++ program") nil "#include \"" - ;; nop without latest cc-mode - (and (fboundp 'c-companion-file) - ;(file-readable-p (c-companion-file 'name)) - (file-name-nondirectory (c-companion-file 'name))) & ?\" - | -10) - - ("[Mm]akefile\\'" . "makefile.inc") + (let ((stem (file-name-sans-extension buffer-file-name))) + (cond ((file-exists-p (concat stem ".h")) + (file-name-nondirectory (concat stem ".h"))) + ((file-exists-p (concat stem ".hh")) + (file-name-nondirectory (concat stem ".hh"))))) + & ?\" | -10) + + (("[Mm]akefile\\'" . "Makefile") . "makefile.inc") (html-mode . (lambda () (sgml-tag "html"))) |