Commit graph

216 commits

Author SHA1 Message Date
John Shahid
ee3e432300 Optionally add argument description in minor mode DOC (bug#10754)
Add a paragraph to minor mode's docstring documenting the mode's ARG
usage if the supplied docstring doesn't already contain the word "ARG".

* easy-mmode.el (easy-mmode--arg-docstring): New const.
(easy-mmode--arg-docstring): New function.
(define-minor-mode): Use them.

Remove argument documentation from all minor modes.
2018-07-01 23:34:53 -04:00
Stefan Monnier
a5511956b4 New functions to switch back and forth to another major mode
* subr.el (major-mode--suspended): New var.
(major-mode-suspend, major-mode-restore): New funs, extracted from doc-view.
* doc-view.el (doc-view--previous-major-mode): Remove.
(doc-view-mode): Use major-mode-suspend.
(doc-view-fallback-mode): Use major-mode-restore.
* hexl-mode.el (hexl-mode--minor-mode-p, hexl-mode--setq-local): Remove.
(hexl-mode): Use major-mode-suspend and hexl-follow-ascii-mode.
(hexl-mode-exit): Use major-mode-restore.
(hexl-activate-ruler, hexl-follow-line): Don't bother trying to preserve
earlier state, now that entering/leaving hexl-mode kills local vars.
(hexl-follow-ascii-mode): New proper local minor mode.
(hexl-follow-ascii): Rewrite, using it.
* image-mode.el (image-mode-previous-major-mode): Remove.
(image-mode): Use major-mode-suspend.
(image-mode-to-text): Use major-mode-restore.
2018-06-21 23:30:11 -04:00
Glenn Morris
db71b31827 Merge from origin/emacs-26
5a6bb01 (origin/emacs-26) Fix building etc/DOC in the MSDOS port
274c979 * lisp/select.el (gui-get-selection): Doc fix.
ad731b0 ; * doc/lispref/display.texi (Temporary Displays): Fix typos.
f1450e9 Complete documentation of syntax flags by adding `c'
6bdcaec Fix typos and minor wording issues in ELisp manual
febac27 Merge branch 'emacs-26' of git.savannah.gnu.org:/srv/git/emac...
6c2e21e Avoid segfault in processes of type 'pipe'
60e10c5 Remove repetitions in documentation strings
208e752 * lisp/image.el (image-load-path): Doc fix.
92e0fd8 ; * etc/NEWS: Remove a FIXME.  (Bug#31122)

Conflicts:
	etc/NEWS
2018-04-14 07:50:45 -07:00
Lars Ingebrigtsen
c768fe1be0 Make image-mode respect `imagemagick-types-inhibit'
* lisp/image-mode.el (image--imagemagick-wanted-p): New function
(bug#29584).
(image-toggle-display-image): Use it to see whether we want to use
imagemagick.
2018-04-14 15:36:53 +02:00
Robert Pluim
60e10c5031 Remove repetitions in documentation strings
* lisp/bindings.el (right-word): Remove repetition
(left-word): Likewise.

* lisp/image-mode.el (image-mode-as-hex): Likewise.

* lisp/cedet/semantic/tag-ls.el (semantic-tag-similar-p): Likewise.

* lisp/textmodes/reftex-vars.el (reftex-view-crossref-extra): Likewise
2018-04-13 12:10:37 +02:00
Juri Linkov
3c46315d21 * lisp/tar-mode.el (tar-summarize-buffer): Let-bind `create-lockfiles' to nil
instead of `buffer-file-truename'.  (Bug#30215)

* lisp/image-mode.el (image-toggle-display-image): Idem.
2018-01-28 23:27:32 +02:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Paul Eggert
bcf244ef9b Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
2017-01-01 01:10:47 -08:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Mark Oteiza
cdf5340f51 New commands image-scroll-left and image-scroll-right
* etc/NEWS: Mention them.
* lisp/image-mode.el (image-scroll-left, image-scroll-right): New
functions.
2016-12-15 21:59:15 -05:00
Mark Oteiza
0c77bcb393 * lisp/image-mode.el (image-mode-winprops-alist): Add docstring. 2016-12-14 16:38:18 -05:00
Nicolas Petton
b176d16934
Fix auto-reverting image-mode buffer (bug#21598)
When auto-reverting an image buffer, `image-mode' is not called since
`revert-buffer' is called with `preserve-modes' set to non-nil.

* lisp/image-mode.el (image-after-revert-hook): Check if there is an
image display property for the current buffer before updating it.
2016-07-25 23:40:35 +02:00
Lars Ingebrigtsen
6b3d64854f Revert "alas, a map can have only one parent"
This reverts commit d05806fda1.

This had already been fixed by using `make-composed-map'.  And
we don't want image-map to inherit from special-mode-map, anyway.
2016-05-02 20:08:48 +02:00
Sam Steingold
d05806fda1 alas, a map can have only one parent
* lisp/image-mode.el (image-model-map): Cannot have two parents.
* lisp/image.el (image-map): Inherit from `special-mode-map'.
2016-05-02 11:47:40 -04:00
Lars Magne Ingebrigtsen
12846626bf Call `make-composed-keymap' correctly
* lisp/image-mode.el (image-mode-map): Call
`make-composed-keymap' correctly.
2016-04-24 17:21:18 +02:00
Lars Magne Ingebrigtsen
b7a21984cc Use `make-composed-keymap' instead of copying the keymap
* lisp/image-mode.el (image-mode-map): Use
`make-composed-keymap' instead of copying the keymap.
2016-04-24 17:11:23 +02:00
Lars Magne Ingebrigtsen
43cc5d8bdf Make `q' etc work in image mode again
* lisp/image-mode.el (image-mode-map): Restore
special-mode-map as the parent keymap of image-mode-map (bug#23167).
2016-04-24 16:22:31 +02:00
Alexander Kuleshov
c483d0530a Support switching to hexl-mode from image-mode
* lisp/image-mode.el (image-toggle-hex-display)
(image-mode-to-text): New functions.
(image-mode-map, image-minor-mode-map): Bind "C-c C-x" to
image-toggle-hex-display.
(image-mode-map): New menu item "Show as Hex".
(image-mode): Update doc string and echo-area message.
(image-toggle-display): Support toggle to hex.  (Bug#22453)

* doc/emacs/files.texi (File Conveniences): Document
'image-toggle-hex-display'.
2016-02-27 19:27:31 +02:00
Lars Ingebrigtsen
378d138e64 Make image commands available in image-mode
* lisp/image-mode.el (image-mode-map): Inherit from
`image-map' so that the usual image commands work.
2016-02-24 18:11:46 +11:00
Glenn Morris
96f6cace6b Don't hard-code 1 as point-min.
* lisp/image-mode.el (image-display-size):
* lisp/xwidget.el (xwidget-webkit-last-session)
(xwidget-webkit-current-session): Don't hard-code 1 as point-min.
2016-01-19 19:09:45 -05:00
Glenn Morris
0b356a6aeb Avoid advising image-display-size for xwidgets.
* lisp/xwidget.el (xwidget-image-display-size): Remove.
(image-display-size): Remove advice.
* lisp/image-mode.el (xwidget-info, xwidget-at): Declare.
(image-display-size): Incorporate xwidget code directly.
2016-01-19 18:13:07 -05:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Daiki Ueno
1721600d24 * lisp/image-mode.el: Support encrypted file
(image-toggle-display-image): Read content from the buffer instead
of the file, if the buffer holds a decrypted data.  (Bug#21870)
2015-11-17 11:49:40 +09:00
Artur Malabarba
e14961fca1 image-mode.el (image-kill-buffer): New command bound to k. 2015-02-06 07:43:50 -02:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Lars Magne Ingebrigtsen
c59f47da5c * image-mode.el: Move defvars earlier to avoid a byte-compilation warning. 2014-09-18 20:38:05 +02:00
Lars Magne Ingebrigtsen
999c35f472 Preserve the aspect ratio when fitting to width/height
* image-mode.el (image-toggle-display-image): If we have a
`fit-width' or a `fit-height', don't limit the size of the image
to the window size, because that doesn't preserve the aspect
ratio.
2014-09-18 20:34:59 +02:00
Lars Magne Ingebrigtsen
9e6adaec87 Allow resetting image transform options
* image-mode.el (image-transform-reset): New command and menu item.
(image-mode-map): Rearrange the menu items to put presumably more
obscure items at the end.
2014-08-12 16:16:45 +02:00
Lars Magne Ingebrigtsen
81d0eae714 Use a max-width when displaying images
* lisp/image-mode.el (image-toggle-display-image): Alway rescale images
to not be bigger than the current window.
2014-08-05 20:18:39 +02:00
Stefan Monnier
9253f7af87 * lisp/image-mode.el (image-mode-window-put): Don't assume there's a `t'
entry in image-mode-winprops-alist.
2014-04-21 10:34:49 -04:00
Ian D
e51c8d91c2 * lisp/image-mode.el (image-mode-window-put): Also update the property of
the "default window".
* lisp/doc-view.el (doc-view-new-window-function): If no window
exists,	move to the last known page.
2014-04-16 23:58:25 -04:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Glenn Morris
3a2ddc2d18 Add functions to change the speed of animated images
* lisp/image-mode.el (image-mode-map): Add menu items to reverse,
increase, decrease, reset animation speed.
(image--set-speed, image-increase-speed, image-decrease-speed)
(image-reverse-speed, image-reset-speed): New functions.
(image-mode-map): Add bindings for speed commands.

* lisp/image.el (image-animate-get-speed, image-animate-set-speed):
New functions.
(image-animate-timeout): Respect image :speed property.

* etc/NEWS: Mention this.
2013-08-15 23:33:08 -07:00
Stefan Monnier
4fd996b389 * lisp/image-mode.el (image-mode-reapply-winprops): Call image-mode-winprops
even if there's no `display' property yet.

Fixes: debbugs:14435
2013-05-26 20:59:33 -04:00
Stefan Monnier
5010583555 * lisp/image-mode.el (image-mode-winprops): Add winprops to
image-mode-winprops-alist before running image-mode-new-window-functions.
* lisp/doc-view.el (doc-view-new-window-function): Don't delay
doc-view-goto-page via timers.

Fixes: debbugs:14435
2013-05-24 13:42:23 -04:00
Glenn Morris
5db881d0da * lisp/image-mode.el (image-mode): Add mouse bindings for mode-line-process. 2013-02-21 20:34:06 -05:00
Glenn Morris
dc50451531 Rework recent image-multi-frame stuff a little
* image.el (image-current-frame): Change from variable to function.
(image-show-frame): Rename from image-nth-frame.  Update callers.

* image-mode.el (image-multi-frame): New variable.
(image-mode-map, image-mode, image-goto-frame):
Use image-multi-frame rather than image-current-frame.
(image-mode, image-goto-frame):
Use image-current-frame as function rather than as variable.
2013-02-19 23:57:33 -08:00
Glenn Morris
f05e2ff2e3 * lisp/image-mode.el (image-mode-map): Add image-dired menu entry. 2013-02-16 16:50:41 -08:00
Glenn Morris
ed8d7fcaa2 Generalize "animated" images to "multi-frame" images
* lisp/image.el (image-animated-types): Remove.
(image-multi-frame-p): Rename from image-animated-p, and generalize.
(image-animated-p): Make obsolete alias.
(image-animate, image-nth-frame, image-animate-timeout):
Use image-multi-frame-p.
(image-animate-timeout): If no delay, use image-default-frame-delay.

* lisp/image-mode.el (image-mode, image-toggle-animation):
Use image-multi-frame-p.
(image-mode): Adjust startup message for a multi-frame image.

* lisp/gnus/shr.el (shr-put-image): Only animate images that specify a delay.
This is consistent with the old image-animated-p behavior.

* etc/NEWS: Add placeholder for this.

Fixes: debbugs:10739
2013-02-16 11:56:50 -08:00
Glenn Morris
783b7b7551 * lisp/image-mode.el (image-mode-map): Give it a menu. 2013-02-16 11:20:21 -08:00
Glenn Morris
c0211c4e37 Add commands for navigating multi-frame images
* lisp/image.el (image-nth-frame): New, split from image-animate-timeout.
(image-animate-timeout): Use image-nth-frame.

* lisp/image-mode.el (image-goto-frame, image-next-frame)
(image-previous-frame): New commands.
(image-mode-map): Add new frame commands.

* etc/NEWS: Mention this.
2013-02-15 19:29:39 -08:00
Glenn Morris
bb9dfee1d6 Display a mode-line frame counter for animated images
* lisp/image.el (image-current-frame): New variable.
(image-animate-timeout): Set image-current-frame.

* lisp/image-mode.el (image-mode): For animated images,
display a frame counter via mode-line-process.
2013-02-15 20:58:20 -05:00
Juri Linkov
9cec74cfd7 Add more keymaps where S-SPC scrolls in the opposite direction to SPC.
* lisp/image-mode.el (image-mode-map):
* lisp/doc-view.el (doc-view-mode-map):
* lisp/vc/ediff-util.el (ediff-setup-keymap):
Make S-SPC scroll in the opposite sense to SPC. 

* lisp/gnus/gnus-art.el (gnus-article-mode-map):
* lisp/gnus/gnus-sum.el (gnus-summary-mode-map, gnus-summary-article-map):
Make S-SPC scroll in the opposite sense to SPC.  (Bug#2145)
2013-02-13 10:28:47 +02:00
Christian Wittern
20de6ab6a5 * image-mode.el (image-next-file, image-previous-file): New commands.
(image-mode-map): Bind them to n and p.
(image-mode--images-in-directory): New helper function.

Fixes: debbugs:8453
2013-01-19 23:22:38 +08:00
Chong Yidong
2a43515aaa * image-mode.el (image-mode-fit-frame): Add a frame argument.
Suggested by Drew Adams.  Handle window decorations;
save and restore the old window configuration.

Fixes: debbugs:7730
2013-01-19 18:34:07 +08:00
Stefan Monnier
08ce64e637 * lisp/image-mode.el (image-mode-winprops): Don't throw away the fallback
`t' pseudo-window entry.
2013-01-09 17:47:27 -05:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Wolfgang Jenkner
977f932513 lisp/image-mode.el (image-transform-check-size): Use assertions only
for images of type imagemagick.

Otherwise no error, image-transform-fit-to-{width,height} is
silently ignored, as before.  Doc fix.
2012-11-23 18:41:01 +01:00
Stefan Monnier
83600dc899 * lisp/image-mode.el: Use lexical-binding.
(image-mode-winprops): Use t to stand for the window of a buffer that's
not displayed.
* lisp/doc-view.el (doc-view-new-window-function): Handle t in winprops.
(doc-view-enlarge): Make it a real nop if the size is not changed.
(doc-view-display): Handle the case where the buffer is not (yet?)
displayed in any window.
(doc-view-saved-settings): New var.
(doc-view-mode): Use it.
(doc-view-fallback-mode): Set it.
2012-09-26 23:16:35 -04:00