From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A97793858D32 for ; Sun, 12 Feb 2023 06:15:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A97793858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR5dt-0005m5-OZ; Sun, 12 Feb 2023 01:15:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7IWJG8MdNo+QgzKYPkNN+w0r/5OdtKL3tSJIyvXf7jE=; b=mfptUaIt3Fe/ 8HSbsDp4+Q7Bi7hJ7loGtPekkTTt1jGvviMwMXMvv5uo/C1g9GCafM0/Gp4QCqbJwn4vNhMM2zcPp plKZd9wT46uqQDPkKFk2lMsdJWpBHTHGX8ZS7kD/wSeoD68hoommbhZvNoN36D+x7okGB2fW+AUCY TaQ6jVsyk6x+L0t86fKV3/xK6YnXu7bgllITawnvEPujrBaQrh/xERSVUL4j8f9aX501SxwAc88cL ogWY5v3zm4vEWC3gx2DWO8gZdwTyKi/sHxNt2n9vxaHpnc8gcNKKNp1TNEXDPZ7+VtstFEcgPm5xn OC3OS3Bxb7932awEie72Jg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR5dt-0004lR-5O; Sun, 12 Feb 2023 01:15:17 -0500 Date: Sun, 12 Feb 2023 08:14:50 +0200 Message-Id: <83edqvif51.fsf@gnu.org> From: Eli Zaretskii To: Gary Johnson Cc: gdb@sourceware.org In-Reply-To: <20230211225233.GB17240@phoenix> (message from Gary Johnson on Sat, 11 Feb 2023 14:52:33 -0800) Subject: Re: [PATCH] Fix 5-line offset of edit command References: <20230211100814.GA17240@phoenix> <83a61kjwp0.fsf@gnu.org> <20230211225233.GB17240@phoenix> X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Sat, 11 Feb 2023 14:52:33 -0800 > From: Gary Johnson > > > > The problem appears to be in the edit_command() function in > > > cli-cmds.c, at line 966 in version 12.1. The solution is to > > > delete that line. The patch is below. > > > > This is probably editor-specific? > > No, it's not editor-specific. The command to run the editor is > created at the end of the edit_command() function: I meant the effect is editor-specific. IOW, what exactly does each editor display when passed a line number. > As I recall, this used to work long ago, then something changed and > the editor was always opened at line 6, then around 2020 it changed > again to open at the current line plus 5. I suspect > a copy-and-paste error, but I haven't looked into the history of > that function. I tried to look into the history with "git log -L", but got stuck at the commit that moved the function from another file. Maybe some Git expert could suggest how to cross that line? > I intended to send this to gdb-patches, but it looks like I wasn't > paying attention to the address and sent it to the general gdb list > instead. Yes, it is best to resent to gdb-patches.