;-- El archivo .emacs de SeaJob
;-- Basado en el de David Dorward (lo puedes conseguir en dotfiles.com)
;-- Diseñado para GNU Emacs 20.7 en un sistemna Debian GNU/Linux 

;--No menus at command line
;    (if (equal window-system nil)
;    (menu-bar-mode nil))

;--Load VM email software
    (autoload 'vm "vm" "Arraca VM en tu buzón primario" t)
    (autoload 'vm-other-frame "vm" "Como `vm'pero arranca en otra ventana" t)
    (autoload 'vm-visit-folder "vm" "Arranca VM en un buzón aleatorio" t)
    (autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t)
    (autoload 'vm-mode "vm" "Run VM major mode on a buffer" t)
    (autoload 'vm-mail "vm" "Send a mail message using VM." t)
    (autoload 'vm-submit-bug-report "vm" "Send a bug report about VM." t)

;--Support for compressed files
    (require 'jka-compr)

;--Load Template support
;    (require 'template)
;    (template-initialize)

;--EMAIL
;--Hacemos que el mail salga como seajob@sindominio.net
(custom-set-variables '(mail-host-address "sindominio.net")
		      '(mail-from-style (quote angles))
		      '(user-mail-address "seajob@sindominio.net"))

;--Ponemos un mayor delante del texto al que respondemos
(setq mail-yank-prefix ">")

;--Guardamos todo el mail que enviamos en un fichero
;--Es buena idea ir rotándolo; de momento no sé cómo hacerlo
(setq mail-archive-file-name "~/mail/sent-items")

;--Añadir automaticamente ~/.firma al final de todos mis mails
(setq mail-signature t)

;--Usamos abreviaturas en (Resent-)?(To|Cc|Bcc):
(add-hook 'mail-setup-hook 'mail-abbrevs-setup)

;--Cargamos un address book
(load-file "~/.dires")

;--Para eliminar los mensajes borrados automáticamente
(add-hook 'vm-mode-hook
          '(lambda ()
             (local-set-key "Q" 'vm-quit)
             (local-set-key "q" "#Q")))

;-- Recomendado (aunque no termino de entender qué hace)
(cond (window-system
       (setq hilit-mode-enable-list  '(not text-mode)
	     hilit-background-mode   'light
	     hilit-inhibit-hooks     nil
	     hilit-inhibit-rebinding nil)
       (require 'hilit19)
       (add-hook 'vm-summary-pointer-update-hook 'hilit-rehighlight-buffer)
       (add-hook 'vm-select-message-hook 'hilit-rehighlight-buffer)
       (hilit-translate comment 'firebrick-bold)
       (hilit-set-mode-patterns
	'outline-mode
	'(("^\*.*$" nil defun)
	  ))
       ))

;--Use Windoze style selection, [del], [home], [end], 
(custom-set-variables '(pc-selection-mode t nil (pc-select)))

(custom-set-faces)

;--Cosas del mailcrypt+GNUpg
(mc-setversion "gpg")

;--Firmar siempre los mensajes cifrados
(setq mc-pgp-always-sign t)
;--El tiempo que tiene que recordar la pass del GNUpg
(setq mc-passwd-timeout 600)


;-- MINIBUFFER & THINGS TO DISPLAY

;--Show the time in the minibuffer 
    (display-time) 

;--Turn on the column numbering in the minibuffer 
    (column-number-mode 1) 

;--Replace yes/no+enter prompts with y/n prompts
    (fset 'yes-or-no-p 'y-or-n-p) 

;--Disable the menu-bar in console mode for a little more screen space. You can still use F10 to access it in the minibuffer
    (menu-bar-mode (if window-system 1 -1)) 

;--Format the title-bar to always include the buffer name
     (setq frame-title-format "emacs - %b")

;-- SUBRAYADO Y COLOREADO

;--Marcar los paréntesis emparejados (fundamental para programar)
    (setq show-paren-mode t)
    (setq show-paren-style 'parenthesis)

;--Colorear todo lo posible
    (setq font-lock-maximum-decoration t)

;--Activar el coloreado
    (global-font-lock-mode 1 t)

;-- MISC

;--Provide access to system clipboard
     (setq x-select-enable-clipboard t)

;--Change default major mode to text from fundamental
     (setq default-major-mode 'text-mode)

;--Ddon't automatically add new lines when scrolling down at the bottom of a buffer
     (setq next-line-add-newlines nil)

;--Scroll just one line when hitting the bottom of the window
     (setq scroll-step 1)

;--Html-helper-mode
;     (autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)

;--Word-wrap when editing an email message
     (add-hook 'mail-mode-hook 'turn-on-auto-fill)

;--Use html-helper-mode when editing .html files
     (setq auto-mode-alist (cons '("\\.htm$" . html-helper-mode) auto-mode-alist))
     (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))

;--Allow me to use Lucida Typewriter font
      '(font-menu-ignore-scaled-fonts nil)

;--set From: address used in header of email I send
;      '(user-mail-address "david@dorward.co.uk")

;--Load bbdb
;     (require 'bbdb)
;     (bbdb-initialize)