Function: semantic-grammar-batch-build-packages

semantic-grammar-batch-build-packages is a byte-compiled function defined in grammar.el.gz.

Signature

(semantic-grammar-batch-build-packages)

Documentation

Build Lisp packages from grammar files on the command line.

That is, run semantic-grammar-batch-build-one-package for each file. Each file is processed even if an error occurred previously. Must be used from the command line, with -batch. For example, to process grammar files in current directory, invoke:

  "emacs -batch -f semantic-grammar-batch-build-packages .".

See also the variable semantic-grammar-file-regexp.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/grammar.el.gz
(defun semantic-grammar-batch-build-packages ()
  "Build Lisp packages from grammar files on the command line.
That is, run `semantic-grammar-batch-build-one-package' for each file.
Each file is processed even if an error occurred previously.
Must be used from the command line, with `-batch'.
For example, to process grammar files in current directory, invoke:

  \"emacs -batch -f semantic-grammar-batch-build-packages .\".

See also the variable `semantic-grammar-file-regexp'."
  (or noninteractive
      (error "\
`semantic-grammar-batch-build-packages' must be used with -batch"
             ))
  (let ((status 0)
        ;; Remove vc from find-file-hook.  It causes bad stuff to
        ;; happen in Emacs 20.
        (find-file-hook (delete 'vc-find-file-hook find-file-hook)))
    (dolist (arg command-line-args-left)
      (unless (and arg (file-exists-p arg))
        (error "Argument %s is not a valid file name" arg))
      (setq arg (expand-file-name arg))
      (if (file-directory-p arg)
          ;; Directory as argument
          (dolist (src (condition-case nil
                           (directory-files
                            arg nil semantic-grammar-file-regexp)
                         (error
                          (error "Unable to read directory files"))))
            (or (semantic-grammar-batch-build-one-package
                 (expand-file-name src arg))
                (setq status 1)))
        ;; Specific file argument
        (or (semantic-grammar-batch-build-one-package arg)
            (setq status 1))))
    (kill-emacs status)
    ))