Skip to content

Commit

Permalink
Update readme, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Artawower committed Dec 1, 2021
1 parent c8f6b31 commit 7d098a4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
25 changes: 23 additions & 2 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@ If line has length more then this value, text will be truncated
**** Prefer blamer face
If you want to disable automatic background detection you can always use blamer face
=(setq blamer-smart-background-p nil)=
**** Tooltip
You can turn on a tooltip when hovering over a commit, by settings =blamer-tooltip-function=
This variably can apply default functions
=(setq blamer-tooltip-function 'blamer-tooltip-keybindings)= - will show keybindings for current commit message
=(setq blamer-tooltip-function 'blamer-tooltip-commit-message)= - show commit message about current line
(it could be helpfull when blamer-commit-formatter is empty)
=(setq blamer-tooltip-function 'blamer-tooltip-author-info)= - show information about author
Also you can write own function with first argumens as =commit-info= plist, or set this variable to null, that mean tooltip is disabled

For example, you can write function for showing commit datetime inside tooltip:
#+BEGIN_SRC emacs-lisp
(defun my-blamer-tooltip-func (commit-info)
(let ((commit-date (plist-get commit-info :commit-date))
(commit-time (plist-get commit-info :commit-time)))
(message "%s" commit-info)
(format "%s - %s" commit-date commit-time)))

(setq blamer-tooltip-function 'my-blamer-tooltip-func
#+END_SRC



* Interactive binding
You can bind the mouse click event and pass custom handler. Where the handler is callback function with commit-info arg.
Expand Down Expand Up @@ -163,7 +184,7 @@ Run before push
emacs -batch -l ert -l blamer.el -l test.el -f ert-run-tests-batch-and-exit
#+END_SRC

* TODO Blamer.el plans [15/16]
* TODO Blamer.el plans [16/16]
- [X] Get necessary information about current line under cursor
- [X] Get commit info by current hash (if necessary)
- [X] Get background color if hl-mode is exist and enabled (transparency)
Expand All @@ -179,4 +200,4 @@ emacs -batch -l ert -l blamer.el -l test.el -f ert-run-tests-batch-and-exit
- [X] Add support for global mode
- [X] Add support for multi line selection
- [X] Canonical blamer format + templates.
- [ ] Clickable annotations
- [X] Clickable annotations
8 changes: 3 additions & 5 deletions blamer.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Artur Yaroshenko <[email protected]>
;; URL: https://github.com/artawower/blamer.el
;; Package-Requires: ((emacs "27.1") (a "1.0.0"))
;; Version: 0.3.3
;; Version: 0.3.4

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -366,11 +366,9 @@ Return nil if error."
raw-commit-author))
(commit-date (match-string 3 blame-msg))
(commit-time (match-string 4 blame-msg))
(commit-messages (when blamer-commit-formatter
(blamer--get-commit-message commit-hash)))
(commit-message (nth 0 commit-messages))
(commit-messages (blamer--get-commit-message commit-hash))
(commit-message (when blamer-commit-formatter (nth 0 commit-messages)))
(raw-commit-message (nth 1 commit-messages))

(parsed-commit-info `(:commit-hash ,commit-hash
:commit-author ,commit-author
:commit-date ,commit-date
Expand Down

0 comments on commit 7d098a4

Please sign in to comment.