From: Mark Oteiza Date: Tue, 13 Dec 2016 16:47:21 +0000 (-0500) Subject: More small fixes for image-dired X-Git-Tag: emacs-26.0.90~1111 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aacb20c0b73dc34e53c268e39131332d779cfe35;p=emacs.git More small fixes for image-dired * lisp/image-dired.el: Fix commentary to refer to correct Emacs manual node. (image-dired--with-db-file): Add declare forms. (image-dired-hidden-p): Rewrite with cl-loop. It's not necessary to run through the whole list. --- diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 30705f841e7..c5fcadc5b00 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -79,7 +79,7 @@ ;; ;; This information has been moved to the manual. Type `C-h r' to open ;; the Emacs manual and go to the node Thumbnails by typing `g -;; Thumbnails RET'. +;; Image-Dired RET'. ;; ;; Quickstart: M-x image-dired RET DIRNAME RET ;; @@ -516,6 +516,7 @@ before warning the user." (defmacro image-dired--with-db-file (&rest body) "Run BODY in a temp buffer containing `image-dired-db-file'. Return the last form in BODY." + (declare (indent 0) (debug t)) `(with-temp-buffer (if (file-exists-p image-dired-db-file) (insert-file-contents image-dired-db-file)) @@ -2238,13 +2239,8 @@ image-dired-file-comment-list: (defun image-dired-hidden-p (file) "Return t if image FILE has a \"hidden\" tag." - (let (hidden) - (mapc - (lambda (tag) - (if (member tag image-dired-gallery-hidden-tags) - (setq hidden t))) - (cdr (assoc file image-dired-file-tag-list))) - hidden)) + (cl-loop for tag in (cdr (assoc file image-dired-file-tag-list)) + if (member tag image-dired-gallery-hidden-tags) return t)) (defun image-dired-gallery-generate () "Generate gallery pages.