<commit_before>; Generated by Chef for <%= node[:fqdn] %>
; Local modifications will be overwritten.

(let* ((emacs-version "2.6.10")
       (tools-path
        (concat "/usr/local/lib/erlang/lib/tools-" emacs-version "/emacs")))
  (when (file-exists-p tools-path)
    (setq load-path (cons tools-path load-path))
    (setq erlang-root-dir "/usr/local/lib/erlang")
    (setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
    (require 'erlang-start)
    (defvar inferior-erlang-prompt-timeout t)))

(add-hook 'erlang-mode-hook
          (lambda ()
            (define-key erlang-mode-map "\C-m"
              'erlang-reindent-then-newline-and-indent)
             (add-hook 'local-write-file-hooks
                        '(lambda()
                           (save-excursion
                             (untabify (point-min) (point-max))
                             (delete-trailing-whitespace))))
             (set (make-local-variable 'tab-width) 2)
             (set (make-local-variable 'erlang-indent-level) 2)
             (set (make-local-variable 'indent-tabs-mode) 'nil)))

(defun erlang-reindent-then-newline-and-indent ()
  "Reindents the current line then creates an indented newline."
  (interactive "*")
  (newline)
  (save-excursion
    (end-of-line 0)
    (indent-according-to-mode)
    (delete-region (point) (progn (skip-chars-backward " \t") (point))))
  (when (erlang-previous-line-is-comment)
      (insert "% "))
  (indent-according-to-mode))

(defun erlang-previous-line-is-comment ()
  "Returns `t' if the previous line is an Erlang comment."
  (save-excursion
    (forward-line -1)
    (erlang-line-is-comment)))

(defun erlang-line-is-comment ()
  "Returns `t' if the current line is an Erlang comment."
  (save-excursion
    (beginning-of-line)
    (search-forward "#" (point-at-eol) t)))
<commit_msg>Add app.src to erlang emacs config<commit_after>; Generated by Chef for <%= node[:fqdn] %>
; Local modifications will be overwritten.

(let* ((emacs-version "2.6.10")
       (tools-path
        (concat "/usr/local/lib/erlang/lib/tools-" emacs-version "/emacs")))
  (when (file-exists-p tools-path)
    (setq load-path (cons tools-path load-path))
    (setq erlang-root-dir "/usr/local/lib/erlang")
    (setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
    (require 'erlang-start)
    (defvar inferior-erlang-prompt-timeout t)))

(setq auto-mode-alist (cons '("\\.app.src$" . erlang-mode) auto-mode-alist))

(add-hook 'erlang-mode-hook
          (lambda ()
            (define-key erlang-mode-map "\C-m"
              'erlang-reindent-then-newline-and-indent)
             (add-hook 'local-write-file-hooks
                        '(lambda()
                           (save-excursion
                             (untabify (point-min) (point-max))
                             (delete-trailing-whitespace))))
             (set (make-local-variable 'tab-width) 2)
             (set (make-local-variable 'erlang-indent-level) 2)
             (set (make-local-variable 'indent-tabs-mode) 'nil)))

(defun erlang-reindent-then-newline-and-indent ()
  "Reindents the current line then creates an indented newline."
  (interactive "*")
  (newline)
  (save-excursion
    (end-of-line 0)
    (indent-according-to-mode)
    (delete-region (point) (progn (skip-chars-backward " \t") (point))))
  (when (erlang-previous-line-is-comment)
      (insert "% "))
  (indent-according-to-mode))

(defun erlang-previous-line-is-comment ()
  "Returns `t' if the previous line is an Erlang comment."
  (save-excursion
    (forward-line -1)
    (erlang-line-is-comment)))

(defun erlang-line-is-comment ()
  "Returns `t' if the current line is an Erlang comment."
  (save-excursion
    (beginning-of-line)
    (search-forward "#" (point-at-eol) t)))

{'fraction_non_alphanumeric': 0.15797830113786715, 'fraction_numerical': 0.004233924318602805, 'mean_word_length': 2.3840644583706356, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3303551', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1284, 'n_words': 265}