all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Daniel Martín" <mardani29@yahoo.es>
To: emacs-devel@gnu.org
Subject: A feature to go to last edit locations
Date: Sun, 12 Feb 2023 18:41:20 +0100	[thread overview]
Message-ID: <m1fsbakchr.fsf@yahoo.es> (raw)
In-Reply-To: m1fsbakchr.fsf.ref@yahoo.es


Some IDEs and text editors provide a feature to go to the position of
the last edit location across all buffers.  For example, in Eclipse or
IntelliJ IDEA, this feature is under Navigate, Last Edit Location.  In
Vim, this feature is called a "change list jump" [1], but it seems to
work in a per-buffer basis.

The closest thing in Emacs is pop-global-mark, but it's not quite the
same feature. The global mark ring requires that the user sets the mark
in advance, and most editing commands do not set the mark.  Information
about last edit locations is already kept in buffer-undo-list, but this
list is per-buffer and does not contain timestamps, so generating a
"global" list for all buffers out of this data structure does not seem
very possible or efficient at the moment; it may need a new data
structure, perhaps at the C level.

My question is: Is there any interest on this new feature?  If so, I
have some questions about how it may fit in Emacs:

- When popping entries from this new "last edit locations ring", should
  we give users the option to skip some changes?  For example, to not go
  to changes in the minibuffer (which will probably be inactive), or to
  other kinds of buffers.

- Should this feature restore killed buffers from files, if possible?
  pop-global-mark does not do that, but the Last Edit Location feature
  in IDEs tries to do that, AFAIK.

- Should this feature be linked to undo information?  That is, if undo
  is disabled for a buffer, should the edit change locations in that
  buffer be preserved?

- I think there should be a configurable threshold to skip adding
  entries that are close to each other.  For instance, an editing
  session that goes like

     Hello, world! M-<backspace> World!

  would generate 3 last edit location entries which are probably
  uninteresting to users.  We should give them an option to skip
  recording some changes (perhaps those that are in the same line, or
  less than a number of character positions apart from another entry in
  the ring).

What do you think?  Third-party packages like goto-last-change.el [2] or
session.el [3] (see session-jump-to-last-change) implement this feature
in a per-buffer basis, but I wonder if we could do better and implement
something that works across buffers.

[1]: https://vimhelp.org/motion.txt.html#changelist
[2]: https://www.emacswiki.org/emacs/goto-last-change.el
[3]: https://www.emacswiki.org/emacs/session.el



       reply	other threads:[~2023-02-12 17:41 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1fsbakchr.fsf.ref@yahoo.es>
2023-02-12 17:41 ` Daniel Martín [this message]
2023-02-12 17:52   ` A feature to go to last edit locations Eli Zaretskii
2023-02-12 18:59     ` Daniel Martín
2023-02-12 19:26       ` Eli Zaretskii
2023-02-12 19:42         ` andrés ramírez
2023-02-12 22:19           ` Daniel Martín
2023-02-12 23:54             ` Dr. Arne Babenhauserheide
2023-02-13  7:50               ` Juri Linkov
2023-02-12 21:40         ` [External] : " Drew Adams
2023-02-13 20:28           ` Jean Louis
2023-02-12 18:07   ` Dmitry Gutov
2023-02-12 18:50     ` Daniel Martín
2023-02-12 18:52       ` Dmitry Gutov
2023-02-12 19:23         ` Daniel Martín
2023-02-13 19:28         ` Jean Louis
2023-02-13 19:24     ` Jean Louis
2023-02-13 19:41       ` Dmitry Gutov
2023-02-13 20:22         ` Dr. Arne Babenhauserheide
2023-02-13 20:56         ` Jean Louis
2023-02-14  3:25         ` Eli Zaretskii
2023-02-14  4:36           ` [External] : " Drew Adams
2023-02-14  4:56             ` Drew Adams
2023-02-14  5:53               ` Jean Louis
2023-02-14 16:24                 ` Drew Adams
2023-02-15  5:45                   ` Jean Louis
2023-02-15 16:34                     ` Drew Adams
2023-02-16  8:17                       ` On Bookmarks+ package Jean Louis
2023-02-16 17:38                         ` [External] : " Drew Adams
2023-02-14 20:08           ` A feature to go to last edit locations Dmitry Gutov
2023-02-13 19:48       ` [External] : " Drew Adams
2023-02-13 20:28         ` Dr. Arne Babenhauserheide
2023-02-13 21:17           ` Drew Adams
2023-02-13 21:21           ` Jean Louis
2023-02-13 21:14         ` Jean Louis
2023-02-14  5:21           ` Drew Adams
2023-02-13 19:49   ` Michael Welsh Duggan
2023-02-13 21:35     ` Jean Louis
2023-02-13 23:14     ` Konstantin Kharlamov
2023-02-14  0:00     ` Ergus
2023-02-14  6:29       ` Dr. Arne Babenhauserheide
2023-02-15  0:00         ` Karthik Chikmagalur

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=m1fsbakchr.fsf@yahoo.es \
    --to=mardani29@yahoo.es \
    --cc=emacs-devel@gnu.org \
    /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.