From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#42839: [PATCH] Support displaying line numbers in goto-line Date: Wed, 12 Aug 2020 23:30:42 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000009d960c05acbc71f0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36653"; mail-complaints-to="usenet@ciao.gmane.io" To: 42839@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 13 08:31:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k66lc-0009N1-F9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 08:31:12 +0200 Original-Received: from localhost ([::1]:42966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k66la-0004Oh-TT for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 02:31:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k66lS-0004N1-G1 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 02:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k66lR-0002lY-VB for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 02:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k66lR-0006dw-Qe for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 02:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Aug 2020 06:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42839 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159730025125519 (code B ref -1); Thu, 13 Aug 2020 06:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Aug 2020 06:30:51 +0000 Original-Received: from localhost ([127.0.0.1]:46589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k66lH-0006dX-30 for submit@debbugs.gnu.org; Thu, 13 Aug 2020 02:30:51 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k66lD-0006dN-9C for submit@debbugs.gnu.org; Thu, 13 Aug 2020 02:30:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k66lD-0004LY-0G for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 02:30:47 -0400 Original-Received: from mail-yb1-f179.google.com ([209.85.219.179]:41615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k66lA-0002gj-LB for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 02:30:46 -0400 Original-Received: by mail-yb1-f179.google.com with SMTP id s195so2726951ybc.8 for ; Wed, 12 Aug 2020 23:30:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=KjBLccKdY/xCoPyorezpd1yeHsb5yBG17lrrjAwvsUw=; b=gQg36O1v8NFthGR9AEIAyxCLrzYIc3EbXCnhPkuHFizcYfuucGRt4DofBla2Odz2nr DuK/tEo8fWgEDZvhl5dpuydhMMs270MNcmSrp6GzmOq4WTHuIWVTyQCrAm4MDcTiLd3d GIMEiqpAFDuGmWccFaGCCCzDpXuN1Lqn3yg624IF7O8AwYJQJj+SjnK6MMliytpX0nxW EpporFSoG40xmfRj/5bY07nItSPVqww4M9cDTOZP76FC5zeLyESmzAwRS/fmBRibHg1s hRqD5+i5XKaELIxuNcJjKSwNWFW1ZvlmMDaiVFuMil/0c8yq74MswcIuOIfzpk2MOmyM f0Kw== X-Gm-Message-State: AOAM532gLU14zVanD8V1zAek4CXTYbqVPKqBvDGRyS1Ie5XicAc7g3bT 9KVs59zLi7WvzA6w0Y8OYpmXL2W5TzUi8nD4fjquTtuErqw= X-Google-Smtp-Source: ABdhPJx92NcYsxrCP8BcdwLvJUbZo2SV2FNXHdcxH+e9ViuBcAPHMwXnOfESA/hBJPoTiLc6lgqM9+400yCK/pkMXe0= X-Received: by 2002:a25:7007:: with SMTP id l7mr4313797ybc.85.1597300243526; Wed, 12 Aug 2020 23:30:43 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Aug 2020 23:30:42 -0700 Received-SPF: pass client-ip=209.85.219.179; envelope-from=stefankangas@gmail.com; helo=mail-yb1-f179.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/13 01:34:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184949 Archived-At: --0000000000009d960c05acbc71f0 Content-Type: text/plain; charset="UTF-8" Here's an interesting idea I picked up from Reddit: make goto-line enable display-line-numbers-mode temporarily when prompting. Please see the attached patch. Comments or thoughts welcome, as always. Best regards, Stefan Kangas PS. I added a new defcustom to enable this behaviour, by default set to nil. But if it seems useful, it would be nifty if we could enable it by default. (I have no idea if display-line-numbers-mode is stable enough in all scenarios, however.) --0000000000009d960c05acbc71f0 Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Support-displaying-line-numbers-in-goto-line.patch" Content-Disposition: attachment; filename="0001-Support-displaying-line-numbers-in-goto-line.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 87d1c9b23052bf48_0.1 RnJvbSA5N2E0NWEzZmM0NzY1YjNiMzZkOGRmM2RmMmM1ZDQzNTA1Y2JlY2U5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5rYW5nYXNAZ21haWwuY29t PgpEYXRlOiBUaHUsIDEzIEF1ZyAyMDIwIDA4OjE5OjQyICswMjAwClN1YmplY3Q6IFtQQVRDSF0g U3VwcG9ydCBkaXNwbGF5aW5nIGxpbmUgbnVtYmVycyBpbiBnb3RvLWxpbmUKCiogbG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GdvdG8tbGluZQogCQkgKGNvbmNhdCAiIGluICIgKGJ1ZmZlci1uYW1lIGJ1ZmZlcikp CiAJICAgICAgICIiKSkpCiAgICAgICAgOzsgUmVhZCB0aGUgYXJndW1lbnQsIG9mZmVyaW5nIHRo YXQgbnVtYmVyIChpZiBhbnkpIGFzIGRlZmF1bHQuCi0gICAgICAgKGxpc3QgKHJlYWQtbnVtYmVy IChmb3JtYXQgIkdvdG8gbGluZSVzOiAiIGJ1ZmZlci1wcm9tcHQpCi0gICAgICAgICAgICAgICAg ICAgICAgICAgIChsaXN0IGRlZmF1bHQgKGxpbmUtbnVtYmVyLWF0LXBvcykpCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICdnb3RvLWxpbmUtaGlzdG9yeSkKLQkgICAgIGJ1ZmZlcikpKSkKKyAg ICAgICAobGV0ICgoc2hvd2luZyBkaXNwbGF5LWxpbmUtbnVtYmVycykpCisgICAgICAgICAodW53 aW5kLXByb3RlY3QKKyAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICh3aGVuIChu b3Qgc2hvd2luZykKKyAgICAgICAgICAgICAgICAgKGRpc3BsYXktbGluZS1udW1iZXJzLW1vZGUg MSkpCisgICAgICAgICAgICAgICAobGlzdCAocmVhZC1udW1iZXIgKGZvcm1hdCAiR290byBsaW5l JXM6ICIgYnVmZmVyLXByb21wdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo bGlzdCBkZWZhdWx0IChsaW5lLW51bWJlci1hdC1wb3MpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICdnb3RvLWxpbmUtaGlzdG9yeSkKKwkgICAgICAgICAgICAgYnVmZmVyKSkK KyAgICAgICAgICAgKHdoZW4gKG5vdCBzaG93aW5nKQorICAgICAgICAgICAgIChkaXNwbGF5LWxp bmUtbnVtYmVycy1tb2RlIC0xKSkpKSkpKQogICA7OyBTd2l0Y2ggdG8gdGhlIGRlc2lyZWQgYnVm ZmVyLCBvbmUgd2F5IG9yIGFub3RoZXIuCiAgIChpZiBidWZmZXIKICAgICAgIChsZXQgKCh3aW5k b3cgKGdldC1idWZmZXItd2luZG93IGJ1ZmZlcikpKQotLSAKMi4yOC4wCgo= --0000000000009d960c05acbc71f0--