* bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility
@ 2017-08-17 4:07 Рейх Константин
2017-08-18 3:36 ` Konstantin Reich
0 siblings, 1 reply; 3+ messages in thread
From: Рейх Константин @ 2017-08-17 4:07 UTC (permalink / raw)
To: 28118
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility
2017-08-17 4:07 bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility Рейх Константин
@ 2017-08-18 3:36 ` Konstantin Reich
2017-08-18 9:34 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Reich @ 2017-08-18 3:36 UTC (permalink / raw)
To: 28118
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-18 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17 4:07 bug#28118: 25.1; input-method-deactivate-hook works twice because of backward compatibility Рейх Константин
2017-08-18 3:36 ` Konstantin Reich
2017-08-18 9:34 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.