Commit graph

134 commits

Author SHA1 Message Date
Stefan Monnier
bba79a9ce4 (doc-view-convert-current-doc): Fix last change. 2009-03-10 13:33:23 +00:00
Tassilo Horn
cde4c3f133 (doc-view-convert-current-doc): Save the current
resolution in the cache directory.
(doc-view-initiate-display): Restore the saved resolution when
using cached image files.
2009-03-05 08:24:26 +00:00
Juanma Barranquero
a8ce3d17d8 Fix typos. 2009-03-02 08:55:47 +00:00
Tassilo Horn
bc19637df0 (doc-view-scroll-up-or-next-page)
(doc-view-scroll-down-or-previous-page, doc-view-goto-page): Reset
the old hscroll value after switching pages.
2009-02-09 15:33:47 +00:00
Tassilo Horn
856997723b (doc-view-mode): Don't use string-match and file
extension to choose fallback mode on empty/non-existing files but
let-bind auto-mode-alist and call normal-mode.
2009-01-28 20:33:44 +00:00
Tassilo Horn
ff0def0e8f Fix broken call to string-match. 2009-01-27 18:34:02 +00:00
Tassilo Horn
06a21f70a8 (doc-view-mode): Enhance docstring and fallback to
fundamental-mode or ps-mode if the file is empty or doesn't exist
at all.
(doc-view-initiate-display): Better info message if doc-view-mode
cannot be used.  (Missing utility or no png support/no X frame.)
2009-01-27 15:52:17 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Tassilo Horn
f1809341da (doc-view-mode): Bugfix: Add conversion killing
function to kill-buffer-hook, not to kill-buffer.
Reported by Markus Triska <markus.triska@gmx.at>
2008-11-05 11:06:22 +00:00
Glenn Morris
ca32d854d6 (doc-view-pdf->txt, doc-view-ps->pdf): Give an error if the needed
external programs were not found.
2008-10-18 22:30:55 +00:00
Tassilo Horn
c36f0e1755 (doc-view-scroll-up-or-next-page)
(doc-view-scroll-down-or-previous-page): Fix scrolling in case of
vertically split windows.
2008-09-12 06:29:25 +00:00
Glenn Morris
c123f7fe96 (bookmark-make-record-default): Fix declaration. 2008-06-26 07:19:01 +00:00
Stefan Monnier
43f8b27568 * bookmark.el (bookmark-alist): Allow the 2 slightly different formats
used until now in bookmark.el's code.
(bookmark-get-bookmark): Accept bookmark names or bookmark records.
(bookmark-get-bookmark-record): Allow the 2 slightly different formats
used until now in bookmark.el's code.
(bookmark-set-filename): Remove special code, moved to its only caller.
(bookmark-store): Use the newer format.
(bookmark-make-record-default): Add arg `point-only'.
Rename from bookmark-make-record-for-text-file.
(bookmark--jump-via): New function.
(bookmark-jump, bookmark-jump-other-window, bookmark-bmenu-2-window)
(bookmark-bmenu-other-window, bookmark-bmenu-switch-other-window):
Use it.
(bookmark-jump-noselect, bookmark-default-handler):
Don't return an alist, instead return the data implicitly by changing
current buffer and point.  Signal an error if the file doesn't exist.
* info.el (Info-bookmark-make-record):
Use bookmark-make-record-default.
(Info-bookmark-jump): Use bookmark-default-handler.
* image-mode.el (image-bookmark-make-record):
Use bookmark-make-record-default.
(image-bookmark-jump): Use bookmark-default-handler.
* doc-view.el (doc-view-bookmark-make-record):
Use bookmark-make-record-default.
(doc-view-bookmark-jump): Use bookmark-default-handler.
2008-06-25 16:51:33 +00:00
Glenn Morris
aa360da10d Add some compiler declarations, for builds without X. 2008-06-12 03:56:20 +00:00
Stefan Monnier
d2d7e96cd8 * image-mode.el (image-mode-map): Suppress key map and bind `q'.
* doc-view.el (doc-view-mode-map): Inherit from image-mode-map.
2008-06-03 07:42:03 +00:00
Stefan Monnier
5b813fe87e (doc-view-mode-map): Bind `q' to quit-window, as is the custom. 2008-05-28 14:16:09 +00:00
Glenn Morris
eb3fa2cfcf Switch to recommended form of GPLv3 permissions notice. 2008-05-06 08:06:51 +00:00
Chong Yidong
10b6e7c189 (doc-view-new-window-function): Avoid using WINDOW
argument to get-char-property, in case the current buffer hasn't
been assigned to that window yet.
(doc-view-display): Default to selected window if the current
buffer hasn't been assigned to a window yet.
2008-04-28 23:49:02 +00:00
Tassilo Horn
d5793be30c (doc-view-scroll-up-or-next-page): Don't use
set-window-vscroll but image-scroll-down.  Fixes a bug where a
command following SPC scrolled up again.
2008-04-22 06:38:12 +00:00
Tassilo Horn
1ecc9da7bd Changed requirements section to tell that only one
of dvipdf or dvipdfm is needed.
(doc-view-already-converted-p): Fix bug that forced reconversion
if doc was already converted.
2008-04-15 06:46:11 +00:00
Tassilo Horn
adc95ad64f (doc-view-mode-map): Bind C-a to image-bol and C-e
to image-eol.
2008-04-14 15:46:06 +00:00
Tassilo Horn
53d4c024e9 * doc-view.el (doc-view-dvipdf-program): New variable.
(doc-view-dvipdfm-program): Mention doc-view-dvipdf-program.
(doc-view-mode-p): Check for doc-view-dvipdf-program as
alternative for doc-view-dvipdfm-program.
(doc-view-dvi->pdf): Prefer dvipdf over dvipdfm.
2008-04-14 13:18:12 +00:00
Tassilo Horn
3c03f2cef0 (doc-view-start-process): Don't set
default-directory to "~/" if the current value is valid.  This
broke PS files that run other files in the same directory.
2008-04-14 11:02:31 +00:00
Stefan Monnier
ec4853ab3d Compute displayed pages first (in PDF).
(doc-view-current-converter-processes): Rename from
doc-view-current-converter-process.  Update users.
(doc-view-sentinel): Test buffer's liveness.
(doc-view-pdf/ps->png-sentinel): Remove.
(doc-view-start-process): New function.
(doc-view-dvi->pdf, doc-view-pdf/ps->png, doc-view-pdf->txt)
(doc-view-ps->pdf): Use it.
(doc-view-pdf->png-1, doc-view-pdf->png, doc-view-active-pages): New functions.
(doc-view-convert-current-doc, doc-view-goto-page): Use them.
(doc-view-mode): Kill the processes when leaving the mode.
2008-03-31 15:14:16 +00:00
Tassilo Horn
322f455981 (doc-view-initiate-display): Use doc-view-doc-type
instead of file name extension to make docs with uncommon
extensions work.
2008-03-18 17:43:26 +00:00
Tassilo Horn
23cda57253 (require): Require cl at compile time because
`assert' needs it.
2008-03-18 12:02:44 +00:00
Tassilo Horn
7edd6b92de (doc-view-doc->txt, doc-view-convert-current-doc):
Use non-nil PARENTS attribute of make-directory instead of
explicitly checking existence the current cache directory.
2008-03-16 09:24:29 +00:00
Tassilo Horn
5986c5c6ad (doc-view-doc->txt, doc-view-convert-current-doc):
Create cache dir only if it doesn't already exist.
2008-03-13 18:12:28 +00:00
Stefan Monnier
b4cb319f0a Remove all cb-args, use closures instead.
(doc-view-sentinel): Merge doc-view-dvi->pdf-sentinel,
doc-view-ps->pdf-sentinel, and doc-view-pdf->txt-sentinel (which was
doing an incorrect check).  Update all callers to use the new name.
(doc-view-doc->txt): Add missing `txt' argument.
2008-03-12 15:26:49 +00:00
Tassilo Horn
86903c81ae (doc-view-current-cache-dir): Set buffer used for
md5 sum calculation to single-byte.
2008-03-12 14:59:10 +00:00
Stefan Monnier
eb79098b2b (doc-view-new-window-function): Add assertion.
(doc-view-doc-type): New var.
(doc-view-convert-current-doc, doc-view-doc->txt): Use it.
(doc-view-intersection): New fun.
(doc-view-mode): Use it to set the new var.
2008-03-12 14:50:36 +00:00
Tassilo Horn
515357c252 (doc-view-doc->txt, doc-view-open-text)
(doc-view-already-converted-p): New functions.
(doc-view-clear-cache): Don't recreate doc-view-cache-directory.
(doc-view-mode-map): Bind C-c C-t to doc-view-open-text.
(doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf)
(doc-view-pdf->txt-sentinel, doc-view-pdf->txt)
(doc-view-ps->pdf-sentinel, doc-view-ps->pdf)
(doc-view-convert-current-doc): Don't hardwire the functions the
sentinels call.  Now they're provided by two args CALLBACK and
CB-ARGS to the functions.
(doc-view-search): Use doc-view-doc->txt.
(doc-view-initiate-display): Use doc-view-already-converted-p.
Mention new binding C-c C-t if doc-view-mode doesn't work.
2008-03-12 12:05:30 +00:00
Stefan Monnier
a9f8b49b44 (bookmark-buffer-file-name, bookmark-prop-get): Declare.
(doc-view-bookmark-make-record): Use them.
(doc-view-bookmark-jump): Use them.  Fix find-file -> find-file-noselect.
(bookmark-get-filename, bookmark-get-bookmark-record): Remove.
2008-03-09 21:37:16 +00:00
Stefan Monnier
32a091dd19 * bookmark.el (bookmark-make): Don't pass the `annotation' to the
make-record function, instead paste it in afterwards.
(bookmark-make-record-for-text-file):
* doc-view.el (doc-view-bookmark-make-record):
* info.el (Info-bookmark-make-record): Don't mess with annotations.
2008-03-09 03:05:34 +00:00
Tassilo Horn
c039a3b294 (doc-view-bookmark-make-record): Delete obsolete
second arg.
2008-03-07 15:59:43 +00:00
Karl Fogel
e0385bf41a Change a return type, for greater extensibility. See
http://lists.gnu.org/archive/html/emacs-devel/2007-12/msg01077.html
and its thread for discussion leading to this change.

* emacs-cvs/lisp/bookmark.el:
(bookmark-jump-noselect): Return an alist instead of a dotted pair.
(bookmark-jump, bookmark-jump-other-window, bookmark-insert)
(bookmark-bmenu-2-window, bookmark-bmenu-other-window)
(bookmark-bmenu-switch-other-window): Adjust accordingly.
(bookmark-make-cell-function): Adjust documentation accordingly.

* emacs-cvs/lisp/image-mode.el
(image-bookmark-jump): Adjust return type accordingly; document.

* emacs-cvs/lisp/doc-view.el
(doc-view-bookmark-jump): Adjust return type accordingly; document.
2008-03-07 05:44:37 +00:00
Stefan Monnier
160dfe4360 (doc-view-current-page): Add a `win' argument. 2008-02-26 02:06:33 +00:00
Stefan Monnier
56741510ef (doc-view-conversion-buffer): Give it an internal name.
Demote it to plain defvar.
(doc-view-conversion-refresh-interval): Reduce interval.
(doc-view-goto-page): Allow moving to pages not yet rendered.
(doc-view-goto-page): Construct a file name rather than extracting it
from doc-view-current-files.
(doc-view-kill-proc): Ignore errors from kill-process.
(doc-view-pdf/ps->png-sentinel): Die gracefully if the buffer is dead.
(doc-view-insert-image): Use appropriate text if the page hasn't been
rendered yet.  Adjust scrolling so the text is displayed.
(doc-view-display): Detect not just that a page is available, but also
that it wasn't available before, to avoid refreshing all pages repeatedly.
(doc-view-mode): Make doc-view-cache-directory if needed.
2008-02-25 20:04:59 +00:00
Stefan Monnier
de17146541 Allow different windows to show different pages.
(doc-view-current-page, doc-view-current-slice, doc-view-current-info)
(doc-view-current-image, doc-view-current-overlay): Remove variables,
add them back as macros instead, using image-mode-winprops instead.
Update all users of those variables.
(doc-view-new-window-function): New function to create a new overlay
for each new window.
(doc-view-mode): Use it and image-mode-setup-winprops.
(doc-view-clone-buffer-hook): Rewrite accordingly.
2008-02-21 03:45:04 +00:00
Stefan Monnier
65073003e7 (doc-view-display): Change file arg to buffer arg, so it
works also for buffers w/o buffer-file-name.  Update callers.
(doc-view-clone-buffer-hook): New fun.
(doc-view-mode): Use it for indirect clones.
Mark the overlays with the `doc-view' property so they can be recognized.
2008-02-12 02:41:55 +00:00
Stefan Monnier
71385ba8e3 Add todo entries. 2008-02-10 03:06:54 +00:00
Stefan Monnier
5c1f16b06e (doc-view-mode): Improve docstring. 2008-02-01 03:00:55 +00:00
Tassilo Horn
865ba89526 * doc-view.el (doc-view-mode): Adapt to i-m-current-[vh]scroll
being an alist now.
2008-01-29 18:01:32 +00:00
Tassilo Horn
6f70aa334f 2008-01-29 Tassilo Horn <tassilo@member.fsf.org>
* doc-view.el (doc-view-mode): Use facilities of
	image-mode to restore [vh]scroll when switching buffers.
2008-01-29 13:50:35 +00:00
Stefan Monnier
38b5ca4a1b (doc-view-goto-page): Don't move point any more, now that
the hscroll behavior was fixed.
(doc-view-mode): Disable auto-hscroll-mode.
2008-01-19 05:34:29 +00:00
Stefan Monnier
cec1df02a4 (doc-view-pdf/ps->png): Make sure we a have a valid cwd.
(doc-view-insert-image): Do something if the image is missing.
(doc-view-mode): Don't use file-remote-p.
2008-01-18 20:09:26 +00:00
Tassilo Horn
39a402e3d9 2008-01-10 Tassilo Horn <tassilo@member.fsf.org>
* doc-view.el (doc-view-buffer-file-name): New variable.
	(doc-view-convert-current-doc, doc-view-search)
	(doc-view-current-cache-dir, doc-view-initiate-display)
	(doc-view-mode): Use it.
	(doc-view-bookmark-make-cell): Use variable buffer-file-name
	instead of function.
2008-01-10 15:08:34 +00:00
Tassilo Horn
0e8356fe05 2008-01-10 Tassilo Horn <tassilo@member.fsf.org>
* doc-view.el (tramp): Require tramp because we use
	tramp-tramp-file-p.
2008-01-10 11:29:41 +00:00
Tassilo Horn
f9adf05bac 2008-01-09 Tassilo Horn <tassilo@member.fsf.org>
* doc-view.el (doc-view-mode): Support tramp, compressed files and
	files inside archives uniformly.
2008-01-09 20:16:14 +00:00
Tassilo Horn
622face2db 2008-01-09 Tassilo Horn <tassilo@member.fsf.org>
* doc-view.el (doc-view-mode-p): Add EPS as supported type.
	(doc-view-mode): Support document files inside archives.
2008-01-09 10:25:17 +00:00