diff options
| author | Chong Yidong | 2008-11-30 22:57:43 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-11-30 22:57:43 +0000 |
| commit | d14202c2ce3dd0f7d8623d2bfef2400a1ed16d5f (patch) | |
| tree | b2c6fb0670434eb736f1703eaed60cacc4d311f5 | |
| parent | 320ee0345cc7fecf4f8bce6d59a5f54eb2d35908 (diff) | |
| download | emacs-d14202c2ce3dd0f7d8623d2bfef2400a1ed16d5f.tar.gz emacs-d14202c2ce3dd0f7d8623d2bfef2400a1ed16d5f.zip | |
(Document View): Explain dependence on gs at the top. Copyedits.
| -rw-r--r-- | doc/emacs/misc.texi | 136 |
1 files changed, 71 insertions, 65 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index cce9857cad1..5c81f2ae004 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | @chapter Miscellaneous Commands | 6 | @chapter Miscellaneous Commands |
| 7 | 7 | ||
| 8 | This chapter contains several brief topics that do not fit anywhere | 8 | This chapter contains several brief topics that do not fit anywhere |
| 9 | else: reading netnews, running shell commands and shell subprocesses, | 9 | else: viewing ``document files'', reading netnews, running shell |
| 10 | using a single shared Emacs for utilities that expect to run an editor | 10 | commands and shell subprocesses, using a single shared Emacs for |
| 11 | as a subprocess, printing hardcopy, sorting text, narrowing display to | 11 | utilities that expect to run an editor as a subprocess, printing |
| 12 | part of the buffer, editing double-column files and binary files, | 12 | hardcopy, sorting text, narrowing display to part of the buffer, |
| 13 | saving an Emacs session for later resumption, following hyperlinks, | 13 | editing double-column files and binary files, saving an Emacs session |
| 14 | browsing images, emulating other editors, and various diversions and | 14 | for later resumption, following hyperlinks, browsing images, emulating |
| 15 | amusements. | 15 | other editors, and various diversions and amusements. |
| 16 | 16 | ||
| 17 | @end iftex | 17 | @end iftex |
| 18 | 18 | ||
| @@ -22,40 +22,52 @@ amusements. | |||
| 22 | 22 | ||
| 23 | @node Document View, Gnus, Calendar/Diary, Top | 23 | @node Document View, Gnus, Calendar/Diary, Top |
| 24 | @section Document Viewing | 24 | @section Document Viewing |
| 25 | @cindex DVI file viewing | 25 | @cindex DVI file |
| 26 | @cindex PDF file | 26 | @cindex PDF file |
| 27 | @cindex PS file | 27 | @cindex PS file |
| 28 | @cindex Postscript file | ||
| 28 | @cindex DocView mode | 29 | @cindex DocView mode |
| 29 | @cindex mode, DocView | 30 | @cindex mode, DocView |
| 30 | @cindex document viewer (DocView) | 31 | @cindex document viewer (DocView) |
| 31 | @findex doc-view-mode | 32 | @findex doc-view-mode |
| 32 | 33 | ||
| 33 | DocView mode (@code{doc-view-mode}) is a document viewer that operates | 34 | DocView mode (@code{doc-view-mode}) is a viewer for DVI, Postscript |
| 34 | within Emacs. It provides convenience features such as slicing, | 35 | (PS), and PDF documents. It provides features such as slicing, |
| 35 | zooming, and searching inside the document. | 36 | zooming, and searching inside documents. It works by converting the |
| 37 | document to a set of images using the @command{gs} (GhostScript) | ||
| 38 | command, and displaying those images. | ||
| 36 | 39 | ||
| 37 | @findex doc-view-toggle-display | 40 | @findex doc-view-toggle-display |
| 38 | When you visit a PDF or DVI file, Emacs begins in DocView mode: it | ||
| 39 | displays a welcome screen and begins formatting the file, page by | ||
| 40 | page. It displays the first page once that has been formatted. You | ||
| 41 | can use @kbd{C-c C-c} (@code{doc-view-toggle-display}) to switch to | ||
| 42 | editing the text of the PDF or DVI file. | ||
| 43 | |||
| 44 | @findex doc-view-toggle-display | 41 | @findex doc-view-toggle-display |
| 45 | For Postscript files, Emacs normally visits them in PS mode, but you | 42 | @cindex doc-view-minor-mode |
| 46 | can use @kbd{C-c C-c} to switch to viewing the formatted text with | 43 | When you visit a PDF or DVI file, Emacs automatically switches to |
| 47 | DocView. For all these files, repeating @kbd{C-c C-c} toggles between | 44 | DocView mode. When you visit a Postscript file, Emacs switches to PS |
| 48 | DocView and the file text. | 45 | mode, a major mode for editing Postscript files as text; however, it |
| 46 | also enables DocView minor mode, so you can type @kbd{C-c C-c} to view | ||
| 47 | the document with DocView. (PDF and DVI files, unlike Postscript | ||
| 48 | files, are not usually human-editable.) In either case, repeating | ||
| 49 | @kbd{C-c C-c} (@code{doc-view-toggle-display}) toggles between DocView | ||
| 50 | and the file text. | ||
| 51 | |||
| 52 | You can explicitly toggle DocView mode with the command @code{M-x | ||
| 53 | doc-view-mode}, and DocView minor mode with the command @code{M-x | ||
| 54 | doc-view-minor-mode}. | ||
| 55 | |||
| 56 | When DocView mode starts, it displays a welcome screen and begins | ||
| 57 | formatting the file, page by page. It displays the first page once | ||
| 58 | that has been formatted. | ||
| 49 | 59 | ||
| 50 | @findex doc-view-enlarge | 60 | @findex doc-view-enlarge |
| 51 | @findex doc-view-shrink | 61 | @findex doc-view-shrink |
| 52 | @vindex doc-view-resolution | 62 | @vindex doc-view-resolution |
| 53 | When in DocView mode, you can enlarge or shrink the document with | 63 | When in DocView mode, you can enlarge or shrink the document with |
| 54 | @kbd{+} (@code{doc-view-enlarge}) and @kbd{-} | 64 | @kbd{+} (@code{doc-view-enlarge}) and @kbd{-} |
| 55 | (@code{doc-view-shrink}). To specify the default size for DocView, | 65 | (@code{doc-view-shrink}). To specify the default size for DocView, |
| 56 | set or customize the variable @code{doc-view-resolution}. | 66 | set or customize the variable @code{doc-view-resolution}. |
| 57 | 67 | ||
| 58 | You can kill the DocView buffer with @kbd{k} and bury it with @kbd{q}. | 68 | To kill the DocView buffer, type @kbd{k} |
| 69 | (@code{doc-view-kill-proc-and-buffer}). To bury it, type @kbd{q} | ||
| 70 | (@code{quit-window}). | ||
| 59 | 71 | ||
| 60 | @menu | 72 | @menu |
| 61 | * Navigation:: Navigation inside DocView buffers. | 73 | * Navigation:: Navigation inside DocView buffers. |
| @@ -68,55 +80,53 @@ You can kill the DocView buffer with @kbd{k} and bury it with @kbd{q}. | |||
| 68 | @subsection Navigation | 80 | @subsection Navigation |
| 69 | 81 | ||
| 70 | When in DocView mode, you can scroll the current page using the usual | 82 | When in DocView mode, you can scroll the current page using the usual |
| 71 | Emacs movement keys; that is, the arrow keys or @kbd{C-p}, @kbd{C-n}, | 83 | Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and |
| 72 | @kbd{C-b} and @kbd{C-f}. | 84 | the arrow keys. |
| 73 | 85 | ||
| 74 | @findex doc-view-next-page | 86 | @findex doc-view-next-page |
| 75 | @findex doc-view-previous-page | 87 | @findex doc-view-previous-page |
| 76 | To go to the next page, use @kbd{n}, @key{next} or @kbd{C-x ]} | 88 | To display the next page, type @kbd{n}, @key{next} or @kbd{C-x ]} |
| 77 | (@code{doc-view-next-page}). To go to the previous page, use @kbd{p}, | 89 | (@code{doc-view-next-page}). To display the previous page, type |
| 78 | @key{prior} or @kbd{C-x [} (@code{doc-view-previous-page}). | 90 | @kbd{p}, @key{prior} or @kbd{C-x [} (@code{doc-view-previous-page}). |
| 79 | 91 | ||
| 80 | @findex doc-view-scroll-up-or-next-page | 92 | @findex doc-view-scroll-up-or-next-page |
| 81 | @findex doc-view-scroll-down-or-previous-page | 93 | @findex doc-view-scroll-down-or-previous-page |
| 82 | The @key{SPC} (@code{doc-view-scroll-up-or-next-page}) key is a | 94 | The @key{SPC} (@code{doc-view-scroll-up-or-next-page}) key is a |
| 83 | convenient way to advance through the document. It scrolls within the | 95 | convenient way to advance through the document. It scrolls within the |
| 84 | current page or advances to the next. @key{DEL} moves backwards in a | 96 | current page or advances to the next. @key{DEL} moves backwards in a |
| 85 | similar way direction (@code{doc-view-scroll-down-or-previous-page}). | 97 | similar way (@code{doc-view-scroll-down-or-previous-page}). |
| 86 | 98 | ||
| 87 | @findex doc-view-first-page | 99 | @findex doc-view-first-page |
| 88 | @findex doc-view-last-page | 100 | @findex doc-view-last-page |
| 89 | To go to the first page use @kbd{M-<} (@code{doc-view-first-page}), to | ||
| 90 | go to the last one use @kbd{M->} (@code{doc-view-last-page}). | ||
| 91 | |||
| 92 | @findex doc-view-goto-page | 101 | @findex doc-view-goto-page |
| 93 | To jump to a page by its number use @kbd{M-g M-g} or @kbd{M-g g} | 102 | To go to the first page, type @kbd{M-<} |
| 94 | (@code{doc-view-goto-page}). | 103 | (@code{doc-view-first-page}); to go to the last one, type @kbd{M->} |
| 104 | (@code{doc-view-last-page}). To jump to a page by its number, type | ||
| 105 | @kbd{M-g M-g} or @kbd{M-g g} (@code{doc-view-goto-page}). | ||
| 95 | 106 | ||
| 96 | @node Searching | 107 | @node Searching |
| 97 | @subsection Searching | 108 | @subsection Searching |
| 98 | 109 | ||
| 99 | While in DocView mode you can search the file's text for a regular | 110 | While in DocView mode, you can search the file's text for a regular |
| 100 | expression (@pxref{Regexps}). The interface for searching is inspired | 111 | expression (@pxref{Regexps}). The interface for searching is inspired |
| 101 | by @code{isearch} (@pxref{Incremental Search}). | 112 | by @code{isearch} (@pxref{Incremental Search}). |
| 102 | 113 | ||
| 103 | @findex doc-view-search | 114 | @findex doc-view-search |
| 104 | @findex doc-view-search-backward | 115 | @findex doc-view-search-backward |
| 105 | To initiate a search use @kbd{C-s} (@code{doc-view-search}) or | ||
| 106 | @kbd{C-r} (@code{doc-view-search-backward}). This reads a regular | ||
| 107 | expression; after you finish it with @key{RET}, it echoes the number | ||
| 108 | of matches found. You can move forward and back among these matches | ||
| 109 | by typing @kbd{C-s} and @kbd{C-r}. | ||
| 110 | |||
| 111 | @findex doc-view-show-tooltip | 116 | @findex doc-view-show-tooltip |
| 112 | DocView mode has no way to show the match inside the page image, so | 117 | To begin a search, type @kbd{C-s} (@code{doc-view-search}) or |
| 113 | instead it displays a tooltip (at the mouse position) which lists all | 118 | @kbd{C-r} (@code{doc-view-search-backward}). This reads a regular |
| 114 | matching lines in the current page. You can force display of this | 119 | expression using a minibuffer, then echoes the number of matches found |
| 115 | tooltip with @kbd{C-t} (@code{doc-view-show-tooltip}). | 120 | within the document. You can move forward and back among the matches |
| 116 | 121 | by typing @kbd{C-s} and @kbd{C-r}. DocView mode has no way to show | |
| 117 | To start a new search, use the search command with a prefix argument; | 122 | the match inside the page image; instead, it displays a tooltip (at |
| 118 | i.e., @kbd{C-u C-s} for a forward search or @kbd{C-u C-r} for a | 123 | the mouse position) listing all matching lines in the current page. |
| 119 | backward search. | 124 | To force display of this tooltip, type @kbd{C-t} |
| 125 | (@code{doc-view-show-tooltip}). | ||
| 126 | |||
| 127 | To start a new search, use the search command with a prefix | ||
| 128 | argument; i.e., @kbd{C-u C-s} for a forward search or @kbd{C-u C-r} | ||
| 129 | for a backward search. | ||
| 120 | 130 | ||
| 121 | @node Slicing | 131 | @node Slicing |
| 122 | @subsection Slicing | 132 | @subsection Slicing |
| @@ -127,12 +137,12 @@ space and can cause inconvenient scrolling. | |||
| 127 | 137 | ||
| 128 | @findex doc-view-set-slice | 138 | @findex doc-view-set-slice |
| 129 | @findex doc-view-set-slice-using-mouse | 139 | @findex doc-view-set-slice-using-mouse |
| 130 | With DocView you can hide these margins by selecting the @dfn{slice} | 140 | With DocView you can hide these margins by selecting a @dfn{slice} |
| 131 | of pages to display. A slice is a rectangle within the page area; | 141 | of pages to display. A slice is a rectangle within the page area; |
| 132 | once you specify a slice in DocView, it applies to whichever page you | 142 | once you specify a slice in DocView, it applies to whichever page you |
| 133 | look at. | 143 | look at. |
| 134 | 144 | ||
| 135 | To specify the slice numerically, type @kbd{s s} | 145 | To specify the slice numerically, type @kbd{s s} |
| 136 | (@code{doc-view-set-slice}); then enter the top left pixel position | 146 | (@code{doc-view-set-slice}); then enter the top left pixel position |
| 137 | and the slice's width and height. | 147 | and the slice's width and height. |
| 138 | @c ??? how does this work? | 148 | @c ??? how does this work? |
| @@ -143,7 +153,7 @@ select the slice. | |||
| 143 | @c ??? How does this work? | 153 | @c ??? How does this work? |
| 144 | 154 | ||
| 145 | @findex doc-view-reset-slice | 155 | @findex doc-view-reset-slice |
| 146 | To cancel the selected slice, type @kbd{s r} | 156 | To cancel the selected slice, type @kbd{s r} |
| 147 | (@code{doc-view-reset-slice}). Then DocView shows the entire page | 157 | (@code{doc-view-reset-slice}). Then DocView shows the entire page |
| 148 | including its entire margins. | 158 | including its entire margins. |
| 149 | 159 | ||
| @@ -151,26 +161,22 @@ including its entire margins. | |||
| 151 | @subsection Conversion | 161 | @subsection Conversion |
| 152 | 162 | ||
| 153 | @vindex doc-view-cache-directory | 163 | @vindex doc-view-cache-directory |
| 154 | DocView works by using @command{gs} (GhostScript) to convert the | ||
| 155 | document to a set of PNG images which are then displayed. For | ||
| 156 | efficiency it caches those images in @code{doc-view-cache-directory}. | ||
| 157 | |||
| 158 | @findex doc-view-clear-cache | 164 | @findex doc-view-clear-cache |
| 159 | You can clear the cache directory with @code{M-x | 165 | For efficiency, DocView caches the images produced by @command{gs}. |
| 160 | doc-view-clear-cache}. But this should never be necessary, because | 166 | The name of this directory is given by the variable |
| 161 | DocView detects changed files based on the md5 checksum of the file | 167 | @code{doc-view-cache-directory}. You can clear the cache directory by |
| 162 | contents. | 168 | typing @code{M-x doc-view-clear-cache}. |
| 163 | 169 | ||
| 164 | @findex doc-view-kill-proc | 170 | @findex doc-view-kill-proc |
| 165 | @findex doc-view-kill-proc-and-buffer | 171 | @findex doc-view-kill-proc-and-buffer |
| 166 | To force a reconversion of the currently viewed document, type @kbd{r} | 172 | To force a reconversion of the currently viewed document, type |
| 167 | or @kbd{g} (@code{revert-buffer}). To kill the converter process | 173 | @kbd{r} or @kbd{g} (@code{revert-buffer}). To kill the converter |
| 168 | associated with the current buffer, type @kbd{K} | 174 | process associated with the current buffer, type @kbd{K} |
| 169 | (@code{doc-view-kill-proc}). The command @kbd{k} | 175 | (@code{doc-view-kill-proc}). The command @kbd{k} |
| 170 | (@code{doc-view-kill-proc-and-buffer}) kills the converter process and | 176 | (@code{doc-view-kill-proc-and-buffer}) kills the converter process and |
| 171 | the DocView buffer. | 177 | the DocView buffer. |
| 172 | 178 | ||
| 173 | The zoom commands @kbd{+} (@code{doc-view-enlarge}) and @kbd{-} | 179 | The zoom commands @kbd{+} (@code{doc-view-enlarge}) and @kbd{-} |
| 174 | (@code{doc-view-shrink}) need to reconvert the document at the new | 180 | (@code{doc-view-shrink}) need to reconvert the document at the new |
| 175 | size. The current page is converted first. | 181 | size. The current page is converted first. |
| 176 | 182 | ||