X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b6bd159922608fa474026837771d63bf7eadcf97..daee954c00b30e0253fde6e2c2f3b4a5c70f2a06:/lisp/image-dired.el diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 5477d01379..3659894f08 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1,6 +1,6 @@ ;;; image-dired.el --- use dired to browse and manipulate your images ;; -;; Copyright (C) 2005-2011 Free Software Foundation, Inc. +;; Copyright (C) 2005-2012 Free Software Foundation, Inc. ;; ;; Version: 0.4.11 ;; Keywords: multimedia @@ -157,7 +157,7 @@ (require 'widget) (eval-when-compile - (require 'cl) + (require 'cl-lib) (require 'wid-edit)) (defgroup image-dired nil @@ -469,7 +469,7 @@ For more information, see the documentation for If non-nil, using `image-dired-next-line-and-display' and `image-dired-previous-line-and-display' will leave a trail of thumbnail images in the thumbnail buffer. If you enable this and want to clean -the thumbnail buffer because it is filled with too many thumbmnails, +the thumbnail buffer because it is filled with too many thumbnails, just call `image-dired-display-thumb' to display only the image at point. This value can be toggled using `image-dired-toggle-append-browsing'." :type 'boolean @@ -602,14 +602,14 @@ according to the Thumbnail Managing Standard." (md5 (file-name-as-directory (file-name-directory f))))) (format "%s%s%s.thumb.%s" (file-name-as-directory (expand-file-name (image-dired-dir))) - (file-name-sans-extension (file-name-nondirectory f)) + (file-name-base f) (if md5-hash (concat "_" md5-hash) "") (file-name-extension f)))) ((eq 'per-directory image-dired-thumbnail-storage) (let ((f (expand-file-name file))) (format "%s.image-dired/%s.thumb.%s" (file-name-directory f) - (file-name-sans-extension (file-name-nondirectory f)) + (file-name-base f) (file-name-extension f)))))) (defun image-dired-create-thumb (original-file thumbnail-file) @@ -653,21 +653,24 @@ previous -ARG, if ARG<0) files." (image-file (dired-get-filename nil t)) thumb-file overlay) - (when (and image-file (string-match-p (image-file-name-regexp) image-file)) + (when (and image-file + (string-match-p (image-file-name-regexp) image-file)) (setq thumb-file (image-dired-get-thumbnail-image image-file)) ;; If image is not already added, then add it. (let ((cur-ov (overlays-in (point) (1+ (point))))) (if cur-ov (delete-overlay (car cur-ov)) (put-image thumb-file image-pos) - (setq overlay (loop for o in (overlays-in (point) (1+ (point))) - when (overlay-get o 'put-image) collect o into ov - finally return (car ov))) + (setq overlay + (cl-loop for o in (overlays-in (point) (1+ (point))) + when (overlay-get o 'put-image) collect o into ov + finally return (car ov))) (overlay-put overlay 'image-file image-file) (overlay-put overlay 'thumb-file thumb-file))))) arg ; Show or hide image on ARG next files. 'show-progress) ; Update dired display after each image is updated. - (add-hook 'dired-after-readin-hook 'image-dired-dired-after-readin-hook nil t)) + (add-hook 'dired-after-readin-hook + 'image-dired-dired-after-readin-hook nil t)) (defun image-dired-dired-after-readin-hook () "Relocate existing thumbnail overlays in dired buffer after reverting. @@ -782,13 +785,12 @@ calling `image-dired-restore-window-configuration'." (dired dir) (delete-other-windows) (when (not arg) - (split-window-horizontally) + (split-window-right) (setq truncate-lines t) (save-excursion (other-window 1) (switch-to-buffer buf) - (split-window-vertically) - (other-window 1) + (select-window (split-window-below)) (switch-to-buffer buf2) (other-window -2))))) @@ -1606,7 +1608,7 @@ With prefix argument ARG, create thumbnails even if they already exist (setq thumb-name (image-dired-thumb-name curr-file)) ;; If the user overrides the exist check, we must clear the ;; image cache so that if the user wants to display the - ;; thumnail, it is not fetched from cache. + ;; thumbnail, it is not fetched from cache. (if arg (clear-image-cache)) (if (or (not (file-exists-p thumb-name)) @@ -2044,7 +2046,7 @@ function. The result is a couple of new files in files))) (defun image-dired-display-next-thumbnail-original () - "In thubnail buffer, move to next thumbnail and display the image." + "In thumbnail buffer, move to next thumbnail and display the image." (interactive) (image-dired-forward-image) (image-dired-display-thumbnail-original-image))