Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions annotate.el
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ of lines. The center of the region is the position of the
annotation as defined in the database."
:type 'number)

(defcustom annotate-autosave nil
"Whether annotations should be saved after each user action,
e.g. new annotation created, existing one amended or deleted."
:type 'boolean)

(defconst annotate-prop-chain-position
'position)

Expand Down Expand Up @@ -886,7 +891,9 @@ and
; with proper text
(forward-line 1)
(goto-char (annotate-end-of-line-pos))
(annotate-annotate)))))))))))))))
(annotate-annotate))))))))))))
(when annotate-autosave
(annotate-save-annotations)))))

(defun annotate-toggle-annotation-text ()
"Hide annotation's text at current cursor's point, if such annotation exists."
Expand Down Expand Up @@ -2526,7 +2533,9 @@ point)."
(let* ((delete-confirmed-p (annotate--confirm-annotation-delete)))
(when delete-confirmed-p
(annotate--delete-annotation-chain annotation)
(font-lock-flush)))))
(font-lock-flush)))
(when annotate-autosave
(annotate-save-annotations))))

(defun annotate--confirm-append-newline-at-the-end-of-buffer ()
"Prompt user for appending newline confirmation.
Expand Down