Function: image-dired-dired-with-window-configuration

image-dired-dired-with-window-configuration is an autoloaded, interactive and byte-compiled function defined in image-dired.el.gz.

Signature

(image-dired-dired-with-window-configuration DIR &optional ARG)

Documentation

Open directory DIR and create a default window configuration.

Convenience command that:

 - opens Dired in folder DIR;
 - splits windows in most useful (?) way; and
 - sets truncate-lines to t

After the command has finished, you would typically mark some image files in Dired and type M-x image-dired-display-thumbs (image-dired-display-thumbs) (image-dired-display-thumbs).

If called with prefix argument ARG, skip splitting of windows.

The current window configuration is saved and can be restored by calling image-dired-restore-window-configuration.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/image/image-dired.el.gz
;;; Starting Image-Dired

;;;###autoload
(defun image-dired-dired-with-window-configuration (dir &optional arg)
  "Open directory DIR and create a default window configuration.

Convenience command that:

 - opens Dired in folder DIR;
 - splits windows in most useful (?) way; and
 - sets `truncate-lines' to t

After the command has finished, you would typically mark some
image files in Dired and type
\\[image-dired-display-thumbs] (`image-dired-display-thumbs').

If called with prefix argument ARG, skip splitting of windows.

The current window configuration is saved and can be restored by
calling `image-dired-restore-window-configuration'."
  (interactive "DDirectory: \nP")
  (let ((buf (image-dired-create-thumbnail-buffer))
        (buf2 (get-buffer-create image-dired-display-image-buffer)))
    (setq image-dired-saved-window-configuration
          (current-window-configuration))
    (dired dir)
    (delete-other-windows)
    (when (not arg)
      (split-window-right)
      (setq truncate-lines t)
      (save-excursion
        (other-window 1)
        (pop-to-buffer-same-window buf)
        (select-window (split-window-below))
        (pop-to-buffer-same-window buf2)
        (other-window -2)))))