From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Roche Newsgroups: gmane.emacs.help Subject: `quick-calc` inside `query-replace` breaks Date: Wed, 29 Jul 2015 18:39:25 -0400 Message-ID: <87vbd2wpuq.fsf@pobox.com> Reply-To: help-gnu-emacs@gnu.org, Tom Roche NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438209601 2839 80.91.229.3 (29 Jul 2015 22:40:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jul 2015 22:40:01 +0000 (UTC) To: help-gnu-emacs@gnu.org, Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 30 00:39:52 2015 Return-path: Envelope-to: geh-help-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 1ZKa0t-0005W5-K1 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jul 2015 00:39:51 +0200 Original-Received: from localhost ([::1]:37234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKa0t-0004HP-5O for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jul 2015 18:39:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKa0i-0004F7-5K for help-gnu-emacs@gnu.org; Wed, 29 Jul 2015 18:39:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKa0c-0002bK-SY for help-gnu-emacs@gnu.org; Wed, 29 Jul 2015 18:39:40 -0400 Original-Received: from pb-smtp1.int.icgroup.com ([208.72.237.35]:58488 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKa0c-0002as-MM for help-gnu-emacs@gnu.org; Wed, 29 Jul 2015 18:39:34 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4804B67FEC; Wed, 29 Jul 2015 18:39:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:reply-to:date:message-id:mime-version:content-type; s= sasl; bh=OdYQGsl8Im7fXLBlvD0jjnPW5Pc=; b=JXVIFFBQyLOQKz4Ki/2rgNt AOQB8k+W1eQnWGY2uOOJSyxm9MuQcWjl6UHigrt3v8Pkl6OA7GNqF9SnmU76ibTs H26jjd9lUP7emW5TLy49O6YwfFgXWRmcKi//95xvuM4PevvVR1+tS2TXH7QsYUI8 XVjgZCh6jodKhseG6Y4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :reply-to:date:message-id:mime-version:content-type; q=dns; s= sasl; b=e3gzBC5CmDAwhfKJRmX2Ksjq4HdVdc+kj+vbEhU3yX+kRHuuByIjo9fS dpJsRi32f127xjmGPBSitXfcklpwOduBgWo0VmoMSN8CmoGfKqP15zgz/8LDdsBA s01FKtT1Ps5DySu2CT2rWf8CVjyATGeLaHTd/XBZC9yJd24/M88= Original-Received: from pb-smtp1.int.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 415F367FEB; Wed, 29 Jul 2015 18:39:33 -0400 (EDT) Original-Received: from tlrW510.pobox.com (unknown [71.20.203.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 878D467FEA; Wed, 29 Jul 2015 18:39:32 -0400 (EDT) User-Agent: GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) X-Pobox-Relay-ID: AE7A61FC-3642-11E5-9D92-21AE9F42C9D4-07218935!pb-smtp1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.72.237.35 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106125 Archived-At: summary: 2 or 3 branched questions (at end) about a change in behavior (24.3.1 -> 24.4.1) when running interactive `quick-calc` inside interactive `query-replace`. details: Until yesterday I was using version='GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.4)' (on Debian) and frequently used workflows like the following: I would compose text with markdown-style footnotes, but instead of enumerating them while composing (which is brittle WRT text rearrangement :-), I would defer the enumeration until I was done. Hence version#=0 ~= > Foo![NNN] but also bar[NNN] and baz[NNN]. > > === > > [NNN]: ... > [NNN]: ... > [NNN]: ... where 'NNN' isa "numerator" (i.e., a template for integers), and '===' isa "fence" between text and footnotes. On "done-ness," I would 1. `query-replace` the "first two" numerators (after the beginning of the document, and after the fence) with '1' 2. recording a macro that interactively `query-replace`d each successive pair of numerators with successive integers. 3. run the macro, checking that the "footnote" matched its text. (This is non-trivial, because * a footnote can be used more than once * sometimes I use a footnote inside another footnote ) The macro relied on the facts that * `query-replace` has an argument stack, accessible via arrow keys: one can retrieve previously-used arguments for the current call. * `query-replace` arguments could be modified *from the stack*. E.g., after doing `query-replace NNN 1', I could record the following sequence: 1. `M-x query-replace` 2. sequence=[2* RET] to retrieve the 'NNN' from the stack, and make it the first argument in the current call 3. sequence=[2* C-k] to copy the '1' (from the previous call) from the stack to the kill-ring 4. `M-x quick-calc` inside the `query-replace` 5. sequence=[C-y + 1 RET] to increment the numeric input (in this case, '1') and exit `quick-calc` 6. C-y to return the result of the incrementation (in this case, 2) from `quick-calc` to the argument list for the current `query-replace` call 7. RET to call `query-replace` to do the work. Seems complex now that I've typed it :-) but after doing it so many times, it's in my "muscle memory." So I was annoyed to discover just now, after finally upgrading to {Jessie, 'GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)'}, that I can no longer do this! because when I call `quick-calc` inside the `query-replace`, I immediately get the error > byte-code: Wrong number of arguments: (lambda nil (interactive) (log-BP4)), 2 which abends `quick-calc`, which abends macro recording. So I'd like to know: 1. Is the new behavior a bug or a feature (i.e., Working As Designed)? 1.1. (if a bug) Has this been previously reported? 1.1.1. (if so) apologies if this is a FAQ, but a quick websearch showed me nothing. 1.1.2. (if not) To where should it be reported? 1.2. (if WAD) How can I workaround the new behavior to do what I want (possibly more effectively)? TIA, Tom Roche