Subject: bug#17775: 24.4.50; `ispell-command-loop` -- portion of code occasionally returns `nil`.

From: Keith David Bershatsky <[email-masked]>
Date: Sat, 14 Jun 2014 09:54:28 -0700

My average `(window-width)` is 168 with `linum-mode` active.   I have `visual-line-mode` active.  As to the first frame that is generated by Emacs, scroll bars are removed with code when Emacs starts -- `(modify-all-frames-parameters (list (cons 'vertical-scroll-bars nil)))` -- this ensures that my initial calling of `toggle-frame-maximized` (when Emacs loads) expands the frame to the full screen width.  As to each new frame, scroll bars are not initially present -- `(add-to-list 'default-frame-alist '(vertical-scroll-bars . nil))`.  Scroll bars are added or removed with a minor mode that calculates whether the the text is longer than the visual window -- `(set-window-scroll-bars selected-window 0 'right nil)` or `(set-window-scroll-bars selected-window 0 'right nil)`.   Scroll bar mode is now on an idle timer, but was previously on the `post-command-hook` -- the spell check error occurs sporadically in either circumstance.

My linum-mode is using a modified version of something I borrowed from Stackoverflow:

http://stackoverflow.com/a/10593165/2112489

(defun my-lawlist-linum-get-format-string ()
  (let* ((width (length (number-to-string
                             (count-lines (point-min) (point-max)))))
         (format (concat "%" (number-to-string width) "d")))
    (setq my-lawlist-linum-format-string format)))

I apologize for not writing up a better initial bug report and I'll update this bug report when I have more useful information.  You are correct in your assumption that the only evidence I have (that the code snippet caused the problem) iss that the error seems to go away by commenting it out.

Keith

---------------------------------------

On Jun 14, 2014, at 1:13 AM, Eli Zaretskii wrote:
> 
> Btw, what was the width of the window when this problem happened?