GNU bug report logs - #18388
24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 2 Sep 2014 13:30:04 UTC

Severity: minor

Found in version 24.4.50

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18388 in the body.
You can then email your comments to 18388 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18388; Package emacs. (Tue, 02 Sep 2014 13:30:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 02 Sep 2014 13:30:08 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; REGRESSION: incompatible change to
 `replace-match-maybe-edit' (and no doc)
Date: Tue, 2 Sep 2014 06:28:45 -0700 (PDT)
You added argument BACKWARD to this function, and you did not add it as
an &optional parameter.  This breaks all existing code that uses the
function.  The parameter should be &optional.

What's more, you did not even mention the new arg in the doc string.


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-08-15 on LEG570
Bzr revision: 117706 rgm <at> gnu.org-20140815043406-p5hbu97cbm7pulcn
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18388; Package emacs. (Fri, 05 Feb 2016 17:17:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: 18388 <at> debbugs.gnu.org
Subject: RE: bug#18388: 24.4.50; REGRESSION: incompatible change to
 `replace-match-maybe-edit' (and no doc)
Date: Fri, 5 Feb 2016 09:16:43 -0800 (PST)
> You added argument BACKWARD to this function, and you did not add it as
> an &optional parameter.  This breaks all existing code that uses the
> function.  The parameter should be &optional.
> 
> What's more, you did not even mention the new arg in the doc string.

ping




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18388; Package emacs. (Sat, 06 Feb 2016 01:14:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 18388 <at> debbugs.gnu.org
Subject: Re: bug#18388: 24.4.50;
 REGRESSION: incompatible change to `replace-match-maybe-edit' (and no
 doc)
Date: Sat, 06 Feb 2016 02:34:28 +0200
>> You added argument BACKWARD to this function, and you did not add it as
>> an &optional parameter.  This breaks all existing code that uses the
>> function.  The parameter should be &optional.
>>
>> What's more, you did not even mention the new arg in the doc string.
>
> ping

I wonder what code and how might use this internal function?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18388; Package emacs. (Sat, 06 Feb 2016 01:41:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 18388 <at> debbugs.gnu.org
Subject: RE: bug#18388: 24.4.50; REGRESSION: incompatible change to
 `replace-match-maybe-edit' (and no doc)
Date: Fri, 5 Feb 2016 17:40:37 -0800 (PST)
> >> You added argument BACKWARD to this function, and you did not add it as
> >> an &optional parameter.  This breaks all existing code that uses the
> >> function.  The parameter should be &optional.
> >>
> >> What's more, you did not even mention the new arg in the doc string.
> >
> > ping
> 
> I wonder what code and how might use this internal function?

Does it matter?  Could you please make the parameter optional
(and document it)?

This code uses it:

http://www.emacswiki.org/emacs/download/icicles-cmd2.el
See the definition of `icicle-search-replace-match'.

Here is that definition, if you don't want to look at it in context:

(defun icicle-search-replace-match (replacement fixedcase)
  "Replace current match with REPLACEMENT, interpreting escapes.

If REPLACEMENT is a function then call that function on the match
 string and use the result as the replacement.
Otherwise, REPLACEMENT is a string, and it is treated as it would be
 treated by `query-replace-regexp'.

FIXEDCASE is as for `replace-match'.  Non-nil means do not alter case."
  (if (functionp replacement)
      (condition-case icicle-search-replace-match0
          (replace-match (funcall replacement (match-string 0)) fixedcase icicle-search-replace-literally-flag)
        (error (replace-match (funcall replacement (match-string 0)) fixedcase t)))
    (if (fboundp 'query-replace-compile-replacement) ; Emacs 22+.
        (let ((compiled
               (save-match-data
                 (query-replace-compile-replacement replacement
                                                    (not icicle-search-replace-literally-flag)))))
          (condition-case icicle-search-replace-match1
              (let ((enable-recursive-minibuffers    t) ; So we can read input from \?.
                    ;; Save and restore these, because we might read input from \?.
                    (icicle-last-completion-command  icicle-last-completion-command)
                    (icicle-last-input               icicle-last-input))
                (replace-match-maybe-edit
                 (if (consp compiled)
                     ;; `replace-count' is free here, bound in `icicle-search'.
                     (funcall (car compiled) (cdr compiled) (setq replace-count  (1+ replace-count)))
                   compiled)
                 fixedcase icicle-search-replace-literally-flag nil (match-data)
                 nil))                  ; BACKWARD parameter for Emacs 24.4+ - see bug #18388
            ;; @@@@@@ Hopefully this is only a temporary hack, until Emacs bug #18388 is fixed.
            (wrong-number-of-arguments
             (condition-case icicle-search-replace-match3
                 (replace-match-maybe-edit
                  (if (consp compiled)
                      ;; `replace-count' is free here, bound in `icicle-search'.
                      (funcall (car compiled) (cdr compiled) (setq replace-count  (1+ replace-count)))
                    compiled)
                  fixedcase icicle-search-replace-literally-flag nil (match-data))
               (buffer-read-only (ding) (icicle-user-error "Buffer is read-only"))
               (error (icicle-remove-Completions-window) (icicle-user-error "No match for `%s'" replacement))))
            (buffer-read-only (ding) (icicle-user-error "Buffer is read-only"))
            (error (icicle-remove-Completions-window) (icicle-user-error "No match for `%s'" replacement))))
      (condition-case icicle-search-replace-match2 ; Emacs < 22.  Try to interpret `\'.
          (replace-match replacement fixedcase icicle-search-replace-literally-flag)
        (error (replace-match replacement fixedcase t))))))




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Wed, 10 Feb 2016 00:48:02 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Wed, 10 Feb 2016 00:48:02 GMT) Full text and rfc822 format available.

Message #19 received at 18388-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 18388-done <at> debbugs.gnu.org
Subject: Re: bug#18388: 24.4.50;
 REGRESSION: incompatible change to `replace-match-maybe-edit' (and no
 doc)
Date: Wed, 10 Feb 2016 02:47:06 +0200
>> >> You added argument BACKWARD to this function, and you did not add it as
>> >> an &optional parameter.  This breaks all existing code that uses the
>> >> function.  The parameter should be &optional.
>> >>
>> >> What's more, you did not even mention the new arg in the doc string.
>> >
>> > ping
>>
>> I wonder what code and how might use this internal function?
>
> Does it matter?  Could you please make the parameter optional
> (and document it)?

Thanks for your patience.  Now fixed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18388; Package emacs. (Wed, 10 Feb 2016 02:04:02 GMT) Full text and rfc822 format available.

Message #22 received at 18388-done <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 18388-done <at> debbugs.gnu.org
Subject: RE: bug#18388: 24.4.50; REGRESSION: incompatible change to
 `replace-match-maybe-edit' (and no doc)
Date: Tue, 9 Feb 2016 18:03:47 -0800 (PST)
> >> >> You added argument BACKWARD to this function, and you did not add it as
> >> >> an &optional parameter.  This breaks all existing code that uses the
> >> >> function.  The parameter should be &optional.
> >> >>
> >> >> What's more, you did not even mention the new arg in the doc string.
> >> >
> >> > ping
> >>
> >> I wonder what code and how might use this internal function?
> >
> > Does it matter?  Could you please make the parameter optional
> > (and document it)?
> 
> Thanks for your patience.  Now fixed.

Thank you.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Mar 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 185 days ago.

Previous Next


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