From f9b697ddaa60742d4a60b1fa4ab37efc2c3cb1e1 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 29 Nov 2013 18:06:34 -0800 Subject: Stop keeping (all but one) generated cedet grammar files in the repository * configure.ac (SUBDIR_MAKEFILES, AC_CONFIG_FILES): Add admin/grammars Makefile. * Makefile.in (distclean, bootstrap-clean, maintainer-clean): Also clean admin/grammars, if present. * admin/grammars/README: Remove. * admin/grammars/Makefile.in: New file. * admin/grammars/c.by, admin/grammars/java-tags.wy, admin/grammars/js.wy: * admin/grammars/python.wy: Update declarations to match generated outputs. * lisp/Makefile.in (semantic): New. (compile-main): Depend on semantic. * lisp/cedet/semantic/bovine/grammar.el (bovine--make-parser-1): New function, split from bovine-make-parsers. (bovine-make-parsers): Use bovine--make-parser-1. (bovine-batch-make-parser): New function. * lisp/cedet/semantic/wisent/grammar.el (wisent--make-parser-1): New function, split from wisent-make-parsers. (wisent-make-parsers): Use wisent--make-parser-1. (wisent-batch-make-parser): New function. * lisp/cedet/semantic/db.el (semanticdb-save-all-db): Avoid prompting in batch mode. * lisp/cedet/semantic/grammar.el (semantic-grammar-footer-template): Disable version-control and autoloads in the output. (semantic-grammar-create-package): Add option to return nil if output is up-to-date. * lisp/cedet/semantic/bovine/c-by.el, lisp/cedet/semantic/bovine/make-by.el: * lisp/cedet/semantic/bovine/scm-by.el, lisp/cedet/semantic/wisent/javat-wy.el: * lisp/cedet/semantic/wisent/js-wy.el, lisp/cedet/semantic/wisent/python-wy.el: * lisp/cedet/srecode/srt-wy.el: Remove generated files from repository. * .bzrignore: Update for this. --- lisp/cedet/semantic/grammar.el | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lisp/cedet/semantic/grammar.el') diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index a545fcaee46..ca36829df82 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -33,6 +33,8 @@ (require 'semantic/wisent) (require 'semantic/ctxt) (require 'semantic/format) +;; FIXME this is a generated file, but we need to load this file to +;; generate it! (require 'semantic/grammar-wy) (require 'semantic/idle) (require 'help-fns) @@ -605,6 +607,11 @@ The symbols in the template are local variables in \(provide '" libr ") +;; Local Variables: +;; version-control: never +;; no-update-autoloads: t +;; End: + ;;; " file " ends here ") "Generated footer template. @@ -822,9 +829,10 @@ Block definitions are read from the current table of lexical types." (noninteractive) noninteractive)) -(defun semantic-grammar-create-package (&optional force) +(defun semantic-grammar-create-package (&optional force uptodate) "Create package Lisp code from grammar in current buffer. -Does nothing if the Lisp code seems up to date. +If the Lisp code seems up to date, do nothing (if UPTODATE +is non-nil, return nil in such cases). If optional argument FORCE is non-nil, unconditionally re-generate the Lisp code." (interactive "P") @@ -854,7 +862,12 @@ Lisp code." (file-newer-than-file-p (buffer-file-name semantic--grammar-output-buffer) (buffer-file-name semantic--grammar-input-buffer))) - (message "Package `%s' is up to date." semantic--grammar-package) + (progn + (message "Package `%s' is up to date." semantic--grammar-package) + ;; It would be better if this were always the case, IMO, + ;; but the (unspecified) return value of this function is + ;; assumed to be non-nil in some places, it seems. + (if uptodate (setq output nil))) ;; Create the package (set-buffer semantic--grammar-output-buffer) ;; Use Unix EOLs, so that the file is portable to all platforms. @@ -1914,6 +1927,7 @@ Optional argument COLOR determines if color is added to the text." (provide 'semantic/grammar) + ;; Local variables: ;; generated-autoload-load-name: "semantic/grammar" ;; End: -- cgit v1.2.1