[Mew-dist 16722] samba
Kazu Yamamoto ( 山本和彦 )
kazu at example.com
2001年 3月 5日 (月) 21:51:44 JST
"y" すると、Samba 符号化するパッチ。Enjoy!
--かず
Index: mew-bq.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-bq.el,v
retrieving revision 1.143
diff -c -r1.143 mew-bq.el
*** mew-bq.el 2001/02/20 05:26:20 1.143
--- mew-bq.el 2001/03/05 12:53:12
***************
*** 126,131 ****
--- 126,153 ----
(setq i (1+ i) j (1+ j)))
(substring ret 0 j)))
+ (defun mew-samba-encoding (str)
+ (setq str (mew-cs-encode-string str mew-cs-samba))
+ (let* ((len (length str))
+ (ret (make-string (* len 3) ?a))
+ (i 0) (j 0) char type)
+ (cond
+ ((eq mew-use-samba-encoding-type 'cap)
+ (setq type 'cap))
+ (t
+ (setq type 'hext)))
+ (while (< i len)
+ (setq char (aref str i))
+ (if (and (eq type 'cap) (< char 128))
+ (aset ret j char)
+ (aset ret j ?:)
+ (setq j (1+ j))
+ (aset ret j (aref "0123456789ABCDEF" (lsh char -4)))
+ (setq j (1+ j))
+ (aset ret j (aref "0123456789ABCDEF" (logand char 15))))
+ (setq i (1+ i) j (1+ j)))
+ (substring ret 0 j)))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Quoted-printable decoding
Index: mew-edit.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-edit.el,v
retrieving revision 1.130
diff -c -r1.130 mew-edit.el
*** mew-edit.el 2001/03/03 01:22:46 1.130
--- mew-edit.el 2001/03/05 12:53:12
***************
*** 215,220 ****
--- 215,223 ----
(setq end (mew-syntax-get-end syntax)))
(setq ctl (mew-syntax-get-ct syntax))
;;
+ (if (and mew-use-samba-encoding
+ (string-match mew-regex-nonascii file))
+ (setq file (mew-samba-encoding file)))
(setq file (mew-summary-input-file-name nil file))
(if (not (file-exists-p file))
(setq doit t)
Index: mew-vars.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-vars.el,v
retrieving revision 1.401
diff -c -r1.401 mew-vars.el
*** mew-vars.el 2001/03/04 13:07:42 1.401
--- mew-vars.el 2001/03/05 12:53:16
***************
*** 1302,1307 ****
--- 1302,1317 ----
"*Cc: field list picked at mew-summary-reply if From: is me."
:group 'mew-reply
:type '(repeat string))
+
+
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;;
+ ;;; Samba
+ ;;;
+
+ (defvar mew-use-samba-encoding nil)
+ (defvar mew-use-samba-encoding-type 'cap) ;; or 'hex
+ (defvar mew-cs-samba 'shift_jis)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
Mew-dist メーリングリストの案内