Function: vc-git-make-stash-button

vc-git-make-stash-button is a byte-compiled function defined in vc-git.el.gz.

Signature

(vc-git-make-stash-button SHOW COUNT1 COUNT2)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-make-stash-button (show count1 count2)
  (let ((orig-text (vc-git--make-button-text show count1 count2)))
    (make-text-button
     orig-text nil
     'action
     (lambda (counts)
       (let* ((inhibit-read-only t)
              (start (next-single-property-change
                      (point-min) 'vc-git-hideable))
              (end (next-single-property-change
                    start 'vc-git-hideable))
              (state (get-text-property start 'invisible)))
         (add-text-properties
          start end
          `(invisible ,(not state)))
         (save-excursion
           (delete-region (button-start (point)) (button-end (point)))
           (insert (vc-git-make-stash-button
                    (not state) (car counts) (cdr counts))))))
     'button-data (cons count1 count2)
     'help-echo (concat "mouse-2, RET: Show/hide stashes\n" vc-git-stash-shared-help))))