1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-12 09:28:24 +00:00
Commit Graph

120 Commits

Author SHA1 Message Date
Glenn Morris
f0da764a5c Allow/recommend explicit args for minor-modes in file local eval:s.
* lisp/files.el (hack-one-local-variable-eval-safep):
Allow minor-modes with explicit +/-1 arguments.

* doc/emacs/custom.texi (Specifying File Variables):
Recommend explicit arguments for minor modes.

* etc/NEWS: Likewise.

* lisp/doc-view.el, lisp/net/soap-client.el: Update file locals.
2011-06-09 16:22:06 -04:00
Juanma Barranquero
8eda563d1e lisp/doc-view.el: Silence compiler warning. 2011-06-05 02:18:46 +02:00
Glenn Morris
b8f82dc15f Deprecate using "mode:" to enable minor modes (bug#8613)
* lisp/files.el (hack-one-local-variable-eval-safep):
Consider "eval: (foo-mode)" to be safe.

* doc/emacs/custom.texi (Specifying File Variables):
Deprecate using mode: for minor modes.

* etc/NEWS: Mention this.

* lisp/doc-view.el, lisp/net/soap-client.el:
Change "mode:" minor-mode file local variables to use "eval:".
2011-05-09 19:31:42 -07:00
Tassilo Horn
d7b898799f Fit contents to emacs window support for doc-view by Sho Nakatani.
2011-03-28  Sho Nakatani <lay.sakura <at> gmail.com>

	* doc-view.el (doc-view-fit-width-to-window)
	(doc-view-fit-height-to-window, doc-view-fit-page-to-window): New
	functions for fitting the shown image to the Emacs window size.
	(doc-view-mode-map): Add bindings for the new functions.
2011-04-08 22:09:19 +02:00
Stefan Monnier
b38b1ec071 Various compiler bug-fixes. MPC seems to run correctly now.
* lisp/files.el (lexical-binding): Add a safe-local-variable property.

* lisp/emacs-lisp/byte-opt.el (byte-inline-lapcode): Check how many elements
are added to the stack.
(byte-compile-splice-in-already-compiled-code): Don't touch lexical nor
byte-compile-depth now that byte-inline-lapcode does it for us.
(byte-compile-inline-expand): Don't inline dynbind byte code into
lexbind code, since it has to be done differently.

* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
Correctly extract arglist from `closure's.
(byte-compile-cl-warn): Compiler-macros are run earlier now.
(byte-compile-top-level): Bind byte-compile-lexical-environment to nil,
except for lambdas.
(byte-compile-form): Don't run the compiler-macro expander here.
(byte-compile-let): Merge with byte-compile-let*.
Don't preserve-body-value if the body's value was discarded.

* lisp/emacs-lisp/cconv.el (cconv--set-diff, cconv--set-diff-map)
(cconv--map-diff, cconv--map-diff-elem, cconv--map-diff-set): New funs.
(cconv--env-var): New constant.
(cconv-closure-convert-rec): Use it and use them.  Fix a typo that
ended up forgetting to remove entries from lmenvs in `let'.
For `lambda' use the outer `fvrs' when building the closure and don't
forget to remove `vars' from the `emvrs' and `lmenvs' of the body.

* lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block): Disable optimization
in lexbind, because it needs a different implementation.

* src/bytecode.c (exec_byte_code): Fix handling of &rest.

* src/eval.c (Vinternal_interpreter_environment): Remove.
(syms_of_eval): Do declare Vinternal_interpreter_environment as
a global lisp var, but unintern it to hide it.
(Fcommandp):
* src/data.c (Finteractive_form): Understand `closure's.
2011-02-17 16:19:13 -05:00
Igor Kuzmin
94d11cb577 * lisp/emacs-lisp/cconv.el: New file.
* lisp/emacs-lisp/bytecomp.el: Use cconv.
(byte-compile-file-form, byte-compile):
Call cconv-closure-convert-toplevel when requested.
* lisp/server.el:
* lisp/mpc.el:
* lisp/emacs-lisp/pcase.el:
* lisp/doc-view.el:
* lisp/dired.el: Use lexical-binding.
2011-02-10 13:53:49 -05:00
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