[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 2e7c18b12a 337/372: - fixed callback for "[replac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 2e7c18b12a 337/372: - fixed callback for "[replace]" button in summary window |
Date: |
Fri, 4 Feb 2022 16:59:18 -0500 (EST) |
branch: elpa/annotate
commit 2e7c18b12a122eb2dcb6de46d1a16b1079b7697d
Author: cage <cage@invalid>
Commit: cage <cage@invalid>
- fixed callback for "[replace]" button in summary window
the callback function was neither properly saving the annotation
database nor refreshing the buffer's annotations.
---
annotate.el | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/annotate.el b/annotate.el
index 2295d2b19a..9df2f5981e 100644
--- a/annotate.el
+++ b/annotate.el
@@ -2338,6 +2338,13 @@ sophisticated way than plain text"
(with-current-buffer buffer
(goto-char (button-get button 'go-to))))))))
+(defun annotate-update-visited-buffer-maybe (filename)
+ (let ((visited-buffer (find-buffer-visiting filename)))
+ (when visited-buffer ;; a buffer is visiting the file
+ (with-current-buffer visited-buffer
+ (annotate-mode -1)
+ (annotate-mode 1)))))
+
(defun annotate-summary-delete-annotation-button-pressed (button)
"Callback for summary window fired when a 'delete' button is
pressed."
@@ -2358,20 +2365,12 @@ pressed."
(button-put annotation-button 'face '(:strike-through
t)))
(let ((replace-button (next-button (point))))
(button-put replace-button 'invisible t)))
- (read-only-mode 1)))
- ;; if the file where the deleted annotation belong to is
visited,
- ;; update the buffer
- (update-visited-buffer-maybe ()
- (let ((visited-buffer (find-buffer-visiting filename)))
- (when visited-buffer ;; a buffer is visiting the file
- (with-current-buffer visited-buffer
- (annotate-mode -1)
- (annotate-mode 1))))))
+ (read-only-mode 1))))
(redraw-summary-window)
- (update-visited-buffer-maybe))))
+ (annotate-update-visited-buffer-maybe filename))))
(defun annotate-summary-replace-annotation-button-pressed (button)
- "Callback for summary window fired when a 'replace' button is
+ "Callback for summary window fired when a 'replace' button is
pressed."
(let* ((filename (button-get button 'file))
(annotation-beginning (button-get button 'beginning))
@@ -2387,9 +2386,10 @@ pressed."
annotation-ending
new-annotation-text)))
(annotate-dump-annotation-data replaced-annotation-db)
- (annotate-show-annotation-summary query)))))
+ (annotate-update-visited-buffer-maybe filename)
+ (annotate-show-annotation-summary query nil nil)))))
-(defun annotate-show-annotation-summary (&optional arg-query cut-above-point)
+(cl-defun annotate-show-annotation-summary (&optional arg-query
cut-above-point (save-annotations t))
"Show a summary of all the annotations in a temp buffer, the
results can be filtered with a simple query language: see
`annotate-summary-filter-db'."
@@ -2503,7 +2503,8 @@ results can be filtered with a simple query language: see
(read-from-minibuffer "Query: "))
(t
".*"))))
- (annotate-save-annotations)
+ (when save-annotations
+ (annotate-save-annotations))
(let* ((filter-query (get-query))
(dump (annotate-summary-filter-db
(annotate-load-annotation-data t)
filter-query
- [nongnu] elpa/annotate 92434b63ff 323/372: - improved documentation and fixed indentation for a couple of local functions., (continued)
- [nongnu] elpa/annotate 92434b63ff 323/372: - improved documentation and fixed indentation for a couple of local functions., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a45584c53f 358/372: - removed customizable function 'annotate-y-or-n-prompt-function'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 07667d4ccb 314/372: - updated version number in top comment block., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 641daae9d0 335/372: - updated docs and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b74bade94c 345/372: - increased version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e6af7f8ef7 058/372: workaround for nil file name, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate eb01c0cfbb 077/372: - removed copyright line from README., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d2841bad65 325/372: - ensured all annotations are saved before showing summary window., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6239d033ce 355/372: - updated README.org mentioning 'annotate-y-or-n-prompt-function'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 04a5710cf6 334/372: - prevented saving a file whith an empty database;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2e7c18b12a 337/372: - fixed callback for "[replace]" button in summary window,
ELPA Syncer <=
- [nongnu] elpa/annotate 6b73ccf009 352/372: - fixed function's name., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4c3ba3a5da 331/372: - prevented calling 'annotate--remove-annotation-property' on a narrowed buffer, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3b0bc40a4f 347/372: - improved docstrings;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 46aa377cfc 370/372: - upgraded version number;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0cfad246ee 372/372: Merge pull request #120 from cage2/add-merge-db, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 401a9b4990 309/372: - removed useless argument for 'font-lock-flush'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ed0c9bc64b 184/372: - prevented annotation of text marked with a region that overlap with, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 24de0e4607 190/372: - renamed and fixed function to search for annotations relative to a, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e6fb2b31df 188/372: - fixed position to start for overlay checks in, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a81a7d9386 209/372: - updated versions;, ELPA Syncer, 2022/02/04