   ;; Your init file should contain only one such instance.
   ;; If there is more than one, they won't work right.
  '(default ((t (:inherit nil :stipple nil :background "Black" :foreground "White" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "apple" :family "Menlo")))))
+(put 'scroll-left 'disabled nil)

;;; (see http://www.cabochon.com/~stevey/blog-rants/effective-emacs.html)
(dolist (f '(menu-bar-mode scroll-bar-mode tool-bar-mode)) (funcall f -1))

;; (setq visible-bell t) ; flash a frame instead of beeping

(transient-mark-mode t) ; highlight marked region
(progn
  (iswitchb-mode t) ; enable switching between buffers using substrings
  (setq iswitchb-prompt-newbuffer nil)) ; create a buffer silently
(icomplete-mode t) ; enable incremental minibuffer completion
(progn (require 'uniquify) (setq uniquify-buffer-name-style 'forward))

(setq backup-directory-alist '((".*" . "~/.backups"))) ; backups location
(setq require-final-newline t default-indicate-empty-lines t)
(put 'narrow-to-region 'disabled nil)

(setq c-default-style '((c-mode . "linux") (awk-mode . "awk") (other . "gnu")))
(setq enable-local-variables :safe)

(when (file-readable-p "/opt/local/share/gtags/gtags.el")
  (autoload 'gtags-mode "/opt/local/share/gtags/gtags.el" nil t)
  (setq gtags-suggested-key-mapping t gtags-pop-delete t)

				 (buffer-name))))
      (delete-trailing-whitespace))))
(add-hook 'before-save-hook 'delete-trailing-whitespace-if-confirmed)
;;; --------------------------------------------------------------------

(global-set-key (kbd "C-c t") 'toggle-truncate-lines)
(global-set-key (kbd "C-c w") 'whitespace-mode)

(global-set-key (kbd "C-c v f") 'view-file)
(global-set-key (kbd "C-c v m") 'view-mode)
;; Don't let gtags overwrite `C-c v'
(eval-after-load "gtags" '(define-key gtags-mode-map "\C-cv" nil))

;;; 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" "~/work-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-persist 'history
	   org-clock-idle-time 10)
     (org-clock-persistence-insinuate)
     (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)
(global-set-key (kbd "C-c ir") 'ispell-region)
;XXX; (add-hook 'c-mode-hook 'flyspell-prog-mode)

(eval-after-load "ps-print"
  '(setq ps-paper-type 'a4
	 ps-print-header nil
	 ps-multibyte-buffer 'bdf-font-except-latin))

(setq vc-follow-symlinks t)

(define-key help-map "A" 'apropos-variable)

;XXX; ;;; --------------------------------------------------------------------
;XXX; ;;; Aquamacs settings
