;;;
-;;; $Id: mel-q.el,v 1.5 1995/06/26 05:56:39 morioka Exp $
+;;; $Id: mel-q.el,v 2.0 1995/09/11 11:33:47 morioka Exp $
;;;
;;; @ constants
(save-restriction
(narrow-to-region beg end)
(goto-char (point-min))
- (while (re-search-forward "^.*$" nil t)
- (replace-match
- (quoted-printable-encode-string
- (buffer-substring (match-beginning 0)(match-end 0))
- ))
- ))))
+ (catch 'tag
+ (let (b e str)
+ (while t
+ (beginning-of-line) (setq b (point))
+ (end-of-line) (setq e (point))
+ (if (< b e)
+ (progn
+ (setq str (buffer-substring b e))
+ (delete-region b e)
+ (insert (quoted-printable-encode-string str))
+ ))
+ (if (eobp)
+ (throw 'tag nil)
+ )
+ (forward-char 1)
+ )))
+ )))
(defun quoted-printable-internal-decode-region (beg end)
(save-excursion
(setq b (match-beginning 0))
(setq e (match-end 0))
(setq str (buffer-substring b e))
- (replace-match (quoted-printable-decode-string str))
+ (delete-region b e)
+ (insert (quoted-printable-decode-string str))
))
)))
(defun q-encoding-encode-string-for-phrase (str)
(mapconcat (function
(lambda (chr)
- (cond ((or (and (<= ?A chr)(<= chr ?Z))
+ (cond ((eq chr 32) "_")
+ ((or (and (<= ?A chr)(<= chr ?Z))
(and (<= ?a chr)(<= chr ?z))
(and (<= ?0 chr)(<= chr ?9))
(memq chr '(?! ?* ?+ ?- ?/))
((eq mode 'comment)
(q-encoding-encode-string-for-comment str)
)
- ((eq mode 'phrase)
+ (t
(q-encoding-encode-string-for-phrase str)
- )
- (t (quoted-printable-encode-string str))
- ))
+ )))
(defun q-encoding-decode-string (str)
(let (q h l)
;;; @ end
;;;
-(provide 'qprint)
+(provide 'mel-q)