1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 470_ispell.el_XEmacs-non-unified-chars-latin01.dpatch by Agustin Martin Domingo <agmartin@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Work around iso-8859-{1,15} charset unification problems in XEmacs. Very hackish!
7
Redefine ispell-get-coding-system function in ispell.el so if emacs
8
buffer-file-coding-system is set to iso-8859-15 and ispell-coding-system is selected as
9
iso-8859-1, this last is set to iso-8859-15. This should work around the iso-8859-{1,15}
10
emacs unification problem.
12
This in practice means do not reencode in this case. Do nothing with utf-8 buffers.
15
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' dictionaries-common~/support/emacsen/ispell.el dictionaries-common/support/emacsen/ispell.el
16
--- dictionaries-common~/support/emacsen/ispell.el 2011-02-24 15:01:42.000000000 +0100
17
+++ dictionaries-common/support/emacsen/ispell.el 2011-02-24 15:02:12.000000000 +0100
18
@@ -1338,6 +1338,36 @@
19
(nth 7 (or (assoc ispell-current-dictionary ispell-local-dictionary-alist)
20
(assoc ispell-current-dictionary ispell-dictionary-alist))))
22
+;;; Redefine this function. We do not overwrite previous definition just
23
+;;; to make patches cleaner
24
+(setq debian-xemacs-last-coding-message nil)
25
+(defun ispell-get-coding-system ()
26
+ (let* ((ispell-dict-encoding
27
+ (nth 7 (or (assoc ispell-current-dictionary ispell-local-dictionary-alist)
28
+ (assoc ispell-current-dictionary ispell-dictionary-alist))))
29
+ (emacs-buffer-encoding (ispell-get-mime-charset))
31
+ (if (and (featurep 'xemacs)
32
+ (string-equal emacs-buffer-encoding "iso-8859-15")
33
+ (string-equal ispell-dict-encoding "iso-8859-1"))
34
+ emacs-buffer-encoding
35
+ ispell-dict-encoding)))
36
+ ;; Write some debugging code if asked so
37
+ (when (and (boundp 'debian-dict-common-debug)
38
+ debian-dict-common-debug)
39
+ (let ((tmp-debug-string
40
+ (format "- codings: bfcs: %s, ebcs: %s, idcs: %s"
41
+ (if (boundp 'buffer-file-coding-system)
42
+ buffer-file-coding-system
44
+ emacs-buffer-encoding
46
+ (unless (string-equal tmp-debug-string debian-xemacs-last-coding-message)
47
+ (message "%s" tmp-debug-string)
48
+ (setq debian-xemacs-last-coding-message tmp-debug-string))))
49
+ ;; and return coding-system value
53
(defvar ispell-pdict-modified-p nil
54
"Non-nil means personal dictionary has modifications to be saved.")