From: "Štěpán Němec" <stepnem@gmail.com>
To: "Jorge A. Alfaro-Murillo" <jorge.alfaro-murillo@yale.edu>
Cc: ding@gnus.org
Subject: Re: Change input method or smtp server depending on addressee
Date: Sat, 14 Sep 2019 19:38:53 +0200 [thread overview]
Message-ID: <87d0g2kcb6.fsf@gmail.com> (raw)
In-Reply-To: <875zlwkpme.fsf_-_@yale.edu> (Jorge A. Alfaro-Murillo's message of "Fri, 13 Sep 2019 14:39:05 -0400")
On Fri, 13 Sep 2019 14:39:05 -0400
Jorge A. Alfaro-Murillo wrote:
> Bob Newell writes:
>
>> We use gnus because it's amazing and does crazy stuff ... what other
>> client would allow me (just as one small example) to set my input
>> method to French, German, or Hawaiian depending on the addressee,
>> let alone choose my smtp server based on a similar criterion?
>> (Certain people ALWAYS get email from my preciously preserved AOL
>> address!)
>
> That sounds very useful, would you care to share more about how you do
> it?
I'm curious about Bob's (or anyone's) way, too. Here's how I do the
input method (and the related spell checking) part (I have no need for
the smtp server part) (`my-message-determine-language' below goes into
`message-setup-hook'):
(defun my-message-determine-language ()
;; adapted from `ispell-message'
(save-excursion
(let ((end-of-headers
(copy-marker
(or (re-search-forward
(concat "^" (regexp-quote mail-header-separator) "$")
nil t)
(re-search-forward "^$" nil t)
(point-min))))
(dictionary-alist ispell-message-dictionary-alist)
dict)
(while dictionary-alist
(goto-char (point-min))
(if (re-search-forward (caar dictionary-alist) end-of-headers t)
(setq dict (cdar dictionary-alist)
ispell-local-dictionary dict
dictionary-alist nil)
(setq dictionary-alist (cdr dictionary-alist))))
(my-message-determine-input-method dict))))
(defun my-message-determine-input-method (&optional lang)
(push (setq evil-input-method (pcase (or lang ispell-local-dictionary)
("english")
("viet" "vietnamese-telex")
(_ "czech")))
input-method-history))
--
Štěpán
next prev parent reply other threads:[~2019-09-14 17:38 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-18 23:26 Proposed new introductory section to the Gnus manual Eric Abrahamsen
2019-08-19 0:34 ` dick.r.chiang
2019-08-19 1:06 ` Eric Abrahamsen
2019-08-19 2:46 ` Bob Newell
2019-08-19 7:01 ` Eric S Fraga
2019-08-20 4:26 ` Eric Abrahamsen
2019-08-20 11:37 ` dick
2019-09-09 8:13 ` Eric Abrahamsen
2019-09-09 11:52 ` dick
2019-09-09 18:39 ` Bob Newell
2019-09-09 19:48 ` dick
2019-09-10 2:36 ` Eric Abrahamsen
2019-09-10 20:21 ` dick
2019-09-10 23:50 ` Eric Abrahamsen
2019-09-12 19:19 ` Michael
2019-09-13 9:19 ` Eric Abrahamsen
2019-09-13 15:08 ` Eric S Fraga
2019-09-13 16:54 ` Michael
2019-09-16 2:51 ` Eric Abrahamsen
2019-09-13 18:24 ` Bob Newell
2019-09-13 18:39 ` Change input method or smtp server depending on addressee (was: Proposed new introductory section to the Gnus manual) Jorge A. Alfaro-Murillo
2019-09-14 17:38 ` Štěpán Němec [this message]
2019-09-16 18:26 ` Change input method or smtp server depending on addressee Bob Newell
2019-09-16 8:52 ` Robert Pluim
2019-12-20 12:54 ` 황병희
2019-09-16 2:55 ` Proposed new introductory section to the Gnus manual Eric Abrahamsen
2019-09-16 18:34 ` Bob Newell
2019-09-10 20:39 ` Adam Sjøgren
2019-09-10 20:54 ` dick
2019-09-12 5:31 ` Steinar Bang
2019-09-07 19:50 ` Adam Sjøgren
2019-09-08 17:00 ` Bob Newell
2019-08-19 16:01 ` Adam Sjøgren
2019-08-19 18:04 ` Bob Newell
2019-08-19 18:09 ` Adam Sjøgren
2019-08-20 4:29 ` Eric Abrahamsen
2019-09-07 19:44 ` Adam Sjøgren
2019-08-19 16:16 ` Eric S Fraga
2019-08-20 7:08 ` Bjørn Mork
2019-08-20 9:51 ` Eric S Fraga
2019-08-20 10:32 ` Bjørn Mork
2019-08-20 10:55 ` Eric S Fraga
2019-08-19 17:55 ` Adam Sjøgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d0g2kcb6.fsf@gmail.com \
--to=stepnem@gmail.com \
--cc=ding@gnus.org \
--cc=jorge.alfaro-murillo@yale.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).