[Top][All Lists]

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

Re: Emacs development...

From: Tassilo Horn
Subject: Re: Emacs development...
Date: Sat, 21 Aug 2021 09:54:51 +0200
User-agent: mu4e 1.6.3; emacs 28.0.50

Jean-Christophe Helary <lists@traduction-libre.org> writes:

Hi Jean-Christophe,

>>> Right now, I use C-h f to find the function definitions and move
>>> around the code.
>> That, and also M-. on a function call or variable will bring you to
>> its definition.
> Thank you.
> Sorry for this very basic question, what's the best way to navigate
> back to where I was ?

I frequently use marks, i.e., hit C-SPC on an interesting place I wan't
to come back and C-u C-SPC to jump back to previous marks.  However,
that works only "intra-buffer".

I also use `imenu' a lot which is great if you already know where you
want to go, i.e., you know the name of the function or variable.

Also, isearch, occur, and rgrep.  And the consult package [1] offers
nice "go to thing" or "search for thing" commands.

Finally, I'm currently test-driving the dogears package [2] which tries
to provide a history of visited locations you can navigate back to by
using session-scoped (i.e., not persisted) bookmarks.  I currently use
this config:

--8<---------------cut here---------------start------------->8---
(use-package dogears
  :quelpa (dogears :fetcher github :repo "alphapapa/dogears.el")
  ;; These bindings are optional, of course:
  :bind (:map global-map
              ("M-g d" . dogears-go)
              ("M-g M-b" . dogears-back)
              ("M-g M-f" . dogears-forward)
              ("M-g M-l" . dogears-list)
              ("M-g M-r" . dogears-remember)
              ("M-g M-S" . dogears-sidebar))
  (setq dogears-limit 300)
  (setq dogears-line-width 30)

  ;; Ignored modes
  (add-to-list 'dogears-ignore-modes 'git-commit-mode)
  ;; This will try popping up gnus-summary-buffer which makes no sense with
  ;; mu4e.
  (add-to-list 'dogears-ignore-modes 'mu4e-view-mode)

  ;; Trigger functions
  (add-to-list 'dogears-functions 'kill-ring-save)

  ;; Trigger hooks
  (add-hook 'dogears-hooks 'after-change-functions)
--8<---------------cut here---------------end--------------->8---

dogears will atomatically remember the current location after 5 seconds
by default of idle time (assuming that you probably are reading
concentrated).  My config of `dogears-functions' and `dogears-hooks'
remember places where I've copied text or edited which are most probably
interesting enough I wanna come back.


[1] https://github.com/minad/consult
[2] https://github.com/alphapapa/dogears.el

reply via email to

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