[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] non latin alphabet based languages input method and l

From: Uwe Brauer
Subject: Re: [AUCTeX-devel] non latin alphabet based languages input method and latex
Date: Thu, 09 Nov 2017 21:42:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>>> "Ikumi" == Ikumi Keita <address@hidden> writes:

    > you do (add-hook 'post-command-hook 'my-test-hebrew) .

    > Part of what you want to do will be achieved by arranging the variable
    > `TeX-math-input-method-off-regexp' to hold a regexp matching
    > "hebrew-phonetic-qwerty" or whatever the name of the input method you
    > are going to use.  Then typing "$" at position of non-math formula or
    > inserting math environment such as "equation" via C-c C-e will turns off
    > the input method.

Ah great! Precisely what I was looking for, thanks very much. Ah
shouldn't that variable be customizable via customize????

    > The prescription described above only works when you enter a "new" math
    > expression with "$" or C-c C-e.  If you adhere to the idea that the
    > input method is arranged always according to the value that `(texmathp)'
    > returns, then `my-test-hebrew' and `my-test-nohbrew' should be defined
    > as
    > (defun my-test-hebrew ()
    >   (interactive)
    >   (when (texmathp)
    >     (deactivate-input-method)
    >     (message "We are in math toogle input method")))

    > (defun my-test-nohbrew ()
    >   (interactive)
    >   (when (not (texmathp))
    >     (set-input-method "hebrew-phonetic-qwerty" t)
    >     (message "Switched from default to hebrew keyboard")))
    > , respectively.  (Notice also that `if' is replaced with `when' because
    > the syntax of `if' is:
    > (if CONDITION
    > .  With your definition, `message' is called when the respective
    > condition is NOT met.)

Sigh, if and when confuses me always, thanks for pointing it out, sorry.

    > It seems that these functions have nothing to do with
    > `keyboard-maniac-fill-mode', but that's a different story.

Well the issue is in that old code, maniac-fill-mode, was/is a minor

When toggled on it executed a maniac filling function with every key
stroke. This is why there was the hook call

(add-hook 'post-command-hook 'do-maniac-fill)

When turning the mode off I thought the function would be removed from
that hook, but now I am not so sure.

In any case my problem is, even with your new improved functions
my-test-nohbrew etc, what is the best way to execute the function??

Because if I move the cursor into a math environment I want to turn the
input method of, without calling a function, because if I need to call
an extra function I turn it off directly.

Thanks again


reply via email to

[Prev in Thread] Current Thread [Next in Thread]