 ;;; --------------------------------------------------------------------
 ;;; Semi-automatic rstripping
 
-(defvar trailing-whitespace-allowed nil
+(defvar trailing-whitespace-allowed "\.diff$"
   "If file name matches this regexp,
 `delete-trailing-whitespace-if-confirmed' will skip it.")
 


(setq calendar-week-start-day 1) ; weeks should begin on Monday

;;; Org Mode
(eval-after-load "org"
  '(progn
    (setq org-hide-leading-stars t
	  ;; see http://doc.norang.ca/org-mode.html#HeadingLevelsOddEven
	  org-odd-levels-only nil
	  org-directory "~/.org"
	  org-default-notes-file (concat org-directory "/refile.org")
	  org-agenda-files '("~/life.org" "~/work.org" "~/overhead.org"))
    (global-set-key "\C-cl" 'org-store-link)
    (global-set-key "\C-cb" 'org-iswitchb)
    (global-set-key "\C-ca" 'org-agenda)))
(eval-after-load "org-clock"
  '(progn
     (setq org-clock-out-remove-zero-time-clocks t
	   org-clock-into-drawer 2
	   org-clock-idle-time 10)
     (global-set-key "\C-cc" 'org-clock-goto)))
(eval-after-load "org-archive"
  '(org-defkey org-mode-map "\C-c\C-x\C-a"
	       'org-archive-subtree-default-with-confirmation))
;; (global-set-key (kbd "C-M-r") 'org-capture)

;;; Spell check
(global-set-key (kbd "C-c ib") 'ispell-buffer)

  (autoload 'gtags-mode "/opt/local/share/gtags/gtags.el" nil t)
  (setq gtags-suggested-key-mapping t gtags-pop-delete t)
  (add-hook 'c-mode-hook '(lambda () (gtags-mode 1)))
  (eval-after-load "gtags"
    '(progn
       (setq gtags-ignore-case nil)
       ;; Don't let gtags overwrite some key sequences.
       (define-key gtags-mode-map "\C-ct" nil)   ; `toggle-truncate-lines'
       (define-key gtags-mode-map "\C-t" nil)))) ; `transpose-chars'

