rpms/emacs-vm/devel vm-8.0.12-fix-charsets.patch, NONE, 1.1 emacs-vm.spec, 1.36, 1.37

Jonathan G. Underwood jgu at fedoraproject.org
Wed Sep 16 11:25:11 UTC 2009


Author: jgu

Update of /cvs/extras/rpms/emacs-vm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4650

Modified Files:
	emacs-vm.spec 
Added Files:
	vm-8.0.12-fix-charsets.patch 
Log Message:
* Wed Sep 16 2009 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 8.0.12-6
- Bump release to fix up cvs problem

* Wed Sep 16 2009 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 8.0.12-5
- Add patch to fix charset recognition with emacs 23
- Bump minimum emacs to version 23.1
- Rebuild against emacs 23.1



vm-8.0.12-fix-charsets.patch:
 vm-mime.el |   43 ++++++++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 13 deletions(-)

--- NEW FILE vm-8.0.12-fix-charsets.patch ---
--- 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))


Index: emacs-vm.spec
===================================================================
RCS file: /cvs/extras/rpms/emacs-vm/devel/emacs-vm.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- emacs-vm.spec	24 Jul 2009 22:05:59 -0000	1.36
+++ emacs-vm.spec	16 Sep 2009 11:25:09 -0000	1.37
@@ -13,7 +13,7 @@
 # If the emacs-el package has installed a pkgconfig file, use that to determine
 # install locations and Emacs version at build time, otherwise set defaults.
 %if %($(pkg-config emacs) ; echo $?)
-%define emacs_version 22.1
+%define emacs_version 23.1
 %define emacs_lispdir %{_datadir}/emacs/site-lisp
 %define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d
 %else
@@ -29,13 +29,14 @@
 Summary: Emacs VM mailreader
 Name: emacs-vm
 Version: 8.0.12
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2+
 Group: Applications/Internet
 URL: http://www.nongnu.org/viewmail/
 Source0: http://download.savannah.nongnu.org/releases/viewmail/vm-%{version}.tgz
 
 Patch0: vm-8.0.12-fix-missing-autoload.patch
+Patch1: vm-8.0.12-fix-charsets.patch
 
 Requires: emacs >= %{emacs_version}
 Requires(pre): /sbin/install-info 
@@ -70,6 +71,7 @@ package. It is not necessary to install 
 %setup -q -n vm-%{version}
 
 %patch0 -p1 -b .fix-missing-autoload
+%patch1 -p1 -b .fix-charsets.patch
 
 # Add missing entry for u-vm-color.el to lisp Makefile.in
 # This shouldn't be necessary after 8.0.12 
@@ -139,8 +141,13 @@ fi
 %{pkgdir}/*.el
 
 %changelog
-* Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 8.0.12-5
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+* Wed Sep 16 2009 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 8.0.12-6
+- Bump release to fix up cvs problem
+
+* Wed Sep 16 2009 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 8.0.12-5
+- Add patch to fix charset recognition with emacs 23
+- Bump minimum emacs to version 23.1
+- Rebuild against emacs 23.1
 
 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 8.0.12-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild




More information about the fedora-extras-commits mailing list