Commit graph

214 commits

Author SHA1 Message Date
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Stefan Monnier
77ab81d054 Merge from emacs-23 2011-01-14 12:18:41 -05:00
Tassilo Horn
1281bd51e8 (doc-view-initiate-display): Fall back to normal mode when
doc-view-mode cannot be enabled, also when extracting the document
text into a separate buffer (bug#6446).
2011-01-13 21:17:15 +01:00
Tassilo Horn
5b3553158d * doc-view.el (doc-view-open-text): Use meaningful text buffer
name.  Keep original document's directory as default-directory
(bug#6446).
2011-01-13 20:48:26 +01:00
Tassilo Horn
c44d54b34f * doc-view.el (doc-view-mode-p): Check for png or imagemagick
image backend support.  Either of them is fine.
2011-01-08 23:57:07 +01:00
Tassilo Horn
f77ca00344 Fix bug in doc-view-enlarge. 2011-01-05 22:54:23 +01:00
Tassilo Horn
875c044ae2 * doc-view.el (doc-view-image-width): New variable.
(doc-view-enlarge, doc-view-insert-image): Prefer imagemagick
backend for PNG images, and do dynamic rescaling instead of
reconverting the whole doc.
2011-01-05 22:17:51 +01:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Tassilo Horn
291cc04566 * doc-view.el (doc-view-set-doc-type): New function refactored
from doc-view-mode.
(doc-view-fallback-mode): New function.
(doc-view-mode): Use it.
(doc-view-mode-maybe): New function that checks if doc-view-mode
can be used and falls back to the next best mode otherwise.

* files.el (auto-mode-alist): Use doc-view-mode-maybe for PDF,
DVI, OpenDocument, and MS Office files.
2010-12-30 19:08:18 +01:00
Tassilo Horn
f9e68477a2 * doc-view.el (doc-view-toggle-display): Perform rassq-delete-all
on a copy of auto-mode-alist, because that deletes with side
effects.
2010-12-30 15:58:32 +01:00
Tassilo Horn
ad727c819a * doc-view.el (doc-view-mode, doc-view-toggle-display): Use
normal-mode without doc-view-mode bindings in auto-mode-alist as
fallback instead of hard coding fundamental mode.
2010-12-30 15:47:53 +01:00
Tassilo Horn
b71b780322 * doc-view.el (doc-view-doc->txt): Handle OpenDocument (or MS Office) files also for searching. 2010-12-30 14:53:22 +01:00
Tassilo Horn
95e16d17b7 * doc-view.el: Implement viewing of OpenDocument (and Microsoft Office) files.
Not yet enabled via auto-mode-list.
(doc-view-unoconv-program): New custom variable.
(doc-view-mode-p): Handle new odf document type.
(doc-view-odf->pdf): New conversion function.
(doc-view-convert-current-doc): Call it for odf files.
(doc-view-mode): Recognize newly supported file extensions.
2010-12-30 14:45:09 +01:00
Karl Fogel
e44fa724e4 Preparation for setting bookmarks in Gnus article buffers (Bug#5975).
* lisp/bookmark.el (bookmark-make-record-default): Allow unneeded
  information to be omitted from the record.

Adjust declarations and calls:

* lisp/info.el (bookmark-make-record-default): Adjust declaration.
  (Info-bookmark-make-record): Adjust call.

* lisp/woman.el (bookmark-make-record-default): Adjust declaration.
  (woman-bookmark-make-record): Adjust call.

* lisp/man.el (bookmark-make-record-default): Adjust declaration.
  (Man-bookmark-make-record): Adjust call.

* lisp/image-mode.el (bookmark-make-record-default): Adjust declaration.

* lisp/doc-view.el (bookmark-make-record-default): Adjust declaration.

* lisp/gnus/gnus-sum.el (bookmark-make-record-default): Adjust declaration.
2010-07-14 11:57:54 -04:00
Chong Yidong
ff90f4b003 Minor tweaks to custom groups.
* cus-edit.el (hardware): Doc fix.

* man.el (man): Add to external custom group.

* delim-col.el (columns): Move to wp custom group.

* doc-view.el (doc-view): Add to data custom group.

* cedet/data-debug.el (data-debug): Move to extensions group.

* cedet/ede.el (ede):
* cedet/srecode.el (srecode):
* cedet/semantic.el (semantic): Put in tools and extensions group.

* nxml/nxml-mode.el (nxml-faces): Remove from font-lock-faces group.
2010-02-16 09:35:45 -05:00
Juri Linkov
0d17c4b987 * doc-view.el (doc-view-mode):
* image-mode.el (image-mode): Put property mode-class=special.
(Bug#4896)
2010-02-06 00:36:20 +02:00
Stefan Monnier
bdd428996e Fix up various corner case problems.
* doc-view.el (doc-view-last-page-number): New function.
(doc-view-mode, doc-view-last-page, doc-view-goto-page): Use it.
(doc-view-goto-page): Avoid inf-loops when the conversion fails.
(doc-view-kill-proc): Avoid inf-loop in freak cases.
(doc-view-reconvert-doc): Use the new recursive delete-directory.
(doc-view-convert-current-doc): Don't create the resolution.el file
here any more.
(doc-view-pdf/ps->png): Do it here instead.
(doc-view-already-converted-p): Check that resolution.el is present.
(doc-view-pdf->png): Don't rely on doc-view-pdf/ps->png for the few
windows that are not yet showing images.
2010-02-04 20:53:40 -05:00
Stefan Monnier
0bca393f91 (doc-view-new-window-function): Be a bit more defensive.
(doc-view-revert-buffer): New command.
(doc-view-mode-map): Use it.
2010-02-01 13:25:47 -05:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Stefan Monnier
5e9fde5e59 Make it work for non-file buffers (bug#5102).
* doc-view.el (doc-view-current-cache-dir):
Use doc-view-buffer-file-name rather than buffer-file-name.
(doc-view-mode): Use buffer-name when buffer-file-name is nil.
2009-12-07 02:37:42 +00:00
Juri Linkov
0a7457335a (doc-view-continuous):
Rename from `doc-view-continuous-mode'.
(doc-view-menu): Move "Toggle display" to the top.
Add submenu "Continuous" with radio buttons "Off"/"On"
and "Save as Default".
(doc-view-scroll-up-or-next-page)
(doc-view-scroll-down-or-previous-page)
(doc-view-next-line-or-next-page)
(doc-view-previous-line-or-previous-page): Rename
`doc-view-continuous-mode' to `doc-view-continuous'.  (Bug#4896)
2009-11-30 16:14:48 +00:00
Juri Linkov
bde04ea9ca (doc-view-mode): Set buffer-local `view-read-only' to nil
instead of switching off view-mode.  (Bug#4896)
2009-11-25 17:21:12 +00:00
Juri Linkov
7d6b4d3cad Mouse-wheel scrolling for DocView Continuous mode. (Bug#4896)
* mwheel.el (mwheel-scroll-up-function)
(mwheel-scroll-down-function): New defvars.
(mwheel-scroll): Funcall `mwheel-scroll-up-function' instead of
`scroll-up', and `mwheel-scroll-down-function' instead of
`scroll-down'.

* doc-view.el (doc-view-scroll-up-or-next-page)
(doc-view-scroll-down-or-previous-page): Add optional ARG.
Use this ARG in the call to image-scroll-up/image-scroll-down.
Change `interactive' spec to "P".  Goto next/previous page only
when `doc-view-continuous-mode' is non-nil or ARG is nil (for the
SPC/DEL case).  Doc fix.
(doc-view-next-line-or-next-page)
(doc-view-previous-line-or-previous-page): Rename arg to ARG
for consistency.
(doc-view-mode): Set buffer-local `mwheel-scroll-up-function' to
`doc-view-scroll-up-or-next-page', and buffer-local
`mwheel-scroll-down-function' to
`doc-view-scroll-down-or-previous-page'.
2009-11-25 17:18:26 +00:00
Tassilo Horn
d1d33062d3 * doc-view.el (doc-view-mode): Switch off view-mode explicitly,
because it could be enabled automatically if view-read-only is
	non-nil.
2009-11-24 07:47:45 +00:00
Juri Linkov
aefcadb650 Implement DocView Continuous mode. (Bug#4896)
* doc-view.el (doc-view-continuous-mode): New defcustom.
(doc-view-mode-map): Bind C-n/<down> to `doc-view-next-line-or-next-page',
C-p/<up> to `doc-view-previous-line-or-previous-page'.
(doc-view-next-line-or-next-page)
(doc-view-previous-line-or-previous-page): New commands.
2009-11-23 20:34:53 +00:00
Chong Yidong
0855c2caf3 * doc-view.el (doc-view-initiate-display): Add yes-or-no-p if
rendering of pngs is not possible instead of messaging a long
description.
2009-07-17 19:43:49 +00:00
Stefan Monnier
96fe38a867 (doc-view-mode): Don't give up if the file doesn't exist. 2009-04-02 21:12:54 +00:00
Chong Yidong
405ee48db3 (doc-view-sentinel): Strip trailing newline from event message. 2009-03-14 02:12:06 +00:00
Tassilo Horn
4376876ec2 (doc-view-mode-map): Bind RET to image-next-line. 2009-03-13 21:03:21 +00:00
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