From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: (other-window) with negative argument Date: Fri, 21 Dec 2018 18:46:15 +0100 Message-ID: <878t0ilqmw.fsf@rub.de> References: <87d0puakg4.fsf@duenenhof-wilhelm.de> <87d0pulqy7.fsf@rub.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545414298 24656 195.159.176.226 (21 Dec 2018 17:44:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2018 17:44:58 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm), help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 21 18:44:54 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaOqx-0006HI-Da for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Dec 2018 18:44:51 +0100 Original-Received: from localhost ([::1]:47047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaOt4-0000VA-5g for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Dec 2018 12:47:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaOsT-0000Ti-BK for help-gnu-emacs@gnu.org; Fri, 21 Dec 2018 12:46:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaOsO-0002J6-3u for help-gnu-emacs@gnu.org; Fri, 21 Dec 2018 12:46:24 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:59739) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaOsM-0002IH-Tl for help-gnu-emacs@gnu.org; Fri, 21 Dec 2018 12:46:19 -0500 Original-Received: from rosalinde ([188.109.146.111]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M4WuC-1hJiy437Fs-00yeqj; Fri, 21 Dec 2018 18:46:16 +0100 In-Reply-To: <87d0pulqy7.fsf@rub.de> (Stephen Berman's message of "Fri, 21 Dec 2018 18:39:28 +0100") X-Provags-ID: V03:K1:PEXw5/VZrCkYRLac9Qr/kzYmTse0VmMQROPR8Dish5yHuJ3M5JS TZItNRCd9Wiyz/H7O4L6buPtWF4oC3yWLaSJ3ZkC7ytCOAhW2620MbFZezycDxRyQTlqL1i HS5a+nvEYnZ503c5Xewcj0h1gzDB0ZcaSZ76Bowj0xI7RM46RmZyUnd3RtSEC0+B7o6wyi7 RBie8N6KzRTI/kp4tvz4Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:q92kCm5hblE=:EM5OdudXzKFl5I4kydAbO2 VS9oN9dtnSBblMto3y09mdTjDOMxNAbHyI5WY6piTxYlGFY0kCi+UpsXT3vfy27U91tLKleCv jzxb56wGNL3RX8FLumNFdxBs82JmWNuyc1f9WdhscJgjrVQPDP9R+A/rkII3LDJS18dHvSJYs t5IDQVxcOi/XtF7q0Eo4TwORKPVVh7K00roY975IohOXlUYDdjk7JWxNke5QFxXO6OAIkb+ol uxYN7S/CemeFEdus1FAIeePO7R07722TSIett1avj8f1Cp1A7MthqAXTUdxmhqSemnqzfSk9A EfGM6+8Az00Rn1y8drwTEBKIWHPr9Ht1LNxScqe5avaUBcWfhhedfo50YZbSGx466KrNaQZRu Dh4cUkmQNlG5f/Bg/QLoI0C+0Fs6sfQHMHks3dAkGZ3q7mvHnr+1dt3ajWzMtcz6gFT5tpAgP PQzidfSgUCyfZ2qWi3o4JFnsep+NZ6Si6Vuf0a8INqSMKK6KNFMi7932e4Lz9mTGJElSMpQQG b4tsO0nH7uZNTyAFyLngSHdmNZe8ZXjqi41J/ywP2XvBbI1MdfNQfA9zAFNhU8P/PDf0LDc3X /jNB0v4j2j9usOWnAOXGGYErNzXbyFpV+qCJrRNlHjb4tMsIKmA22AAmNDdRuqKxDlGPI7oNh pgutorSccY7Z3w9CVwL7b1i7kFjEXbBum3zAhpx3o5B1d8DCmtTbiwDjflSyWqFuLDr/XJANZ /3dPOEd9eH8Ro06rf3RwRkaoH90jzS88t6hIGOVCBt7DI48Y47BeMWiYWjBtffjyO7VPCvsG X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:119017 Archived-At: On Fri, 21 Dec 2018 18:39:28 +0100 Stephen Berman wrote: > On Fri, 21 Dec 2018 17:55:23 +0100 dieter@duenenhof-wilhelm.de (H. Dieter > Wilhelm) wrote: > >> Hello () >> >> I can't get a function to work with a negative argument of >> (other-window). When I'm using (other-window -1) in the *scratch* >> buffer it is working as expected, as soon as I put it into a function >> like the following >> >> (defun previous-window () >> (other-window -1)) >> >> or >> >> (defun previous-window () >> "blabla" >> (interactive) >> (other-window -1)) >> >> and activate the function any call to (other-window -1) is opening the >> debugger! >> >> What am I doing wrong? > > Redefining a function, previous-window, which is a primitive Emacs > function defined in C. When other-window has a negative argument, it > calls the built-in previous-window with three arguments, which are > optional in the built-in version, and since your redefinition takes no > arguments, this raises the error. If you name your function > e.g. my-previous-window, it will work as you expect. Actually, I think it's irrelevant than previous-window is defined in C; what causes the error is simply that other-window calls previous-window with three arguments, but your redefinition takes no arguments. Steve Berman