 ;; Copyright (C) 2011 Dylan.Wen
 
 ;; Author: Dylan.Wen <hhkbp2@gmail.com>
-;; Time-stamp: <2014-06-17 17:43>
+;; Time-stamp: <2014-10-17 18:02>
 
 ;; This file is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by

              ;; no untabify in makefile
              (and (equal mode-hook 'makefile-mode-hook)
                   (equal feature 'my-untabify))
              (and (equal mode-hook 'markdown-mode-hook)
                   (equal feature 'my-delete-trailing-space))))
        (add-hook mode-hook feature))))


(defconst dw-tab-width 4)


(defun dev-misc()
  "Miscellaneous settings for software development."

  ;; set tab width
  (setq default-tab-width dw-tab-width)
  (setq tab-width dw-tab-width)
  (setq tab-stop-list (number-sequence dw-tab-width 120 dw-tab-width))

  ;; 用空格而不用tab来对齐(默认用tab来对齐)
  (setq-default indent-tabs-mode nil)

  (require 'paren-settings)
  )

(dev-misc)


(require 'occur-settings)


;;; 去tab化
(defun my-untabify()
  "Replace TAB with whitespace."
  (make-variable-buffer-local 'write-contents-functions)
  (add-hook 'write-contents-functions
            '(lambda()
               (save-excursion
                 (untabify (point-min) (point-max)))
               ;; Return nil for the benefit of `write-contents-functions'.
               nil)))


