bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54374: 29.0.50; previous-completion fails at beginning of completion


From: Eli Zaretskii
Subject: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer
Date: Mon, 14 Mar 2022 14:59:14 +0200

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: juri@linkov.net,  54374@debbugs.gnu.org
> Date: Mon, 14 Mar 2022 08:20:29 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Philip Kaludercic <philipk@posteo.net>
> >> Date: Sun, 13 Mar 2022 20:39:53 +0000
> >> Cc: 54374@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]