X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/f99f7826a0303f7a40864571be7cbf84f3d4ee62..be94d7130041927a372f21bb2afeddafb4f92e5c:/lisp/doc-view.el diff --git a/lisp/doc-view.el b/lisp/doc-view.el index e4434c3a0d..589a57b64c 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -136,7 +136,7 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (require 'dired) (require 'image-mode) (require 'jka-compr) @@ -698,14 +698,6 @@ It's a subdirectory of `doc-view-cache-directory'." (md5 (current-buffer))))) doc-view-cache-directory))))) -(defun doc-view-remove-if (predicate list) - "Return LIST with all items removed that satisfy PREDICATE." - (let (new-list) - (dolist (item list) - (when (not (funcall predicate item)) - (setq new-list (cons item new-list)))) - (nreverse new-list))) - ;;;###autoload (defun doc-view-mode-p (type) "Return non-nil if document type TYPE is available for `doc-view'. @@ -1270,7 +1262,7 @@ ARGS is a list of image descriptors." (car (image-size image 'pixels))) img-width) img-width)) - (window-width (window-width (selected-window)))) + (window-width (window-width))) (setf (doc-view-current-image) image) (move-overlay ol (point-min) (point-max)) ;; In case the window is wider than the image, center the image @@ -1488,7 +1480,7 @@ If BACKWARD is non-nil, jump to the previous match." (defun doc-view-search-next-match (arg) "Go to the ARGth next matching page." (interactive "p") - (let* ((next-pages (doc-view-remove-if + (let* ((next-pages (cl-remove-if (lambda (i) (<= (car i) (doc-view-current-page))) doc-view--current-search-matches)) (page (car (nth (1- arg) next-pages)))) @@ -1502,7 +1494,7 @@ If BACKWARD is non-nil, jump to the previous match." (defun doc-view-search-previous-match (arg) "Go to the ARGth previous matching page." (interactive "p") - (let* ((prev-pages (doc-view-remove-if + (let* ((prev-pages (cl-remove-if (lambda (i) (>= (car i) (doc-view-current-page))) doc-view--current-search-matches)) (page (car (nth (1- arg) (nreverse prev-pages)))))