GNU bug report logs - #45973
replace-regexp lisp replacement bug

Previous Next

Package: emacs;

Reported by: Nicholas Drozd <nicholasdrozd <at> gmail.com>

Date: Tue, 19 Jan 2021 00:16:01 UTC

Severity: normal

Tags: confirmed, fixed

Fixed in version 28.0.50

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

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nicholas Drozd <nicholasdrozd <at> gmail.com>
Cc: 45973 <at> debbugs.gnu.org
Subject: Re: bug#45973: replace-regexp lisp replacement bug
Date: Tue, 19 Jan 2021 04:44:52 +0100
Nicholas Drozd <nicholasdrozd <at> gmail.com> writes:

> I tried to make a Lisp test to reproduce this, but the `\,`
> replacement feature is interactive-only, and I don't know how to test
> it non-interactively.

The reproducer is:

(replace-regexp "\\(\\(L\\)\\|\\(R\\)\\)" '(replace-eval-replacement replace-quote (if (match-string 2) "R" "L")) nil nil nil nil nil)

And this leads to the following backtrace:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  make-overlay(nil nil)
  replace-highlight(2 3 nil nil "\\(\\(L\\)\\|\\(R\\)\\)" t nil nil nil)
  perform-replace("\\(\\(L\\)\\|\\(R\\)\\)" (replace-eval-replacement replace-quote (if (match-string 2) "R" "L")) nil t nil nil nil nil nil nil nil)
  replace-regexp("\\(\\(L\\)\\|\\(R\\)\\)" (replace-eval-replacement replace-quote (if (match-string 2) "R" "L")) nil nil nil nil nil)
  eval((replace-regexp "\\(\\(L\\)\\|\\(R\\)\\)" '(replace-eval-replacement replace-quote (if (match-string 2) "R" "L")) nil nil nil nil nil) t)
  eval-expression((replace-regexp "\\(\\(L\\)\\|\\(R\\)\\)" '(replace-eval-replacement replace-quote (if (match-string 2) "R" "L")) nil nil nil nil nil) nil nil 127)
  funcall-interactively(eval-expression (replace-regexp "\\(\\(L\\)\\|\\(R\\)\\)" '(replace-eval-replacement replace-quote (if (match-string 2) "R" "L")) nil nil nil nil nil) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

So this is a problem with the new code that highlights the matches, I
think?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 118 days ago.

Previous Next


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