Skip to content

Commit

Permalink
annotate: make variable names more explicit
Browse files Browse the repository at this point in the history
annotate: make variable names more explicit
  • Loading branch information
jdtsmith committed Apr 23, 2024
1 parent 1f2a81c commit 3e2e13a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions activities.el
Original file line number Diff line number Diff line change
Expand Up @@ -873,15 +873,15 @@ OLDEST-POSSIBLE is the oldest age in the `vc-annotate-color-map'."
(setf (alist-get type data)
(list (length (delq nil files))
(and time (float-time (time-since time))) buffers)))))
(pcase-let* ((`(,last-file-cnt ,last-age ,last-bufs) (map-elt data 'last))
(`(,default-file-cnt ,default-age ,default-bufs) (map-elt data 'default))
(pcase-let* ((`(,num-last-files ,last-age ,last-buffers) (map-elt data 'last))
(`(,num-default-files ,default-age ,default-buffers) (map-elt data 'default))
(age (if last-age (min last-age default-age) default-age))
(buf-cnt (length (or last-bufs default-bufs)))
(file-cnt (or last-file-cnt default-file-cnt))
(dirty (and last-bufs
(or (/= (length last-bufs) (length default-bufs))
(not (seq-set-equal-p last-bufs default-bufs)))))
(ann (format "%s bufs %s files "
(buf-cnt (length (or last-buffers default-buffers)))
(file-cnt (or num-last-files num-default-files))
(dirtyp (when last-buffers
(or (/= (length last-buffers) (length default-buffers))
(not (seq-set-equal-p last-buffers default-buffers)))))
(annotation (format "%s bufs %s files "
(propertize (format "%2d" buf-cnt) 'face 'success)
(propertize (format "%2d" file-cnt) 'face 'warning)))
(age-color (or (cdr (vc-annotate-compcar
Expand All @@ -892,11 +892,11 @@ OLDEST-POSSIBLE is the oldest age in the `vc-annotate-color-map'."
(format "%15s" (apply #'format "[%d %s]" (activities--age age)))
'face `( :foreground ,age-color
:background ,vc-annotate-background)))
(dirty-ann (propertize (if dirty "*" " ") 'face 'bold)))
(dirty-ann (propertize (if dirtyp "*" " ") 'face 'bold)))
(concat (propertize " " 'display
`( space :align-to
(- right ,(+ (length ann) (length age-ann) 1))))
ann age-ann dirty-ann))))))
(- right ,(+ (length annotation) (length age-ann) 1))))
annotation age-ann dirty-ann))))))

(cl-defun activities-completing-read
(&key (activities activities-activities)
Expand Down

0 comments on commit 3e2e13a

Please sign in to comment.