Function: makefile-create-up-to-date-overview

makefile-create-up-to-date-overview is an interactive and byte-compiled function defined in make-mode.el.gz.

Signature

(makefile-create-up-to-date-overview)

Documentation

Create a buffer containing an overview of the state of all known targets.

Known targets are targets that are explicitly defined in that makefile; in other words, all targets that appear on the left hand side of a dependency in the makefile.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/make-mode.el.gz
;;; ------------------------------------------------------------
;;; Up-to-date overview buffer
;;; ------------------------------------------------------------

(defun makefile-create-up-to-date-overview ()
  "Create a buffer containing an overview of the state of all known targets.
Known targets are targets that are explicitly defined in that makefile;
in other words, all targets that appear on the left hand side of a
dependency in the makefile."
  (interactive)
  (if (y-or-n-p "Are you sure that the makefile being edited is consistent? ")
      ;;
      ;; The rest of this function operates on a temporary makefile, created by
      ;; writing the current contents of the makefile buffer.
      ;;
      (let ((saved-target-table makefile-target-table)
            (this-buffer (current-buffer))
            (makefile-up-to-date-buffer
             (get-buffer-create makefile-up-to-date-buffer-name))
            (filename (makefile-save-temporary))
            ;;
            ;; Forget the target table because it may contain picked-up filenames
            ;; that are not really targets in the current makefile.
            ;; We don't want to query these, so get a new target-table with just the
            ;; targets that can be found in the makefile buffer.
            ;; The 'old' target table will be restored later.
            ;;
            (real-targets (progn
                            (makefile-pickup-targets)
                            makefile-target-table))
            (prereqs makefile-has-prereqs))
        (unwind-protect
            (progn
              (set-buffer makefile-up-to-date-buffer)
              (setq buffer-read-only nil)
              (erase-buffer)
              (makefile-query-targets filename real-targets prereqs)
              (when (zerop (buffer-size))     ; if it did not get us anything
                (kill-buffer (current-buffer))
                (message "No overview created!"))
              (set-buffer this-buffer)
              (setq makefile-target-table saved-target-table)
              (when (get-buffer makefile-up-to-date-buffer-name)
                (pop-to-buffer (get-buffer makefile-up-to-date-buffer-name))
                (shrink-window-if-larger-than-buffer)
                (sort-lines nil (point-min) (point-max))
                (setq buffer-read-only t)))
          (ignore-errors (delete-file filename))))))