From unknown Sun Jun 22 11:34:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2730 <2730@debbugs.gnu.org> To: bug#2730 <2730@debbugs.gnu.org> Subject: Status: Patch to fix "Wrong number of arguments" error in with-selected-frame in CVS Emacs Reply-To: bug#2730 <2730@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:34:48 +0000 retitle 2730 Patch to fix "Wrong number of arguments" error in with-selecte= d-frame in CVS Emacs reassign 2730 emacs submitter 2730 Fran Litterio severity 2730 normal thanks From flitterio@gmail.com Fri Mar 20 10:10:56 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Mar 2009 17:10:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=2.0 required=4.0 tests=GMAIL,MULTALT, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KHArkF007823 for ; Fri, 20 Mar 2009 10:10:54 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkiFA-0005Ge-QR for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 13:10:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkiF5-0005Fh-OA for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 13:10:51 -0400 Received: from [199.232.76.173] (port=39928 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkiF5-0005Fc-KT for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 13:10:47 -0400 Received: from mail-qy0-f116.google.com ([209.85.221.116]:54614) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LkiF5-000243-3I for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 13:10:47 -0400 Received: by qyk14 with SMTP id 14so1421232qyk.14 for ; Fri, 20 Mar 2009 10:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:received:message-id:subject :from:to:content-type; bh=wlF2hrB5wSfJXZUfH2WdAnBdvAJOF1KoWb6HbhB8bdk=; b=Jah9yl2MQS7mrUJU9DMCVngDqu48qEIXP3AcOMMiuhOnLf2PDKaLhc5rMHEFLLxJDe a+CUITXSUk1gwH9nQxjErnLCUnjcKr+meTDP0BDSkfI4aO3CSGr1DhMH4i+MgBhuCdNt YZkTN2YUJtNyKKSykxw2B+BySaGl2JgKfzVRg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=dabb477kOxip1wPk6/h/fsk8nbMmaXsIbb7ECZ3zYRVrIlitZ6v2rIevZYOCCZH7TQ 93xGbIe5pAxUizf73CUVvt+a2zoAG6+BSaEs48FtDQjG0N8YUIayt4AS3UDCIhkFMYQS 8a/8MDbOCFm1nlguA2JPSIZanPgAGANK5ZdRs= MIME-Version: 1.0 Date: Fri, 20 Mar 2009 13:09:08 -0400 Received: by 10.220.83.194 with SMTP id g2mr1857137vcl.74.1237569045046; Fri, 20 Mar 2009 10:10:45 -0700 (PDT) Message-ID: Subject: Patch to fix "Wrong number of arguments" error in with-selected-frame in CVS Emacs From: Fran Litterio To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=0016364ece9e50a82f04658fffb0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) --0016364ece9e50a82f04658fffb0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The following bug exists in CVS Emacs as of 2009-03-20. In lisp/subr.el, the definition of with-selected-frame has a bug where select-frame is called with two arguments instead of one. This patch fixes that. -- Fran Litterio flitterio@gmail.com --- subr.el~ 2009-03-20 10:28:52.000492000 -0400 +++ subr.el 2009-03-20 13:04:24.000046000 -0400 @@ -2584,10 +2584,10 @@ `(let ((,old-frame (selected-frame)) (,old-buffer (current-buffer))) (unwind-protect - (progn (select-frame ,frame 'norecord) + (progn (select-frame ,frame) ,@body) (when (frame-live-p ,old-frame) - (select-frame ,old-frame 'norecord)) + (select-frame ,old-frame)) (when (buffer-live-p ,old-buffer) (set-buffer ,old-buffer)))))) --0016364ece9e50a82f04658fffb0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The following bug exists in CVS Emacs as of 2009-03-20. In lisp/subr.el, th= e definition of with-selected-frame has a bug where select-frame is called = with two arguments instead of one. This patch fixes that.
--
Fran Litterio
flitterio@gma= il.com


-= -- subr.el~=A0=A0=A0 2009-03-20 10:28:52.000492000 -0400
+++ subr.el=A0=A0=A0 20= 09-03-20 13:04:24.000046000 -0400
@@ -2584= ,10 +2584,10 @@
=A0=A0=A0=A0 `(let ((,o= ld-frame (selected-frame))
=A0=A0=A0=A0 = =A0=A0 (,old-buffer (current-buffer)))
=A0=A0=A0=A0=A0=A0=A0 (= unwind-protect
-=A0=A0=A0 =A0=A0 (progn (s= elect-frame ,frame 'norecord)
+=A0=A0=A0 =A0=A0 (prog= n (select-frame ,frame)
=A0=A0=A0=A0 =A0= =A0=A0 =A0 ,@body)
=A0=A0=A0=A0 =A0(when (= frame-live-p ,old-frame)
-=A0=A0=A0 =A0=A0= (select-frame ,old-frame 'norecord))
+=A0=A0=A0 =A0=A0 (sele= ct-frame ,old-frame))
=A0=A0=A0=A0 =A0(whe= n (buffer-live-p ,old-buffer)
=A0=A0=A0=A0 =A0=A0 (se= t-buffer ,old-buffer))))))
=A0

--0016364ece9e50a82f04658fffb0-- From flitterio@gmail.com Fri Mar 20 10:46:22 2009 Received: (at 2730) by emacsbugs.donarmstrong.com; 20 Mar 2009 17:46:22 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=2.0 required=4.0 tests=GMAIL,MULTALT, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-gx0-f171.google.com (mail-gx0-f171.google.com [209.85.217.171]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KHkIpb016954 for <2730@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 10:46:20 -0700 Received: by gxk19 with SMTP id 19so3373385gxk.1 for <2730@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 10:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:received:message-id:subject :from:to:content-type; bh=azHCyeEkE2OBcflOX4Dlb8rp0w7abF8QSoxvFAEDZrE=; b=reE4ZmCeZ13XHUOqnveyfNj7XseqZiRcWAZEYjx4Ocq4zzi5r8db1YYx8WyyVf+D4p JIZP6Y/OUGWWVYTYIb2VICDTmufk+Dxr2fBeDv6MbzvtTUejTJnV+et6NHsYmwvIsFyw qg29Dd12SeP2+O6owIeT4O5IxarlYigPPJRX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=m+NQj3zsCxbIFiMdkbWlNlMlDhk4jvzSCQFc7b6CT4B6DNyW+O+OYDYQh8bP4aEvBf k+/uTtURjl90luGWgqWNSdrKfCI9L8Ay8BYkMf2aYtmZxddRdCTWP0AY7c7fSMpzsHh5 8TmybVi55S1A900Aq/wFsg+aTSSFsP24GI2O4= MIME-Version: 1.0 Date: Fri, 20 Mar 2009 13:45:57 -0400 Received: by 10.220.98.209 with SMTP id r17mr1160654vcn.20.1237571172808; Fri, 20 Mar 2009 10:46:12 -0700 (PDT) Message-ID: Subject: More info about select-frame problem From: Fran Litterio To: 2730@debbugs.gnu.org Content-Type: multipart/alternative; boundary=0016e646900c23ba2b0465907ed5 --0016e646900c23ba2b0465907ed5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Something strange is going on. My original bug report (and the patch it contains) was motivated by a Wrong-number-of-arguments error caused when * with-selected-frame* calls *select-frame* with two arguments. I sent the bug report because M-x describe-function select-frame RET shows this: select-frame is an interactive built-in function in `C source code'. (select-frame frame) Select the frame frame. Subsequent editing commands apply to its selected window. The selection of frame lasts until the next time the user does something to select a different frame, or until the next time this function is called. If you are using a window system, the previously selected frame may be restored as the selected frame after return to the command loop, because it still may have the window system's input focus. On a text-only terminal, the next redisplay will display frame. This function returns frame, or nil if frame has been deleted. But this doesn't match the code in *src/frame.c* that defines *select-frame* : DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", doc: /* Select FRAME. Subsequent editing commands apply to its selected window. Optional argument NORECORD means to neither change the order of recently selected windows nor the buffer list. The selection of FRAME lasts until the next time the user does something to select a different frame, or until the next time this function is called. If you are using a window system, the previously selected frame may be restored as the selected frame after return to the command loop, because it still may have the window system's input focus. On a text-only terminal, the next redisplay will display FRAME. This function returns FRAME, or nil if FRAME has been deleted. */) (frame, norecord) Lisp_Object frame, norecord; { return do_switch_frame (frame, 1, 0, norecord); } I built Emacs from up-to-date CVS sources using these commands: $ ./configure --prefix=/usr/local --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no $ make bootstrap $ sudo make install -- Francis Litterio flitterio@gmail.com --0016e646900c23ba2b0465907ed5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Something strange is going on. My original bug report (and the patch it con= tains) was motivated by a Wrong-number-of-arguments error caused when wi= th-selected-frame calls select-frame with two arguments. I sent = the bug report because M-x describe-function select-frame RET shows this:
select-frame is an interactive built-in function in `C sourc= e code'.

(select-frame frame)

Select the frame frame.
Subsequent editing comm= ands apply to its selected window.
The sel= ection of frame lasts until the next time the user does
something to select a d= ifferent frame, or until the next time this
selected frame may be r= estored as the selected frame after return to
the command loop, because it still may have the window system's inp= ut
focus.=A0 On a text-onl= y terminal, the next redisplay will display frame.

This function returns f= rame, or nil if frame has been deleted.

But this doesn't match the code in sr= c/frame.c that defines select-frame:

DEFUN ("select-frame", Fselect_frame, Sselect_fram= e, 1, 2, "e",
=A0=A0=A0=A0=A0=A0 doc:= /* Select FRAME.
<= span style=3D"font-family: courier new,monospace;">Subsequent editing comma= nds apply to its selected window.
Optional argument NOREC= ORD means to neither change the order of
r= ecently selected windows nor the buffer list.

The selection of FRAME lasts until the next time= the user does
something to select a diffe= rent frame, or until the next time
this function is called= .=A0 If you are using a window system, the
previously selected frame may be restored as the selected frame
after return to the com= mand loop, because it still may have the
w= indow system's input focus.=A0 On a text-only terminal, the next=
redisplay will display = FRAME.

This function returns FRAME, or nil if FRAME has been delete= d.=A0 */)
=A0=A0=A0=A0 (frame, no= record)
=A0=A0=A0=A0 Lisp_Object frame, no= record;
{
=A0 return do_switch_frame (frame, 1, 0, norecord);
}

I built Emacs from up-to-date = CVS sources using these commands:

= $ ./configure --prefix=3D/usr/local --with-jpeg=3Dno -= -with-png=3Dno --with-gif=3Dno --with-tiff=3Dno
$ make bootstrap=
$ sudo make install
--
Francis Litterio
flitterio@gmail.= com
--0016e646900c23ba2b0465907ed5-- From flitterio@gmail.com Fri Mar 20 11:02:54 2009 Received: (at 2730) by emacsbugs.donarmstrong.com; 20 Mar 2009 18:02:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=2.0 required=4.0 tests=GMAIL,MULTALT autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-gx0-f171.google.com (mail-gx0-f171.google.com [209.85.217.171]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KI2pkN020842 for <2730@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 11:02:52 -0700 Received: by gxk19 with SMTP id 19so3392246gxk.1 for <2730@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 11:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :received:message-id:subject:from:to:content-type; bh=3Kx74iLzBbN4wtD7vhhkIV/1lfllrpcMaXMMcO/o/eQ=; b=oJtxvzzDRuGOsy1sMKc/ciNNh4VZIcZae5+W4thu5roIn2hf/kQobiHZjG4ChXF4Bf uEFh4vj/BdmxfTWAgQGxc/sRWPf8xnQK3YY3SRY1kXAE7DNaSs7G2/A9CucPshXC3aPj 1gN+lZBueRHr1mTe3bEdCDEzFu23rDd/zZ7V4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=m49zDHPezoYN+58VI25VGicSYxLjdpLXrFPwcX2H1XXXMnMfk642S+zhRk9O9egpno ek8J7zXUpkt1Pk1snW9r4vIOZGfd6MNIXCigOyVBmjoAuUw0ARPd5nk6vJkEvEipjcbx BD3b+NcbtGrGl/pLZlnlHz5iC6PB9kaxrSJJs= MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 20 Mar 2009 14:02:31 -0400 Received: by 10.151.112.12 with SMTP id p12mr6903657ybm.110.1237572166199; Fri, 20 Mar 2009 11:02:46 -0700 (PDT) Message-ID: Subject: Re: More info about select-frame problem From: Fran Litterio To: 2730@debbugs.gnu.org Content-Type: multipart/alternative; boundary=00151757461459ac52046590b95b --00151757461459ac52046590b95b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Please ignore this bug report. Something in my environment is preventing "make install" from overwriting /usr/local/bin/emacs with my newly-built version. Sorry for the confusion. -- Fran Litterio flitterio@gmail.com --00151757461459ac52046590b95b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Please ignore this bug report. Something in my environment is preventing "make install" from overwriting /usr/local/bin/emacs with my newly-built version.

Sorry for the confusion.
--
Fran Litterio
flitterio@gmail.com

--00151757461459ac52046590b95b-- From rgm@gnu.org Fri Mar 20 11:52:02 2009 Received: (at control) by emacsbugs.donarmstrong.com; 20 Mar 2009 18:52:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.0 required=4.0 tests=VALID_BTS_CONTROL, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KIpx9s001897 for ; Fri, 20 Mar 2009 11:52:00 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Lkjp1-0001wD-An; Fri, 20 Mar 2009 14:51:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18883.58831.196202.892065@fencepost.gnu.org> Date: Fri, 20 Mar 2009 14:51:59 -0400 From: Glenn Morris To: control Subject: control message X-Debbugs-No-Ack: yes severity 2693 minor tags 2693 notabug reassign 2728 spam close 2730 From monnier@IRO.UMontreal.CA Fri Mar 20 14:08:38 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Mar 2009 21:08:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KL8ZTX006290 for ; Fri, 20 Mar 2009 14:08:36 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LklxC-00013M-Qk for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 17:08:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lklx8-0000zk-Az for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 17:08:34 -0400 Received: from [199.232.76.173] (port=57442 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lklx8-0000zb-6Y for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 17:08:30 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38188) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lklx7-0008KW-Ob for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 17:08:29 -0400 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n2KL8L2E015573; Fri, 20 Mar 2009 17:08:21 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id AE19880DF6; Fri, 20 Mar 2009 17:08:20 -0400 (EDT) From: Stefan Monnier To: Fran Litterio Cc: 2730@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#2730: Patch to fix "Wrong number of arguments" error in with-selected-frame in CVS Emacs Message-ID: References: Date: Fri, 20 Mar 2009 17:08:20 -0400 In-Reply-To: (Fran Litterio's message of "Fri, 20 Mar 2009 13:09:08 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3236=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) > The following bug exists in CVS Emacs as of 2009-03-20. In lisp/subr.el, the > definition of with-selected-frame has a bug where select-frame is called > with two arguments instead of one. This patch fixes that. C-h f select-frame RET: (select-frame frame &optional norecord) ... so the problem you're trying to fix is elsewhere. Actually, this second argument was added to select-frame specifically for use in with-selected-frame ;-) Stefan From unknown Sun Jun 22 11:34:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sat, 18 Apr 2009 14:24:11 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator