GNU bug report logs - #21730
25.0.50; Random errors in redisplay--pre-redisplay-functions

Previous Next

Package: emacs;

Reported by: Michael Welsh Duggan <mwd <at> md5i.com>

Date: Thu, 22 Oct 2015 04:05:02 UTC

Severity: normal

Found in version 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Welsh Duggan <mwd <at> md5i.com>
To: Eli Zaretskii <eliz <at> gnu.org>,  21730 <at> debbugs.gnu.org
Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions
Date: Sat, 31 Oct 2015 09:07:05 -0400
Michael Welsh Duggan <mwd <at> md5i.com> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> From the backtrace it is obvious that the immediate reason for the
>> problem is the call to 'get-char-property' with an invalid 1st argument
>> of zero (it's a buffer position, so should be at least 1).
>>
>> Looking at 'cursor-sensor--detect', I see this:
>>
>>   (defun cursor-sensor--detect (window)
>>     (unless cursor-sensor-inhibit
>>       (let* ((point (window-point window))
>> 	     ;; It's often desirable to make the cursor-sensor-functions property
>> 	     ;; non-sticky on both ends, but that means get-pos-property might
>> 	     ;; never see it.
>> 	     (new (or (get-char-property point 'cursor-sensor-functions)
>> 		      (unless (bobp)
>> 			(get-char-property (1- point) 'cursor-sensor-functions))))
>>
>> So my guess is that the value of 'point' (the variable, not the
>> function) is 1, i.e. beginning of buffer, and subtracting 1 from it
>> produces that zero.  Then the second call to 'get-char-property' barfs
>> as expected.
>>
>> The code tries to protect itself against such a calamity by calling
>> 'bobp', but that function looks at the buffer's value of point, which
>> might be different from what 'window-point' returns.
>>
>> So my advice would be to replace the call to 'bobp' with an explicit
>> test of the value of the local variable 'point', and see if that fixes
>> the problem.
>
> I've changed the (bobp) to (= point 1).  I'll run it for a couple of
> weeks and report back.

This change seems to have done the trick.  I have not encountered the
error in several days.

-- 
Michael Welsh Duggan
(md5i <at> md5i.com)




This bug report was last modified 7 years and 358 days ago.

Previous Next


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