~ubuntu-branches/ubuntu/oneiric/dictionaries-common/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/470_ispell.el_XEmacs-non-unified-chars-latin01.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2011-06-08 13:18:25 UTC
  • mfrom: (1.1.37 sid)
  • Revision ID: james.westby@ubuntu.com-20110608131825-fimpnbuh09dmbkcd
Tags: 1.11.3ubuntu1
* Merge from debian unstable. (LP: #794498) Remaining changes:
  - scripts/system/dc-debconf-select.pl: Drop default debconf priority
    from 'high' to 'medium'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
3
##
 
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!
 
6
 
 
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. 
 
11
 
 
12
This in practice means do not reencode in this case. Do nothing with utf-8 buffers.
 
13
 
 
14
@DPATCH@
 
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))))
 
21
 
 
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))
 
30
+        (return-coding
 
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
 
43
+                      "unbound")
 
44
+                    emacs-buffer-encoding
 
45
+                    return-coding)))
 
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
 
50
+    return-coding))
 
51
+
 
52
 
 
53
 (defvar ispell-pdict-modified-p nil
 
54
   "Non-nil means personal dictionary has modifications to be saved.")