branch: elpa/annotate
commit 9c80b465297dce20901abaf0389a48951b6e030f
Merge: 5dbf119fd61 4e610f56ae5
Author: cage2 <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #176 from cage2/master
    
    removed expansion of file paths when deserializing annotations records
---
 Changelog   | 14 ++++++++++++++
 Eask        |  2 +-
 NEWS.org    |  4 ++++
 annotate.el | 50 ++++++++++++++++++++++----------------------------
 4 files changed, 41 insertions(+), 29 deletions(-)

diff --git a/Changelog b/Changelog
index 03e399391a9..31bb9cf8c8a 100644
--- a/Changelog
+++ b/Changelog
@@ -1,9 +1,23 @@
+2025-11-11 cage
+
+       * annotate.el:
+
+       - removed expansion of file paths when deserializing annotations
+       records;
+       - moved to local function code for record's deserialization.
+
 2025-11-02 cage
 
+       * Changelog,
+       * Eask,
+       * NEWS.org,
        * annotate.el:
 
        - changed (in function 'annotate-file-exists-p') 'ignore-errors' with:
        'with-demoted-errors', to convert errors to message.
+       - increased version number;
+       - updated NEWS and Changelog files.
+       Merge pull request #175 from cage2/master
 
 2025-11-01 cage
 
diff --git a/Eask b/Eask
index f81bf470e72..df37264dfde 100644
--- a/Eask
+++ b/Eask
@@ -1,7 +1,7 @@
 ;; -*- mode: eask; lexical-binding: t -*-
 
 (package "annotate"
-         "2.4.4"
+         "2.4.5"
          "annotate files without changing them")
 
 (website-url "https://github.com/bastibe/annotate.el";)
diff --git a/NEWS.org b/NEWS.org
index 1c2931032f7..36e984ba872 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,7 @@
+- 2025-11-11 v2.4.5 cage ::
+
+  This version fixes a bug that prevented correct loading of the annotations 
database.
+
 - 2025-11-02 v2.4.4 cage ::
 
   This version informs the user when an error occurred while checking the 
existence of an annotated file.
diff --git a/annotate.el b/annotate.el
index 152b3691637..8c331133cde 100644
--- a/annotate.el
+++ b/annotate.el
@@ -7,7 +7,7 @@
 ;; Maintainer: Bastian Bechtold <[email protected]>, cage 
<[email protected]>
 ;; URL: https://github.com/bastibe/annotate.el
 ;; Created: 2015-06-10
-;; Version: 2.4.4
+;; Version: 2.4.5
 ;; Package-Requires: ((emacs "27.1"))
 
 ;; This file is NOT part of GNU Emacs.
@@ -59,7 +59,7 @@
 ;;;###autoload
 (defgroup annotate nil
   "Annotate files without changing them."
-  :version "2.4.4"
+  :version "2.4.5"
   :group 'text)
 
 (defvar annotate-mode-map
@@ -1958,34 +1958,28 @@ annotation."
   (let ((db (annotate-db-clean-records (annotate-load-annotation-data t))))
     (annotate-dump-annotation-data db)))
 
-(defun annotate--expand-record-path (record)
-  "Expand file component of RECORD."
-  (let* ((short-filename  (annotate-filename-from-dump    record))
-         (annotations     (annotate-annotations-from-dump record))
-         (file-checksum   (annotate-checksum-from-dump    record))
-         (expandp         (not (or (file-remote-p short-filename)
-                                   (annotate-info-root-dir-p short-filename))))
-         (actual-filename (if expandp
-                              (expand-file-name short-filename)
-                            short-filename)))
-    (annotate-make-record actual-filename
-                          annotations
-                          file-checksum)))
-
 (defun annotate--deserialize-database-file (file)
   "Return a sexp from the annotation database contained in FILE."
-  (with-temp-buffer
-    (let* ((annotations-file file)
-           (attributes       (file-attributes annotations-file)))
-      (cond
-       ((not (annotate-file-exists-p annotations-file))
-        (signal 'annotate-db-file-not-found (list annotations-file)))
-       ((= (file-attribute-size attributes)
-           0)
-        nil)
-       (t
-        (insert-file-contents annotations-file)
-        (mapcar #'annotate--expand-record-path (read (current-buffer))))))))
+  (cl-flet ((deserialize-record (record)
+              "deserialize `RECORD' form its sexp form."
+              (let* ((filename  (annotate-filename-from-dump    record))
+                     (annotations     (annotate-annotations-from-dump record))
+                     (file-checksum   (annotate-checksum-from-dump    record)))
+                (annotate-make-record filename
+                                      annotations
+                                      file-checksum))))
+    (with-temp-buffer
+      (let* ((annotations-file file)
+             (attributes       (file-attributes annotations-file)))
+        (cond
+         ((not (annotate-file-exists-p annotations-file))
+          (signal 'annotate-db-file-not-found (list annotations-file)))
+         ((= (file-attribute-size attributes)
+             0)
+          nil)
+         (t
+          (insert-file-contents annotations-file)
+          (mapcar #'deserialize-record (read (current-buffer)))))))))
 
 (defun annotate-load-annotation-data (&optional ignore-errors)
   "Read and returns saved annotations."

Reply via email to