[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Forward: [PATCH] emacs-w3m-1.2.6 doesn't work without MULE



Nix さんから以下のメールが届きました。
--- Begin Message ---
I couldn't work out where to send this patch: I hope you'll do, as the
person who introduced the use of `detect-coding-region-with-priority'
into emacs-w3m in the first place :)

'w3m-detect-coding-region' calls `w3m-detect-coding-with-priority' in
both Emacs and XEmacs. In Emacs, this is fine, but it is a bad thing in
XEmacs, because `w3m-detect-coding-with-priority' is defined in the
mule-base package, which need not be installed if your XEmacs is not
MULE-capable.

If you have file-coding enabled (which will be mandated in the next
major release of XEmacs), then you have the closely related
`detect-coding-region'; without that, you must punt back to the
`w3m-coding-system'. So this patch introduces a wrapper macro that does
the appropriate thing (depending on the build system, so it may not be
ideal for .elc file distributors; but I disapprove of .elc distribution
anyway.)

(If `detect-coding-region-with-priority' gets used outside of
Emacs/XEmacs-specific, the wrapper macro may need to be provided in
fsf.el as an empty wrapper. For now there's no need though.

It may well apply to the trunk too.)

2002-03-24  Nix  <nix@esperi.demon.co.uk>

	* w3m-xmas.el:
	* w3m-xmas.el (w3m-detect-coding-with-priority): New function,
	handle non-MULE XEmacsen.
	* w3m-xmas.el (w3m-detect-coding-region): Use it.

Index: w3m-xmas.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m-xmas.el,v
retrieving revision 1.58.2.7
diff -u -r1.58.2.7 w3m-xmas.el
--- w3m-xmas.el	2002/02/26 02:09:07	1.58.2.7
+++ w3m-xmas.el	2002/03/24 12:03:00
@@ -66,6 +66,15 @@
 (defalias 'w3m-make-ccl-coding-system (if (featurep 'mule)
 					  'make-ccl-coding-system
 					'ignore))
+(defmacro w3m-detect-coding-with-priority (from to priority-list)
+  (cond
+  ((featurep 'mule)
+   `(detect-coding-with-priority ,from ,to ,priority-list))
+  ((featurep 'file-coding)
+    `(detect-coding-region ,from ,to))
+  (t
+   w3m-default-coding-system)))
+
 (unless (featurep 'mule)
   (defalias 'coding-system-category 'ignore)
   (defmacro define-ccl-program (&rest args)))
@@ -80,7 +89,7 @@
       (setq category (coding-system-category codesys))
       (unless (assq category categories)
 	(push (cons category codesys) categories)))
-    (if (consp (setq codesys (detect-coding-with-priority
+    (if (consp (setq codesys (w3m-detect-coding-with-priority
 			      start end (nreverse categories))))
 	(car codesys)
       codesys)))


-- 
`Oh, I seeeee, good light; bad light. Presumably the bad light is
 different -- perhaps it's a sawtooth waveform, and the pointy bits
 scratch your eyes?' --- John Ineson to a `monitors emit radiation,
 all radiation is bad, therefore monitors are bad' tub-thumper

--- End Message ---
特に問題無さそうだったので commit しようと思ったのですが、
いつの間にか without Mule な XEmacs で `w3m-find-coding-system' が
定義されていなくてこれだけでは動きませんでした。

ChangeLog からは以下以降の w3m-find-coding-system の変更は見当たら
なかったのですが、復活させちゃって良いのでしょうか?

| 2001-10-26  ARISAWA Akihiro  <ari@mbf.sphere.ne.jp>
[...]
| 	* w3m-xmas.el (w3m-find-coding-system): Define as a dummy function
| 	to support XEmacs without MULE.
| 	(w3m-make-ccl-coding-system): Ditto.
| 	(w3m-detect-coding-region): Ditto.
| 	(coding-system-list): Ditto.

-- 
有沢 明宏
;; 最近の XEmacs では file-coding 有り、mule 無しといった構成が
;; 可能になっているのでしょうか?