2009-05-26 Vitaly Mayatskikh <v.mayatskih@gmail.com>
authorkaoru <kaoru>
Thu, 28 May 2009 10:39:58 +0000 (10:39 +0000)
committerkaoru <kaoru>
Thu, 28 May 2009 10:39:58 +0000 (10:39 +0000)
* wl-summary.el (wl-summary-display-raw): New function, display
message in raw format.

wl/ChangeLog
wl/wl-summary.el

index e83a52f..8d02305 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-26  Vitaly Mayatskikh <v.mayatskih@gmail.com>
+
+       * wl-summary.el (wl-summary-display-raw): New function, display
+       message in raw format.
+
 2009-05-26  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * Version number is increased to 2.15.7.
index 61b2965..ac04708 100644 (file)
@@ -291,7 +291,8 @@ See also variable `wl-use-petname'."
      ["Resend bounced mail" wl-summary-resend-bounced-mail t]
      ["Enter the message" wl-summary-jump-to-current-message t]
      ["Pipe message" wl-summary-pipe-message t]
-     ["Print message" wl-summary-print-message t])
+     ["Print message" wl-summary-print-message t]
+     ["View raw message" wl-summary-display-raw t])
     ("Thread Operation"
      ["Open or Close" wl-thread-open-close (eq wl-summary-buffer-view 'thread)]
      ["Open all"     wl-thread-open-all (eq wl-summary-buffer-view 'thread)]
@@ -387,6 +388,7 @@ See also variable `wl-use-petname'."
   ;; basic commands
   (define-key wl-summary-mode-map " "    'wl-summary-read)
   (define-key wl-summary-mode-map "."    'wl-summary-redisplay)
+  (define-key wl-summary-mode-map ","    'wl-summary-display-raw)
   (define-key wl-summary-mode-map "<"    'wl-summary-display-top)
   (define-key wl-summary-mode-map ">"    'wl-summary-display-bottom)
   (define-key wl-summary-mode-map "\177" 'wl-summary-prev-page)
@@ -4741,6 +4743,31 @@ If ARG is numeric number, decode message as following:
        (if message-buf (set-buffer message-buf))
        (wl-draft-edit-string (buffer-substring (point-min) (point-max)))))))
 
+(defun wl-summary-display-raw (&optional arg)
+  "Display current message in raw format."
+  (interactive)
+  (let ((number (wl-summary-message-number))
+       (folder wl-summary-buffer-elmo-folder))
+    (if number
+       (let ((raw (elmo-message-fetch-string 
+                   folder number
+                   (elmo-find-fetch-strategy folder number)))
+             (raw-buffer (get-buffer-create "*wl:raw message*"))
+             (raw-mode-map (make-sparse-keymap)))
+         (with-current-buffer raw-buffer
+           (toggle-read-only -1)
+           (erase-buffer)
+           (princ raw raw-buffer)
+           (toggle-read-only t)
+           (beginning-of-buffer)
+           (switch-to-buffer-other-window raw-buffer)
+           (define-key raw-mode-map "l" 'toggle-truncate-lines)
+           (define-key raw-mode-map "q" 'kill-buffer-and-window)
+           (define-key raw-mode-map "," 'kill-buffer-and-window)
+           (use-local-map raw-mode-map)))
+      (message "No message to display."))
+    number))
+
 (defun wl-summary-save (&optional arg wl-save-dir)
   "Save current message to disk."
   (interactive)