GNU bug report logs - #54374
29.0.50; previous-completion fails at beginning of completions buffer

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 13 Mar 2022 18:14:02 UTC

Severity: normal

Merged with 55289, 55430

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


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

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54374 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#54374: 29.0.50; previous-completion fails at beginning of
 completions buffer
Date: Mon, 14 Mar 2022 13:34:26 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Cc: juri <at> linkov.net,  54374 <at> debbugs.gnu.org
>> Date: Mon, 14 Mar 2022 08:20:29 +0000
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Philip Kaludercic <philipk <at> posteo.net>
>> >> Date: Sun, 13 Mar 2022 20:39:53 +0000
>> >> Cc: 54374 <at> debbugs.gnu.org
>> >> 
>> >> -      (while (< n 0)
>> >> +      (while (and (< n 0) (< 1 (point)))
>> >
>> > Please always use point-min, never a literal 1.
>> 
>> Can do, but does it make a difference in this case?  The only reason the
>> comparison is made is so that (1- (point)) doesn't return an invalid
>> point value.
>
> Any buffer position outside of the accessible portion of the buffer is
> almost always invalid; the number of APIs which tolerate such values
> of buffer position is very small.
>
> Here, try this:
>
>   emacs -Q
>   M-: (narrow-to-region 20 (point-max)) RET
>   M-: (get-text-property 1 'mouse-face) RET
>
> You will get the same args-out-of-range error.  That's because
> get-text-property validates the position against the accessible
> portion of the buffer, not against some absolute values.

I didn't know that, thank you for the background information!

-- 
	Philip Kaludercic




This bug report was last modified 2 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.