                    (terpri)
                    (princ (symbol-name (car package)))
                    (princ (if (cdr package) " (update)" " (install)"))))
-               (if (y-or-n-p "Auto install/update these package?")
+               (if (or auto-update
+                       (y-or-n-p "Auto install/update these package?"))
                    (progn (package-download-transaction (package-compute-transaction () install-list))
                           (kill-buffer "*packup: packages to upgrade*")
                           (message "Dependency installation completed."))

    (pop-to-buffer-same-window buffer)))

;;;###autoload
(defun kotct/packup-install-dependencies (no-refresh &optional update)
  "Installs the dependencies.
With a non-nil or prefix arg NO-REFRESH, do not refresh package list.
If UPDATE is non-nil, out-of-date packages will be updated."
  (interactive "P")

  (unless no-refresh (package-refresh-contents))

    (save-excursion (funcall function))
    (forward-line)))

(defun kotct/packup-marker-regexp ()
  (concat "^\\[" (regexp-quote (char-to-string kotct/packup-marker-char)) "\\]"))

(defmacro kotct/packup-map-over-marks (body)
  "Call BODY on each marked line in current buffer."
  `(prog1
       (let ((inhibit-read-only t) case-fold-search found results)
         (let ((regexp (kotct/packup-marker-regexp)) next-position)
           (save-excursion
             (goto-char (point-min))
             ;; remember position of next marked package before BODY
             ;; can insert lines before the just found package,
             ;; confusing us by finding the same marked package again
             ;; and again and...
             (setq next-position (and (re-search-forward regexp nil t)
                                      (point-marker))
                   found (not (null next-position)))
             (while next-position
               (goto-char next-position)
               (setq results (cons ,body results))
               (message "hi")
               ;; move after last match
               (goto-char next-position)
               (forward-line 1)
               (set-marker next-position nil)
               (setq next-position (and (re-search-forward regexp nil t)
                                        (point-marker))))))
         (if t
             results
           nil))))

(defun kotct/packup-get-package-name ()
    "Gets package name on current line.
Returns \"\" if there is no package name on the line."
    (save-excursion
      (beginning-of-line)
      (let (p)
           (forward-char 4)
           (setq p (point-marker))
           (if (re-search-forward " " nil t)
               (prog2
                   (backward-char)
                   (buffer-substring p (point-marker))
                   )
             ""))))

(defun kotct/packup-do-update ()
  "Executes update in current buffer."
  (interactive)
  (let ((inhibit-read-only t))
    (save-excursion
      (goto-char (point-min))
      (let ((kotct/dependency-list (kotct/packup-map-over-marks (intern (kotct/packup-get-package-name)))))
        (kotct/packup-install-dependencies nil t t))))
  (kotct/packup-refresh))

(defun kotct/packup-mark (arg &optional interactive)
  "Mark the package for update at point in the Packup buffer.
