private-comments-mode
private-comment-mode is an emacs plugin for Private Comments allowing you to see and manipulate your private comments from within emacs.
A minor mode for “masukomi/private_comments“. https://github.com/masukomi/private_comments Private comments appear as overlays and are not part of the source.
Install
From Melpa
M-x package-install
Then choose private-comments-mode
From GitHub
$ git clone https://github.com/masukomi/private-comments-mode.git $ cd private-comments-mode $ make # in emacs M-x package-install-file # then give it the path to the private-comments-mode-<version>.tar file # in the dist directory
Usage
Toggle private-comments-modeM-x private-comments-mode
Add or edit a comment
C-c C-r ; or private-comments-record
Delete the 1st comment above the cursor
C-c C-d ; or private-commentns-delete
Keymap (C-h b)
key binding --- ------- C-c Prefix Command ESC Prefix Command C-c C-d private-comments-delete C-c C-r private-comments-record C-M-q prog-indent-sexp
Customizing colors
Colors are defined via the private-comments-face
. To customize the look, just override its defaults to something that works for you.
Using Emacs’ Easy Customize
The easiest way to customize the look of your private comments is to add a comment, and then run M-x list-faces-display
Search for private-comments-face
and select it. Edit the foreground and background colors and click “Apply” to test out new colors. Once you’ve got something you like, click “Apply and Save” to save it for future sessions.
Manual Customization
Choose your favorite foreground and background color combination and add it to your config as follows.
(with-eval-after-load "private-comments-mode"
(set-face-background 'private-comments-face "#527568")
(set-face-foreground 'private-comments-face "#FFFFFF"))
Troubleshooting
private-comments-apply: Failed
This error indicates that the file in question has not been committed to git. [The Private Comments system](https://github.com/masukomi/private_comments#readme) uses git commit treeishes to know which comments apply to which versions of a file. As such it can’t work on files that haven’t been committed.
Warning (private-comments): private-comments-apply: Failed (status 128) git --no-pager ls-files -z --full-name -- my_filename