+2000-10-25 20:13:02 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * mm-decode.el (mm-viewer-completion-map): New.
+ (mm-interactively-view-part): Use it.
+
+2000-10-25 18:51:12 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * rfc2047.el (rfc2047-q-encode-region): Don't break if a QP-word
+ could be fitted in one line.
+
2000-10-25 Dirk Meyer <dischi@tzi.de>
* gnus-demon.el (gnus-demon-time-to-step): theHour was set to
;; "message/rfc822".
(defvar mm-dissect-default-type "text/plain")
+(defvar mm-viewer-completion-map
+ (let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
+ (set-keymap-parent map minibuffer-local-completion-map)
+ map)
+ "Keymap for input viewer with completion.")
+
+;; Should we bind other key to minibuffer-complete-word?
+(define-key mm-viewer-completion-map " " 'self-insert-command)
+
;;; The functions.
(defun mm-dissect-buffer (&optional no-strict-mime)
(methods
(mapcar (lambda (i) (list (cdr (assoc 'viewer i))))
(mailcap-mime-info type 'all)))
- (method (completing-read "Viewer: " methods)))
+ (method (let ((minibuffer-local-completion-map
+ mm-viewer-completion-map))
+ (completing-read "Viewer: " methods))))
(when (string= method "")
(error "No method given"))
(if (string-match "^[^% \t]+$" method)
(save-excursion
(save-restriction
(narrow-to-region (goto-char b) e)
- (let ((alist rfc2047-q-encoding-alist))
+ (let ((alist rfc2047-q-encoding-alist)
+ (bol (save-restriction
+ (widen)
+ (gnus-point-at-bol))))
(while alist
(when (looking-at (caar alist))
(quoted-printable-encode-region b e nil (cdar alist))
(subst-char-in-region (point-min) (point-max) ? ?_)
(setq alist nil))
(pop alist))
- (goto-char (1+ (point-min)))
- (while (and (not (bobp)) (not (eobp)))
- (goto-char (min (point-max) (save-restriction
- (widen)
- ;; THe QP encapsulation is about 20.
- (+ 56 (gnus-point-at-bol)))))
- (search-backward "=" (- (point) 2) t)
- (unless (or (bobp) (eobp))
- (insert "\n")))))))
+ ;; The size of QP encapsulation is about 20, so set limit to
+ ;; 56=76-20.
+ (unless (< (- (point-max) (point-min)) 56)
+ ;; Don't break if it could fit in one line.
+ ;; Let rfc2047-encode-region break it later.
+ (goto-char (1+ (point-min)))
+ (while (and (not (bobp)) (not (eobp)))
+ (goto-char (min (point-max) (+ 56 bol)))
+ (search-backward "=" (- (point) 2) t)
+ (unless (or (bobp) (eobp))
+ (insert "\n")
+ (setq bol (point)))))))))
;;;
;;; Functions for decoding RFC2047 messages