jao-skel-haskell.el 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ;; jao-skel-haskell.el --- skeleton for haskell -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2003, 2004, 2005, 2009, 2010, 2012, 2022 Jose A Ortega Ruiz
  3. ;; Author: Jose A Ortega Ruiz <jao@member.fsf.org>
  4. ;; Keywords: languages
  5. ;; This file is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation; either version 3, or (at your option)
  8. ;; any later version.
  9. ;; This file is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs; see the file COPYING. If not, write to
  15. ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. ;; Boston, MA 02111-1307, USA.
  17. ;;; Code:
  18. (require 'jao-skel)
  19. (require 'jao-compilation)
  20. (require 'haskell-mode nil t)
  21. (defun jao-skel-haskell--guess-module ()
  22. (if (fboundp 'haskell-guess-module-name)
  23. (haskell-guess-module-name)
  24. (read-string "Module: " (jao-skel-basename))))
  25. (defconst jao-skel--haskell-line (make-string 78 ?-))
  26. (define-skeleton jao-skel-haskell-file
  27. "Haskell hs file header"
  28. "Brief description: "
  29. '(setq v (jao-skel-haskell--guess-module))
  30. jao-skel--haskell-line \n
  31. "-- |" \n
  32. "-- Module: " v \n
  33. (jao-skel-copyright-line "-- Copyright: " "" t)
  34. "-- License: BSD3-style (see LICENSE)" \n
  35. "--" \n
  36. "-- Maintainer: " user-mail-address \n
  37. "-- Stability: unstable" \n
  38. "-- Portability: portable" \n
  39. "-- Created: " (format-time-string "%a %b %d, %Y %H:%M") \n
  40. "--" \n
  41. "--" \n
  42. "-- " str \n
  43. "--" \n
  44. jao-skel--haskell-line
  45. \n \n \n
  46. "module " v " where " \n \n \n)
  47. (jao-skel-install "\\.hs\\'" 'jao-skel-haskell-file)
  48. (provide 'jao-skel-haskell)
  49. ;;; jao-skel-haskell.el ends here