branch: externals/triples
commit 0620d0f25d21af1d2d9fde69530c0e6b8eab006d
Author: Andrew Hyatt <[email protected]>
Commit: Andrew Hyatt <[email protected]>

    Fix error in `triples-backup' when called with nil argument
---
 NEWS.org   |  2 ++
 triples.el | 12 ++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 6bcdfa5d34..93a48b0d27 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,5 +1,7 @@
 TITLE: Changelog for the triples module for GNU Emacs.
 
+* 0.2.5
+- Fix bug where backing up a =nil= filename resulted in an error.
 * 0.2.4
 - Move the =CHANGELOG.org= file to =NEWS.org= so the changes show up in GNU 
ELPA.
 * 0.2.3
diff --git a/triples.el b/triples.el
index 83a7d98294..8224791823 100644
--- a/triples.el
+++ b/triples.el
@@ -118,12 +118,12 @@ exist at any time. Older backups are the ones that are 
deleted."
                   nil nil nil filename
                   (format ".backup '%s'" (expand-file-name
                                           (car (find-backup-file-name
-                                                filename))))))
-  (let ((backup-files (file-backup-file-names filename)))
-    (cl-loop for backup-file in (cl-subseq
-                                 backup-files
-                                 (min num-to-keep (length backup-files)))
-             do (delete-file backup-file))))
+                                                filename)))))
+    (let ((backup-files (file-backup-file-names filename)))
+      (cl-loop for backup-file in (cl-subseq
+                                   backup-files
+                                   (min num-to-keep (length backup-files)))
+               do (delete-file backup-file)))))
 
 (defun triples--decolon (sym)
   "Remove colon from SYM."

Reply via email to