Giter Site home page Giter Site logo

history's Introduction

MELPA MELPA Stable TRAVIS-CI

history.el - History Utility For Code Navigation

This tool is similar to pop-global-mark but more powerful. You can go through the whole history without losing them. Actually, pop-global-mark will use the latest record but also discard it. But this tool will preserve all the history and smartly ignore killed buffers or invalid symbol string.

You'll feel the power and convenience of using history-add-history, history-prev-history and history-next-history instead of built-in old way.

Demo

history screenshot

Basic Concept - Linked List Liked

  • Normal history database:
  (1) - (2) - (3) - (4) - (5)
                           ^ index
  • Goto previous Nth history:
  (1) - (2) - (3) - (4) - (5)
               ^ index
  • Add a new history into the database:
  (1) - (2) - (3) - (new)
                      ^ index
histories behind index will be discard,
and new one will be appended to the end.

Usage - First Step, Enable history-mode

history screenshot history screenshot

  • (history-add-history) Save current point and buffer as a history into the database.

  • (history-add-history t) Like above, but also save symbol string at point. When navigating to the history, the tool compare the matched string so that it makes sure the history is VALID.

  • M-x history-prev-history Goto previous history.

  • M-x history-next-history Goto new history.

  • M-x history-kill-histories Discard whole history database.

  • M-x history-goto-history Enter history preview mode. ENTER to confirm to use the selected history. ESC to cancel preview and restore everything.

history screenshot

Advanced Usage

  • Configure history-advised-before-functions and history-advised-after-functions to add history automatically for you.

Example:

;; Add history just before `find-tag' executed.
(add-to-list 'history-advised-before-functions 'find-tag-noselect t)

;; Add history just before `find-file' executed.
(add-to-list 'history-advised-before-functions 'find-file-noselect t)

Advise primitive functions might cause infinite loop, strongly suggest you NOT to advise them.

Customization

  • history-history-max The maximum length of the history database.

  • history-ignore-buffer-names A REGEXP list to ignore specific buffers.

  • history-window-local-history To toggle using window-local or global history. Window-local history means every window has its independent history database.

history screenshot

  • history-advised-before-functions and history-advised-after-functions, a functions list to be advised to call history-add-history.

history screenshot

Contribution

Forks and pull requests are welcome!

history's People

Contributors

emacs18 avatar mrbliss avatar tcw165 avatar

Watchers

 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.