From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Newsgroups: gmane.emacs.bugs Subject: bug#32034: 26.1; [PACTH] better xref-location-marker for imperfect file locations Date: Mon, 02 Jul 2018 16:28:53 +0100 Message-ID: <87muv9sll6.fsf@gmail.com> References: <87y3etsqb7.fsf@gmail.com> <83601xlmno.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530546109 25481 195.159.176.226 (2 Jul 2018 15:41:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2018 15:41:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32034@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 17:41:44 2018 Return-path: Envelope-to: geb-bug-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 1fa0xU-0006X4-1Z for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 17:41:44 +0200 Original-Received: from localhost ([::1]:33697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0zb-0005cI-Cg for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 11:43:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0mF-0002mM-7N for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0mB-0008RT-8u for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa0mB-0008Qx-2p for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fa0mA-0006Py-OS for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jul 2018 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32034 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32034-submit@debbugs.gnu.org id=B32034.153054534824560 (code B ref 32034); Mon, 02 Jul 2018 15:30:02 +0000 Original-Received: (at 32034) by debbugs.gnu.org; 2 Jul 2018 15:29:08 +0000 Original-Received: from localhost ([127.0.0.1]:43739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0lH-0006O4-O2 for submit@debbugs.gnu.org; Mon, 02 Jul 2018 11:29:07 -0400 Original-Received: from mail-wr0-f169.google.com ([209.85.128.169]:46508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0lG-0006NT-SR for 32034@debbugs.gnu.org; Mon, 02 Jul 2018 11:29:07 -0400 Original-Received: by mail-wr0-f169.google.com with SMTP id s11-v6so6731047wra.13 for <32034@debbugs.gnu.org>; Mon, 02 Jul 2018 08:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=K0iTcw1ElzouXTKC35Ih6BjHNzob7cbn0Lq/wVeygyU=; b=L+iMMhRiBLCmgC8lsVKMyh+GHaEaB4Oh/Ar9+/DwwlgvUxPbNWXnMv0EaZqO5xwnjd P8A67tcb0O0cDTQfYuweiIG3gRakYVGD2EdZcAm+RkMLktELEw6F5lXa0rmwd3FxgF1u A7WNSd3B+f0k5RshpbnqykXb+ROFma8zHbEhvkpbz6HIOPVdAqb9FcacjvSzEE/H7S4/ cTiabczTy6wEM7nZ9+yXke7+fdVZNBTyb2u+qaUzuHjTmC0qUGhyADSFakJkaMv8SfbL V/QYqtCZPE5lUoPMZ7xzMoZuYhP9ti7/PKiK/NX5u13Kmt1EerlmcrcItXLy2V9dJYFL ZdRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=K0iTcw1ElzouXTKC35Ih6BjHNzob7cbn0Lq/wVeygyU=; b=ch2mAs5DBQ5YGIfNCg10Q0fq439xmV1B7IbAT2B7FWDQa0S4clwpBZi+B4vXqOv02j fnomXPh4//tHePyqFPqr0zxuLpp3+aTHbqLJO1vK2K8/J8W7tm1CkG4zoNGSaQwd9nj1 BOkWiNqHag1oZOk86ePKBf1JajKYyRESkT457UM2ASQ2Ao46BcmgBhZP17/zDDRL1WIO 3AfZIxkplfuZ7Kw4YQhV53BoE8P2A58md7oYBDL71C8/TRYj6tinMdFsACyyJHEAtPG+ Y5nlF6gb+yV0yJE24zCzF7L81kM0pu8AfH16HToLX4baA7wuLpe7rrlkmdQmQ4MUNtuC PDsw== X-Gm-Message-State: APt69E1zA6UQX+K0Ej7iMGMO3AO1pCJmlSbqvY8DoslG+nev+STz+3dB HILw8eyEcmLQBlnHFAiF8p8= X-Google-Smtp-Source: AAOMgpf2jQdO2SRq0z7QVxs5FW4R2Gp6TAJP2Qb4zm8q2gkWljAtyIsxUYXfBHrcz/9tmn23LXIBTA== X-Received: by 2002:adf:a706:: with SMTP id c6-v6mr20653757wrd.61.1530545340997; Mon, 02 Jul 2018 08:29:00 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id 131-v6sm20574446wmm.31.2018.07.02.08.28.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 08:29:00 -0700 (PDT) In-Reply-To: <83601xlmno.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Jul 2018 17:47:39 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148102 Archived-At: Eli Zaretskii writes: >> (beginning-of-line line) >> - (forward-char column) >> + (ignore-errors (forward-char column)) >> + (unless (and (= (1+ (current-line)) line) >> + (= (current-column) column)) >> + (message "Intended xref location was line=%d, column=%d" >> + line column)) >> (point-marker)))))) > > What will the last hunk do when a file changed, but the identifier was > still found? The function is completely oblivious to the identifier being found or not. So it would do what it does now: jump to the wrong location (unless you're lucky and the change preserved the location of the definition you're after). > AFAIR, the etags back-end is capable of doing that > (because it searches the file in the vicinity of the line/column if > not found at the exact location), and it's a valuable feature, for > obvious reasons. IIUC, that's what I'm proposing in my point 3: add a "hint" field to xref-file-location and default that hint to the identifier being looked for. If etags has code for that already, then great, we could try to share it, but that would be for master right? Or can 1, 2 and 3 go into emacs-26?