aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-11-30 22:57:43 +0000
committerChong Yidong2008-11-30 22:57:43 +0000
commitd14202c2ce3dd0f7d8623d2bfef2400a1ed16d5f (patch)
treeb2c6fb0670434eb736f1703eaed60cacc4d311f5
parent320ee0345cc7fecf4f8bce6d59a5f54eb2d35908 (diff)
downloademacs-d14202c2ce3dd0f7d8623d2bfef2400a1ed16d5f.tar.gz
emacs-d14202c2ce3dd0f7d8623d2bfef2400a1ed16d5f.zip
(Document View): Explain dependence on gs at the top. Copyedits.
-rw-r--r--doc/emacs/misc.texi136
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
9else: reading netnews, running shell commands and shell subprocesses, 9else: viewing ``document files'', reading netnews, running shell
10using a single shared Emacs for utilities that expect to run an editor 10commands and shell subprocesses, using a single shared Emacs for
11as a subprocess, printing hardcopy, sorting text, narrowing display to 11utilities that expect to run an editor as a subprocess, printing
12part of the buffer, editing double-column files and binary files, 12hardcopy, sorting text, narrowing display to part of the buffer,
13saving an Emacs session for later resumption, following hyperlinks, 13editing double-column files and binary files, saving an Emacs session
14browsing images, emulating other editors, and various diversions and 14for later resumption, following hyperlinks, browsing images, emulating
15amusements. 15other 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
33DocView mode (@code{doc-view-mode}) is a document viewer that operates 34DocView mode (@code{doc-view-mode}) is a viewer for DVI, Postscript
34within Emacs. It provides convenience features such as slicing, 35(PS), and PDF documents. It provides features such as slicing,
35zooming, and searching inside the document. 36zooming, and searching inside documents. It works by converting the
37document to a set of images using the @command{gs} (GhostScript)
38command, and displaying those images.
36 39
37@findex doc-view-toggle-display 40@findex doc-view-toggle-display
38When you visit a PDF or DVI file, Emacs begins in DocView mode: it
39displays a welcome screen and begins formatting the file, page by
40page. It displays the first page once that has been formatted. You
41can use @kbd{C-c C-c} (@code{doc-view-toggle-display}) to switch to
42editing the text of the PDF or DVI file.
43
44@findex doc-view-toggle-display 41@findex doc-view-toggle-display
45For Postscript files, Emacs normally visits them in PS mode, but you 42@cindex doc-view-minor-mode
46can 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
47DocView. For all these files, repeating @kbd{C-c C-c} toggles between 44DocView mode. When you visit a Postscript file, Emacs switches to PS
48DocView and the file text. 45mode, a major mode for editing Postscript files as text; however, it
46also enables DocView minor mode, so you can type @kbd{C-c C-c} to view
47the document with DocView. (PDF and DVI files, unlike Postscript
48files, are not usually human-editable.) In either case, repeating
49@kbd{C-c C-c} (@code{doc-view-toggle-display}) toggles between DocView
50and the file text.
51
52 You can explicitly toggle DocView mode with the command @code{M-x
53doc-view-mode}, and DocView minor mode with the command @code{M-x
54doc-view-minor-mode}.
55
56 When DocView mode starts, it displays a welcome screen and begins
57formatting the file, page by page. It displays the first page once
58that 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
53When 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,
56set or customize the variable @code{doc-view-resolution}. 66set or customize the variable @code{doc-view-resolution}.
57 67
58You 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
70When in DocView mode, you can scroll the current page using the usual 82When in DocView mode, you can scroll the current page using the usual
71Emacs movement keys; that is, the arrow keys or @kbd{C-p}, @kbd{C-n}, 83Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and
72@kbd{C-b} and @kbd{C-f}. 84the 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
76To 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
82The @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
83convenient way to advance through the document. It scrolls within the 95convenient way to advance through the document. It scrolls within the
84current page or advances to the next. @key{DEL} moves backwards in a 96current page or advances to the next. @key{DEL} moves backwards in a
85similar way direction (@code{doc-view-scroll-down-or-previous-page}). 97similar 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
89To go to the first page use @kbd{M-<} (@code{doc-view-first-page}), to
90go 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
93To 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
99While in DocView mode you can search the file's text for a regular 110While in DocView mode, you can search the file's text for a regular
100expression (@pxref{Regexps}). The interface for searching is inspired 111expression (@pxref{Regexps}). The interface for searching is inspired
101by @code{isearch} (@pxref{Incremental Search}). 112by @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
105To 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
107expression; after you finish it with @key{RET}, it echoes the number
108of matches found. You can move forward and back among these matches
109by typing @kbd{C-s} and @kbd{C-r}.
110
111@findex doc-view-show-tooltip 116@findex doc-view-show-tooltip
112DocView 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
113instead it displays a tooltip (at the mouse position) which lists all 118@kbd{C-r} (@code{doc-view-search-backward}). This reads a regular
114matching lines in the current page. You can force display of this 119expression using a minibuffer, then echoes the number of matches found
115tooltip with @kbd{C-t} (@code{doc-view-show-tooltip}). 120within the document. You can move forward and back among the matches
116 121by typing @kbd{C-s} and @kbd{C-r}. DocView mode has no way to show
117To start a new search, use the search command with a prefix argument; 122the match inside the page image; instead, it displays a tooltip (at
118i.e., @kbd{C-u C-s} for a forward search or @kbd{C-u C-r} for a 123the mouse position) listing all matching lines in the current page.
119backward search. 124To 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
128argument; i.e., @kbd{C-u C-s} for a forward search or @kbd{C-u C-r}
129for 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
130With DocView you can hide these margins by selecting the @dfn{slice} 140 With DocView you can hide these margins by selecting a @dfn{slice}
131of pages to display. A slice is a rectangle within the page area; 141of pages to display. A slice is a rectangle within the page area;
132once you specify a slice in DocView, it applies to whichever page you 142once you specify a slice in DocView, it applies to whichever page you
133look at. 143look at.
134 144
135To 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
137and the slice's width and height. 147and 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
146To 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
148including its entire margins. 158including 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
154DocView works by using @command{gs} (GhostScript) to convert the
155document to a set of PNG images which are then displayed. For
156efficiency it caches those images in @code{doc-view-cache-directory}.
157
158@findex doc-view-clear-cache 164@findex doc-view-clear-cache
159You can clear the cache directory with @code{M-x 165For efficiency, DocView caches the images produced by @command{gs}.
160doc-view-clear-cache}. But this should never be necessary, because 166The name of this directory is given by the variable
161DocView detects changed files based on the md5 checksum of the file 167@code{doc-view-cache-directory}. You can clear the cache directory by
162contents. 168typing @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
166To force a reconversion of the currently viewed document, type @kbd{r} 172 To force a reconversion of the currently viewed document, type
167or @kbd{g} (@code{revert-buffer}). To kill the converter process 173@kbd{r} or @kbd{g} (@code{revert-buffer}). To kill the converter
168associated with the current buffer, type @kbd{K} 174process 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
171the DocView buffer. 177the DocView buffer.
172 178
173The 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
175size. The current page is converted first. 181size. The current page is converted first.
176 182