From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: 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) Message-ID: <0d78b1ce-867e-4f1e-bcba-4dc765cf0749@default> References: <871t8qps15.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1454722888 14135 80.91.229.3 (6 Feb 2016 01:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2016 01:41:28 +0000 (UTC) Cc: 18388@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 06 02:41:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aRrs9-0006SA-73 for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Feb 2016 02:41:13 +0100 Original-Received: from localhost ([::1]:51230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRrs5-0007hh-Bq for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Feb 2016 20:41:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRrs1-0007hW-P6 for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2016 20:41:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRrry-0001GR-Fw for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2016 20:41:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRrry-0001GN-CC for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2016 20:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aRrry-0005gX-2K for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2016 20:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Feb 2016 01:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18388 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18388-submit@debbugs.gnu.org id=B18388.145472284921827 (code B ref 18388); Sat, 06 Feb 2016 01:41:02 +0000 Original-Received: (at 18388) by debbugs.gnu.org; 6 Feb 2016 01:40:49 +0000 Original-Received: from localhost ([127.0.0.1]:34956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRrrk-0005fz-S4 for submit@debbugs.gnu.org; Fri, 05 Feb 2016 20:40:49 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:47344) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRrri-0005fk-W2 for 18388@debbugs.gnu.org; Fri, 05 Feb 2016 20:40:47 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u161ee0o016180 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 6 Feb 2016 01:40:40 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u161edDn022974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 6 Feb 2016 01:40:40 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u161ed4m008266; Sat, 6 Feb 2016 01:40:39 GMT In-Reply-To: <871t8qps15.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112540 Archived-At: > >> You added argument BACKWARD to this function, and you did not add it a= s > >> 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 >=20 > 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 i= cicle-search-replace-literally-flag) (error (replace-match (funcall replacement (match-string 0)) fixedc= ase t))) (if (fboundp 'query-replace-compile-replacement) ; Emacs 22+. (let ((compiled (save-match-data (query-replace-compile-replacement replacement (not icicle-search-repl= ace-literally-flag))))) (condition-case icicle-search-replace-match1 (let ((enable-recursive-minibuffers t) ; So we can read in= put 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-sear= ch'. (funcall (car compiled) (cdr compiled) (setq replace-c= ount (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-sea= rch'. (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-onl= y")) (error (icicle-remove-Completions-window) (icicle-user-error "N= o match for `%s'" replacement)))) (condition-case icicle-search-replace-match2 ; Emacs < 22. Try to in= terpret `\'. (replace-match replacement fixedcase icicle-search-replace-litera= lly-flag) (error (replace-match replacement fixedcase t))))))