Subject: 24.3.50; Fix small issue with ispell-hunspell when dictionary is set to default (nil)
From: Vladimir Lomov <[email-masked]>
To: [email-masked]
Date: Sat, 16 Nov 2013 00:16:59 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

--text follows this line--

Hello,
according to variable 'ispell-dictionary-base-alist' defined in
'ispell.el' if 'ispell-dictionary' is nil then it is considered as
default value for dictionary. Unfortunately, when hunspell is used as
ispell program function 'ispell-parse-hunspell-affix-file' fails because
it doesn't expect nil as argument.

I propose small and simple patch. I checked it starting emacs as:
  emacs -Q
and evaluating in *scratch*:
  (setq ispell-program-name "hunspell")
  (setq ispell-really-hunspell t)
after that I run 'M-$' while point is on first 's' of
  (message)

In minibuffer I see
  MESSAGE is correct

Without this patch the same steps lead to message
  ispell-phaf: No matching entry for nil.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.3)
 of 2013-11-14 on smoon
Bzr revision: [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11404000
System Description:	Arch Linux

Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
 --libexecdir=/usr/lib --with-xpm --with-jpeg --with-tiff --with-gif
 --with-png --with-rsvg --with-x-toolkit=gtk3 --with-xft --with-libotf
 --with-dbus --with-gsettings --without-sound 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: ru_RU.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Org

Minor modes in effect:
  erc-services-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  diff-auto-refine-mode: t
  global-auto-complete-mode: t
  shell-dirtrack-mode: t
  org-cdlatex-mode: t
  ido-everywhere: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<down> <down> <down> <down> <up> <tab> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> C-c ' <up> <up> <up> <up> <up> <up> <up> 
<up> C-SPC <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <end> C-c ; C-c C-c <help-echo> <help-echo> 
<help-echo> <menu-bar> <emacs-lisp> <comment-region> 
<down> <down> <end> <left> <left> <left> <left> <left> 
<left> <left> <left> u <backspace> e n g l i s h <delete> 
<delete> <delete> <delete> <delete> <delete> <delete> 
<down> <down> <home> C-k <up> <down> <delete> <up> 
<end> <left> <backspace> <backspace> <backspace> <backspace> 
l i s h <down> <down> <down> <down> <down> <down> <end> 
<left> <backspace> <backspace> <backspace> <backspace> 
l i s h <down> <backspace> <backspace> <backspace> 
<backspace> l i s h <home> <down> <down> <down> <end> 
<up> <down> <down> C-SPC <home> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> C-g <down> <down> <down> C-SPC 
<down> <down> <end> <help-echo> <help-echo> <help-echo> 
<menu-bar> <emacs-lisp> <comment-region> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> C-c 
' <f2> C-c C-v C-t <down-mouse-1> <mouse-movement> 
<mouse-1> C-c ' <up> <up> <up> <home> C-SPC <down> 
<down> <down> <end> <help-echo> <help-echo> <help-echo> 
<menu-bar> <emacs-lisp> <comment-region> <down> <down> 
<down> <down> <end> <home> <down> C-SPC <down> <end> 
<help-echo> <help-echo> <menu-bar> <emacs-lisp> <comment-region> 
<up> <home> <right> <right> <right> <right> <right> 
<right> <delete> <delete> <delete> <delete> <delete> 
<delete> <down> <delete> <delete> <delete> <delete> 
<delete> <delete> C-c ' <f2> C-c C-v C-t <down-mouse-1> 
<mouse-1> C-c ' <home> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <up> <up> 
<up> <up> <up> <up> <up> <end> C-SPC <home> <up> <up> 
<up> C-w <delete> C-c ' <f2> C-c C-v C-t M-x r e p 
o r t - e m <tab> <return>

Recent messages:
Wrote /home/lomov/works/scripts/emacs.d/erc-us.el
Wrote /home/lomov/works/scripts/emacs.d/emacs
Wrote /home/lomov/works/scripts/emacs.d/cdlatex-us.el
Wrote /home/lomov/works/scripts/emacs.d/auctex-us.el
Wrote /home/lomov/works/scripts/emacs.d/org-us.el
Wrote /home/lomov/works/scripts/emacs.d/keybinds-us.el
Wrote /home/lomov/works/scripts/emacs.d/mode/org-capture-note-idea.txt
Wrote /home/lomov/works/scripts/emacs.d/mode/org-capture-journal.txt
Wrote /home/lomov/works/scripts/emacs.d/mode/org-capture-todo.txt
Tangled 27 code blocks from emacs.org

Load-path shadows:
/usr/share/emacs/site-lisp/org/org-macs hides /usr/share/emacs/24.3.50/lisp/org/org-macs
/usr/share/emacs/site-lisp/org/org-list hides /usr/share/emacs/24.3.50/lisp/org/org-list
/usr/share/emacs/site-lisp/org/org-feed hides /usr/share/emacs/24.3.50/lisp/org/org-feed
/usr/share/emacs/site-lisp/org/org-faces hides /usr/share/emacs/24.3.50/lisp/org/org-faces
/usr/share/emacs/site-lisp/org/org-ctags hides /usr/share/emacs/24.3.50/lisp/org/org-ctags
/usr/share/emacs/site-lisp/org/org-crypt hides /usr/share/emacs/24.3.50/lisp/org/org-crypt
/usr/share/emacs/site-lisp/org/org-colview hides /usr/share/emacs/24.3.50/lisp/org/org-colview
/usr/share/emacs/site-lisp/org/org-clock hides /usr/share/emacs/24.3.50/lisp/org/org-clock
/usr/share/emacs/site-lisp/org/org-archive hides /usr/share/emacs/24.3.50/lisp/org/org-archive
/usr/share/emacs/site-lisp/org/org-agenda hides /usr/share/emacs/24.3.50/lisp/org/org-agenda
/usr/share/emacs/site-lisp/org/ob-lilypond hides /usr/share/emacs/24.3.50/lisp/org/ob-lilypond
/usr/share/emacs/site-lisp/org/ob-ocaml hides /usr/share/emacs/24.3.50/lisp/org/ob-ocaml
/usr/share/emacs/site-lisp/org/ob-latex hides /usr/share/emacs/24.3.50/lisp/org/ob-latex
/usr/share/emacs/site-lisp/org/ob-python hides /usr/share/emacs/24.3.50/lisp/org/ob-python
/usr/share/emacs/site-lisp/org/ob-mscgen hides /usr/share/emacs/24.3.50/lisp/org/ob-mscgen
/usr/share/emacs/site-lisp/org/ob-asymptote hides /usr/share/emacs/24.3.50/lisp/org/ob-asymptote
/usr/share/emacs/site-lisp/org/ob-comint hides /usr/share/emacs/24.3.50/lisp/org/ob-comint
/usr/share/emacs/site-lisp/org/ob-clojure hides /usr/share/emacs/24.3.50/lisp/org/ob-clojure
/usr/share/emacs/site-lisp/org/ob-scheme hides /usr/share/emacs/24.3.50/lisp/org/ob-scheme
/usr/share/emacs/site-lisp/org/org-table hides /usr/share/emacs/24.3.50/lisp/org/org-table
/usr/share/emacs/site-lisp/org/org-src hides /usr/share/emacs/24.3.50/lisp/org/org-src
/usr/share/emacs/site-lisp/org/org-rmail hides /usr/share/emacs/24.3.50/lisp/org/org-rmail
/usr/share/emacs/site-lisp/org/org-protocol hides /usr/share/emacs/24.3.50/lisp/org/org-protocol
/usr/share/emacs/site-lisp/org/ox-odt hides /usr/share/emacs/24.3.50/lisp/org/ox-odt
/usr/share/emacs/site-lisp/org/org-plot hides /usr/share/emacs/24.3.50/lisp/org/org-plot
/usr/share/emacs/site-lisp/org/org-pcomplete hides /usr/share/emacs/24.3.50/lisp/org/org-pcomplete
/usr/share/emacs/site-lisp/org/ox-md hides /usr/share/emacs/24.3.50/lisp/org/ox-md
/usr/share/emacs/site-lisp/org/org-mouse hides /usr/share/emacs/24.3.50/lisp/org/org-mouse
/usr/share/emacs/site-lisp/org/org-mobile hides /usr/share/emacs/24.3.50/lisp/org/org-mobile
/usr/share/emacs/site-lisp/org/org-mhe hides /usr/share/emacs/24.3.50/lisp/org/org-mhe
/usr/share/emacs/site-lisp/org/org-macro hides /usr/share/emacs/24.3.50/lisp/org/org-macro
/usr/share/emacs/site-lisp/org/org-irc hides /usr/share/emacs/24.3.50/lisp/org/org-irc
/usr/share/emacs/site-lisp/org/org-inlinetask hides /usr/share/emacs/24.3.50/lisp/org/org-inlinetask
/usr/share/emacs/site-lisp/org/ox-icalendar hides /usr/share/emacs/24.3.50/lisp/org/ox-icalendar
/usr/share/emacs/site-lisp/org/org-info hides /usr/share/emacs/24.3.50/lisp/org/org-info
/usr/share/emacs/site-lisp/org/org-indent hides /usr/share/emacs/24.3.50/lisp/org/org-indent
/usr/share/emacs/site-lisp/org/org-id hides /usr/share/emacs/24.3.50/lisp/org/org-id
/usr/share/emacs/site-lisp/org/org-habit hides /usr/share/emacs/24.3.50/lisp/org/org-habit
/usr/share/emacs/site-lisp/org/org-gnus hides /usr/share/emacs/24.3.50/lisp/org/org-gnus
/usr/share/emacs/site-lisp/org/org-footnote hides /usr/share/emacs/24.3.50/lisp/org/org-footnote
/usr/share/emacs/site-lisp/org/ox-html hides /usr/share/emacs/24.3.50/lisp/org/ox-html
/usr/share/emacs/site-lisp/org/org-eshell hides /usr/share/emacs/24.3.50/lisp/org/org-eshell
/usr/share/emacs/site-lisp/org/org-entities hides /usr/share/emacs/24.3.50/lisp/org/org-entities
/usr/share/emacs/site-lisp/org/ox-beamer hides /usr/share/emacs/24.3.50/lisp/org/ox-beamer
/usr/share/emacs/site-lisp/org/org-element hides /usr/share/emacs/24.3.50/lisp/org/org-element
/usr/share/emacs/site-lisp/org/ox-ascii hides /usr/share/emacs/24.3.50/lisp/org/ox-ascii
/usr/share/emacs/site-lisp/org/org-docview hides /usr/share/emacs/24.3.50/lisp/org/org-docview
/usr/share/emacs/site-lisp/org/org hides /usr/share/emacs/24.3.50/lisp/org/org
/usr/share/emacs/site-lisp/org/org-datetree hides /usr/share/emacs/24.3.50/lisp/org/org-datetree
/usr/share/emacs/site-lisp/org/org-w3m hides /usr/share/emacs/24.3.50/lisp/org/org-w3m
/usr/share/emacs/site-lisp/org/org-compat hides /usr/share/emacs/24.3.50/lisp/org/org-compat
/usr/share/emacs/site-lisp/org/org-timer hides /usr/share/emacs/24.3.50/lisp/org/org-timer
/usr/share/emacs/site-lisp/org/ox hides /usr/share/emacs/24.3.50/lisp/org/ox
/usr/share/emacs/site-lisp/org/org-capture hides /usr/share/emacs/24.3.50/lisp/org/org-capture
/usr/share/emacs/site-lisp/org/ox-latex hides /usr/share/emacs/24.3.50/lisp/org/ox-latex
/usr/share/emacs/site-lisp/org/org-bibtex hides /usr/share/emacs/24.3.50/lisp/org/org-bibtex
/usr/share/emacs/site-lisp/org/ox-texinfo hides /usr/share/emacs/24.3.50/lisp/org/ox-texinfo
/usr/share/emacs/site-lisp/org/org-bbdb hides /usr/share/emacs/24.3.50/lisp/org/org-bbdb
/usr/share/emacs/site-lisp/org/org-attach hides /usr/share/emacs/24.3.50/lisp/org/org-attach
/usr/share/emacs/site-lisp/org/ox-publish hides /usr/share/emacs/24.3.50/lisp/org/ox-publish
/usr/share/emacs/site-lisp/org/ox-man hides /usr/share/emacs/24.3.50/lisp/org/ox-man
/usr/share/emacs/site-lisp/org/ox-org hides /usr/share/emacs/24.3.50/lisp/org/ox-org
/usr/share/emacs/site-lisp/org/ob hides /usr/share/emacs/24.3.50/lisp/org/ob
/usr/share/emacs/site-lisp/org/ob-tangle hides /usr/share/emacs/24.3.50/lisp/org/ob-tangle
/usr/share/emacs/site-lisp/org/ob-table hides /usr/share/emacs/24.3.50/lisp/org/ob-table
/usr/share/emacs/site-lisp/org/ob-sqlite hides /usr/share/emacs/24.3.50/lisp/org/ob-sqlite
/usr/share/emacs/site-lisp/org/ob-plantuml hides /usr/share/emacs/24.3.50/lisp/org/ob-plantuml
/usr/share/emacs/site-lisp/org/ob-java hides /usr/share/emacs/24.3.50/lisp/org/ob-java
/usr/share/emacs/site-lisp/org/ob-picolisp hides /usr/share/emacs/24.3.50/lisp/org/ob-picolisp
/usr/share/emacs/site-lisp/org/ob-maxima hides /usr/share/emacs/24.3.50/lisp/org/ob-maxima
/usr/share/emacs/site-lisp/org/ob-io hides /usr/share/emacs/24.3.50/lisp/org/ob-io
/usr/share/emacs/site-lisp/org/ob-perl hides /usr/share/emacs/24.3.50/lisp/org/ob-perl
/usr/share/emacs/site-lisp/org/ob-matlab hides /usr/share/emacs/24.3.50/lisp/org/ob-matlab
/usr/share/emacs/site-lisp/org/ob-haskell hides /usr/share/emacs/24.3.50/lisp/org/ob-haskell
/usr/share/emacs/site-lisp/org/ob-sql hides /usr/share/emacs/24.3.50/lisp/org/ob-sql
/usr/share/emacs/site-lisp/org/ob-org hides /usr/share/emacs/24.3.50/lisp/org/ob-org
/usr/share/emacs/site-lisp/org/ob-ledger hides /usr/share/emacs/24.3.50/lisp/org/ob-ledger
/usr/share/emacs/site-lisp/org/ob-gnuplot hides /usr/share/emacs/24.3.50/lisp/org/ob-gnuplot
/usr/share/emacs/site-lisp/org/ob-shen hides /usr/share/emacs/24.3.50/lisp/org/ob-shen
/usr/share/emacs/site-lisp/org/ob-octave hides /usr/share/emacs/24.3.50/lisp/org/ob-octave
/usr/share/emacs/site-lisp/org/ob-keys hides /usr/share/emacs/24.3.50/lisp/org/ob-keys
/usr/share/emacs/site-lisp/org/ob-fortran hides /usr/share/emacs/24.3.50/lisp/org/ob-fortran
/usr/share/emacs/site-lisp/org/ob-screen hides /usr/share/emacs/24.3.50/lisp/org/ob-screen
/usr/share/emacs/site-lisp/org/ob-exp hides /usr/share/emacs/24.3.50/lisp/org/ob-exp
/usr/share/emacs/site-lisp/org/ob-lisp hides /usr/share/emacs/24.3.50/lisp/org/ob-lisp
/usr/share/emacs/site-lisp/org/ob-eval hides /usr/share/emacs/24.3.50/lisp/org/ob-eval
/usr/share/emacs/site-lisp/org/ob-ref hides /usr/share/emacs/24.3.50/lisp/org/ob-ref
/usr/share/emacs/site-lisp/org/ob-lob hides /usr/share/emacs/24.3.50/lisp/org/ob-lob
/usr/share/emacs/site-lisp/org/ob-emacs-lisp hides /usr/share/emacs/24.3.50/lisp/org/ob-emacs-lisp
/usr/share/emacs/site-lisp/org/ob-sass hides /usr/share/emacs/24.3.50/lisp/org/ob-sass
/usr/share/emacs/site-lisp/org/ob-js hides /usr/share/emacs/24.3.50/lisp/org/ob-js
/usr/share/emacs/site-lisp/org/ob-dot hides /usr/share/emacs/24.3.50/lisp/org/ob-dot
/usr/share/emacs/site-lisp/org/ob-ruby hides /usr/share/emacs/24.3.50/lisp/org/ob-ruby
/usr/share/emacs/site-lisp/org/ob-makefile hides /usr/share/emacs/24.3.50/lisp/org/ob-makefile
/usr/share/emacs/site-lisp/org/ob-ditaa hides /usr/share/emacs/24.3.50/lisp/org/ob-ditaa
/usr/share/emacs/site-lisp/org/ob-scala hides /usr/share/emacs/24.3.50/lisp/org/ob-scala
/usr/share/emacs/site-lisp/org/ob-R hides /usr/share/emacs/24.3.50/lisp/org/ob-R
/usr/share/emacs/site-lisp/org/ob-css hides /usr/share/emacs/24.3.50/lisp/org/ob-css
/usr/share/emacs/site-lisp/org/ob-C hides /usr/share/emacs/24.3.50/lisp/org/ob-C
/usr/share/emacs/site-lisp/org/ob-sh hides /usr/share/emacs/24.3.50/lisp/org/ob-sh
/usr/share/emacs/site-lisp/org/org-loaddefs hides /usr/share/emacs/24.3.50/lisp/org/org-loaddefs
/usr/share/emacs/site-lisp/org/ob-awk hides /usr/share/emacs/24.3.50/lisp/org/ob-awk
/usr/share/emacs/site-lisp/org/ob-core hides /usr/share/emacs/24.3.50/lisp/org/ob-core
/usr/share/emacs/site-lisp/org/ob-calc hides /usr/share/emacs/24.3.50/lisp/org/ob-calc
/usr/share/emacs/site-lisp/org/org-version hides /usr/share/emacs/24.3.50/lisp/org/org-version
/usr/share/emacs/site-lisp/org/org-install hides /usr/share/emacs/24.3.50/lisp/org/org-install

Features:
(shadow sort spook cookie1 mail-extr emacsbug message idna rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils
image-file tabify ffap org-colview cal-china lunar solar cal-dst
cal-bahai cal-iso vc-git cdlatex texmathp org-annotate-file org-id
org-habit org-info org-docview org-bibtex bibtex org-bbdb erc-services
erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete erc-track
erc-match erc-button wid-edit erc-fill erc-stamp erc-netsplit
erc-goodies erc erc-backend erc-compat magit-key-mode magit grep compile
epa derived epg epg-config diff-mode git-rebase-mode thingatpt rx
git-commit-mode server log-edit pcvs-util add-log magit-version
auto-complete-config auto-complete cl-macs gv popup cl calfw-ical url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse auth-source eieio eieio-core gnus-util
mm-util mail-prsvr password-cache url-vars mailcap icalendar diary-lib
diary-loaddefs calfw-org org-agenda calfw edmacro kmacro cl-loaddefs
cl-lib holidays hol-loaddefs ob-sh shell ob-perl ob-latex ob-asymptote
ob-gnuplot ox-latex ox-icalendar ox-html ox-ascii ox-publish ox
org-element org byte-opt bytecomp byte-compile cconv org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref
ob-lob ob-table ob-keys ob-exp ob-comint comint ansi-color ring ob-core
ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu
calendar cal-loaddefs preview-latex tex-site auto-loads jka-compr dired+
dired-aux bookmark+ bookmark+-key easy-mmode advice help-fns dired-x
dired bookmark+-1 bookmark+-bmu help-mode easymenu bookmark+-lit
bookmark pp ido uniquify flyspell ispell time-date paren cyril-util
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

P.S. I wasn't able to configure Emacs Message mode to use local
configured mail server (postfix), so I have to resend message using
other mail agent.

--
WBR, Vladimir Lomov

-- 
Whenever Richard Cory went downtown,
	We people on the pavement looked at him:
He was a gentleman from sole to crown,
	Clean-favored, and imperially slim.
And he was always quietly arrayed,
	And he was always human when he talked;
But still he fluttered pulses when he said,
	"Good morning," and he glittered when he walked.
And he was rich -- yes, richer than a king --
	And admirably schooled in every grace:
In fine, we thought that he was everything
	To make us wish that we were in his place.
So on we worked, and waited for the light,
	And went without the meat, and cursed the bread;
And Richard Cory, one calm summer night,
	Went home and put a bullet through his head.
		-- E.A. Robinson, "Richard Cory"
--- ispell.el.orig	2013-11-15 22:40:50.922512372 +0900
+++ ispell.el	2013-11-15 22:41:25.509015578 +0900
@@ -1181,6 +1181,7 @@
 (defun ispell-parse-hunspell-affix-file (dict-key)
   "Parse hunspell affix file to extract parameters for `DICT-KEY'.
 Return a list in `ispell-dictionary-alist' format."
+  (unless dict-key (setq dict-key "english"))
   (let ((affix-file (cadr (assoc dict-key ispell-hunspell-dict-paths-alist))))
     (unless affix-file
       (error "ispell-phaf: No matching entry for %s.\n" dict-key))