From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5042: bug#9917: 24.0.90; Make `goto-line' consistent with the line number from the minibuffer Date: Mon, 21 Sep 2020 22:03:44 +0300 Organization: LINKOV.NET Message-ID: <87lfh3dtoj.fsf@mail.linkov.net> References: <877dspmzo3.fsf@gnus.org> <83zh5l1uqw.fsf@gnu.org> <87wo0osspd.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26884"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: dmoncayo@gmail.com, 9917@debbugs.gnu.org, monnier@iro.umontreal.ca, 5042@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 21 21:15:27 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 1kKRHb-0006sl-BQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 21:15:27 +0200 Original-Received: from localhost ([::1]:38300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKRHa-0005km-8W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 15:15:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKRHD-0005HA-Ae for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 15:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKRHD-0003gS-0E for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 15:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKRHC-0007yR-SW for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 15:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2020 19:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5042 X-GNU-PR-Package: emacs Original-Received: via spool by 5042-submit@debbugs.gnu.org id=B5042.160071567530431 (code B ref 5042); Mon, 21 Sep 2020 19:15:02 +0000 Original-Received: (at 5042) by debbugs.gnu.org; 21 Sep 2020 19:14:35 +0000 Original-Received: from localhost ([127.0.0.1]:56255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKRGl-0007uk-HS for submit@debbugs.gnu.org; Mon, 21 Sep 2020 15:14:35 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:44241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKRGg-0007tx-Cw; Mon, 21 Sep 2020 15:14:31 -0400 X-Originating-IP: 91.129.108.13 Original-Received: from mail.gandi.net (m91-129-108-13.cust.tele2.ee [91.129.108.13]) (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 8C1DC20006; Mon, 21 Sep 2020 19:14:20 +0000 (UTC) In-Reply-To: <87wo0osspd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 20 Sep 2020 11:28:14 +0200") 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:188639 Archived-At: > However, if people have a narrowed buffer, and are looking at (say) the > compilation output that says "error on like 45" in a shell, then `M-g g > 45' will definitely do the wrong thing is we change the command to start > counting from the start of the narrowed region. In this case another option is to widen the buffer before going to that line. This is what for example help-function-def--button-function does: ;; Widen the buffer if necessary to go to this position. (when (or (< position (point-min)) (> position (point-max))) (widen)) (goto-char position) Unfortunately, xref doesn't provide such nice feature, so 'M-.' fails to navigate in a narrowed buffer. For 'M-g M-g' this means removing 'save-restriction' from 'goto-line'. > So a new command and keystroke seems warranted. How about... > `M-g M-v'? (The mnemonic is "goto visual line".) Or to add a new key to narrow-map 'C-x n' that currently contains only 4 keys: C-x n d narrow-to-defun C-x n n narrow-to-region C-x n p narrow-to-page C-x n w widen where a new key could be: C-x n g go to narrowed line