GNU bug report logs - #76565
30.1; emacs xref: cannot jump back to the previous position when `xref-history-storage' is set to `xref-window-local-history'

Previous Next

Package: emacs;

Reported by: Guoyu Ou <benogy <at> gmail.com>

Date: Tue, 25 Feb 2025 19:44:01 UTC

Severity: normal

Found in version 30.1

Fixed in version 30.2

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76565 in the body.
You can then email your comments to 76565 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76565; Package emacs. (Tue, 25 Feb 2025 19:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guoyu Ou <benogy <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 25 Feb 2025 19:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Guoyu Ou <benogy <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Guoyu Ou <benogy <at> gmail.com>
Subject: 30.1; emacs xref: cannot jump back to the previous position when
 `xref-history-storage' is set to `xref-window-local-history'
Date: Tue, 25 Feb 2025 22:36:27 +0800
[Message part 1 (text/plain, inline)]
Dear maintainers,

I installed emacs 30.1 from debian sid, and found that xref cannot jump
back to the previous position when `xref-history-storage` is set to
`xref-window-local-history`. It works in emacs 29.4 with xref 1.6.3.

### settings and tests

The following is my `~/.emacs`:

```lisp
(when (>= emacs-major-version 29)
  (setq xref-history-storage 'xref-window-local-history))
```

And two c++ files for reproducing this bug:

content of `func-def.cpp`:

```c++
void func() {
}

void func(int) {
}
```

and `main.cpp`:

```c++
int main() {
  func();
}
```

### how to reproduce

Use the following command to generate a `TAGS` file:

```bash
/usr/bin/etags *.cpp
```

Then run

```bash
emacs -Q
```

open `main.cpp` and move the cursor to the word `func` and run

   M-x xref-find-definitions

a `*xref*` buffer is opened and shows two candidates of `func`.

Then I press `n RET` in the `*xref*` buffer to choose the first
candidate in the xref buffer.

Now the cursor is in a new buffer named `func-def.cpp`. Then I press
`M-,` and a message "At start of xref history" is shown in the
minibuffer.

In emacs 29.4 I can jump back to `main.cpp` when pressing `M-,`.

--
Best Regards,
Guoyu
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76565; Package emacs. (Thu, 27 Feb 2025 03:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 76565 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Guoyu Ou <benogy <at> gmail.com>, 76565 <at> debbugs.gnu.org
Subject: Re: bug#76565: 30.1; emacs xref: cannot jump back to the previous
 position when `xref-history-storage' is set to `xref-window-local-history'
Date: Thu, 27 Feb 2025 05:51:47 +0200
[Message part 1 (text/plain, inline)]
Hi!

On 25/02/2025 16:36, Guoyu Ou wrote:
> I installed emacs 30.1 from debian sid, and found that xref cannot jump
> back to the previous position when `xref-history-storage` is set to
> `xref-window-local-history`. It works in emacs 29.4 with xref 1.6.3.
> 
> ### settings and tests
> 
> The following is my `~/.emacs`:
> 
> ```lisp
> (when (>= emacs-major-version 29)
>    (setq xref-history-storage 'xref-window-local-history))
> ```

Thanks for the report. It seems like a regression from fixing bug#65631.

Here's a patch that addresses it.

I'm not 100% convinced it this direction, though, (things are getting 
more complex) so it would be great if it you could try it out and see if 
there are any other scenarios that worked for you before, that still are 
not good with this patch applied.
[fix-76565-xref-window-local-history.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76565; Package emacs. (Thu, 27 Feb 2025 07:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 76565 <at> debbugs.gnu.org (full text, mbox):

From: Guoyu Ou <benogy <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 76565 <at> debbugs.gnu.org
Subject: Re: bug#76565: 30.1; emacs xref: cannot jump back to the previous
 position when `xref-history-storage' is set to `xref-window-local-history'
Date: Thu, 27 Feb 2025 12:36:36 +0800
[Message part 1 (text/plain, inline)]
Hi,

After applying this patch, I tested my commonly used functions and they are
all working well. Thanks for your patch.

Dmitry Gutov <dmitry <at> gutov.dev> 于2025年2月27日周四 11:51写道:

> Hi!
>
> On 25/02/2025 16:36, Guoyu Ou wrote:
> > I installed emacs 30.1 from debian sid, and found that xref cannot jump
> > back to the previous position when `xref-history-storage` is set to
> > `xref-window-local-history`. It works in emacs 29.4 with xref 1.6.3.
> >
> > ### settings and tests
> >
> > The following is my `~/.emacs`:
> >
> > ```lisp
> > (when (>= emacs-major-version 29)
> >    (setq xref-history-storage 'xref-window-local-history))
> > ```
>
> Thanks for the report. It seems like a regression from fixing bug#65631.
>
> Here's a patch that addresses it.
>
> I'm not 100% convinced it this direction, though, (things are getting
> more complex) so it would be great if it you could try it out and see if
> there are any other scenarios that worked for you before, that still are
> not good with this patch applied.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76565; Package emacs. (Fri, 28 Feb 2025 02:36:03 GMT) Full text and rfc822 format available.

Message #14 received at 76565 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Guoyu Ou <benogy <at> gmail.com>
Cc: 76565 <at> debbugs.gnu.org
Subject: Re: bug#76565: 30.1; emacs xref: cannot jump back to the previous
 position when `xref-history-storage' is set to `xref-window-local-history'
Date: Fri, 28 Feb 2025 04:35:42 +0200
On 27/02/2025 06:36, Guoyu Ou wrote:
> After applying this patch, I tested my commonly used functions and they 
> are all working well. Thanks for your patch.

Thanks for testing!

Maintainers: I suppose this should go into the emacs-30 branch?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76565; Package emacs. (Fri, 28 Feb 2025 08:07:02 GMT) Full text and rfc822 format available.

Message #17 received at 76565 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: benogy <at> gmail.com, 76565 <at> debbugs.gnu.org
Subject: Re: bug#76565: 30.1;
 emacs xref: cannot jump back to the previous position when
 `xref-history-storage' is set to `xref-window-local-history'
Date: Fri, 28 Feb 2025 10:06:30 +0200
> Cc: 76565 <at> debbugs.gnu.org
> Date: Fri, 28 Feb 2025 04:35:42 +0200
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> On 27/02/2025 06:36, Guoyu Ou wrote:
> > After applying this patch, I tested my commonly used functions and they 
> > are all working well. Thanks for your patch.
> 
> Thanks for testing!
> 
> Maintainers: I suppose this should go into the emacs-30 branch?

Yes, thanks.




Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Sun, 02 Mar 2025 03:25:02 GMT) Full text and rfc822 format available.

Notification sent to Guoyu Ou <benogy <at> gmail.com>:
bug acknowledged by developer. (Sun, 02 Mar 2025 03:25:02 GMT) Full text and rfc822 format available.

Message #22 received at 76565-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: benogy <at> gmail.com, 76565-done <at> debbugs.gnu.org
Subject: Re: bug#76565: 30.1; emacs xref: cannot jump back to the previous
 position when `xref-history-storage' is set to `xref-window-local-history'
Date: Sun, 2 Mar 2025 05:24:42 +0200
Version: 30.2

On 28/02/2025 10:06, Eli Zaretskii wrote:
>> Cc:76565 <at> debbugs.gnu.org
>> Date: Fri, 28 Feb 2025 04:35:42 +0200
>> From: Dmitry Gutov<dmitry <at> gutov.dev>
>>
>> On 27/02/2025 06:36, Guoyu Ou wrote:
>>> After applying this patch, I tested my commonly used functions and they
>>> are all working well. Thanks for your patch.
>> Thanks for testing!
>>
>> Maintainers: I suppose this should go into the emacs-30 branch?
> Yes, thanks.

Thank you, pushed now: 
https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-30&id=625ed68aeaadce4df7bdfd8c08ddfc8ed4f9b01a




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 Mar 2025 11:24:32 GMT) Full text and rfc822 format available.

This bug report was last modified 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.