Browse Source

where am i ?

jordyn 2 năm trước cách đây
mục cha
commit
c1150f3119
1 tập tin đã thay đổi với 19 bổ sung2 xóa
  1. 19 2
      photogal.el

+ 19 - 2
photogal.el

@@ -1,6 +1,6 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;    PHOTOGAL    ;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;    PHOTOGAL    ;;;;;;;;;;;;;;;;;;;;;`;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; v1.0 ;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;                                                         ;;
@@ -222,11 +222,12 @@ for all tags defined -- one function per tag."
 
 ;;;;  --  ----  --  -       U I         -  --  ----  --  ;;;;
 (defun photogal-init (photo-file-path &optional show-filepath)
-  "Set everything up in the buffer."
+    "Set everything up in the buffer."
   (let ((buf (get-buffer-create "photogal")))
     (with-current-buffer buf
       (photogal-mode)
       (erase-buffer)
+      (photogal-index-tracker)
       (insert "\n")
       (insert " ")
       (insert-image
@@ -278,6 +279,22 @@ for all tags defined -- one function per tag."
   (interactive)
   (photogal-refresh-buffer t))
 
+(defun photogal-index-tracker ()
+  ;; this is a little expensive, running photogal-all-photos
+  ;; on every paint, but i'd like to have the file count
+  ;; be very accurate.
+  (let ((current-index
+	 (+ 1 (seq-position
+	       (photogal-all-photos *photogal/photos-origin-directory*)
+	       (photogal-current-file))))
+	(total-photos
+	 (length (photogal-all-photos *photogal/photos-origin-directory*))))
+    (insert "ur lookin at photo ")
+    (photogal--insert-print-color current-index "red")
+    (insert " of ")
+    (photogal--insert-print-color total-photos "red")))
+
+
 ;;;;  --  ----  --  - LO-LEVEL DISPLAY  -  --  ----  --  ;;;;
 ;; this stuff paints the words on the screen, changing     ;;
 ;; color, etc, pprinting stuff at a pretty granular and    ;;