From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: Setting input method automatically whenever text is to be entered. Date: Fri, 23 Apr 2021 18:21:09 +0300 Message-ID: <87fszh81sq.fsf@gmail.com> References: <87pmypuh4i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 23 17:22:01 2021 Return-path: Envelope-to: geh-help-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 1lZxd2-0002PY-Ah for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 17:22:00 +0200 Original-Received: from localhost ([::1]:48726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZxd1-0004i9-Dj for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 11:21:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZxcD-0004hU-CE for help-gnu-emacs@gnu.org; Fri, 23 Apr 2021 11:21:09 -0400 Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:35426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZxcA-0005Hv-Kb for help-gnu-emacs@gnu.org; Fri, 23 Apr 2021 11:21:08 -0400 Original-Received: by mail-lj1-x22f.google.com with SMTP id a13so2249941ljp.2 for ; Fri, 23 Apr 2021 08:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=DPuFd/pYc3kmk28ZJ2xH6eOh6aEhdoJEZ6nFrLHmEOU=; b=iXPjcCTzb8zyNNklrG6j/VNZHK2ya2xx5ShCQvI8KAsqHMqf+iODpQsYnpRhgSt4Bw 9Tsn5yKlK4wjTe/Fpmx6jasWdD+WuOhBj9brgq38DbdZrXkbs8yzzZ6un+LvlekkAQw/ XytAWCcfw/QkvoSG0+yZZtJSQmXMVVRwRCBfnjpykhak4e+x21TmFfCBE9R+YGvNWevr tkQT0kEUWxXwjnuBShqeYJtUb9EgzRW1IRFI5LU1R9EoLX6dRAW7J7bCPGGGFOdrWlze cJ2/Klk/1jhm34iGW5zzhXEQwTERBG3qjrUtvAU/KRD6129kLVhvTL23RhVrm3F42TTb aCMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=DPuFd/pYc3kmk28ZJ2xH6eOh6aEhdoJEZ6nFrLHmEOU=; b=AWAEmnM8/FgeV6i5aFmZ37MU1R3/agBTgUedlJ+iiokevD4V/+OzE1WfNAWS0vCHYP IP7nuZEfSeg5Drt5VXJxWMTwks09OiLhUi0gqqHZmSaRTdPlTQDwrMB4KXfTqIpwHOqS eE1ndXmwQDUqgnx7kQKUkTZMxQgkQ04fQe3VXcV9oAR4DTZhr/d8QITncEXHfSAXW3tX vki9tKesPWXxxNDiheFUB8zqJebN3BPnYZ/EIuG/pVamorO9n7jyAm/hypCU7TS2HsV5 WNuJYlUi3o/W0mQ+GQUWsl2h12ZST5GKLGnw8zcWVU1yshICUG5MPZ10V3dm4cwAUIlk VL5Q== X-Gm-Message-State: AOAM533anOuEVgO6wxejYfoJzbb8bcnJI0+YrpgdSFx1mAkNGk7Fo6Hi olXxofQn5fFqzQ5GQzEmxVpuezWphso= X-Google-Smtp-Source: ABdhPJyY04HpcpAU+1wPj8ndx+xsvnlSCK2ipoNv9Mp9lz3TwueXGW6N7M1jvhyM3a7WmQxZhmNpgQ== X-Received: by 2002:a2e:a71e:: with SMTP id s30mr2999567lje.137.1619191263929; Fri, 23 Apr 2021 08:21:03 -0700 (PDT) Original-Received: from leviafan ([217.107.194.14]) by smtp.gmail.com with ESMTPSA id q3sm552149ljp.62.2021.04.23.08.21.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Apr 2021 08:21:03 -0700 (PDT) In-Reply-To: <87pmypuh4i.fsf@gmail.com> (max brieiev's message of "Tue, 20 Apr 2021 18:10:05 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=alezost@gmail.com; helo=mail-lj1-x22f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129128 Archived-At: max.brieiev@gmail.com (2021-04-20 18:10 +0300) wrote: > Hi Hello! > I am quite new Emacs user. I prefer to type text using Dvorak > layout. Each time I visit new buffer or interact with minibuffer I have > to press C-\, which is rather inconvenient. So I added the following to > my .emacs file: > > (defun set-dvp-input-method (mode-hook) > (add-hook mode-hook > (lambda () > (if (not (string= current-input-method "programmer-dvorak")) > (set-input-method "programmer-dvorak"))))) > > (mapc #'set-dvp-input-method > '(text-mode-hook > prog-mode-hook > special-mode-hook > minibuffer-setup-hook > comint-mode-hook > dired-mode > info-mode-hook > term-mode-hook > Custom-mode-hook)) [...] > There are also some more annoyances. In some minibuffer yes-no prompts I > have to press keys as they are located on qwerty layout, however in the > other seemingly same prompts the key needs to be pressed as on > Dvorak. Is there some way to fix this? You can use `after-change-major-mode-hook' instead of specifying all those mode-hooks manually. BTW, I also use Dvorak ;-) -- Alex