summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/skels/jao-skel-haskell.el24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/skels/jao-skel-haskell.el b/lib/skels/jao-skel-haskell.el
index 01a9936..0c3c17d 100644
--- a/lib/skels/jao-skel-haskell.el
+++ b/lib/skels/jao-skel-haskell.el
@@ -1,4 +1,5 @@
-;;; jao-skel-haskell.el --- skeleton for haskell source files -*- lexical-binding: t; -*-
+;; jao-skel-haskell.el --- skeleton for haskell -*- lexical-binding: t; -*-
+
;; Copyright (C) 2003, 2004, 2005, 2009, 2010, 2012, 2022 Jose A Ortega Ruiz
;; Author: Jose A Ortega Ruiz <jao@member.fsf.org>
@@ -19,31 +20,23 @@
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;;; Commentary:
-
-;;
-
;;; Code:
(require 'jao-skel)
(require 'jao-compilation)
+(require 'haskell-mode nil t)
-;;; Auxiliar
-(defun jao-skel--read-haskell-module ()
- (let* ((ddir (jao-compilation-root))
- (mbase (and ddir (concat (replace-regexp-in-string "/" "." ddir)
- ".")))
- (m (read-string "Module prefix (empty for no module): "
- (concat (or mbase "") (jao-skel-basename)))))
- (or m "")))
+(defun jao-skel-haskell--guess-module ()
+ (if (fboundp 'haskell-guess-module-name)
+ (haskell-guess-module-name)
+ (read-string "Module: " (jao-skel-basename))))
(defconst jao-skel--haskell-line (make-string 78 ?-))
-;;; Skeletons
(define-skeleton jao-skel-haskell-file
"Haskell hs file header"
"Brief description: "
- '(setq v (jao-skel--read-haskell-module))
+ '(setq v (jao-skel-haskell--guess-module))
jao-skel--haskell-line \n
"-- |" \n
"-- Module: " v \n
@@ -63,7 +56,6 @@
"module " v " where " \n \n \n)
(jao-skel-install "\\.hs\\'" 'jao-skel-haskell-file)
-;; (jao-skel-install "\\.lhs\\'" 'jao-skel-lit-haskell-file)
(provide 'jao-skel-haskell)