cdl.el 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ;;; cdl.el --- Common Data Language (CDL) utility functions for GNU Emacs
  2. ;; Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
  3. ;; Author: ATAE@spva.physics.imperial.ac.uk (Ata Etemadi)
  4. ;; Maintainer: FSF
  5. ;; Keywords: data
  6. ;; This file is part of GNU Emacs.
  7. ;; GNU Emacs is free software: you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published by
  9. ;; the Free Software Foundation, either version 3 of the License, or
  10. ;; (at your option) any later version.
  11. ;; GNU Emacs is distributed in the hope that it will be useful,
  12. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;; GNU General Public License for more details.
  15. ;; You should have received a copy of the GNU General Public License
  16. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  17. ;;; Commentary:
  18. ;;; Code:
  19. (defun cdl-get-file (filename)
  20. "Run file through ncdump and insert result into buffer after point."
  21. (interactive "fCDF file: ")
  22. (message "ncdump in progress...")
  23. (let ((start (point)))
  24. (call-process "ncdump" nil t nil (expand-file-name filename))
  25. (goto-char start))
  26. (message "ncdump in progress...done"))
  27. (defun cdl-put-region (filename start end)
  28. "Run region through ncgen and write results into a file."
  29. (interactive "FNew CDF file: \nr")
  30. (message "ncgen in progress...")
  31. (call-process-region start end "ncgen"
  32. nil nil nil "-o" (expand-file-name filename))
  33. (message "ncgen in progress...done"))
  34. (provide 'cdl)
  35. ;;; cdl.el ends here