Created attachment 1818551 [details]
Tar file made of three patch files and one script file (not compressed)
Description of problem: Emacs-anthy-unicode does not work on emacs, because the character encodings in anthy-agent-unicode and emacs lisp files are configured improperly.
Version-Release number of selected component (if applicable):
How reproducible: Everytime
Steps to Reproduce:
1. Add (require 'anthy) to ~/.emacs file.
2. Start emacs and type C-\ in emacs.
3. Type arbitrary Japanese romaji.
Actual results: Entered romaji is displayed as two octets, and converted into two octets still when space-key is typed.
Expected results: Entered romaji is displayed as Japanese hiragana, and converted into right Japanese characters when space-key is typed.
I attached three patch files and one script file. The anthy-unicode-util.patch and anthy-unicode-emacs-el.patch fix this problem sufficiently. To use anthy and anthy-unicode on emacs, the anthy-unicode-util-Makefile.patch and anthy-unicode-emacs-el-change-name.sh are required. These files add 'unicode' to the names of emacs lisp files and their functions, and change character encoding of emacs lisp files into utf8. The script file requires nkf.
Thank you very much for your patches.
Your patch causes build errors:
anthy-unicode.el:906:1:Error: Cannot open load file: No such file or directory, anthy-dic
anthy-unicode-isearch.el:14:1:Error: Cannot open load file: No such file or directory, anthy
I modified #906 line in anthy-unicode.el but still receive a build error:
@@ -903,8 +903,8 @@
;(global-set-key [(meta escape)] 'anthy-mode)
;; is it ok for i18n?
(set-language-info "Japanese" 'input-method "japanese-anthy")
anthy-unicode.el:906:1:Error: Loading file /builddir/build/BUILD/anthy-unicode-188.8.131.5201109/src-util/anthy-unicode-dic.el failed to provide feature `anthy-unicode-dic'
Thank you for committing my patches and informing me.
The patch files are insufficient if only the names of files are changed.
I recommend adding "unicode" to the names of all functions and variables in anthy-unicode emacs lisp files because Fedora provides anthy and anthy-unicode RPMs.
If anthy and anthy-unicode RPMs are installed simultaneously, "/usr/share/site-lisp/anthy-unicode" is earlier than "/usr/share/site-lisp/anthy" in the variable load-path of emacs.
In this situation, there is a problem in using anthy in emacs because anthy and anthy-unicode RPMs provide the emacs lisp files that contain the functions with same name and different return values.
Changing the subject, I have another proposal of a patch file to make consistent with adding word by kasumi-unicode.
--- src-util/anthy-unicode-dic.el.orig 2021-08-28 19:09:41.806091512 +0900
+++ src-util/anthy-unicode-dic.el 2021-10-22 21:34:29.331951069 +0900
@@ -125,7 +125,7 @@
((= cat 4)
(setq param (anthy-dic-get-av-category word))))
- (setq res (anthy-add-word yomi 1 word param)))
+ (setq res (anthy-add-word yomi 500 word param)))
(message (concat word "(" yomi ")を登録しました")))))
In my last comment
I don't think the build error is caused by installing both anthy and anthy-unicode.
I think you suggest to fix another issue.
I think your 500 word patch also does not resolve the build error.
I mean if the build errors are not resolved, I will revert your patches in the upstream again.
Finally we fixed the build errors:
I revised the patch.
FEDORA-2021-bf632768c1 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-bf632768c1
FEDORA-2021-bf632768c1 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-bf632768c1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-bf632768c1
See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-bf632768c1 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.