diff options
Diffstat (limited to 'app-emacs/vm/files/vm-8.0.12-emacs-23.patch')
-rw-r--r-- | app-emacs/vm/files/vm-8.0.12-emacs-23.patch | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/app-emacs/vm/files/vm-8.0.12-emacs-23.patch b/app-emacs/vm/files/vm-8.0.12-emacs-23.patch new file mode 100644 index 000000000000..aee214333249 --- /dev/null +++ b/app-emacs/vm/files/vm-8.0.12-emacs-23.patch @@ -0,0 +1,96 @@ +Fix wrong charset for outgoing mail with Emacs 23 +Gentoo patch, reported upstream: +http://groups.google.de/group/gnu.emacs.vm.bug/msg/33d027060b6fffe6 + +--- vm-8.0.12-orig/lisp/vm-mime.el ++++ vm-8.0.12/lisp/vm-mime.el +@@ -1409,7 +1409,6 @@ + + (defvar buffer-file-coding-system) + +-;; TODO: integrate with the FSF's unify-8859-on-encoding-mode stuff. + (defun vm-determine-proper-charset (beg end) + "Work out what MIME character set to use for sending a message. + +@@ -1430,6 +1429,28 @@ + (if (or vm-xemacs-mule-p + (and vm-fsfemacs-mule-p enable-multibyte-characters)) + ;; Okay, we're on a MULE build. ++ (if (fboundp 'check-coding-systems-region) ++ ;; check-coding-systems-region appeared in GNU Emacs 23. ++ (let* ((preapproved (vm-get-coding-system-priorities)) ++ (ucs-list (vm-get-mime-ucs-list)) ++ (cant-encode (check-coding-systems-region ++ (point-min) (point-max) ++ (cons 'us-ascii preapproved)))) ++ (if (not (assq 'us-ascii cant-encode)) ++ ;; If there are only ASCII chars, we're done. ++ "us-ascii" ++ (while (and preapproved ++ (assq (car preapproved) cant-encode) ++ (not (memq (car preapproved) ucs-list))) ++ (setq preapproved (cdr preapproved))) ++ (if preapproved ++ (cadr (assq (car preapproved) ++ vm-mime-mule-coding-to-charset-alist)) ++ ;; None of the entries in vm-coding-system-priorities ++ ;; can be used. This can only happen if no universal ++ ;; coding system is included. Fall back to utf-8. ++ "utf-8"))) ++ + (let ((charsets (delq 'ascii + (vm-charsets-in-region (point-min) + (point-max))))) +@@ -1472,9 +1493,7 @@ + (while preapproved + (if (memq (car preapproved) ucs-list) + (throw 'done +- (car (cdr (assq +- (vm-coding-system-name +- (car preapproved)) ++ (car (cdr (assq (car preapproved) + vm-mime-mule-coding-to-charset-alist))))) + (setq preapproved (cdr preapproved))) + ;; Nothing universal in the preapproved list. +@@ -1488,8 +1507,8 @@ + (when (latin-unity-maybe-remap (point-min) + (point-max) sys + csets psets t) +- (throw 'done (second (assq +- (vm-coding-system-name sys) ++ (throw 'done ++ (second (assq sys + vm-mime-mule-coding-to-charset-alist))))) + (setq systems (cdr systems))) + (throw 'done nil)) +@@ -1511,9 +1530,8 @@ + ;; If we encounter a universal character set on + ;; the preapproved list, pass it back. + (if (memq (car preapproved) ucs-list) +- (throw 'done (second (assq +- (vm-coding-system-name +- (car preapproved)) ++ (throw 'done ++ (second (assq (car preapproved) + vm-mime-mule-coding-to-charset-alist)))) + + ;; The preapproved entry isn't universal. Check if +@@ -1549,15 +1567,14 @@ + ;; If we encounter a universal character set on + ;; the preapproved list, pass it back. + (when (memq (car preapproved) ucs-list) +- (throw 'done (second (assq +- (vm-coding-system-name +- (car preapproved)) ++ (throw 'done ++ (second (assq (car preapproved) + vm-mime-mule-coding-to-charset-alist)))) + (setq preapproved (cdr preapproved))))) + (throw 'done nil)))) + ;; Couldn't do any magic with vm-coding-system-priorities. Pass + ;; back a Japanese iso-2022 MIME character set. +- (t (or vm-mime-8bit-composition-charset "iso-2022-jp")))) ++ (t (or vm-mime-8bit-composition-charset "iso-2022-jp"))))) + ;; If we're non-MULE and there are eight bit characters, use a + ;; sensible default. + (goto-char (point-min)) |