File tree 1 file changed +6
-14
lines changed 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -1033,27 +1033,19 @@ LOC = (list FILE LINE COL)"
1033
1033
collect (replace-regexp-in-string " \\ .l?hs$" " " part))))
1034
1034
(mapconcat 'identity (reverse components) " ." )))
1035
1035
1036
+ (defvar haskell-auto-insert-module-format-string
1037
+ " -- | \n\n module %s where\n\n "
1038
+ " Template string that will be inserted in new haskell buffers via `haskell-auto-insert-module-template' ." )
1039
+
1036
1040
(defun haskell-auto-insert-module-template ()
1037
1041
" Insert a module template for the newly created buffer."
1038
1042
(interactive )
1039
1043
(when (and (= (point-min )
1040
1044
(point-max ))
1041
1045
(buffer-file-name ))
1042
- (insert
1043
- " -- | "
1044
- " \n "
1045
- " \n "
1046
- " module "
1047
- )
1048
- (let ((name (haskell-guess-module-name)))
1049
- (if (string= name " " )
1050
- (insert " " )
1051
- (insert name)))
1052
- (insert " where"
1053
- " \n "
1054
- " \n " )
1046
+ (insert (format haskell-auto-insert-module-format-string (haskell-guess-module-name)))
1055
1047
(goto-char (point-min ))
1056
- (forward-char 4 )))
1048
+ (end-of-line )))
1057
1049
1058
1050
1059
1051
; ; Provide ourselves:
You can’t perform that action at this time.
0 commit comments