GNU bug report logs - #43084
toggle-korean-input-method, Korean with Dvorak

Previous Next

Package: emacs;

Reported by: "L.J. Lee" <lj.is.writing <at> gmail.com>

Date: Fri, 28 Aug 2020 11:03:02 UTC

Severity: normal

Tags: fixed, moreinfo

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43084 in the body.
You can then email your comments to 43084 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43084; Package emacs. (Fri, 28 Aug 2020 11:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "L.J. Lee" <lj.is.writing <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 28 Aug 2020 11:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "L.J. Lee" <lj.is.writing <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: toggle-korean-input-method, Korean with Dvorak
Date: Fri, 28 Aug 2020 18:41:08 +0900
[Message part 1 (text/plain, inline)]
Hi, I hope this finds you well! I have recently started using Emacs and
wanted to alert you to a really bedevilling problem I had with Korean input
and input method toggling, how I solved it, and suggestions for improving
it.

Long story short, I use the 3-beol-sik final layout (designated as
korean-hangul3f on the emacs system) to type Korean and set it as my
default input method in
init.el.

I was  puzzled, however, that my Korean layout
reverted to the more common 2-beol-sik (korean-hangul) whenever I
pressed S-SPC. C-\ would work to switch my layout correctly, but
pressing S-SPC even once to toggle to Korean layout would change the
default layout to korean-hangul and necessitate a manual change back to
korean-hangul3f
using M-x set-input-method.

I found out through language-info-alist that S-SPC is
bound to toggle-korean-input-method, and used the function query to
track this function to korea-util.el under lisp/language.

As expected, the toggle-korean-input-method function set the
default input method to korean-hangul regardless of user settings, so I
redefined it from init.el to set the default-korean-keyboard as
korean-hangul3f. Here's the code I used:

(with-eval-after-load "language/korea-util"
(defun toggle-korean-input-method ()
"Turn on or off a Korean text input method for the current butter."
(interactive)
(if current-input-method
    (deactivate-input-method)
    (activate-input-method)
        (concat "korean-hangul3f" default-korean-keyboard)))))

This worked, but it took me a lot of time, frustration, and a crash course
on the
workings of Emacs. It seems to me the much more logical way for this
function to work is to look for any relevant user configurations
and setting the layout accordingly rather than statically setting the Korean
layout.

All this was after I had to redefine a different function because Korean
layouts were not compatible with Dvorak layout, which I solved with the
help of the patch  here: https://blog.jamzattack.xyz/emacs-hangul-input.html
Updating hangul.el as described there would solve the Dvorak-Korean
incompatibility.

I hope these suggestions will help in improving Emacs, which despite my
short usage and the problems I ran into is a great, versatile
program. Keep up the good work!

With regards,

L.J.
[Message part 2 (text/html, inline)]

Information forwarded to jihyun.jo <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#43084; Package emacs. (Fri, 28 Aug 2020 13:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 43084 <at> debbugs.gnu.org (full text, mbox):

From: soyeomul <at> doraji.xyz (황병희)
To: "L.J. Lee" <lj.is.writing <at> gmail.com>
Cc: 43084 <at> debbugs.gnu.org
Subject: Re: bug#43084: toggle-korean-input-method, Korean with Dvorak
Date: Fri, 28 Aug 2020 22:04:51 +0900
X-Debbugs-CC: jihyun.jo <at> gmail.com

"L.J. Lee" <lj.is.writing <at> gmail.com> writes:

> Hi, I hope this finds you well! I have recently started using Emacs and wanted to alert you to a really bedevilling
> problem I had with Korean input and input method toggling, how I solved it, and suggestions for improving it.
>
> Long story short, I use the 3-beol-sik final layout (designated as korean-hangul3f on the emacs system) to type
> Korean and set it as my default input method in
> init.el.
>
> I was  puzzled, however, that my Korean layout
> reverted to the more common 2-beol-sik (korean-hangul) whenever I
> pressed S-SPC. C-\ would work to switch my layout correctly, but
> pressing S-SPC even once to toggle to Korean layout would change the
> default layout to korean-hangul and necessitate a manual change back to korean-hangul3f
> using M-x set-input-method.
>
> I found out through language-info-alist that S-SPC is
> bound to toggle-korean-input-method, and used the function query to
> track this function to korea-util.el under lisp/language.
>
> As expected, the toggle-korean-input-method function set the
> default input method to korean-hangul regardless of user settings, so I
> redefined it from init.el to set the default-korean-keyboard as
> korean-hangul3f. Here's the code I used:
>
> (with-eval-after-load "language/korea-util"
> (defun toggle-korean-input-method ()
> "Turn on or off a Korean text input method for the current butter."
> (interactive)
> (if current-input-method
>     (deactivate-input-method)
>     (activate-input-method)
>         (concat "korean-hangul3f" default-korean-keyboard)))))
>
> This worked, but it took me a lot of time, frustration, and a crash course on the
> workings of Emacs. It seems to me the much more logical way for this
> function to work is to look for any relevant user configurations
> and setting the layout accordingly rather than statically setting the Korean
> layout.
>
> All this was after I had to redefine a different function because Korean
> layouts were not compatible with Dvorak layout, which I solved with the
> help of the patch  here: https://blog.jamzattack.xyz/emacs-hangul-input.html Updating hangul.el as described there
> would solve the Dvorak-Korean incompatibility.
>
> I hope these suggestions will help in improving Emacs, which despite my
> short usage and the problems I ran into is a great, versatile
> program. Keep up the good work!
>
> With regards,
>
> L.J.

IMHO, i think we need to confirm of Jihyun(KLDP: sylphong) -- the author
of korean-input-method in GNU Emacs [1].

Sincerely, Byung-Hee

[1] https://kldp.org/node/91578

-- 
^고맙습니다 _布德天下_ 감사합니다_^))//




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43084; Package emacs. (Wed, 27 Jan 2021 06:34:01 GMT) Full text and rfc822 format available.

Message #11 received at 43084 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "L.J. Lee" <lj.is.writing <at> gmail.com>
Cc: 43084 <at> debbugs.gnu.org
Subject: Re: bug#43084: toggle-korean-input-method, Korean with Dvorak
Date: Wed, 27 Jan 2021 07:33:31 +0100
"L.J. Lee" <lj.is.writing <at> gmail.com> writes:

> I was  puzzled, however, that my Korean layout
> reverted to the more common 2-beol-sik (korean-hangul) whenever I
> pressed S-SPC. C-\ would work to switch my layout correctly, but
> pressing S-SPC even once to toggle to Korean layout would change the
> default layout to korean-hangul and necessitate a manual change back to
> korean-hangul3f
> using M-x set-input-method.
>
> I found out through language-info-alist that S-SPC is
> bound to toggle-korean-input-method, and used the function query to
> track this function to korea-util.el under lisp/language.
>
> As expected, the toggle-korean-input-method function set the
> default input method to korean-hangul regardless of user settings, so I
> redefined it from init.el to set the default-korean-keyboard as
> korean-hangul3f. Here's the code I used:
>
> (with-eval-after-load "language/korea-util"
> (defun toggle-korean-input-method ()
> "Turn on or off a Korean text input method for the current butter."
> (interactive)
> (if current-input-method
>     (deactivate-input-method)
>     (activate-input-method)
>         (concat "korean-hangul3f" default-korean-keyboard)))))

I don't use the Korean input methods, so this is totally uninformed --
but looking at the code, your alteration seems to be the same as putting

(setq default-korean-keyboard "3f")

in your init file?

In which case configuring this is already supported in Emacs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 27 Jan 2021 06:34:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43084; Package emacs. (Fri, 29 Jan 2021 05:09:02 GMT) Full text and rfc822 format available.

Message #16 received at 43084 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "L.J. Lee" <lj.is.writing <at> gmail.com>
Cc: 43084 <at> debbugs.gnu.org
Subject: Re: bug#43084: toggle-korean-input-method, Korean with Dvorak
Date: Fri, 29 Jan 2021 06:08:32 +0100
"L.J. Lee" <lj.is.writing <at> gmail.com> writes:

>>> (with-eval-after-load "language/korea-util"
>>> (defun toggle-korean-input-method ()
>>> "Turn on or off a Korean text input method for the current butter."
>>> (interactive)
>>> (if current-input-method
>>>     (deactivate-input-method)
>>>     (activate-input-method)
>>>         (concat "korean-hangul3f" default-korean-keyboard)))))
>>
>> I don't use the Korean input methods, so this is totally uninformed --
>> but looking at the code, your alteration seems to be the same as putting
>>
>> (setq default-korean-keyboard "3f")
>>
>> in your init file?
>>
>> In which case configuring this is already supported in Emacs.
>
> It doesn't, actually--your suggested method was what I tried at first,
> because it's the normal way to do things.

I'm just reading the code, and I don't quite understand why.
`default-korean-keyboard' is (by default) "", so this:

(defun toggle-korean-input-method ()
  "Turn on or off a Korean text input method for the current buffer."
  (interactive)
  (if current-input-method
      (deactivate-input-method)
    (activate-input-method
     (concat "korean-hangul" default-korean-keyboard))))

means that we call

(activate-input-method "korean-hangul")

If `default-korean-keyboard' was "3f", then we'd call

(activate-input-method "korean-hangul3f")

You suggested this change:

>>>     (activate-input-method)
>>>         (concat "korean-hangul3f" default-korean-keyboard)))))

and assuming that ")" after `activate-input-method' is a typo, that
would mean that we call

(activate-input-method "korean-hangul3f")

which is identical to what we'd get if we set the variable to "3f".

Or am I misreading the code or what you suggested?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43084; Package emacs. (Fri, 29 Jan 2021 07:11:02 GMT) Full text and rfc822 format available.

Message #19 received at 43084 <at> debbugs.gnu.org (full text, mbox):

From: "L.J. Lee" <lj.is.writing <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43084 <at> debbugs.gnu.org
Subject: Re: bug#43084: toggle-korean-input-method, Korean with Dvorak
Date: Fri, 29 Jan 2021 13:54:52 +0900
Lars Ingebrigtsen writes:

> "L.J. Lee" <lj.is.writing <at> gmail.com> writes:
>
>> I was  puzzled, however, that my Korean layout
>> reverted to the more common 2-beol-sik (korean-hangul) whenever I
>> pressed S-SPC. C-\ would work to switch my layout correctly, but
>> pressing S-SPC even once to toggle to Korean layout would change the
>> default layout to korean-hangul and necessitate a manual change back to
>> korean-hangul3f
>> using M-x set-input-method.
>>
>> I found out through language-info-alist that S-SPC is
>> bound to toggle-korean-input-method, and used the function query to
>> track this function to korea-util.el under lisp/language.
>>
>> As expected, the toggle-korean-input-method function set the
>> default input method to korean-hangul regardless of user settings, so I
>> redefined it from init.el to set the default-korean-keyboard as
>> korean-hangul3f. Here's the code I used:
>>
>> (with-eval-after-load "language/korea-util"
>> (defun toggle-korean-input-method ()
>> "Turn on or off a Korean text input method for the current butter."
>> (interactive)
>> (if current-input-method
>>     (deactivate-input-method)
>>     (activate-input-method)
>>         (concat "korean-hangul3f" default-korean-keyboard)))))
>
> I don't use the Korean input methods, so this is totally uninformed --
> but looking at the code, your alteration seems to be the same as putting
>
> (setq default-korean-keyboard "3f")
>
> in your init file?
>
> In which case configuring this is already supported in Emacs.

It doesn't, actually--your suggested method was what I tried at first,
because it's the normal way to do things.
However, my setting didn't survive the first time I tried to
switch between Korean and English using S-SPC because doing so triggered
toggle-korean-input-method, which overrode my default-korean-keyboard
setting (korean-hangul3f) and reset it to korean-hangul instead.

Long story short, the toggle-korean-input-method is written to
override user settings which is just Bad Code and should be changed.

(Most Korean keyboard users wouldn't even notice, by the way, because
most use korean-hangul and korean-hangul3f is a minority layout.
It's probably why this error survived so long.)

Regards,
-- 
L.J. Lee
Mastodon account: https://rage.love/@ljwrites
Dreamwidth blog: https://lj_writes.dreamwidth.org




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43084; Package emacs. (Sun, 31 Jan 2021 07:14:02 GMT) Full text and rfc822 format available.

Message #22 received at 43084 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "L.J. Lee" <lj.is.writing <at> gmail.com>
Cc: 43084 <at> debbugs.gnu.org
Subject: Re: bug#43084: toggle-korean-input-method, Korean with Dvorak
Date: Sun, 31 Jan 2021 08:13:26 +0100
"L.J. Lee" <lj.is.writing <at> gmail.com> writes:

> So I changed my settings to test this and you were right!
>
>> (setq default-korean-keyboard "3f")
>
> worked without having to change the toggle-korean-input-method function.

Thanks for testing.

> However, now I think there's a problem of documentation and
> discoverability.

Yup.  I've now mentioned the variable in the doc strings of all the
functions that use the variable, which should allow it to be discovered
more easily.




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 31 Jan 2021 07:14:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 43084 <at> debbugs.gnu.org and "L.J. Lee" <lj.is.writing <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 31 Jan 2021 07:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Feb 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.