Single-window-Wanderlust
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sat, 2 May 2015 18:53:41 +0000 (20:53 +0200)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sat, 2 May 2015 18:53:41 +0000 (20:53 +0200)
.wl

diff --git a/.wl b/.wl
index 708ed52..c536e88 100644 (file)
--- a/.wl
+++ b/.wl
@@ -1,5 +1,6 @@
 ;; mode: -*-emacs-lisp-*-
 ;
+(load "silly-mail" nil t)
 (setq wl-stay-folder-window t
       wl-local-domain "gpcf.eu"
       wl-message-id-domain "aubergine.gpcf.eu"
       wl-fcc-force-as-read t
       wl-interactive-send nil
       wl-summary-width 120
+      mime-pgp-decrypt-when-preview t
       )
-
+(add-hook 'mime-view-mode-hook
+         '(lambda ()   (local-set-key (kbd "ä") 'wl-next-message)
+            (local-set-key (kbd "ö") 'wl-prev-message))
+         )
 (setq mime-edit-insert-user-agent-field nil)
 
 (setq wl-generate-mailer-string-function
                                     (wl-summary-jump-to-current-message)
                                     (gpcf-decrypt-mail))))
             (local-set-key "0" 'mc-wl-verify-signature)
+            (local-set-key (kbd "ä") 'wl-next-message)
+            (local-set-key (kbd "ö") 'wl-prev-message)
+            (local-set-key (kbd "<return>") '(lambda () (interactive) (wl-summary-redisplay)
+                                               (wl-summary-jump-to-current-message)
+                                               (delete-other-windows)) )
             (local-set-key "X" '(lambda ()
                                        ; checks for mail remotely using rsync.
                                   (interactive)
@@ -67,7 +77,7 @@
 ))
 (defun gpcf-decrypt-mail ()
   "Decrypts mail in MIME preview buffer. Works with both PGP/MIME
-and PGP-Inline"
+and PGP-Inline. OBSOLETE FOR PGP/MIME, USE (setq mime-pgp-decrypt-when-preview t) instead." 
   (interactive)
   (save-excursion
     (beginning-of-buffer)
@@ -100,18 +110,19 @@ and PGP-Inline"
      (t (error "No GPG encrypted message found in this file."))))
   )
 
-(autoload 'sm-add-emacs-name "silly-mail" nil t)
+
 (defun gpcf-setup-mail ()
   "This function prepares the draft mode.
 It add headers and defines keyboard shortcuts.  Before the
 message is sent, it adds the user's signature."
-  (if  (string= "*draft*" (buffer-name))
+  (if  (string-match-p "\\*draft\\*.*" (buffer-name))
       (progn
        (setq enc-color (face-remap-add-relative 'mode-line :background "dark red"))
        (set-input-method "TeX")
        (auto-fill-mode)
        (setq default-justification 'full)
        (sm-add-microsoft)
+       (sm-add-emacs-name)
        (sm-put-header "X-PGP-Key" "http://en.gpcf.eu/key.asc") 
        (local-set-key (kbd "C-c e") '(lambda () 
                                        (interactive)
@@ -138,7 +149,7 @@ message is sent, it adds the user's signature."
 ; single window mode.
 (setq wl-stay-folder-window nil
       wl-draft-use-frame    nil
-      wl-summary-move-order 'unread
+      wl-summary-move-order 'new
 )
 ;; Prevent wl from splitting large messages
 (setq mime-edit-split-message nil)
@@ -150,3 +161,31 @@ message is sent, it adds the user's signature."
 
 ;; AUTO-REFILE rules
 (load "~/.emacs.d/files/refile-rules.el")
+(defadvice mime-preview-quit (after mime-preview-quit activate)
+  (delete-other-windows)
+  )
+(defun wl-delete-other-windows ()
+    (wl-summary-jump-to-current-message)
+  (delete-other-windows)
+)
+(defadvice wl-summary-next  (after wl-summary-next activate)
+  (wl-delete-other-windows)
+  )
+(defadvice wl-summary-prev (after wl-summary-prev activate)
+  (wl-delete-other-windows)
+  )
+(defun wl-next-message ()
+  (interactive)
+  (if (string= (buffer-name) "Summary")
+      (wl-summary-next)
+    (progn
+      (mime-preview-quit)
+      (wl-summary-next))))
+(defun wl-prev-message ()
+  (interactive)
+  (if (string= (buffer-name) "Summary")
+      (wl-summary-prev)
+    (progn
+      (mime-preview-quit)
+      (wl-summary-prev))))    
+