[Mew-dist 08340] Quoting in addrbook

Atsushi Nemoto nemoto at example.com
1999年 3月 30日 (火) 14:52:49 JST


mew-1.94b17 (おそらく他のバージョンでも)で、Addrbook の nickname や 
name でダブルクォートを含んだ文字列('Foo "baz" bar' とか)を指定できま
せん。

まじめにやるならきちんとエスケープ処理をしないといけないのだと思います
が、とりあえず以下のようなパッチを作ってみました。ダブルクォートまたは
シングルクォートでのクォートを可能にしてあります。

# シングルクォートがそのままでは通らなくなりますのでご注意ください。
---
根本 篤志 (Atsushi Nemoto)
E-Mail: anemo at example.com (Home)
E-Mail: nemoto at example.com (Office)
-------------- next part --------------
--- mew-addrbook.el.orig	Mon Mar 29 17:59:04 1999
+++ mew-addrbook.el	Tue Mar 30 14:22:46 1999
@@ -127,7 +127,7 @@
 	 (pars (mew-split file ?,)) ;; parents
 	 (files pars) ;; included
 	 (cregex (concat "[" comment "].*$"))
-	 par chr path beg)
+	 par chr path beg qchar)
     ;; include parents files
     (while pars
       (setq par (car pars))
@@ -162,10 +162,11 @@
     ;; unquote, replace white spaces to "\0".
     (if unquote
 	(catch 'quote
-	  (while (re-search-forward "\"" nil t)
+	  (while (re-search-forward "[\"']" nil t)
+	    (setq qchar (char-before))
 	    (backward-delete-char 1) ;; delete quote
 	    (setq beg (point))
-	    (if (not (re-search-forward "\"" nil t))
+	    (if (not (re-search-forward (char-to-string qchar) nil t))
 		(throw 'quote nil) ;; error
 	      (backward-delete-char 1) ;; delete quote
 	      (save-restriction


Mew-dist メーリングリストの案内