emacs-devel
[Top][All Lists]
Advanced

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

Bug Report -- replace-regexp-in-string from subr.el


From: Sam Fiechter
Subject: Bug Report -- replace-regexp-in-string from subr.el
Date: Sat, 19 Apr 2014 19:50:13 -0400

Hi,

I noticed that the lisp function replace-regexp-in-string from emacs 24.4.50.1 does not pass the sub-_expression_ match when the rep is a function call rather than a string.  
For Example:
(progn
  (defun samscat (s)
      (concat "[" s "]"))
 (replace-regexp-in-string "\\(foo\\).*\\'" 'samscat " foo foo" nil nil 1))

returns:
" [foo foo] foo"
 not:
" [foo] foo"

looking at the code, I notice that the sub-_expression_ is hard-coded on line 3642 of subr.el.gz:
    (funcall rep (match-string 0 str)))
rather than:
     (funcall rep (match-string (or subexp 0) str)))

I hope this is helpful!  

Here's my about emacs screen:
This is GNU Emacs, one component of the GNU/Linux operating system.

GNU Emacs 24.4.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2014-03-30 on lenovo-laptop
Copyright (C) 2014 Free Software Foundation, Inc.

If you would like any other info please let me know.

Best,

Sam

--
Sam Fiechter
(302) 689-3798

reply via email to

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