-;;; code.El -- Settings and functions for programming modes
+;;; code.el -- Settings and functions for programming modes
+;;
+;;; Commentary:
+;;
+;;; Code:
 (eval-when-compile
   (require 'saveplace)
   (require 'company))

      (puthash default-directory compile-command projectile-compilation-cmd-map)
      (compile compile-command))))

(defun pjones:comment-bar (&optional without-newline)
  "Create a comment bar based on the current mode."
  (interactive "P")
  (let ((char (cond
               ((string= comment-start "-- ") ?-)
               ((string= comment-start "// ") ?*)
               ((string= comment-start "/* ") ?*)
               (t ?#)))

        (start (cond
                ((string= comment-start "# ")  "#")
                ((string= comment-start "-- ") "-")
                ((string= comment-start "// ") "/*")
                ((string= comment-start "/* ") "/*")
                (t comment-start)))

        (end (cond
              ((string= comment-start "// ") "*/")
              ((string= comment-start "/* ") "*/")
              (t (if (> (length comment-end) 0) comment-end ""))))

        (col (current-column)))
    (insert start)
    (insert-char char (- 80 (length start) (length end) col))
    (insert end)
    (if without-newline (beginning-of-line)
      (electric-indent-just-newline 1)
      (indent-according-to-mode))))

(defun pjones:add-fixme-lock ()
  (font-lock-add-keywords nil '(("\\<\\(FIXME:\\|TODO:\\|NOTE:\\)"
                                 1 'pjones:fixme-face t))))
(defun pjones:prog-mode-hook ()

  (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p))

(defun pjones:add-programming-hook (mode-hook)
  "Add the programming hook to the given MODE-HOOK."
  (add-hook mode-hook 'pjones:prog-mode-hook))

(defun pjones:after-save-reload-browser ())
