* lisp/files.el (auto-mode-alist): Use doc-view for djvu files.

* lisp/doc-view.el (doc-view-document->bitmap):
Use doc-view-single-page-converter-function instead of
single-page-converter arg; adjust callers.

Fixes: debbugs:13164
This commit is contained in:
Elias Pipping 2013-01-10 10:50:04 -05:00 committed by Stefan Monnier
parent e6ed8f0846
commit 72781fefa6
3 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2013-01-10 Elias Pipping <pipping@exherbo.org>
* files.el (auto-mode-alist): Use doc-view for djvu files (bug#13164).
* doc-view.el (doc-view-document->bitmap):
Use doc-view-single-page-converter-function instead of
single-page-converter arg; adjust callers.
2013-01-10 Feng Li <fengli@gmail.com> (tiny change) 2013-01-10 Feng Li <fengli@gmail.com> (tiny change)
* progmodes/which-func.el (which-function): Understand Semantic's use * progmodes/which-func.el (which-function): Understand Semantic's use

View file

@ -942,7 +942,7 @@ is named like ODF with the extension turned to pdf."
(declare-function clear-image-cache "image.c" (&optional filter)) (declare-function clear-image-cache "image.c" (&optional filter))
(defun doc-view-document->bitmap (pdf png pages single-page-converter) (defun doc-view-document->bitmap (pdf png pages)
"Convert a document file to bitmap images asynchronously. "Convert a document file to bitmap images asynchronously.
Start by converting PAGES, and then the rest." Start by converting PAGES, and then the rest."
(if (null pages) (if (null pages)
@ -952,7 +952,7 @@ Start by converting PAGES, and then the rest."
;; a single page anyway, and of the remaining 1%, few cases will have ;; a single page anyway, and of the remaining 1%, few cases will have
;; consecutive pages, it's not worth the trouble. ;; consecutive pages, it's not worth the trouble.
(let ((rest (cdr pages))) (let ((rest (cdr pages)))
(funcall single-page-converter (funcall doc-view-single-page-converter-function
pdf (format png (car pages)) (car pages) pdf (format png (car pages)) (car pages)
(lambda () (lambda ()
(if rest (if rest
@ -1066,8 +1066,7 @@ Those files are saved in the directory given by the function
((or `pdf `djvu) ((or `pdf `djvu)
(let ((pages (doc-view-active-pages))) (let ((pages (doc-view-active-pages)))
;; Convert doc to bitmap images starting with the active pages. ;; Convert doc to bitmap images starting with the active pages.
(doc-view-document->bitmap doc-view-buffer-file-name png-file pages (doc-view-document->bitmap doc-view-buffer-file-name png-file pages)))
doc-view-single-page-converter-function)))
(_ (_
;; Convert to PNG images. ;; Convert to PNG images.
(doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) (doc-view-pdf/ps->png doc-view-buffer-file-name png-file)))))

View file

@ -2357,7 +2357,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode)
("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG
("\\.[eE]?[pP][sS]\\'" . ps-mode) ("\\.[eE]?[pP][sS]\\'" . ps-mode)
("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode)
("BROWSE\\'" . ebrowse-tree-mode) ("BROWSE\\'" . ebrowse-tree-mode)