diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-03-17 21:30:20 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-03-17 21:30:20 -0700 |
commit | 982efbcdc4b44d595743cf9085ad64731417cde3 (patch) | |
tree | e3cd03529909cb4fde00c06b2a27d273f73a9e9a /lisp/international/ja-dic-cnv.el | |
parent | 2fcc7665107849677e6803b54cc7c668c0bcbd24 (diff) | |
download | emacs-982efbcdc4b44d595743cf9085ad64731417cde3.tar.gz |
Automate the build of ja-dic.el.
ja-dic.el no longer needs to be in the repository: it's now
generated as part of the build from bzr. Also, update SKK-JISYO.L to
match the upstream source exactly.
* .bzrignore: Add leim/ja-dic/.
* leim/ja-dic/ja-dic.el: Remove from repository. It is still distributed
as part of the Emacs tarball.
* leim/Makefile.in ($(srcdir)/ja-dic/ja-dic.el): New rule.
(compile-main): Depend on it.
* leim/SKK-DIC/README: Update to reflect new build procedure.
* leim/SKK-DIC/SKK-JISYO.L: Update to match source exactly.
This is now the annotated version, to match the upstream file name;
the unannotated one is built from it automatically.
* lisp/international/ja-dic-cnv.el (skkdic-convert): Remove the annotations
from the input, rather than assume that it's been done for us by the
SKK script unannotate.awk. Switch ja-dic.el to UTF-8. Don't put
the current date into a ja-dic.el comment, as that complicates
regression testing.
Fixes: debbugs:13984
Diffstat (limited to 'lisp/international/ja-dic-cnv.el')
-rw-r--r-- | lisp/international/ja-dic-cnv.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el index c0fcf19d841..5382dbe3ad7 100644 --- a/lisp/international/ja-dic-cnv.el +++ b/lisp/international/ja-dic-cnv.el @@ -330,16 +330,21 @@ The name of generated file is specified by the variable `ja-dic-filename'." (interactive "FSKK dictionary file: ") (message "Reading file \"%s\" ..." filename) (let* ((coding-system-for-read 'euc-japan) - (skkbuf(find-file-noselect (expand-file-name filename))) + (skkbuf (get-buffer-create " *skkdic-unnannotated*")) (buf (get-buffer-create "*skkdic-work*"))) + ;; Set skkbuf to an unannotated copy of the dictionary. + (with-current-buffer skkbuf + (insert-file-contents (expand-file-name filename)) + (re-search-forward "^[^;]") + (while (re-search-forward ";[^\n/]*/" nil t) + (replace-match "/"))) ;; Setup and generate the header part of working buffer. (with-current-buffer buf (erase-buffer) (buffer-disable-undo) (insert ";;; ja-dic.el --- dictionary for Japanese input method" - " -*-coding: euc-japan; -*-\n" + " -*-coding: utf-8; -*-\n" ";;\tGenerated by the command `skkdic-convert'\n" - ";;\tDate: " (current-time-string) "\n" ";;\tOriginal SKK dictionary file: " (file-relative-name (expand-file-name filename) dirname) "\n\n" @@ -348,7 +353,6 @@ The name of generated file is specified by the variable `ja-dic-filename'." ";; Do byte-compile this file again after any modification.\n\n" ";;; Start of the header of the original SKK dictionary.\n\n") (set-buffer skkbuf) - (widen) (goto-char 1) (let (pos) (search-forward ";; okuri-ari") @@ -399,7 +403,7 @@ The name of generated file is specified by the variable `ja-dic-filename'." ;; Save the working buffer. (set-buffer buf) (set-visited-file-name (expand-file-name ja-dic-filename dirname) t) - (set-buffer-file-coding-system 'euc-japan) + (set-buffer-file-coding-system 'utf-8) (save-buffer 0)) (kill-buffer skkbuf) (switch-to-buffer buf))) |