   (package-refresh-contents)
   (let ((install-list nil))
     (dolist (package kotct/dependency-list)
-      (if (or (not (package-installed-p package))
-              (not (kotct/package-up-to-date-p package)))
-          (apply 'kotct/packup-insert-package-row (list package (package-desc-version (cadr (assq package package-alist)))))))))
+      (when (or (not (package-installed-p package))
+                (not (kotct/package-up-to-date-p package)))
+        (apply #'kotct/packup-insert-package-row (list package (package-desc-version (cadr (assq package package-alist)))))))))
 
 (defun kotct/packup-initialize-buffer ()
   "Initializes the packup buffer."
   (kill-all-local-variables)
   (use-local-map packup-mode-map)
-  (setq major-mode 'packup-mode
+  (setf major-mode 'packup-mode
         mode-name "Packup"
         buffer-read-only t)
   (kotct/packup-initialize-buffer-contents))


(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))
               ;; 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)
      (forward-char 4)
      (let ((point (point-marker)))
        (if (re-search-forward " " nil t)
            (prog2
                (backward-char)
                (buffer-substring point (point-marker)))
          ""))))

(defun kotct/packup-do-update ()
  "Executes update in current buffer."

(defun kotct/packup-refresh ()
  "Refreshes packages in current buffer."
  (interactive)
  (when (eq major-mode 'packup-mode)
    (let ((inhibit-read-only t))
      (erase-buffer))
    (kotct/packup-initialize-buffer-contents)))

(defun kotct/packup-help ()
  (interactive)
  (message "g-refresh m-mark u-unmark x-execute ?-help"))

(defvar packup-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map "m" #'kotct/packup-mark)
    (define-key map "M" #'kotct/packup-mark-all)
    (define-key map "u" #'kotct/packup-unmark)
    (define-key map "U" #'kotct/packup-unmark-all)
    (define-key map "x" #'kotct/packup-do-update)
    (define-key map "g" #'kotct/packup-refresh)
    (define-key map "?" #'kotct/packup-help)
    map))

;;;###autoload
