changeset 99723:a626eb454478

(auto-insert-alist): Don't use match data.
author Lute Kamstra <lute@gnu.org>
date Wed, 19 Nov 2008 05:50:54 +0000
parents 54f0f48fe43e
children bfbf9ff7903f
files lisp/autoinsert.el
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/autoinsert.el	Wed Nov 19 04:38:16 2008 +0000
+++ b/lisp/autoinsert.el	Wed Nov 19 05:50:54 2008 +0000
@@ -93,9 +93,9 @@
 (defcustom auto-insert-alist
   '((("\\.\\([Hh]\\|hh\\|hpp\\)\\'" . "C / C++ header")
      (upcase (concat (file-name-nondirectory
-		      (substring buffer-file-name 0 (match-beginning 0)))
+		      (file-name-sans-extension buffer-file-name))
 		     "_"
-		     (substring buffer-file-name (1+ (match-beginning 0)))))
+		     (file-name-extension buffer-file-name)))
      "#ifndef " str \n
      "#define " str "\n\n"
      _ "\n\n#endif")