]> code.delx.au - gnu-emacs/blobdiff - admin/grammars/wisent-grammar.el
Merge from emacs-23; up to 2012-01-19T07:15:48Z!rgm@gnu.org.
[gnu-emacs] / admin / grammars / wisent-grammar.el
similarity index 98%
rename from etc/grammars/wisent-grammar.el
rename to admin/grammars/wisent-grammar.el
index 77fdfddc5bfbb47da8601c4858a2e680f856007f..714b5211127aed77f6b7a84b14a9aebeabce1fe4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; wisent-grammar.el --- Wisent's input grammar mode
 
-;; Copyright (C) 2002-2011, 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: David Ponce <david@dponce.com>
@@ -331,7 +331,7 @@ Menu items are appended to the common grammar menu.")
      (grammar-setupcode-builder  . wisent-grammar-setupcode-builder)
      )))
 
-(add-to-list 'auto-mode-alist '("\\.wy$" . wisent-grammar-mode))
+(add-to-list 'auto-mode-alist '("\\.wy\\'" . wisent-grammar-mode))
 
 (defvar-mode-local wisent-grammar-mode semantic-grammar-macros
   '(
@@ -358,7 +358,6 @@ Menu items are appended to the common grammar menu.")
     )
   "Semantic grammar macros used in wisent grammars.")
 
-
 (defvar wisent-make-parsers--emacs-license
   ";; This file is part of GNU Emacs.
 
@@ -485,7 +484,7 @@ Menu items are appended to the common grammar menu.")
   (semantic-mode 1)
   ;; Loop through each .wy file in current directory, and run
   ;; `semantic-grammar-batch-build-one-package' to build the grammar.
-  (dolist (f (directory-files default-directory nil ".wy$"))
+  (dolist (f (directory-files default-directory nil "\\.wy\\'"))
     (let ((packagename
            (condition-case err
                (with-current-buffer (find-file-noselect f)
@@ -500,7 +499,6 @@ Menu items are appended to the common grammar menu.")
          ;; Touch up the generated parsers for Emacs integration.
          (with-temp-buffer
            (insert-file-contents packagename)
-           (setq buffer-file-name (expand-file-name packagename))
            ;; Fix copyright header:
            (goto-char (point-min))
            (when additional-copyright
@@ -514,7 +512,7 @@ Menu items are appended to the common grammar menu.")
            (insert wisent-make-parsers--emacs-license)
            (insert "\n\n;;; Commentary:
 ;;
-;; This file was generated from etc/grammars/"
+;; This file was generated from admin/grammars/"
                        f ".")
            (when additional-license
              (insert "\n" additional-license))
@@ -525,7 +523,7 @@ Menu items are appended to the common grammar menu.")
            (insert ";;; " require-name
                    ".el --- Generated parser support file")
            (delete-trailing-whitespace)
-           (re-search-forward ";;\n(require 'semantic-lex)\n")
+           (re-search-forward ";;\n(require 'semantic/lex)\n")
            (delete-region (match-beginning 0) (match-end 0))
            ;; Fix footer:
            (goto-char (point-max))
@@ -534,9 +532,6 @@ Menu items are appended to the common grammar menu.")
            (goto-char (point-max))
            (insert "(provide '" require-name ")\n\n")
            (insert ";;; " require-name ".el ends here\n")
-           (let ((make-backup-files nil))
-             (save-buffer))))))))
-
-
+           (write-region nil nil (expand-file-name packagename))))))))
 
 ;;; wisent-grammar.el ends here