From cc922b3b56698b33a58cc7aebe2c0abc0fec6a13 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 4 Aug 2017 21:41:40 +0100 Subject: [PATCH] Support different languages for mutt spell checking --- src/freedombone-app-emacs | 58 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-emacs b/src/freedombone-app-emacs index 87f68fcb..0adc6887 100755 --- a/src/freedombone-app-emacs +++ b/src/freedombone-app-emacs @@ -34,7 +34,8 @@ IN_DEFAULT_INSTALL=1 SHOW_ON_ABOUT=0 emacs_variables=(USB_MOUNT - MY_USERNAME) + MY_USERNAME + DEFAULT_LANGUAGE) function logging_on_emacs { echo -n '' @@ -274,7 +275,60 @@ function install_emacs { echo "(dolist (hook '(text-mode-hook))" >> /home/$USERNAME/.emacs-mutt echo ' (add-hook hook (lambda () (flyspell-mode 1))))' >> /home/$USERNAME/.emacs-mutt echo '(setq-default fill-column 72)' >> /home/$USERNAME/.emacs-mutt - echo '(setq ispell-dictionary "british")' >> /home/$USERNAME/.emacs-mutt + if [[ $DEFAULT_LANGUAGE == 'en_US'* ]]; then + echo '(setq ispell-dictionary "american")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'en_GB'* ]]; then + echo '(setq ispell-dictionary "british")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'fr_FR'* ]]; then + echo '(setq ispell-dictionary "french")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'it_IT'* ]]; then + echo '(setq ispell-dictionary "italian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'cs_CZ'* ]]; then + echo '(setq ispell-dictionary "czech")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'da_DK'* ]]; then + echo '(setq ispell-dictionary "danish")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'nl_NL'* ]]; then + echo '(setq ispell-dictionary "dutch")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'ru_RU'* ]]; then + echo '(setq ispell-dictionary "russian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'es_ES'* ]]; then + echo '(setq ispell-dictionary "spanish")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'sv_SE'* ]]; then + echo '(setq ispell-dictionary "swedish")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'no_NO'* ]]; then + echo '(setq ispell-dictionary "norwegian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'de_DE'* ]]; then + echo '(setq ispell-dictionary "ngerman")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'bg_BG'* ]]; then + echo '(setq ispell-dictionary "bulgarian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'pl'* ]]; then + echo '(setq ispell-dictionary "polish")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'et_EE'* ]]; then + echo '(setq ispell-dictionary "estonian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'lt_LT'* ]]; then + echo '(setq ispell-dictionary "lithuanian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'uk_UA'* ]]; then + echo '(setq ispell-dictionary "ukranian")' >> /home/$USERNAME/.emacs-mutt + fi + if [[ $DEFAULT_LANGUAGE == 'ca_ES'* ]]; then + echo '(setq ispell-dictionary "catalan")' >> /home/$USERNAME/.emacs-mutt + fi echo '(setq auto-fill-mode 0)' >> /home/$USERNAME/.emacs-mutt echo "(add-hook 'text-mode-hook 'turn-on-auto-fill)" >> /home/$USERNAME/.emacs-mutt echo "(setq-default auto-fill-function 'do-auto-fill)" >> /home/$USERNAME/.emacs-mutt