From unknown Mon Jun 23 04:14:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility Resent-From: =?UTF-8?Q?=D0=A0=D0=B5=D0=B9=D1=85_?= =?UTF-8?Q?=D0=9A=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D0=B8=D0=BD?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Aug 2017 05:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28118 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 28118@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150294714229260 (code B ref -1); Thu, 17 Aug 2017 05:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Aug 2017 05:19:02 +0000 Received: from localhost ([127.0.0.1]:41853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diDCv-0007bs-Sg for submit@debbugs.gnu.org; Thu, 17 Aug 2017 01:19:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diC6F-0005sE-9s for submit@debbugs.gnu.org; Thu, 17 Aug 2017 00:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diC69-0002Jc-50 for submit@debbugs.gnu.org; Thu, 17 Aug 2017 00:07:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34475) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diC69-0002JX-1P for submit@debbugs.gnu.org; Thu, 17 Aug 2017 00:07:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diC67-00088l-Va for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 00:07:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diC62-0002Gv-NR for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 00:07:55 -0400 Received: from forward102p.mail.yandex.net ([77.88.28.102]:60158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diC62-0002FT-Cd for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 00:07:50 -0400 Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 83F834304BE9 for ; Thu, 17 Aug 2017 07:07:45 +0300 (MSK) Received: from web2j.yandex.ru (web2j.yandex.ru [5.45.198.43]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uoLppMaQf8-7iimsoM9; Thu, 17 Aug 2017 07:07:45 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1502942865; bh=1FIYn51h9Mhhv2fXRZT4SAhnOwwZMjxoDYSJgrDT7S4=; h=From:To:Subject:Message-Id:Date; b=CfYtgOwMz/JpV5XpT+j8kc5U41wVjktgoCtq4CYC0bgW7JNxkVZiOydxrEU3H5zNa yvRe12hhfXngQN+2WZuXLgCuo5Wv/QfjdTpxB6mshPw/4i12kiqLLW7FlQztoEu4F7 V8BC/zi7Y/S4uOxfiRd54nXqlh4/yHDzodSUOQDY= Authentication-Results: mxback4j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by web2j.yandex.ru with HTTP; Thu, 17 Aug 2017 07:07:44 +0300 From: =?UTF-8?Q?=D0=A0=D0=B5=D0=B9=D1=85_?= =?UTF-8?Q?=D0=9A=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D0=B8=D0=BD?= Envelope-From: reich-cv@yandex.ru MIME-Version: 1.0 Message-Id: <162771502942864@web2j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 17 Aug 2017 07:07:44 +0300 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Thu, 17 Aug 2017 01:19:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hi, I noticed that when i add hook to input-method-deactivate-hook i also add hook to input-method-inactivate-hook. As a result the hook in input-method-deactivate-hook works twice, which should not be the case. This can be seen from the code in function deactivate-input-method in international/mule-cmds.el: .... (run-hooks 'input-method-inactivate-hook ; for backward compatibility 'input-method-deactivate-hook) ..... For example (add-hook 'input-method-deactivate-hook '(lambda () (message "b") )) produces "b [2 times]" with deactivation of the input method. All version of emacs from 24.3 are affected. From unknown Mon Jun 23 04:14:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility References: <162771502942864@web2j.yandex.ru> In-Reply-To: <162771502942864@web2j.yandex.ru> Resent-From: Konstantin Reich Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Aug 2017 03:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28118 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 28118@debbugs.gnu.org Received: via spool by 28118-submit@debbugs.gnu.org id=B28118.150302741617578 (code B ref 28118); Fri, 18 Aug 2017 03:37:01 +0000 Received: (at 28118) by debbugs.gnu.org; 18 Aug 2017 03:36:56 +0000 Received: from localhost ([127.0.0.1]:43382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diY5f-0004ZQ-PU for submit@debbugs.gnu.org; Thu, 17 Aug 2017 23:36:55 -0400 Received: from forward104j.mail.yandex.net ([5.45.198.247]:56905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diY5e-0004ZE-2q for 28118@debbugs.gnu.org; Thu, 17 Aug 2017 23:36:54 -0400 Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward104j.mail.yandex.net (Yandex) with ESMTP id E6049443E2 for <28118@debbugs.gnu.org>; Fri, 18 Aug 2017 06:36:47 +0300 (MSK) Received: from web38g.yandex.ru (web38g.yandex.ru [95.108.252.208]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id F37XqNUID7-allaiZ99; Fri, 18 Aug 2017 06:36:47 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1503027407; bh=i3/4YbogOcuNm3qqOp3rwVr2i2y8Hwp6tKIgJfJPNys=; h=From:To:Subject:Message-Id:Date; b=vdd6NvM5NWd3R+JUvUr+ymlutTKMIlBtYW+FZURZ0CMQW+7k9EE0i4boRfWwnVokD aosIlW2RCVI8PohTp+ooN1o4BdkO3bnK8yk3kLqkVsrLCB3Awi9Ri7XzMimhxPxsLe eplJeuMqaUZUg4Daox/RYK3785u7QHhs73zuhg8o= Authentication-Results: mxback12g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by web38g.yandex.ru with HTTP; Fri, 18 Aug 2017 06:36:47 +0300 From: Konstantin Reich Envelope-From: reich-cv@yandex.ru MIME-Version: 1.0 Message-Id: <100131503027407@web38g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 18 Aug 2017 06:36:47 +0300 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) I think the following patch solves the problem. --- emacs-25.2/lisp/international/mule-cmds.el.orig 2017-02-03 04:25:44.000000000 -0600 +++ emacs-25.2/lisp/international/mule-cmds.el 2017-08-17 22:24:38.750733577 -0500 @@ -1483,7 +1483,6 @@ system (if it corresponds to a MIME char (funcall deactivate-current-input-method-function)) (unwind-protect (run-hooks - 'input-method-inactivate-hook ; for backward compatibility 'input-method-deactivate-hook) (setq current-input-method nil) (force-mode-line-update))))) The problem is that the function deactivate-input-method in the file mule-cmds run two hooks:input-method-inactivate-hook and input-method-deactivate-hook. But they are identical: (define-obsolete-function-alias 'inactivate-input-method 'deactivate-input-method "24.3") So one hook should be removed. From unknown Mon Jun 23 04:14:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?=D0=A0=D0=B5=D0=B9=D1=85_?= =?UTF-8?Q?=D0=9A=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D0=B8=D0=BD?= Subject: bug#28118: closed (Re: bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility) Message-ID: References: <83lgmhdxsa.fsf@gnu.org> <162771502942864@web2j.yandex.ru> X-Gnu-PR-Message: they-closed 28118 X-Gnu-PR-Package: emacs Reply-To: 28118@debbugs.gnu.org Date: Fri, 18 Aug 2017 09:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1503048962-19288-1" This is a multi-part message in MIME format... ------------=_1503048962-19288-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #28118: 25.1; input-method-deactivate-hook works twice because of backward = compatibility which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 28118@debbugs.gnu.org. --=20 28118: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28118 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1503048962-19288-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 28118-done) by debbugs.gnu.org; 18 Aug 2017 09:35:07 +0000 Received: from localhost ([127.0.0.1]:43546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1didgJ-0004yI-Dj for submit@debbugs.gnu.org; Fri, 18 Aug 2017 05:35:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1didgI-0004xY-2I for 28118-done@debbugs.gnu.org; Fri, 18 Aug 2017 05:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1didg9-0007DU-Tq for 28118-done@debbugs.gnu.org; Fri, 18 Aug 2017 05:35:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1didg9-0007DQ-Pt; Fri, 18 Aug 2017 05:34:57 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4383 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1didg9-00065m-B7; Fri, 18 Aug 2017 05:34:57 -0400 Date: Fri, 18 Aug 2017 12:34:45 +0300 Message-Id: <83lgmhdxsa.fsf@gnu.org> From: Eli Zaretskii To: Konstantin Reich In-reply-to: <100131503027407@web38g.yandex.ru> (message from Konstantin Reich on Fri, 18 Aug 2017 06:36:47 +0300) Subject: Re: bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility References: <162771502942864@web2j.yandex.ru> <100131503027407@web38g.yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28118-done Cc: 28118-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Konstantin Reich > Date: Fri, 18 Aug 2017 06:36:47 +0300 > > I think the following patch solves the problem. Indeed, but there were several other instances of the same bug. Now fixed on the master branch. Thanks. ------------=_1503048962-19288-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Aug 2017 05:19:02 +0000 Received: from localhost ([127.0.0.1]:41853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diDCv-0007bs-Sg for submit@debbugs.gnu.org; Thu, 17 Aug 2017 01:19:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diC6F-0005sE-9s for submit@debbugs.gnu.org; Thu, 17 Aug 2017 00:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diC69-0002Jc-50 for submit@debbugs.gnu.org; Thu, 17 Aug 2017 00:07:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34475) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diC69-0002JX-1P for submit@debbugs.gnu.org; Thu, 17 Aug 2017 00:07:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diC67-00088l-Va for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 00:07:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diC62-0002Gv-NR for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 00:07:55 -0400 Received: from forward102p.mail.yandex.net ([77.88.28.102]:60158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diC62-0002FT-Cd for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 00:07:50 -0400 Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 83F834304BE9 for ; Thu, 17 Aug 2017 07:07:45 +0300 (MSK) Received: from web2j.yandex.ru (web2j.yandex.ru [5.45.198.43]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uoLppMaQf8-7iimsoM9; Thu, 17 Aug 2017 07:07:45 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1502942865; bh=1FIYn51h9Mhhv2fXRZT4SAhnOwwZMjxoDYSJgrDT7S4=; h=From:To:Subject:Message-Id:Date; b=CfYtgOwMz/JpV5XpT+j8kc5U41wVjktgoCtq4CYC0bgW7JNxkVZiOydxrEU3H5zNa yvRe12hhfXngQN+2WZuXLgCuo5Wv/QfjdTpxB6mshPw/4i12kiqLLW7FlQztoEu4F7 V8BC/zi7Y/S4uOxfiRd54nXqlh4/yHDzodSUOQDY= Authentication-Results: mxback4j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by web2j.yandex.ru with HTTP; Thu, 17 Aug 2017 07:07:44 +0300 From: =?utf-8?B?0KDQtdC50YUg0JrQvtC90YHRgtCw0L3RgtC40L0=?= Envelope-From: reich-cv@yandex.ru To: bug-gnu-emacs@gnu.org Subject: 25.1; input-method-deactivate-hook works twice because of backward compatibility MIME-Version: 1.0 Message-Id: <162771502942864@web2j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 17 Aug 2017 07:07:44 +0300 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 17 Aug 2017 01:19:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hi, I noticed that when i add hook to input-method-deactivate-hook i also add hook to input-method-inactivate-hook. As a result the hook in input-method-deactivate-hook works twice, which should not be the case. This can be seen from the code in function deactivate-input-method in international/mule-cmds.el: .... (run-hooks 'input-method-inactivate-hook ; for backward compatibility 'input-method-deactivate-hook) ..... For example (add-hook 'input-method-deactivate-hook '(lambda () (message "b") )) produces "b [2 times]" with deactivation of the input method. All version of emacs from 24.3 are affected. ------------=_1503048962-19288-1--