From: Eli Zaretskii <eliz@gnu.org>
To: joaotavora@gmail.com (João Távora)
Cc: 32034@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#32034: 26.1; [PACTH] better xref-location-marker for imperfect file locations
Date: Mon, 02 Jul 2018 17:47:39 +0300 [thread overview]
Message-ID: <83601xlmno.fsf@gnu.org> (raw)
In-Reply-To: <87y3etsqb7.fsf@gmail.com> (joaotavora@gmail.com)
> From: joaotavora@gmail.com (João Távora)
> Date: Mon, 02 Jul 2018 14:46:52 +0100
> Cc: dgutov@yandex.ru
>
> The attached patch fixes 1. and 2. It should probably go into emacs-26
>
> Then, I'd like to know your opinions on 3., to go into master.
>
> diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
> index b0bdd62ae9..d38328cccd 100644ppp
> --- a/lisp/progmodes/xref.el
> +++ b/lisp/progmodes/xref.el
> @@ -119,13 +119,19 @@ xref-make-file-location
> (with-current-buffer
> (or (get-file-buffer file)
> (let ((find-file-suppress-same-file-warnings t))
> + (unless (file-exists-p file)
> + (error "File %s doesn't exist!" file))
> (find-file-noselect file)))
> (save-restriction
> (widen)
> (save-excursion
> (goto-char (point-min))
> (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? 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.
next prev parent reply other threads:[~2018-07-02 14:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 13:46 bug#32034: 26.1; [PACTH] better xref-location-marker for imperfect file locations João Távora
2018-07-02 14:35 ` Robert Pluim
2018-07-02 15:22 ` João Távora
2018-07-02 14:47 ` Eli Zaretskii [this message]
2018-07-02 15:28 ` João Távora
2018-07-02 15:37 ` Eli Zaretskii
2018-07-02 15:50 ` João Távora
2018-07-02 16:32 ` Eli Zaretskii
2018-07-02 16:55 ` João Távora
2018-07-02 17:29 ` Eli Zaretskii
2020-08-10 12:59 ` Lars Ingebrigtsen
2020-08-10 18:53 ` Dmitry Gutov
2020-08-10 20:42 ` João Távora
2018-07-03 13:56 ` Dmitry Gutov
2018-07-03 14:50 ` João Távora
2018-07-03 15:07 ` Dmitry Gutov
2018-07-03 15:43 ` João Távora
2018-07-04 12:58 ` Dmitry Gutov
2018-07-04 13:37 ` João Távora
2018-07-04 14:33 ` Dmitry Gutov
2018-07-04 14:53 ` João Távora
2018-07-04 15:08 ` Dmitry Gutov
2018-07-04 19:16 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83601xlmno.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=32034@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=joaotavora@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.