unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 71068@debbugs.gnu.org
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Date: Mon, 03 Jun 2024 07:47:29 +0200	[thread overview]
Message-ID: <m1plsy8tn2.fsf@dazzs-mbp.kpn> (raw)
In-Reply-To: <508511e2-f964-420d-a453-b098303c5def@gutov.dev> (Dmitry Gutov's message of "Wed, 29 May 2024 04:37:00 +0300")

Hi Dmitry,

Dmitry Gutov <dmitry@gutov.dev> writes:

> On 26/05/2024 11:00, Eshel Yaron wrote:
>> +    (or (and (re-search-forward (format cl--generic-find-defgeneric-regexp name)
>> +                                nil t)
>> +             (or (funcall search ":method[ \t\n]+"
>> +                          (save-excursion (end-of-defun) (point)))
>> +                 (not (goto-char (point-min)))))
>> +        (funcall search base-re)
>
> Should the second clause also be wrapped in some save-excursion or similar?

Do you mean the (funcall search base-re) part?  If so, then no, it
doesn't need save-excursion because it just calls re-search-forward,
which doesn't move point when the search fails.

> And I'd probably change the order (looking for the variations on
> defmethod first), but that's not too important.

Actually I think neither order is quite correct for all cases, because the
regex we construct is currently too lax: if we're searching for a method
definition with no specializers, it also matches definitions with
specializers.  So ISTM that this needs some more work to get right.
If no one beats me to it, I'll look into it when I have some time.


Best,

Eshel





  reply	other threads:[~2024-06-03  5:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-19 15:55 bug#71068: 30.0.50; Incorrect xref positions for eglot-execute Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26  3:04 ` Dmitry Gutov
2024-05-26  8:00   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29  1:37     ` Dmitry Gutov
2024-06-03  5:47       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-06-03 11:27         ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1plsy8tn2.fsf@dazzs-mbp.kpn \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71068@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=me@eshelyaron.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).