<commit_before>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; ghc-command.el
;;;

;; Author:  <NAME> <<EMAIL>>
;; Created: Apr 13, 2010

;;; Code:

(require 'ghc-flymake)

(defun ghc-insert-template ()
  (interactive)
  (cond
   ((bobp)
    (ghc-insert-module-template))
   ((ghc-flymake-have-errs-p)
    (ghc-flymake-insert-from-warning))
   (t
    (message "Nothing to be done"))))

(defun ghc-insert-module-template ()
  ;; xxx mod from filename...
  (let ((mod (file-name-sans-extension (buffer-name))))
    (insert "module " mod " where\n")))

(defun ghc-sort-lines (beg end)
  (interactive "r")
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (goto-char (point-min))
      (let ((inhibit-field-text-motion t))
        (sort-subr nil 'forward-line 'end-of-line
		   (lambda ()
		     (re-search-forward "^import\\( *qualified\\)? *" nil t)
		     nil)
		   'end-of-line)))))

(defun ghc-save-buffer ()
  (interactive)
  (if (buffer-modified-p)
      (save-buffer)
    (flymake-start-syntax-check)))

(provide 'ghc-command)<commit_msg>capitalize mod name.<commit_after>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; ghc-command.el
;;;

;; Author:  <NAME> <<EMAIL>>
;; Created: Apr 13, 2010

;;; Code:

(require 'ghc-flymake)

(defun ghc-insert-template ()
  (interactive)
  (cond
   ((bobp)
    (ghc-insert-module-template))
   ((ghc-flymake-have-errs-p)
    (ghc-flymake-insert-from-warning))
   (t
    (message "Nothing to be done"))))

(defun ghc-insert-module-template ()
  (let ((mod (capitalize (file-name-sans-extension (buffer-name)))))
    (insert "module " mod " where\n")))

(defun ghc-sort-lines (beg end)
  (interactive "r")
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (goto-char (point-min))
      (let ((inhibit-field-text-motion t))
        (sort-subr nil 'forward-line 'end-of-line
		   (lambda ()
		     (re-search-forward "^import\\( *qualified\\)? *" nil t)
		     nil)
		   'end-of-line)))))

(defun ghc-save-buffer ()
  (interactive)
  (if (buffer-modified-p)
      (save-buffer)
    (flymake-start-syntax-check)))

(provide 'ghc-command)
{'fraction_non_alphanumeric': 0.24014665444546288, 'fraction_numerical': 0.005499541704857928, 'mean_word_length': 3.1900191938579656, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7207687', 'n_tokens_mistral': 902, 'n_tokens_neox': 818, 'n_words': 152}