Git Product home page Git Product logo

emacs-postrace's Introduction

postrace

Leave trace points to navigate back and forth examining important code paths.

postrace is similar in spirit to Emacs' global mark ring, but offers a more intuitive interface for browsing/navigating buffer positions. It is particularly useful when examining code paths.

postrace provides commands to push buffer positions onto a position stack and navigate back and forth between these positions, with the position under the cursor being previwed in the active window. The functionality is primarily offered through two interactive commands:

  • postrace-push: pushes the buffer position (marker) at point to the position stack.

  • postrace-browse: enters "browse mode". The position stack is displayed and can be browsed in the minibuffer. The position under the cursor is previewed in the active window. The postrace-browse-map has the following default keybindings:

    • up/C-p: move one step up the position stack.
    • down/C-n: move one step down the position stack.
    • RET: jump to the position under the cursor.
    • C-g/escape: exit the minibuffer and return to whichever buffer was active when postrace-browse was issued.
    • M-up/M-p: move the position under the cursor one step up.
    • M-down/M-n: move the position under the cursor one step down.
    • delete: remove the position under the cursor from the position stack.

Screenshots

This animation illustrates how positions are pushed onto the stack with postrace-push (bound to C-c p p in the sample) and how the position stack is browsed with postrace-browse (bound to C-c p b in the sample).

Code browsing animation

While in "browse mode", RETURN brings you to the position under cursor.

Code browsing animation

You can rearrange stack items in "browse mode" with M-<up>/M-<down>:

Code browsing animation

You can delete stack items in "browse mode" with <delete>:

Code browsing animation

Install

  • From MELPA (or MELPA stable) via:

      (require 'package)
      (add-to-list 'package-archives
                   '("melpa" . "https://melpa.org/packages/"))
    

    Then issue:

      M-x package-refresh-contents
      M-x package-install RET postrace
    
  • Via use-package (note: also sets keybindings):

      (use-package postrace
        :ensure t
        :bind (("C-c p p" . postrace-push)
               ("C-c p b" . postrace-browse)))
    
  • By adding postrace.el to your ~/.emacs.d/lisp/:

      (add-to-list 'load-path "~/.emacs.d/lisp/")
      (require 'postrace)
    

Develop

Run tests:

make test

Start up a clean slate Emacs installation with pos-stack installed.

make emacs

This is useful to try out functions in a clean environment.

emacs-postrace's People

Contributors

petergardfjall avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.