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

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

bug#45973: replace-regexp lisp replacement bug


From: Lars Ingebrigtsen
Subject: bug#45973: replace-regexp lisp replacement bug
Date: Tue, 19 Jan 2021 04:44:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Nicholas Drozd <nicholasdrozd@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





reply via email to

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