[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8579: 24.0.50; ispell bug in `ispell-add-per-file-word-list'

From: Dirk Ullrich
Subject: bug#8579: 24.0.50; ispell bug in `ispell-add-per-file-word-list'
Date: Thu, 28 Apr 2011 18:08:26 +0200

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your report will be posted to the address@hidden mailing list
and the gnu.emacs.bug news group, and at http://debbugs.gnu.org.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':

* How to reproduce the bug:

Load a text file;
Enable `flyspell-mode'
Type a word not contained in the active Ispell dictionary, and place the
point just behind the word;
Run command `flyspell-correct-word-before-point',
and choose the option `Accept (Buffer)';

* Symptom:

Emacs signals an error:
flyspell-do-correct: Wrong type argument: char-or-string-p, nil

* Diagnosis:

`ispell.el's function `ispell-add-per-file-word-list' cannot handle a
`nil' value of the `comment-start' variable.

* A possible fix:

This is a fixed version of `ispell-add-per-file-word-list'.
It ignores the comment-related stuff if `comment-begin' (or
`comment-end') has value `nil'.

(defun ispell-add-per-file-word-list (word)
  "Add WORD to the per-file word list (fixed version)."
  (or ispell-buffer-local-name
      (setq ispell-buffer-local-name (buffer-name)))
    (goto-char (point-min))
    (let (line-okay search done found)
      (while (not done)
        (let ((case-fold-search nil))
          (setq search (search-forward ispell-words-keyword nil 'move)
              found (or found search)
              line-okay (< (+ (length word) 1 ; 1 for space after word..
                              (progn (end-of-line) (current-column)))
        (if (or (and search line-okay)
                (null search))
              (setq done t)
              (if (null search)
                    (open-line 1)
                    (unless found (newline))
                    (insert (if comment-start
                                  (if (fboundp 'comment-padright)
                                      ;; Try and use the proper comment marker,
                                      ;; e.g. ";;" rather than ";".
                                      (comment-padright comment-start
                                                        (comment-add nil))
                                  " ")
                    (if (and comment-end (> (length comment-end) 0))
                          (insert comment-end)))))
              (insert (concat " " word))))))))

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file

In GNU Emacs (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4)
 of 2011-04-28 on red
Windowing system distributor `The X.Org Foundation', version 11.0.11001000
configured using `configure  '--prefix=/usr' '--sysconfdir=/etc'
'--localstatedir=/var' '--libexecdir=/usr/lib'
'--mandir=/usr/share/man' '--without-sound' '--with-x-toolkit=gtk'
'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe'
'LDFLAGS=-Wl,--hash-style=gnu -Wl,--as-needed''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  flyspell-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f f l <tab> <backspace> <backspace> <backspace>
<backspace> / t <tab> f l <tab> <return> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <S-down>
<S-down> <delete> <backspace> <up> <up> <right> <right>
<right> <right> <right> <left> <S-down> <S-down> <insert>
<delete> <backspace> <up> <up> <up> <up> <up> <up>
<down> <down> <down> <down> <down> <down> <insert>
C-x C-s M-x f l <backspace> <backspace> i s <tab> p
<tab> - <tab> w <tab> <return> ? ? ? ? e <backspace>
<backspace> <backspace> s s s s M-x <up> <down> f l
y <tab> s <tab> m <tab> <return> C-c $ <down-mouse-1>
<mouse-1> <up> <up> <up> <up> <up> <S-down> <S-down>
<S-down> <S-down> <S-down> <delete> <delete> <right>
<right> <right> <right> <right> M-x r e p o <tab> r
<tab> <return>

Recent messages:
Making completion list... [2 times]
Starting new Ispell process [default] ...
Checking spelling of GGG...
You can run the command `ispell-word' with M-$
Making completion list...
Flyspell mode enabled
flyspell-do-correct: Wrong type argument: char-or-string-p, nil
Mark set
Making completion list...

Load-path shadows:
/usr/share/emacs/site-lisp/coq-db hides
/usr/share/emacs/site-lisp/coq-syntax hides
/usr/share/emacs/site-lisp/coq hides
/usr/share/emacs/24.0.50/lisp/erc/erc-hecomplete hides

(shadow sort mail-extr message idna sendmail format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader emacsbug url-util
url-parse auth-source eieio byte-opt bytecomp byte-compile cconv
macroexp assoc gnus-util time-date password-cache url-vars mm-util
mail-prsvr flyspell regexp-opt ispell help-mode easymenu view vc-git
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image fringe lisp-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 loaddefs button faces
cus-face files text-properties overlay md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]