GNU bug report logs - #64049
30.0.50; Minor search_buffer cleanup

Previous Next

Package: emacs;

Reported by: Basil Contovounesios <contovob <at> tcd.ie>

Date: Tue, 13 Jun 2023 17:31:01 UTC

Severity: minor

Tags: patch

Found in version 30.0.50

Fixed in version 30.1

Done: Basil Contovounesios <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Po Lu <luangruo <at> yahoo.com>
To: Basil Contovounesios <contovob <at> tcd.ie>
Cc: 64049 <at> debbugs.gnu.org
Subject: bug#64049: 30.0.50; Minor search_buffer cleanup
Date: Wed, 14 Jun 2023 08:25:02 +0800
Basil Contovounesios <contovob <at> tcd.ie> writes:

> * src/lisp.h (search_buffer): Turn RE flag/argument from an int into
> a bool.  All callers updated.

We typically write ``All callers changed'' in ChangeLog, I think.

> +/* Search for the Nth occurrence of STRING in the current buffer,
> +   from buffer position POS/POS_BYTE until LIM/LIM_BYTE,
> +   treating STRING as a literal string if RE is false
> +   or as a regular expression if RE is true.
> +
> +   If N is positive, searching is forward and LIM must be greater than POS.
> +   If N is negative, searching is backward and LIM must be less than POS.
> +
> +   Returns -x if x occurrences remain to be found (x > 0),
> +   or else the position at the beginning of the Nth occurrence
> +   (if searching backward) or the end (if searching forward).
> +
> +   TRT and INVERSE_TRT are translation tables.
> +
> +   POSIX is true if we want full backtracking (POSIX style) for this pattern.
> +   False means backtrack only enough to get a valid match.  */

How about:

  Search for the Nth occurence of STRING in the current buffer,
  from buffer position POS/POS_BYTE until LIM/LIM_BYTE.

  If RE, look for matches against the regular expression STRING instead;
  if POSIX, enable POSIX style backtracking within that regular
  expression.

  If N is positive, search forward; in this case, LIM must be greater
  than POS.

  If N is negative, search backwards; LIM must be less than POS.

  Return -X if there are X remaining occurrences or matches, or else the
  position at the beginning (if N is negative) or the end (if N is
  positive) of the Nth occurrence or match against STRING.

  Use TRT and INVERSE_TRT as character translation tables.




This bug report was last modified 1 year and 316 days ago.

Previous Next


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