diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-10 07:51:54 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-10 07:51:54 -0400 |
commit | f58e0fd503567288bb30e243595acaa589034929 (patch) | |
tree | e40cb0a5c087c0af4bdd41948d655358b0fcd56e /lisp/doc-view.el | |
parent | dfa96edd13d1db4a90fa0977d06b6bdeab2f642e (diff) | |
download | emacs-f58e0fd503567288bb30e243595acaa589034929.tar.gz |
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
Diffstat (limited to 'lisp/doc-view.el')
-rw-r--r-- | lisp/doc-view.el | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index f526825b0bd..72b36feb1d8 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -133,7 +133,7 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) (require 'dired) (require 'image-mode) (require 'jka-compr) @@ -259,9 +259,9 @@ of the page moves to the previous page." (setq ol nil)) (if ol (progn - (assert (eq (overlay-buffer ol) (current-buffer))) + (cl-assert (eq (overlay-buffer ol) (current-buffer))) (setq ol (copy-overlay ol))) - (assert (not (get-char-property (point-min) 'display))) + (cl-assert (not (get-char-property (point-min) 'display))) (setq ol (make-overlay (point-min) (point-max) nil t)) (overlay-put ol 'doc-view t)) (overlay-put ol 'window (car winprops)) @@ -892,30 +892,30 @@ Start by converting PAGES, and then the rest." (defun doc-view-doc->txt (txt callback) "Convert the current document to text and call CALLBACK when done." (make-directory (doc-view-current-cache-dir) t) - (case doc-view-doc-type - (pdf + (pcase doc-view-doc-type + (`pdf ;; Doc is a PDF, so convert it to TXT (doc-view-pdf->txt doc-view-buffer-file-name txt callback)) - (ps + (`ps ;; Doc is a PS, so convert it to PDF (which will be converted to ;; TXT thereafter). (let ((pdf (expand-file-name "doc.pdf" (doc-view-current-cache-dir)))) (doc-view-ps->pdf doc-view-buffer-file-name pdf (lambda () (doc-view-pdf->txt pdf txt callback))))) - (dvi + (`dvi ;; Doc is a DVI. This means that a doc.pdf already exists in its ;; cache subdirectory. (doc-view-pdf->txt (expand-file-name "doc.pdf" (doc-view-current-cache-dir)) txt callback)) - (odf + (`odf ;; Doc is some ODF (or MS Office) doc. This means that a doc.pdf ;; already exists in its cache subdirectory. (doc-view-pdf->txt (expand-file-name "doc.pdf" (doc-view-current-cache-dir)) txt callback)) - (t (error "DocView doesn't know what to do")))) + (_ (error "DocView doesn't know what to do")))) (defun doc-view-ps->pdf (ps pdf callback) "Convert PS to PDF asynchronously and call CALLBACK when finished." @@ -950,14 +950,14 @@ Those files are saved in the directory given by the function (let ((png-file (expand-file-name "page-%d.png" (doc-view-current-cache-dir)))) (make-directory (doc-view-current-cache-dir) t) - (case doc-view-doc-type - (dvi + (pcase doc-view-doc-type + (`dvi ;; DVI files have to be converted to PDF before Ghostscript can process ;; it. (let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir))) (doc-view-dvi->pdf doc-view-buffer-file-name pdf (lambda () (doc-view-pdf/ps->png pdf png-file))))) - (odf + (`odf ;; ODF files have to be converted to PDF before Ghostscript can ;; process it. (let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir)) @@ -973,11 +973,11 @@ Those files are saved in the directory given by the function ;; Rename to doc.pdf (rename-file opdf pdf) (doc-view-pdf/ps->png pdf png-file))))) - (pdf + (`pdf (let ((pages (doc-view-active-pages))) ;; Convert PDF to PNG images starting with the active pages. (doc-view-pdf->png doc-view-buffer-file-name png-file pages))) - (t + (_ ;; Convert to PNG images. (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) @@ -1103,7 +1103,7 @@ have the page we want to view." (and (not (member pagefile prev-pages)) (member pagefile doc-view-current-files))) (with-selected-window win - (assert (eq (current-buffer) buffer)) + (cl-assert (eq (current-buffer) buffer)) (doc-view-goto-page page)))))))) (defun doc-view-buffer-message () |