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 @@ -1152,27 +1152,19 @@ given a prefix arg."
1152
1152
collect (replace-regexp-in-string " \\ .l?hs$" " " part))))
1153
1153
(mapconcat 'identity (reverse components) " ." )))
1154
1154
1155
+ (defvar haskell-auto-insert-module-format-string
1156
+ " -- | \n\n module %s where\n\n "
1157
+ " Template string that will be inserted in new haskell buffers via `haskell-auto-insert-module-template' ." )
1158
+
1155
1159
(defun haskell-auto-insert-module-template ()
1156
1160
" Insert a module template for the newly created buffer."
1157
1161
(interactive )
1158
1162
(when (and (= (point-min )
1159
1163
(point-max ))
1160
1164
(buffer-file-name ))
1161
- (insert
1162
- " -- | "
1163
- " \n "
1164
- " \n "
1165
- " module "
1166
- )
1167
- (let ((name (haskell-guess-module-name)))
1168
- (if (string= name " " )
1169
- (insert " " )
1170
- (insert name)))
1171
- (insert " where"
1172
- " \n "
1173
- " \n " )
1165
+ (insert (format haskell-auto-insert-module-format-string (haskell-guess-module-name)))
1174
1166
(goto-char (point-min ))
1175
- (forward-char 4 )))
1167
+ (end-of-line )))
1176
1168
1177
1169
(defun haskell-describe (ident )
1178
1170
" Describe the given identifier."
You can’t perform that action at this time.
0 commit comments