From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sukbeom Kim Newsgroups: gmane.emacs.bugs Subject: bug#66970: 29.1; Overwrite-mode is not working with Korean characters Date: Fri, 10 Nov 2023 09:34:11 +0900 Message-ID: <87il6atp4e.fsf@gmail.com> References: <83cywizx9m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35151"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.14; emacs 29.1 Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 66970@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 10 01:58:52 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1FrF-0008s9-J8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Nov 2023 01:58:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1Fqr-0002E2-Nr; Thu, 09 Nov 2023 19:58:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1Fqp-0002CH-HJ for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 19:58:23 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1Fqo-0008KM-RR for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 19:58:23 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1FrR-0003Qx-LO for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 19:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sukbeom Kim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Nov 2023 00:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66970 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 66970-submit@debbugs.gnu.org id=B66970.169957790113142 (code B ref 66970); Fri, 10 Nov 2023 00:59:01 +0000 Original-Received: (at 66970) by debbugs.gnu.org; 10 Nov 2023 00:58:21 +0000 Original-Received: from localhost ([127.0.0.1]:49197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1Fqn-0003Pu-6t for submit@debbugs.gnu.org; Thu, 09 Nov 2023 19:58:21 -0500 Original-Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:46125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1Fqi-0003Pe-4k for 66970@debbugs.gnu.org; Thu, 09 Nov 2023 19:58:20 -0500 Original-Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cc4f777ab9so13020255ad.0 for <66970@debbugs.gnu.org>; Thu, 09 Nov 2023 16:57:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699577850; x=1700182650; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=z544x6FIOZgNhoH6pBJx8Azg1ExAX1jxi3MkeKZeSN4=; b=LqwmxA/ZMA4y349c78C4cEygCm4ZTUstK9LKtObaws1Qs+bAsRHbrzg9KCFWjcEO8d F+T+PuIJ5uZuR3CVbQH1UkG9QxPyopApjSMWw+vOXBVp7bQmvKejyLVB2W0G4nx2I6fs pHlSjDoKuquGtBdYPgL7zvwq9W6zn0stZziOMZLHsCFBp6upIwEbl7pMw+CeWTgPOeix WVDIY02rMSe6njuDaz7cKlNYwE+L+urBfPYbm3jsczDkB+vDF3z3lxEG9wVB54cvR1rs 624d8QH+pIK83IvSCKjbB44fT4QtdKoS9+YAOHOIHE0oM2tm7V/BOsskZ6bYJ+O9HCL9 f45Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699577850; x=1700182650; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=z544x6FIOZgNhoH6pBJx8Azg1ExAX1jxi3MkeKZeSN4=; b=pIyML0+hWA82YstD877EDMohzu6GPHq+0f5/1EYcE4UtPC2+5wSlP5Nc5z4z+OOxHy g+7swJv5gzwniAFOVGkaj2QdYIIwkaAsNyemnMmetG7td+KRZvF90pf0nLnCJVP8+fFL Otd52yLVMHfuztth2UAeIrXI3xHrhTSaQjkXGj10L2y1okRJ/tRfoReFsDZjEGJ1FwSR lUnPLvX/yNf/4J6n5h3v5luQ0qIe20+Veq4ssUFyU7/5lpDdwXS57JiAqUOHka8R97k4 WujIokczg2FExTEQwVBHBHIDA1BM0pzdydgSbqYXV5ESLT89m+4Zrjx5Bbs07BpGFqml hyKg== X-Gm-Message-State: AOJu0YyILpdfOcR4UbeM1r+NfI+DwL/KEM51o7FXeyfoQTm+CBbn8/1e lBroInsmwcV/MUTYliQ75dbBK94oKS88RQ== X-Google-Smtp-Source: AGHT+IHRZDAq8CyG3gE3QqEH857SAhuvMQOaYXzff2myN2N0EPA/MH9GMFps/e6QuGfq+1GfGWixog== X-Received: by 2002:a17:902:e80f:b0:1cc:70dd:62c3 with SMTP id u15-20020a170902e80f00b001cc70dd62c3mr7962564plg.30.1699577850328; Thu, 09 Nov 2023 16:57:30 -0800 (PST) Original-Received: from LAPTOP-R4FQS2C5 ([175.210.40.96]) by smtp.gmail.com with ESMTPSA id k4-20020a170902d58400b001c5fd2a28d3sm4089005plh.28.2023.11.09.16.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 16:57:29 -0800 (PST) In-reply-to: <83cywizx9m.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274076 Archived-At: Thanks for the patch. It seems that the issue within the overwrite-mode can be resolved with the patch. Anyway, I have one more question. I think there is a similar issue with org-edit-special (table.el). I thought it would be resolved if the overwrite-mode was fixed but it seems not. Should I report it with a new bug ticket? Or can I describe it in this ticket? Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Thu, 9 Nov 2023 16:37:17 +0000 >> >> Eli brought up this bug in emacs-devel and I thought >> I would give it a shot. >> >> I had never touched this code or anything like it, but I do >> use input methods a bit for portuguese. Let me know what >> you think. > > Thanks. > > Sukbeom, could you please try the patch and see if it gives good > results, both with and without Overwrite mode? > >> diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el >> index 46a2e5a6ba2..7e6c7310179 100644 >> --- a/lisp/leim/quail/hangul.el >> +++ b/lisp/leim/quail/hangul.el >> @@ -146,21 +146,34 @@ hangul-insert-character >> (progn >> (delete-region (region-beginning) (region-end)) >> (deactivate-mark))) >> - (quail-delete-region) >> - (let ((first (car queues))) >> - (insert >> - (hangul-character >> - (+ (aref first 0) (hangul-djamo 'cho (aref first 0) (aref first 1= ))) >> - (+ (aref first 2) (hangul-djamo 'jung (aref first 2) (aref first = 3))) >> - (+ (aref first 4) (hangul-djamo 'jong (aref first 4) (aref first = 5)))))) >> - (move-overlay quail-overlay (overlay-start quail-overlay) (point)) >> - (dolist (queue (cdr queues)) >> - (insert >> - (hangul-character >> - (+ (aref queue 0) (hangul-djamo 'cho (aref queue 0) (aref queue 1= ))) >> - (+ (aref queue 2) (hangul-djamo 'jung (aref queue 2) (aref queue = 3))) >> - (+ (aref queue 4) (hangul-djamo 'jong (aref queue 4) (aref queue = 5))))) >> - (move-overlay quail-overlay (1+ (overlay-start quail-overlay)) (poi= nt)))) >> + (let* ((chars-to-insert >> + (with-temp-buffer >> + (dolist (queue queues (mapcar #'identity (buffer-string))) >> + (insert >> + (hangul-character >> + (+ (aref queue 0) (hangul-djamo 'cho (aref queue 0) >> (aref queue 1))) >> + (+ (aref queue 2) (hangul-djamo 'jung (aref queue 2) >> (aref queue 3))) >> + (+ (aref queue 4) (hangul-djamo 'jong (aref queue 4) >> (aref queue 5)))))))) >> + (may-have-to-overwrite-p >> + (or >> + ;; If the overlay isn't showing (i.e. it has 0 length) then >> + ;; we may want to insert char overwriting (iff overwrite-mod= e is >> + ;; non-nil, of course) >> + (=3D (overlay-start quail-overlay) (overlay-end quail-overla= y)) >> + ;; Likewise we want to do it if there is more then one >> + ;; character that were combined. >> + (cdr chars-to-insert)))) >> + (quail-delete-region) ; this kills the overlay >> + (dolist (c chars-to-insert) >> + (let ((last-command-event c) >> + (overwrite-mode (and overwrite-mode >> + may-have-to-overwrite-p >> + overwrite-mode))) >> + (self-insert-command 1) >> + ;; TODO: maybe use cl-loop for an easier-to-read loop? >> + (setq may-have-to-overwrite-p nil))) >> + ; this revives it (TODO: do we really always revive?) >> + (move-overlay quail-overlay (1- (point)) (point)))) >> >> (defun hangul-djamo (jamo char1 char2) >> "Return the double Jamo index calculated from the arguments. >> >> >> >> -- >> Jo=C3=A3o T=C3=A1vora >>