diff options
| author | Eli Zaretskii | 2013-11-30 12:42:17 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-11-30 12:42:17 +0200 |
| commit | 28c9be2d34709a7d575e4bd4e26956bc3b2a0b8c (patch) | |
| tree | f83f16ad4f105cb96896de93db4af686a2da4fc3 /admin | |
| parent | 10634b405c72506eb6ff664640681c858f70eae1 (diff) | |
| download | emacs-28c9be2d34709a7d575e4bd4e26956bc3b2a0b8c.tar.gz emacs-28c9be2d34709a7d575e4bd4e26956bc3b2a0b8c.zip | |
(Mostly) fix bug #16007 with generation of MULE-*.map files.
admin/charsets/mule-charsets.el: Rewritten to work in Emacs 23 and
later.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/ChangeLog | 5 | ||||
| -rw-r--r-- | admin/charsets/mule-charsets.el | 46 |
2 files changed, 35 insertions, 16 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index d70056f001e..f65596a1015 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-11-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * charsets/mule-charsets.el: Rewritten to work in Emacs 23 and | ||
| 4 | later. (Bug#16007) | ||
| 5 | |||
| 1 | 2013-11-30 Glenn Morris <rgm@gnu.org> | 6 | 2013-11-30 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | Stop keeping (most) generated cedet grammar files in the repository. | 8 | Stop keeping (most) generated cedet grammar files in the repository. |
diff --git a/admin/charsets/mule-charsets.el b/admin/charsets/mule-charsets.el index 4a48d994b1b..4ccf4bfb5be 100644 --- a/admin/charsets/mule-charsets.el +++ b/admin/charsets/mule-charsets.el | |||
| @@ -19,20 +19,32 @@ | |||
| 19 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 19 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | (if (not (or (and (= emacs-major-version 21) (= emacs-minor-version 4)) | 22 | ;; For the record: the old, pre-v23 code was this: |
| 23 | (= emacs-major-version 22))) | 23 | ;; (if (not (or (and (= emacs-major-version 21) (= emacs-minor-version 4)) |
| 24 | (error "Use Emacs of version 21.4 or any of version 22")) | 24 | ;; (= emacs-major-version 22))) |
| 25 | 25 | ;; (error "Use Emacs of version 21.4 or any of version 22")) | |
| 26 | (defun func (start end) | 26 | ;; |
| 27 | (while (<= start end) | 27 | ;; (defun func (start end) |
| 28 | (let ((split (split-char start)) | 28 | ;; (while (<= start end) |
| 29 | (unicode (encode-char start 'ucs))) | 29 | ;; (let ((split (split-char start)) |
| 30 | (if unicode | 30 | ;; (unicode (encode-char start 'ucs))) |
| 31 | (if (nth 2 split) | 31 | ;; (if unicode |
| 32 | (insert (format "0x%02X%02X 0x%04X\n" | 32 | ;; (if (nth 2 split) |
| 33 | (nth 1 split) (nth 2 split) unicode)) | 33 | ;; (insert (format "0x%02X%02X 0x%04X\n" |
| 34 | (insert (format "0x%02X 0x%04X\n" (nth 1 split) unicode))))) | 34 | ;; (nth 1 split) (nth 2 split) unicode)) |
| 35 | (setq start (1+ start)))) | 35 | ;; (insert (format "0x%02X 0x%04X\n" (nth 1 split) unicode))))) |
| 36 | ;; (setq start (1+ start)))) | ||
| 37 | |||
| 38 | (defun func (range charset) | ||
| 39 | (let ((start (car range)) | ||
| 40 | (end (cdr range))) | ||
| 41 | (while (and (<= start end) (<= start #x10ffff)) | ||
| 42 | (let ((ch (encode-char start charset))) | ||
| 43 | (if ch | ||
| 44 | (if (> ch 256) | ||
| 45 | (insert (format "0x%04X 0x%04X\n" ch start)) | ||
| 46 | (insert (format "0x%02X 0x%04X\n" ch start))))) | ||
| 47 | (setq start (1+ start))))) | ||
| 36 | 48 | ||
| 37 | (defconst charset-alist | 49 | (defconst charset-alist |
| 38 | '(("MULE-ethiopic.map" . ethiopic) | 50 | '(("MULE-ethiopic.map" . ethiopic) |
| @@ -51,6 +63,8 @@ | |||
| 51 | (dolist (elt charset-alist) | 63 | (dolist (elt charset-alist) |
| 52 | (with-temp-buffer | 64 | (with-temp-buffer |
| 53 | (insert header) | 65 | (insert header) |
| 54 | (map-charset-chars 'func (cdr elt)) | 66 | (map-charset-chars 'func (cdr elt) (cdr elt)) |
| 55 | (write-file (car elt)))) | 67 | (sort-lines nil (point-min) (point-max)) |
| 68 | (let ((coding-system-for-write 'unix)) | ||
| 69 | (write-file (car elt))))) | ||
| 56 | 70 | ||