Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. diff -ruN emh-1.14.1-orig/EMH-ELS emh-1.14.1/EMH-ELS
  2. --- emh-1.14.1-orig/EMH-ELS 2000-12-20 17:53:25.000000000 +0900
  3. +++ emh-1.14.1/EMH-ELS 2017-04-24 23:40:12.000000000 +0900
  4. @@ -6,6 +6,6 @@
  5.  
  6. ;; (require 'mh-e)
  7.  
  8. -(setq emh-modules '(emh emh-def emh-face emh-comp emh-setup))
  9. +(setq emh-modules '(emh emh-def emh-face emh-comp emh-setup mh-e-hack))
  10.  
  11. ;;; EMH-ELS ends here
  12. diff -ruN emh-1.14.1-orig/emh.el emh-1.14.1/emh.el
  13. --- emh-1.14.1-orig/emh.el 2000-12-25 18:44:56.000000000 +0900
  14. +++ emh-1.14.1/emh.el 2013-11-17 00:25:42.000000000 +0900
  15. @@ -67,6 +67,7 @@
  16. (buffer-name folder-buffer)
  17. folder-buffer)))
  18.  
  19. +(defun mh-display-msg-redefine ()
  20. (defun mh-display-msg (msg-num folder &optional show-buffer mode)
  21. "Display message number MSG-NUM of FOLDER.
  22. This function uses `mime-view-mode' if MODE is not nil. If MODE is
  23. @@ -149,6 +150,11 @@
  24. folder msg-num)))
  25. (set-buffer folder)
  26. (setq mh-showing-with-headers nil)))))
  27. +) ;; end of mh-display-msg-redefine
  28. +;; redefine after load mh-show in mh-e version 8 or later
  29. +(if (>= (string-to-number (car (split-string mh-version "\\."))) 8)
  30. + (eval-after-load "mh-show" '(mh-display-msg-redefine))
  31. + (mh-display-msg-redefine))
  32.  
  33. (defun emh-view-message (&optional msg)
  34. "MIME decode and play this message."
  35. diff -ruN emh-1.14.1-orig/mh-e-hack.el emh-1.14.1/mh-e-hack.el
  36. --- emh-1.14.1-orig/mh-e-hack.el 1970-01-01 09:00:00.000000000 +0900
  37. +++ emh-1.14.1/mh-e-hack.el 2013-11-16 23:44:31.000000000 +0900
  38. @@ -0,0 +1,104 @@
  39. +;;; mh-e-hack.el --- MH-E 7.8x hack for mh-jp.
  40. +;;; $Id: mh-e-hack.el,v 1.8 2006/03/12 04:45:42 amura Exp $
  41. +
  42. +;; Author: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
  43. +;; Keywords: mh-e, mail, MIME
  44. +
  45. +;; Some codes are picked from MH-E 7.82
  46. +
  47. +;; This program is free software; you can redistribute it and/or
  48. +;; modify it under the terms of the GNU General Public License as
  49. +;; published by the Free Software Foundation; either version 2, or (at
  50. +;; your option) any later version.
  51. +
  52. +;; This program is distributed in the hope that it will be useful, but
  53. +;; WITHOUT ANY WARRANTY; without even the implied warranty of
  54. +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  55. +;; General Public License for more details.
  56. +
  57. +;; You should have received a copy of the GNU General Public License
  58. +;; along with GNU Emacs; see the file COPYING. If not, write to the
  59. +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  60. +;; Boston, MA 02111-1307, USA.
  61. +
  62. +;; mh-jp does not have flist(s) command
  63. +(setq mh-flists-present-flag nil)
  64. +
  65. +;; use iso-2022-jp for sendmail
  66. +(setq sendmail-coding-system 'iso-2022-jp)
  67. +
  68. +;; Create message in iso-2022-jp
  69. +(add-hook 'mh-letter-mode-hook
  70. + '(lambda ()
  71. + (set-buffer-file-coding-system 'iso-2022-jp)
  72. + (set-buffer-modified-p nil)))
  73. +
  74. +;; With t-gnus, Gnus composion does not activate.
  75. +(setq mh-compose-insertion 'mhn)
  76. +
  77. +;; Without content-type, mh-e assume coding system as iso-2022-jp.
  78. +(defadvice mm-decode-body (before mm-decode-body-jp activate)
  79. + (unless (ad-get-arg 0) (ad-set-arg 0 "ISO-2022-JP")))
  80. +
  81. +;; scan hack (fontlock)
  82. +(eval-after-load "mh-folder" '(progn
  83. + (setq mh-scan-subject-hack-regexp "^ *[0-9]+........[ ]*\\(.\\)\\([^\n]*\\)")
  84. + (setq mh-scan-subject-re-regexp "\\s-[Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-")
  85. + (setq mh-scan-subject-end "\\(<<\\|\n\\)")
  86. + (setq mh-scan-name-width 18)
  87. +
  88. + (defun mh-folder-font-lock-subject (limit)
  89. + "Return MH-E scan subject strings to font-lock between point and LIMIT."
  90. + (defun mh-xwidthpos (str width n)
  91. + (if (>= (string-width (substring str 0 n)) width)
  92. + n
  93. + (mh-xwidthpos str width (+ n 1))))
  94. + (if (not (re-search-forward mh-scan-subject-hack-regexp limit t))
  95. + nil
  96. + (let* ((ss-offset (match-beginning 1))
  97. + (ss (buffer-substring (match-beginning 1) (match-end 2)))
  98. + (s1 (mh-xwidthpos ss mh-scan-name-width 1))
  99. + (e1 (string-match mh-scan-subject-end ss s1))
  100. + (s (+ s1 ss-offset))
  101. + (e (+ (if (not e1) (length ss) e1) ss-offset)))
  102. + (if (string-match mh-scan-subject-re-regexp
  103. + (buffer-substring (- s 1) e))
  104. + (set-match-data (list s e s e nil nil))
  105. + (set-match-data (list s e nil nil s e)))
  106. + t)))))
  107. +
  108. +;; scan hack (thread)
  109. +(eval-after-load "mh-thread" '(progn
  110. + (defun mh-thread-parse-scan-line (&optional string)
  111. + "Parse a scan line.
  112. +If optional argument STRING is given then that is assumed to be the scan line.
  113. +Otherwise uses the line at point as the scan line to parse."
  114. + (defun mh-xsubstring (str from &optional to)
  115. + (defun mh-xtruncwidth (str width start rev)
  116. + (if (< (string-width (substring str 0 start)) width)
  117. + (mh-xtruncwidth str width (+ start 1) rev)
  118. + (if (> (string-width (substring str 0 start)) width)
  119. + (if rev
  120. + (concat " " (substring str start))
  121. + (concat (substring str 0 (- start 1)) " "))
  122. + (if rev
  123. + (substring str start)
  124. + (substring str 0 start)))))
  125. + (let ((s (mh-xtruncwidth str from 0 t)))
  126. + (if to
  127. + (mh-xtruncwidth s (- to from) 1 nil)
  128. + s)))
  129. + (let* ((string (or string
  130. + (buffer-substring-no-properties (line-beginning-position)
  131. + (line-end-position))))
  132. + (address-start (+ mh-cmd-note mh-scan-field-from-start-offset))
  133. + (body-start (+ mh-cmd-note mh-scan-field-from-end-offset))
  134. + (first-string (mh-xsubstring string 0 address-start)))
  135. + (list first-string
  136. + (mh-xsubstring string address-start (- body-start 2))
  137. + (mh-xsubstring string body-start)
  138. + string)))))
  139. +
  140. +(provide 'mh-e-hack)
  141. +
  142. +;;; mh-e-hack.el ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement