[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate f21146ec7a 014/372: add documentation and autoloa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate f21146ec7a 014/372: add documentation and autoload cookies |
Date: |
Fri, 4 Feb 2022 16:58:15 -0500 (EST) |
branch: elpa/annotate
commit f21146ec7aed67bce845ac49e57a768502184fe2
Author: Bastian Bechtold <bb@Mr-Bigglesworth.local>
Commit: Bastian Bechtold <bb@Mr-Bigglesworth.local>
add documentation and autoload cookies
---
README.md | 10 ++++++++++
annotate.el | 35 ++++++++++++++++++++++++++++++++++-
example.png | Bin 0 -> 193352 bytes
3 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..ed835aff93
--- /dev/null
+++ b/README.md
@@ -0,0 +1,10 @@
+Annotate.el
+===========
+
+A minor mode that can add non-destructive annotations to any file. When
`annotate-mode` is active, `C-c C-a` will create, edit, or delete annotations.
+
+![screenshot](https://raw.githubusercontent.com/bastibe/annotate.el/master/example.png)
+
+With an active region, `C-c C-a` creates a new annotation for that region.
With no active region, `C-c C-a` will create an annotation for the word under
point. If point is on an annotated region, `C-c C-a` will edit that annotation
instead of creating a new one. Clearing the annotation deletes them.
+
+This package is released under the MIT license.
diff --git a/annotate.el b/annotate.el
index d1e0cfcc0b..f66600cb5f 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1,10 +1,31 @@
+;;; annotate.el --- annotate files without changing them
+;; Copyright (C) 2015 Bastian Bechtold
+
+;; Author: Bastian Bechtold
+;; Maintainer: Bastian Bechtold
+;; URL: https://github.com/bastibe/annotate.el
+;; Created: 2015-06-10
+;; Version: 0.1
+
+;; This package provides the minor mode annotate-mode, which add
+;; annotations to arbitrary files without changing the files
+;; themselves. Annotations are saved in annotate-file (~/.annotations
+;; by default).
+;;
+;; To add annotations to a file, select a region and hit C-c C-a. The
+;; region will be underlined, and the annotation will be displayed in
+;; the right margin. Annotations are saved whenever the file is saved.
+
+;;; Code:
(require 'cl)
+;;;###autoload
(defgroup annotate nil
"Annotate files without changing them."
:version 0.1
:group 'text)
+;;;###autoload
(define-minor-mode annotate-mode
"Toggle Annotate mode."
:init-value nil
@@ -17,21 +38,25 @@
(define-key annotate-mode-map (kbd "C-c C-a") 'annotate-annotate)
-(defcustom annotate-file "~/.file-annotations"
+;;;###autoload
+(defcustom annotate-file "~/.annotations"
"File where annotations are stored."
:type 'file
:group 'annotate)
+;;;###autoload
(defface annotate-highlight
'((t (:underline "coral")))
"Face for annotation highlights."
:group 'annotate)
+;;;###autoload
(defface annotate-annotation
'((t (:background "coral" :foreground "black")))
"Face for annotations."
:group 'annotate)
+;;;###autoload
(defcustom annotate-annotation-column 85
"Where annotations appear."
:type 'number
@@ -47,6 +72,7 @@
(annotate-clear-annotations)
(remove-hook 'after-save-hook 'annotate-save-annotations t))
+;;;###autoload
(defun annotate-annotate ()
"Create, modify, or delete annotation."
(interactive)
@@ -57,6 +83,7 @@
(destructuring-bind (start end) (annotate-bounds)
(annotate-create-annotation start end))))))
+;;;###autoload
(defun annotate-save-annotations ()
"Save all annotations to disk."
(interactive)
@@ -72,6 +99,7 @@
(annotate-dump-annotation-data all-annotations)
(message "Annotations saved.")))
+;;;###autoload
(defun annotate-load-annotations ()
"Load all annotations from disk."
(interactive)
@@ -99,6 +127,7 @@
(concat prefix text "\n"))))))
(message "Annotations loaded."))))
+;;;###autoload
(defun annotate-clear-annotations ()
"Clear all current annotations."
(interactive)
@@ -161,12 +190,14 @@
(t (1+ (point))))))
(defun annotate-describe-annotation (highlight)
+ "Return list that describes the overlay `highlight`."
(list
(overlay-start highlight)
(overlay-end highlight)
(overlay-get highlight 'annotation)))
(defun annotate-load-annotation-data ()
+ "Read and return saved annotations."
(with-temp-buffer
(when (file-exists-p annotate-file)
(insert-file-contents annotate-file))
@@ -176,7 +207,9 @@
(read (current-buffer))))))
(defun annotate-dump-annotation-data (data)
+ "Save `data` into annotation file."
(with-temp-file annotate-file
(prin1 data (current-buffer))))
(provide 'annotate)
+;;; annotate.el ends here
diff --git a/example.png b/example.png
new file mode 100644
index 0000000000..31cdd4812c
Binary files /dev/null and b/example.png differ
- [nongnu] elpa/annotate 4ae1d4f2a6 346/372: Merge pull request #112 from cage2/clean-style, (continued)
- [nongnu] elpa/annotate 4ae1d4f2a6 346/372: Merge pull request #112 from cage2/clean-style, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8471cdaa7c 328/372: - updated Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0e5ccfdb4e 326/372: - replaced 'if' with 'when' when no 'else' branch exists., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7871adfbd8 320/372: - skipped file left with no annotations when saving., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 42587e0623 327/372: - added checks for 'annotate-use-messages' value when trying to print a message., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d52ee5dec0 359/372: Merge pull request #113 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate de990d8adf 348/372: - added command to delete an annotation under point;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6fbd8aa985 357/372: - used variable 'annotate-annotation-confirm-deletion' when asking for deleting an annotation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 47136434a3 343/372: - cleaned up style using checkdoc;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f0e4850ef4 356/372: - updated README.org added missing reference to 'annotate-y-or-n-prompt-function'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f21146ec7a 014/372: add documentation and autoload cookies,
ELPA Syncer <=
- [nongnu] elpa/annotate d19834f627 031/372: fix compile warnings, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e04e0ebc0c 045/372: deactivate mark after creating annotation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 960b01db30 033/372: add variable for disabling minibuffer messages, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 426201f246 076/372: - update contributors according to the original author., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3a062310d0 080/372: - do not checks for fingerprints if annotations file has old format., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 22ae42cb3d 153/372: - removed wrong 'push'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cc2d32dcbb 165/372: - added a reference of project's homepage in a doc string that is used, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d10b915857 169/372: Merge pull request #56 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate fccf7a5b51 178/372: Merge branch 'master' into org-mode-fix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ca86e4a511 187/372: - removed org-mode from blacklist., ELPA Syncer, 2022/02/04