unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)
@ 2014-09-02 13:28 Drew Adams
  2016-02-05 17:16 ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2014-09-02 13:28 UTC (permalink / raw)
  To: 18388

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@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'





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)
  2014-09-02 13:28 bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc) Drew Adams
@ 2016-02-05 17:16 ` Drew Adams
  2016-02-06  0:34   ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2016-02-05 17:16 UTC (permalink / raw)
  To: 18388

> 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)
  2016-02-05 17:16 ` Drew Adams
@ 2016-02-06  0:34   ` Juri Linkov
  2016-02-06  1:40     ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2016-02-06  0:34 UTC (permalink / raw)
  To: Drew Adams; +Cc: 18388

>> 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?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)
  2016-02-06  0:34   ` Juri Linkov
@ 2016-02-06  1:40     ` Drew Adams
  2016-02-10  0:47       ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2016-02-06  1:40 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 18388

> >> 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))))))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)
  2016-02-06  1:40     ` Drew Adams
@ 2016-02-10  0:47       ` Juri Linkov
  2016-02-10  2:03         ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2016-02-10  0:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: 18388-done

>> >> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc)
  2016-02-10  0:47       ` Juri Linkov
@ 2016-02-10  2:03         ` Drew Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2016-02-10  2:03 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 18388-done

> >> >> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-10  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 13:28 bug#18388: 24.4.50; REGRESSION: incompatible change to `replace-match-maybe-edit' (and no doc) Drew Adams
2016-02-05 17:16 ` Drew Adams
2016-02-06  0:34   ` Juri Linkov
2016-02-06  1:40     ` Drew Adams
2016-02-10  0:47       ` Juri Linkov
2016-02-10  2:03         ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).