Mercurial > emacs
comparison lisp/doc-view.el @ 87006:a15ce3ca213a
(doc-view-initiate-display): Use `doc-view-mode-p'.
(doc-view-current-overlay, doc-view-pending-cache-flush): Add doc
string.
author | Reiner Steib <Reiner.Steib@gmx.de> |
---|---|
date | Mon, 03 Dec 2007 07:24:34 +0000 |
parents | 6934c0956614 |
children | a99e0ba48aeb |
comparison
equal
deleted
inserted
replaced
87005:ce6a9097341e | 87006:a15ce3ca213a |
---|---|
232 (defvar doc-view-current-search-matches nil | 232 (defvar doc-view-current-search-matches nil |
233 "Only used internally.") | 233 "Only used internally.") |
234 | 234 |
235 (defvar doc-view-current-image nil | 235 (defvar doc-view-current-image nil |
236 "Only used internally.") | 236 "Only used internally.") |
237 (defvar doc-view-current-overlay) | 237 |
238 (defvar doc-view-pending-cache-flush nil) | 238 (defvar doc-view-current-overlay nil |
239 "Only used internally.") | |
240 | |
241 (defvar doc-view-pending-cache-flush nil | |
242 "Only used internally.") | |
239 | 243 |
240 (defvar doc-view-current-info nil | 244 (defvar doc-view-current-info nil |
241 "Only used internally.") | 245 "Only used internally.") |
242 | 246 |
243 (defvar doc-view-previous-major-mode nil | 247 (defvar doc-view-previous-major-mode nil |
885 | 889 |
886 ;; (put 'doc-view-mode 'mode-class 'special) | 890 ;; (put 'doc-view-mode 'mode-class 'special) |
887 | 891 |
888 (defun doc-view-initiate-display () | 892 (defun doc-view-initiate-display () |
889 ;; Switch to image display if possible | 893 ;; Switch to image display if possible |
890 (if (and (display-images-p) | 894 (if (doc-view-mode-p (intern (file-name-extension buffer-file-name))) |
891 (image-type-available-p 'png)) | |
892 (progn | 895 (progn |
893 (doc-view-buffer-message) | 896 (doc-view-buffer-message) |
894 (setq doc-view-current-page (or doc-view-current-page 1)) | 897 (setq doc-view-current-page (or doc-view-current-page 1)) |
895 (if (file-exists-p (doc-view-current-cache-dir)) | 898 (if (file-exists-p (doc-view-current-cache-dir)) |
896 (progn | 899 (progn |
903 (concat "Type \\[doc-view-toggle-display] to toggle between " | 906 (concat "Type \\[doc-view-toggle-display] to toggle between " |
904 "editing or viewing the document.")))) | 907 "editing or viewing the document.")))) |
905 (message | 908 (message |
906 "%s" | 909 "%s" |
907 (substitute-command-keys | 910 (substitute-command-keys |
908 (concat "No image (png) support available. Type \\[doc-view-toggle-display] " | 911 (concat "No image (png) support available or some conversion utility for " |
909 "to switch to an editing mode."))))) | 912 (file-name-extension buffer-file-name)" files is missing. " |
913 "Type \\[doc-view-toggle-display] to switch to an editing mode."))))) | |
910 | 914 |
911 ;;;###autoload | 915 ;;;###autoload |
912 (defun doc-view-mode () | 916 (defun doc-view-mode () |
913 "Major mode in DocView buffers. | 917 "Major mode in DocView buffers. |
914 You can use \\<doc-view-mode-map>\\[doc-view-toggle-display] to | 918 You can use \\<doc-view-mode-map>\\[doc-view-toggle-display] to |