From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17775: 24.4.50; `ispell-command-loop` -- portion of code occasionally returns `nil`. Date: Sat, 14 Jun 2014 11:13:28 +0300 Message-ID: <837g4jx61j.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1402733667 22349 80.91.229.3 (14 Jun 2014 08:14:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Jun 2014 08:14:27 +0000 (UTC) Cc: 17775@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 14 10:14:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wvj6P-00081B-Jj for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Jun 2014 10:14:17 +0200 Original-Received: from localhost ([::1]:34570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvj6P-0004Em-2U for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Jun 2014 04:14:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvj6G-0004Dc-AQ for bug-gnu-emacs@gnu.org; Sat, 14 Jun 2014 04:14:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wvj6A-0001zb-N8 for bug-gnu-emacs@gnu.org; Sat, 14 Jun 2014 04:14:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvj6A-0001zX-Jo for bug-gnu-emacs@gnu.org; Sat, 14 Jun 2014 04:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wvj6A-000374-9L for bug-gnu-emacs@gnu.org; Sat, 14 Jun 2014 04:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jun 2014 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17775 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 17775-submit@debbugs.gnu.org id=B17775.140273362811935 (code B ref 17775); Sat, 14 Jun 2014 08:14:02 +0000 Original-Received: (at 17775) by debbugs.gnu.org; 14 Jun 2014 08:13:48 +0000 Original-Received: from localhost ([127.0.0.1]:47169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wvj5v-00036Q-MC for submit@debbugs.gnu.org; Sat, 14 Jun 2014 04:13:48 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:42744) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wvj5t-00036A-7A for 17775@debbugs.gnu.org; Sat, 14 Jun 2014 04:13:46 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N7500G00G5B7G00@a-mtaout20.012.net.il> for 17775@debbugs.gnu.org; Sat, 14 Jun 2014 11:13:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7500G31G6P1M20@a-mtaout20.012.net.il>; Sat, 14 Jun 2014 11:13:38 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90367 Archived-At: > Date: Fri, 13 Jun 2014 15:43:43 -0700 > From: Keith David Bershatsky > > I believe that the following code snippet from `ispell.el` (which I commented out) is responsible for sporadically returning `nil` and causing the function `ispell-command-loop` to fail. Because the issue is sporadic, I have not yet been able to catch it when running Emacs -Q. Commenting out the code and replacing it with just `choices` appears to resolve the issue, but I'm not certain what negative affect that might have. > > (while choices > ;; EXPERIMENTAL WITHOUT THESE CONDITIONS *** > ;; (and choices > ;; (< (if (> (+ 7 (current-column) (length (car choices)) > ;; (if (> count ?~) 3 0)) > ;; (window-width)) > ;; (progn > ;; (insert "\n") > ;; (setq line (1+ line))) > ;; line) > ;; max-lines)) Do you have any evidence that this is the offending code, besides the (maybe) fact that commenting it out makes the problem go away? If so, please show that evidence, because I see nothing in this snippet that could attempt to treat nil as a number or a marker. If there's no specific evidence that this snippet is the root cause, then we need additional information to be able to fix this. The code you commented out is important (it handles the case that the number of possible corrections of a word is more than a single line of the window could hold), so removing it is not an option. Here are some ways of providing the additional information: . provide a reproducible recipe, starting with "emacs -Q", that can be used to reliably reproduce the problem . run Emacs under GDB, set a breakpoint at xsignal2, load ispell.el (the source, not the .elc byte-compiled file), reproduce the error, then type "source /path/to/.gdbinit" at GDB prompt, and finally type "xbacktrace" to show the Lisp backtrace which will pinpoint the locus of the problem more accurately. Thanks. Btw, what was the width of the window when this problem happened? > Here is a thread I opened a couple of weeks ago on Stackoverflow regarding this issue: > > http://stackoverflow.com/questions/23820002/emacs-debugging-an-ispell-error Please in the future reproduce the important part of your report here, instead of pointing to some URL. (I actually encourage you to report any such problems directly here, not on Stackoverflow. It's not like Emacs lacks dedicated places where to report bugs.) Here is the important part, for the benefit of others and for the record: > A few times each day, I receive an ispell error (like the following) that is corrected by restarting Emacs. Any ideas on how to further troubleshoot this type of error would be greatly appreciated. > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) > ispell-command-loop(("Brae" "Br ea" "Br-ea" "Bra" "Bread" "Break" "Bream" > "Brew" "Bret" "Bred" "Area" "Urea") nil "Brea" 2229 2233) > ispell-process-line("^Brea, CA ~ 92821\n" nil) > ispell-region(1 6771) > ispell-buffer() > ispell() > call-interactively(ispell nil nil) > command-execute(ispell) > The document being spell-checked is in tex-mode (built-in -- i.e., not using AUCTeX). The error (today) comes form a simple address at flush-left: > 242 S. Orange Avenue\\ > Brea, CA ~ 92821 Thanks.