Function: magit-insert-revision-gravatar-cb

magit-insert-revision-gravatar-cb is a byte-compiled function defined in magit-diff.el.

Signature

(magit-insert-revision-gravatar-cb IMAGE SIZE REV MARKER ALIGN-TO COLUMN)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit-insert-revision-gravatar-cb (image size rev marker align-to column)
  (cond-let
    ((eq image 'error))
    ([buffer (marker-buffer marker)]
     (with-current-buffer buffer
       (save-excursion
         (goto-char marker)
         ;; The buffer might display another revision by now or
         ;; it might have been refreshed, in which case another
         ;; process might already have inserted the image.
         (when (and (equal rev magit-buffer-revision)
                    (not (eq (car-safe
                              (car-safe
                               (get-text-property (point) 'display)))
                             'image)))
           (setf (image-property image :ascent) 'center)
           (setf (image-property image :relief) 1)
           (setf (image-property image :scale)  1)
           (setf (image-property image :height) size)
           (let ((top (list image '(slice 0.0 0.0 1.0 0.5)))
                 (bot (list image '(slice 0.0 0.5 1.0 1.0)))
                 (align `((space :align-to ,align-to))))
             (let ((inhibit-read-only t))
               (insert (propertize " " 'display top))
               (insert (propertize " " 'display align))
               (forward-line)
               (forward-char column)
               (insert (propertize " " 'display bot))
               (insert (propertize " " 'display align))))))))))