[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 16:43:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> Hi Uwe,
> I don't switch keyboard. I set up the default input method for Japanese
> in my init file ~/.emacs.d/init.el and just type C-\
> (toggle-input-method) to activate and deactivate the input method during
> the edit of LaTeX documents.
> Yes, this is a little cumbersome certainly, but I accept it as
> inevitable cost for us Japanese to use computers.
I tried the following
(defvar keyboard-maniac-fill-mode nil)
(make-variable-buffer-local 'keyboard-maniac-fill-mode)
(defun my-test-hebrew ()
(interactive)
(if (texmathp)
(toggle-input-method nil 1)
(message "We are in math toogle input method")))
(defun my-test-nohbrew ()
(interactive)
(if (not (texmathp))
(set-input-method "hebrew-phonetic-qwerty" t)
(message "Switched from default to hebrew keyboard")))
;; Call keyboard-maniac fill after each command.
(add-hook 'post-command-hook 'my-test-hebrew)
(add-hook 'post-command-hook 'my-test-nohebrew)
;; (remove-hook 'post-command-hook 'my-test-nohebrew)
;; (remove-hook 'post-command-hook 'my-test-hebrew)
;; Add to mode line.
(or (assq 'keyboard-maniac-fill-mode minor-mode-alist)
(setq minor-mode-alist
(cons '(keyboard-maniac-fill-mode (" Keyb-Maniac"))
minor-mode-alist)))
;;;###autoload
(defun keyboard-maniac-fill-mode (&optional arg)
"Toggle keyboard-maniac fill mode.
With prefix arg, turn keyboard-maniac fill mode on iff arg is positive.
When keyboard-maniac fill mode is on, the current paragraph will be formatted
after each command."
(interactive "P")
(setq keyboard-maniac-fill-mode (not (or (and (null arg)
keyboard-maniac-fill-mode)
(<= (prefix-numeric-value arg) 0))))
(set-buffer-modified-p (buffer-modified-p)))
(provide 'keyboard-maniac)
;;; keyboard-maniac.el ends here
Based on an old code from Peer Abrahamsen,
the hook
(add-hook 'post-command-hook 'my-test-hebrew)
is very problematic.
Any ideas?
Uwe
- [AUCTeX-devel] non latin alphabet based languages input method and latex, Uwe Brauer, 2017/11/09
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Ikumi Keita, 2017/11/09
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex,
Uwe Brauer <=
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Ikumi Keita, 2017/11/09
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Uwe Brauer, 2017/11/09
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Ikumi Keita, 2017/11/10
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Ikumi Keita, 2017/11/10
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Uwe Brauer, 2017/11/10
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Ikumi Keita, 2017/11/11
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Uwe Brauer, 2017/11/11
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Arash Esbati, 2017/11/12
- Re: [AUCTeX-devel] non latin alphabet based languages input method and latex, Ikumi Keita, 2017/11/13