GNU bug report logs - #8579
24.0.50; ispell bug in `ispell-add-per-file-word-list'

Previous Next

Package: emacs;

Reported by: Dirk Ullrich <dirk.ullrich <at> googlemail.com>

Date: Thu, 28 Apr 2011 19:44:01 UTC

Severity: normal

Found in version 24.0.50

Done: Agustin Martin <agustin.martin <at> hispalinux.es>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8579 in the body.
You can then email your comments to 8579 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8579; Package emacs. (Thu, 28 Apr 2011 19:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dirk Ullrich <dirk.ullrich <at> googlemail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 28 Apr 2011 19:44:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dirk Ullrich <dirk.ullrich <at> googlemail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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 bug-gnu-emacs <at> gnu.org 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)))
  (save-excursion
    (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)))
                             fill-column)))
	(if (or (and search line-okay)
		(null search))
	    (progn
	      (setq done t)
	      (if (null search)
		  (progn
		    (open-line 1)
		    (unless found (newline))
		    (insert (if comment-start
                                (progn
                                  (if (fboundp 'comment-padright)
                                      ;; Try and use the proper comment marker,
                                      ;; e.g. ";;" rather than ";".
                                      (comment-padright comment-start
                                                        (comment-add nil))
                                    comment-start)
                                  " ")
                              "")
                            ispell-words-keyword)
		    (if (and comment-end (> (length comment-end) 0))
			(save-excursion
			  (newline)
			  (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
/usr/share/emacs/24.0.50/etc/DEBUG.


In GNU Emacs 24.0.50.1 (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
Auto-saving...
Mark set
Making completion list...

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

Features:
(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 sent to Agustin Martin <agustin.martin <at> hispalinux.es>:
You have taken responsibility. (Tue, 03 May 2011 11:14:02 GMT) Full text and rfc822 format available.

Notification sent to Dirk Ullrich <dirk.ullrich <at> googlemail.com>:
bug acknowledged by developer. (Tue, 03 May 2011 11:14:02 GMT) Full text and rfc822 format available.

Message #10 received at 8579-done <at> debbugs.gnu.org (full text, mbox):

From: Agustin Martin <agustin.martin <at> hispalinux.es>
To: Dirk Ullrich <dirk.ullrich <at> googlemail.com>, 8579-done <at> debbugs.gnu.org
Subject: Re: bug#8579: 24.0.50; ispell bug in `ispell-add-per-file-word-list'
Date: Tue, 3 May 2011 13:12:51 +0200
On Thu, Apr 28, 2011 at 06:08:26PM +0200, Dirk Ullrich wrote:
> 
> * 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'.

Fix installed. Thanks for your contribution.

-- 
Agustin




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 31 May 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 343 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.