emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/annotate 51ae976d39 01/13: - fixed an error that was signa


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 51ae976d39 01/13: - fixed an error that was signalled when the annotated buffer was an indirect one.
Date: Fri, 16 Sep 2022 11:58:21 -0400 (EDT)

branch: elpa/annotate
commit 51ae976d39631f45c59449d540cf7ea6cb3f90c0
Author: cage <cage@invalid>
Commit: cage <cage@invalid>

    - fixed an error that was signalled when the annotated buffer was an 
indirect one.
---
 annotate.el | 41 +++++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/annotate.el b/annotate.el
index 895a3ca18c..06fbba5a9f 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1328,6 +1328,7 @@ buffer is not on info-mode"
   "Get the actual file name of the current buffer."
   (substring-no-properties (or (annotate-info-actual-filename)
                                (buffer-file-name)
+                               (buffer-file-name (buffer-base-buffer))
                                "")))
 
 (cl-defun annotate-guess-filename-for-dump (filename
@@ -1447,24 +1448,28 @@ essentially what you get from:
                                         (annotate-describe-annotations)))
         (all-annotations  (annotate-load-annotation-data t))
         (filename         (annotate-guess-filename-for-dump 
(annotate-actual-file-name))))
-    (if (assoc-string filename all-annotations)
-        (setcdr (assoc-string filename all-annotations)
-                (list file-annotations
-                      (annotate-buffer-checksum)))
-      (setq all-annotations
-            (push (list filename
-                        file-annotations
-                        (annotate-buffer-checksum))
-                  all-annotations)))
-    ;; remove duplicate entries (a user reported seeing them)
-    (dolist (entry all-annotations)
-      (delete-dups entry))
-    ;; skip files with no annotations
-    (annotate-dump-annotation-data (cl-remove-if (lambda (entry)
-                                                   (null 
(annotate-annotations-from-dump entry)))
-                                                 all-annotations))
-    (when annotate-use-messages
-      (message "Annotations saved."))))
+    (if filename
+        (progn
+          (if (assoc-string filename all-annotations)
+              (setcdr (assoc-string filename all-annotations)
+                      (list file-annotations
+                            (annotate-buffer-checksum)))
+            (setq all-annotations
+                  (push (list filename
+                              file-annotations
+                              (annotate-buffer-checksum))
+                        all-annotations)))
+          ;; remove duplicate entries (a user reported seeing them)
+          (dolist (entry all-annotations)
+            (delete-dups entry))
+          ;; skip files with no annotations
+          (annotate-dump-annotation-data (cl-remove-if (lambda (entry)
+                                                         (null 
(annotate-annotations-from-dump entry)))
+                                                       all-annotations))
+          (when annotate-use-messages
+            (message "Annotations saved.")))
+      (user-error "Annotations can not be saved: unable to find a file for 
buffer %S"
+                  (current-buffer)))))
 
 (defun annotate-load-annotation-old-format ()
   "Load all annotations from disk in old format."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]