Skip to content

thanhvg/emacs-virtual-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emacs Virtual Comments

https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg

Intro

This package allows adding virtual comments to files in buffers. These comments don’t belong to the files so they don’t. They are saved in project root or a global file which can be viewed and searched. The file name is .evc.

Demo

media/screencast.gif

Virtual comments

A virtual comment is an overlay and it is added above the line it comments on and has the same indentation. The virtual comment can be single line or multiline. Each line can have one comment.

Install

Spacemacs layer: https://github.com/thanhvg/spacemacs-eos

Melpa

https://melpa.org/packages/virtual-comment-badge.svg

(require 'virtual-comment)
(add-hook 'find-file-hook 'virtual-comment-mode)

Commands

  • virtual-comment-make: create or edit a comment at current line
  • virtual-comment-next: go to next comment in buffer
  • virtual-comment-previous: go to previous comment in buffer
  • virtual-comment-delete: remove the current comment
  • virtual-comment-paste: paste the last removed comment to current line
  • virtual-comment-realign: realign the comments if they are misplaced
  • virtual-comment-persist: manually persist project comments
  • virtual-comment-show: show all comments of current project in a derived mode

from outline-mode, press enter on a comment will call virtual-comment-go to go to the location of comment. C-c C-d (virtual-comment-show-delete-display-unit-at-point) will delete that comemt.

There are no default bindings at all for these commands.

Remarks

  • It’s very hard to manage overlays. So this mode should be use in a sensible way. Only comments of files can be persisted.

Changes

0.5

  • won’t create .evc if there is no comment for the project
  • only save data if there is change
  • if can’t parse the .evc file copy it to .evc.error

0.4

  • a backup of current data will be made as .evc.bk when data is persisted

Test

cask install
cask exec ert-runner

Other similar packages and inspirations

https://github.com/blue0513/phantom-inline-comment https://www.emacswiki.org/emacs/InPlaceAnnotations

About

Virtual Comments for Emacs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published