From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 15 04:19:03 2014 Received: (at submit) by debbugs.gnu.org; 15 Dec 2014 09:19:03 +0000 Received: from localhost ([127.0.0.1]:46436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0Rny-0005eU-95 for submit@debbugs.gnu.org; Mon, 15 Dec 2014 04:19:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48881) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0Rnv-0005eA-Ny for submit@debbugs.gnu.org; Mon, 15 Dec 2014 04:19:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0Rnj-0007yd-Sb for submit@debbugs.gnu.org; Mon, 15 Dec 2014 04:18:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Rnj-0007yV-Pc for submit@debbugs.gnu.org; Mon, 15 Dec 2014 04:18:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Rnd-0004Ta-QO for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 04:18:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0RnY-0007rl-06 for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 04:18:41 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0RnX-0007qu-Sv for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 04:18:35 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3AE822070B for ; Mon, 15 Dec 2014 04:18:34 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 15 Dec 2014 04:18:34 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=L3jxshs8XQwkbcJjW99RNVfjqII=; b=mRQN 4GMUh6ShOXZeZGGt+iiu/X1Nhkh9tnIBVQlxbCHJkPzz2XQdZ+bdemo2kbiMll4R qmdUqI9+SZ5PKB9hasbDTqHbW8U/8sIDStq4puZPSm+tPDIZX2McwUS25glCCRRj 1Ic93QPTTOofI5L+jTZwxy/9HmEunkkGX3lemQo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=L3jxshs8XQw kbcJjW99RNVfjqII=; b=uGW6we7BJ9wEdYdTAekWwHGZn0ViKjDpU842iI5MgRm r3uMV1WbABr8l1+Hdt/5e8F+3VpWifRPBe/b+g9muxCIrDZBheJUGVM0u/06TSHn muhwbAxvKl7fISLy6Up5giSAsJNfGclu+/IQSj/4c3w0nUtZ8tgYRB0CvghTdiEg = X-Sasl-enc: oU5j5zgWPBuHFxRRjRoqlbT86bWm83fYetCW5nQL/xv9 1418635113 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id E52536800EA for ; Mon, 15 Dec 2014 04:18:33 -0500 (EST) Received: from dima by shorty.local with local (Exim 4.84) (envelope-from ) id 1Y0RnU-0001Qb-K4 for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 01:18:32 -0800 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 25.0.50; query-replace-regexp becomes unusable when using lisp expressions for replacement Date: Mon, 15 Dec 2014 01:01:28 -0800 Message-ID: <871to1l193.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi. I'm using a bleeding-edge emacs build, compiled from latest source as of Dec 14. There's a regression in query-replace-regexp where under some conditions it becomes unable to parse its history, and becomes unusable. Here's a recipe. Deviating from the exact steps can make the failure not occur, but I do see this in everyday use, so this isn't exactly a corner case. 1. Create a file called /tmp/dat. I don't think the contents are super important. I have 0001 0002 0003 0004 0005 0006 0007 0008 2. emacs -Q /tmp/dat 3. C-M-% ^. \,(concat \#&) Here we try to do a replacement, but there's an error: (concat ...) expects a string, but \#& is a number, and emacs complains. This is fine. 4. C-M-% SPC We run another replacement. We pull the previous one from the history, and manually remove the # to fix the complaint. \& is a string, as desired. We then replace the first match by presing SPC 5. M-% Error! After step 5, trying to M-% or C-M-% always fails with mapconcat: Wrong type argument: number-or-marker-p, replace-eval-replacement This is irreparable without dipping into lisp. Resetting the history fixes it for the session: (setq query-replace-defaults nil) When broken, the value of query-replace-defaults is (("" replace-eval-replacement replace-quote (concat (match-string 0))) ("^." . "\\,(concat \\#&)")) and the value of query-replace-history is ((replace-eval-replacement replace-quote (concat (match-string 0))) "" "\\,(concat \\#&)" "^.") The backtrace looks like this: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p replace-eval-replacement) isearch-text-char-description(replace-eval-replacement) mapconcat(isearch-text-char-description (replace-eval-replacement replace-quote (concat (match-string 0))) "") query-replace-descr((replace-eval-replacement replace-quote (concat (match-string 0)))) #[(from-to) "\302@! \302A!Q\207" [from-to separator query-replace-descr] 4](("" replace-eval-replacement replace-quote (concat (match-string 0)))) mapcar(#[(from-to) "\302@! \302A!Q\207" [from-to separator query-replace-descr] 4] (("" replace-eval-replacement replace-quote (concat (match-string 0))) ("^." . "\\,(concat \\#&)"))) query-replace-read-from("Query replace" nil) query-replace-read-args("Query replace" nil) (let ((common (query-replace-read-args (concat "Query replace" (if current-prefix-arg (if (eq current-prefix-arg ...) " backward" " word") "") (if (and transient-mark-mode mark-active) " in region" "")) nil))) (list (nth 0 common) (nth 1 common) (nth 2 common) (if (and transient-mark-mode mark-active) (region-beginning)) (if (and transient-mark-mode mark-active) (region-end)) (nth 3 common))) call-interactively(query-replace nil nil) command-execute(query-replace) The issue is that isearch-text-char-description expects a string argument, but it's getting bits of that s-expression; specifically 'replace-eval-replacement. I haven't looked further, and I don't know if this value of the history variables is wrong, or if their parsing is incorrect in some way. Thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 15 18:57:11 2014 Received: (at 19383-done) by debbugs.gnu.org; 15 Dec 2014 23:57:11 +0000 Received: from localhost ([127.0.0.1]:47286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0fVn-0003OK-7y for submit@debbugs.gnu.org; Mon, 15 Dec 2014 18:57:11 -0500 Received: from ps18281.dreamhost.com ([69.163.222.226]:43570 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0fVl-0003OC-Bl for 19383-done@debbugs.gnu.org; Mon, 15 Dec 2014 18:57:09 -0500 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id DE622348328E73; Mon, 15 Dec 2014 15:57:07 -0800 (PST) From: Juri Linkov To: Dima Kogan Subject: Re: bug#19383: 25.0.50; query-replace-regexp becomes unusable when using lisp expressions for replacement Organization: LINKOV.NET References: <871to1l193.fsf@secretsauce.net> Date: Tue, 16 Dec 2014 01:54:53 +0200 In-Reply-To: <871to1l193.fsf@secretsauce.net> (Dima Kogan's message of "Mon, 15 Dec 2014 01:01:28 -0800") Message-ID: <87oar431v6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19383-done Cc: 19383-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > The issue is that isearch-text-char-description expects a string > argument, but it's getting bits of that s-expression; specifically > 'replace-eval-replacement. I haven't looked further, and I don't know if > this value of the history variables is wrong, or if their parsing is > incorrect in some way. Thanks for the detailed report. This was caused by the recent changes and is fixed now. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 15 19:35:46 2014 Received: (at 19383-done) by debbugs.gnu.org; 16 Dec 2014 00:35:46 +0000 Received: from localhost ([127.0.0.1]:47297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0g78-0004L0-Bd for submit@debbugs.gnu.org; Mon, 15 Dec 2014 19:35:46 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56849) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0g75-0004Kr-U9 for 19383-done@debbugs.gnu.org; Mon, 15 Dec 2014 19:35:44 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3C2C1208FE for <19383-done@debbugs.gnu.org>; Mon, 15 Dec 2014 19:35:43 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Mon, 15 Dec 2014 19:35:43 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=/koqa9c+8sN5 FKgjWdo1a4ZQriw=; b=rSXZ97D+/iZT2h2QTr+FGpRkOogPfaieLvUdqigy4VIw FJTWR25FaX7zvct86j8RBkPvdbi5Ulw+T9pr6yQYg7Uql3UZXGVudZ/cDJktFIaR fasFFNqoAasl0yNPv4lXqctoa0vI9IhImdrfhukrSV5YoMfNZNoL5cV48fDbIBU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=/koqa9c+8sN5FKgjWdo1a4ZQriw=; b=bKxXr5d0YCpP792ul3a6 rFn2orRfCYuuKoiBgH5LKKvfrTF0yY9KwiYQtRbbLbTXE4cr+EGCCycP5WMZaudp uwsJBxRHU0ijNWlMJB6snTiXVPnOHJptegX81eVAWjBMxF/QR5Gfqyuc1BQsbb02 oPX4Qgr3r3q2HXuhFGeTBeA= X-Sasl-enc: Fqyzwsru57poAy1/7JIWIeBNnDMTLiWGknBbGSG8FEfR 1418690142 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id E2BCA6800CC; Mon, 15 Dec 2014 19:35:42 -0500 (EST) Received: from dima by shorty.local with local (Exim 4.84) (envelope-from ) id 1Y0g73-00005U-LI; Mon, 15 Dec 2014 16:35:41 -0800 References: <871to1l193.fsf@secretsauce.net> <87oar431v6.fsf@mail.linkov.net> From: Dima Kogan To: Juri Linkov Subject: Re: bug#19383: 25.0.50; query-replace-regexp becomes unusable when using lisp expressions for replacement Date: Mon, 15 Dec 2014 16:35:22 -0800 In-reply-to: <87oar431v6.fsf@mail.linkov.net> Message-ID: <87y4q8jusi.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19383-done Cc: 19383-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Juri Linkov writes: > Thanks for the detailed report. This was caused by the recent changes > and is fixed now. Thanks you very much for your work on emacs! From unknown Mon Jun 23 23:54:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 13 Jan 2015 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator