goto-chg icon indicating copy to clipboard operation
goto-chg copied to clipboard

Comments created by comment-dwim-2 are not detected as changes

Open taquangtrung opened this issue 2 years ago • 4 comments

Hi,

This is a similar issue to https://github.com/emacs-evil/goto-chg/issues/8, but happens to comment-dwim-2.

Can you help to check?

I'm using:

  • Emacs 28.1 (GNU official release)
  • undo-tree version 0.8.2: https://elpa.gnu.org/packages/undo-tree.html
  • comment-dwim-2 version 1.4.3, released on 20210101.1820
  • goto-chg version 1.7.5, released on 20220107.1733

Thank you!

taquangtrung avatar Sep 04 '22 09:09 taquangtrung

This is still lacking reproduction instructions.

wasamasa avatar Sep 05 '22 09:09 wasamasa

@wasamasa: I did a further investigation and it turned out that goto-last-change cannot record the changes done by comment-region, shipped default with Emacs 28.1

Reproduction steps:

  • Open a file of Emacs lisp mode, like this file: https://github.com/emacs-evil/goto-chg/blob/master/goto-chg.el
  • Select and mark a region of text (using C-SPC).
  • Call M-x comment-region to comment out that region.
  • Move the cursor to another location in the file, and call M-x goto-last-change.

The cursor does not jump to the previous location where the region is commented.

Note that I used the default undo mechanism in the above step (undo-tree was not used).

taquangtrung avatar Sep 11 '22 09:09 taquangtrung

Thank you, I can reproduce this now. First question that comes to mind is whether this is an issue exclusive to Emacs 28.1. Does Emacs 27.1 behave correctly? If yes, that would point to glc-fixup-edit requiring adjustments specific to Emacs 28.1.

wasamasa avatar Sep 12 '22 08:09 wasamasa

Thanks for the confirmation!

FYI, I just tested on Emacs 27.1 (similar reproducing steps) and the bug still occurs when comment-region is used.

taquangtrung avatar Sep 12 '22 11:09 taquangtrung