Main Page | Report this Page

 




 

 

Computers Forum Index  »  Computer - Emacs  »  mule-ucs and character sets problem
Page 1 of 1    

mule-ucs and character sets problem

Author Message
Reiner Steib
Posted: Mon Apr 11, 2005 1:04 pm
Guest
On Sat, Apr 09 2005, Haines Brown wrote:

Quote:
I reinstalled emacs 21.4.1 under debian sarge, and since then have had
some character set difficulties. I was under the impression that this
version of emacs had built-in support for mule-ucs, and so I didn't
migrate ~/elisp/mule-ucs over to the new installation. Could that be
my problem?

AFAIK, the builtin Unicode support in Emacs 21 should be sufficient
for European languages.

Quote:
These default coding systems were tried:
undecided-unix iso-latin-1
However, none of them safely encodes the target text.

Select one of the following safe coding systems:
mule-utf-16-be mule-utf-16-le utf-8 raw-text emacs-mule
no-conversion

And in the minibuffer: Select coding system (default mule-utf-16-be):
However, select the default did nothing and I can't save. I suppose I
could save as raw-text, but I'm anxious to resolve the problem, not
work around it.

I'm not sure, but maybe this could help:

;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/rs-sort-coding-systems-21-3-fix.el
[...]
;;; Commentary:

;; Emacs 21.3 and Emacs 21.4 come with a slightly broken version of the
;; function `sort-coding-systems'. Therefore in some cases, Gnus uses
;; utf-16-x rather than utf-8. Additionally, it's not correct utf-16-be. See
;; <URL:http://news.gmane.org/v9adfeig1c.fsf@marauder.physik.uni-ulm.de> for
;; details.
;;
;; This file provides a simple solution for this problem. It's specific to
;; these Emacs versions, don't use is with other Emacs versions.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
 
Haines Brown
Posted: Mon Apr 11, 2005 5:03 pm
Guest
Reiner Steib <reinersteib+from-uce@imap.cc> writes:

Quote:
And in the minibuffer: Select coding system (default mule-utf-16-be):
However, select the default did nothing and I can't save. I suppose I
could save as raw-text, but I'm anxious to resolve the problem, not
work around it.

I'm not sure, but maybe this could help:

;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/rs-sort-coding-systems-21-3-fix.el
[...]
;;; Commentary:

;; Emacs 21.3 and Emacs 21.4 come with a slightly broken version of the
;; function `sort-coding-systems'. Therefore in some cases, Gnus uses
;; utf-16-x rather than utf-8. Additionally, it's not correct utf-16-be. See
;; <URL:http://news.gmane.org/v9adfeig1c.fsf@marauder.physik.uni-ulm.de> for
;; details.
;;
;; This file provides a simple solution for this problem. It's specific to
;; these Emacs versions, don't use is with other Emacs versions.

Thank you, it does seem I need the patch. Unfortunately, I'm a lisp
ignoramus and seem to have groked the .el file.

I cut the needed .el file lines from the recommended URL and put it
into ~/elisp. However, I also carefull removed the two comment
semicolons at the start of each line. As a result, the first three
lines (starting --, +++ and @) wouldn't parse, and so I re-commented
them. But then I remained with a error:

End of file during parsing:
/home/brownh/elisp/rs-sort-coding-systems-21-3-fix.el

I played with the end of the file (removing spaces; adding a blank
line), but without luck.

--

Haines Brown
 
Reiner Steib
Posted: Mon Apr 11, 2005 7:04 pm
Guest
On Mon, Apr 11 2005, Haines Brown wrote:

Quote:
Reiner Steib <reinersteib+from-uce@imap.cc> writes:
;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/rs-sort-coding-systems-21-3-fix.el
[...]
I cut the needed .el file lines from the recommended URL and put it
into ~/elisp. However, I also carefull removed the two comment
semicolons at the start of each line. As a result, the first three
lines (starting --, +++ and @) wouldn't parse, and so I re-commented
them.

I wonder what's unclear about the installation instruction in the
file:

;;; Installation:

;; Put `rs-sort-coding-systems-21-3-fix.el' in a directory that's at the
;; beginning of your `load-path', e.g. ~/lisp:
;;
;; ;; Make sure this path comes before system paths:
;; (setq load-path (nconc (list "~/lisp") load-path))
;;
;; Load the file, by adding the following in your startup file (usually
;; ~/.emacs):
;;
;; (require 'rs-sort-coding-systems-21-3-fix)
;;
;; That's all.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
 
Haines Brown
Posted: Mon Apr 11, 2005 9:50 pm
Guest
Reiner,

Thanks for your patience, and I apologize for not being clearer about
my difficulty. Here's the section of the directions about which I was
speaking:

;; This is the relevant patch:

;; --8<---------------cut here---------------start------------->8---
;; --- mule-cmds.el 26 Dec 2002 17:27:20 -0000 1.216
;; +++ mule-cmds.el 3 Jan 2003 20:16:11 -0000 1.217
;; @@ -425,9 +425,18 @@
;; (let ((base (coding-system-base x)))
;; (+ (if (eq base most-preferred) 64 0)
;; (let ((mime (coding-system-get base 'mime-charset)))
;; + ;; Prefer coding systems corresponding to a
....

I extracted the material below the "cut here" and before the "cut
here... end." I then removed all the initial semi-colons at the
beginning of each line so that the lines would appear as:

--- mule-cmds.el 26 Dec 2002 17:27:20 -0000 1.216
+++ mule-cmds.el 3 Jan 2003 20:16:11 -0000 1.217
@@ -425,9 +425,18 @@
(let ((base (coding-system-base x)))
(+ (if (eq base most-preferred) 64 0)
(let ((mime (coding-system-get base 'mime-charset)))
+ ;; Prefer coding systems corresponding to a
...

This wouldn't parse, and so I restored the first three lines as a
comment as such:

;; --- mule-cmds.el 26 Dec 2002 17:27:20 -0000 1.216
;; +++ mule-cmds.el 3 Jan 2003 20:16:11 -0000 1.217
;; @@ -425,9 +425,18 @@
(let ((base (coding-system-base x)))
(+ (if (eq base most-preferred) 64 0)
(let ((mime (coding-system-get base 'mime-charset)))
+ ;; Prefer coding systems corresponding to a
....

and I received the error message concerning end of file. Otherwise,
the instructions were quite clear.

--

Haines Brown
 
Haines Brown
Posted: Tue Apr 12, 2005 3:03 am
Guest
Aha! I was looking at the wrong coding altogether. Now I'm trying the
material at the end of the file, the material after "The original
version from `international/mule-cmds.el' is broken. This":

(if sort-coding-systems-predicate
(sort codings sort-coding-systems-predicate)

...

;;; rs-sort-coding-systems-21-3-fix.el ends here

But still a problem:c "Symbol's value as variable is void: coding". I
regret being such a dullard in what should be a simple matter.

--

Haines Brown
 
Reiner Steib
Posted: Tue Apr 12, 2005 9:03 am
Guest
On Tue, Apr 12 2005, Haines Brown wrote:

Quote:
Aha! I was looking at the wrong coding altogether. Now I'm trying the
material at the end of the file, [...]

You don't need to extract any material from the file. Put the
complete file `rs-sort-coding-systems-21-3-fix.el' in a directory
that's at the beginning of your `load-path', e.g. ~/lisp:

;; Make sure this path comes before system paths:
(setq load-path (nconc (list "~/lisp") load-path))

Load the file, by adding the following in your startup file (usually
~/.emacs):

(require 'rs-sort-coding-systems-21-3-fix)

That's all. Restart Emacs.


How to make sure it is working correctly? Copy the following line
into the *scratch* buffer and hit `C-j':

(car (sort-coding-systems '(mule-utf-16-be mule-utf-16-le mule-utf-Cool))

It should return mule-utf-8.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
 
 
Page 1 of 1    
All times are GMT
The time now is Sat Jul 31, 2010 9:29 pm