[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: A feature to go to last edit locations

From: Drew Adams
Subject: RE: [External] : Re: A feature to go to last edit locations
Date: Sun, 12 Feb 2023 21:40:11 +0000

> > >> 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.
> > >
> > > Emacs also has registers.
> >
> > Yes, but registers still require that users explicitly save the
> position
> > in a register beforehand.  Users may be editing a file, then switch to
> > another file (or to another part of the same file) and then get a bit
> > lost and ask themselves "where is what I was editing before?".  If
> they
> > haven't saved their position in a register or in the mark ring, Emacs
> > can't help them.
> Given how much one moves during editing, I have hard time imagining
> how a command that returns me to "the last place I edited" could be
> useful without me telling Emacs which of those places is important and
> which isn't.  If you invent a mechanism to save "the last location"
> automatically, you are going to add a facility that will have a high
> probability of false positives.
> In any case, whatever method of deducing automatically which place to
> record, I think it's better to build the feature on top of registers,
> since they are already equipped for saving and restoring locations.

FWIW, Bookmark+ has `bmkp-automatic-bookmark-mode', which
just records locations with a timer delay.

Not claiming it's what's requested here, but it might be
similar or serve as food for thought.

  When the mode is enabled in the current buffer, a bookmark is
  automatically set every `bmkp-automatic-bookmark-mode-delay' seconds,
  using the setting function that is the value of option
  `bmkp-automatic-bookmark-set-function'.  Note that a buffer must be
  current (selected) for an automatic bookmark to be created there - it
  is not enough that the mode be enabled in the buffer.

  Turning the mode on and off runs hooks
  `bmkp-automatic-bookmark-mode-on-hook' and
  `bmkp-automatic-bookmark-mode-off-hook', respectively.

  If you want the automatic bookmarks to be temporary (not saved to your
  bookmark file), then customize option
  `bmkp-autotemp-bookmark-predicates' so that it includes the kind of
  bookmarks that are set by `bmkp-automatic-bookmark-set-function'.
  For example, if automatic bookmarking sets autonamed bookmarks, then
  `bmkp-autotemp-bookmark-predicates' should include
  `bmkp-autonamed-bookmark-p' or

  If you want the automatically created bookmarks to be highlighted,
  then customize option `bmkp-auto-light-when-set' to highlight
  bookmarks of the appropriate kind.  For example, to highlight
  autonamed bookmarks set it to `autonamed-bookmark'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]