diff options
| author | Glenn Morris | 2013-02-16 11:20:21 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-02-16 11:20:21 -0800 |
| commit | 783b7b7551b197fdcfd384ac4a3d93302a073eaf (patch) | |
| tree | a007f3ffdcee66787a721458322ee0aaff673c4e | |
| parent | 61addbc212a08ba146fc7baa7b3c04071f4445fb (diff) | |
| download | emacs-783b7b7551b197fdcfd384ac4a3d93302a073eaf.tar.gz emacs-783b7b7551b197fdcfd384ac4a3d93302a073eaf.zip | |
* lisp/image-mode.el (image-mode-map): Give it a menu.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/image-mode.el | 50 |
2 files changed, 52 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dd738ca9430..17ecbd8bf31 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-02-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * image-mode.el (image-mode-map): Give it a menu. | ||
| 4 | |||
| 1 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> | 5 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 6 | ||
| 3 | * net/tramp-cache.el (tramp-connection-properties): New customer | 7 | * net/tramp-cache.el (tramp-connection-properties): New customer |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index e539848675c..b6298adeb7e 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -359,6 +359,53 @@ call." | |||
| 359 | (define-key map [remap move-end-of-line] 'image-eol) | 359 | (define-key map [remap move-end-of-line] 'image-eol) |
| 360 | (define-key map [remap beginning-of-buffer] 'image-bob) | 360 | (define-key map [remap beginning-of-buffer] 'image-bob) |
| 361 | (define-key map [remap end-of-buffer] 'image-eob) | 361 | (define-key map [remap end-of-buffer] 'image-eob) |
| 362 | (easy-menu-define image-mode-menu map "Menu for Image mode." | ||
| 363 | '("Image" | ||
| 364 | ["Show as Text" image-toggle-display :active t | ||
| 365 | :help "Show image as text"] | ||
| 366 | "--" | ||
| 367 | ["Fit Frame to Image" image-mode-fit-frame :active t | ||
| 368 | :help "Resize frame to match image"] | ||
| 369 | ["Fit to Window Height" image-transform-fit-to-height | ||
| 370 | :visible (eq image-type 'imagemagick) | ||
| 371 | :help "Resize image to match the window height"] | ||
| 372 | ["Fit to Window Width" image-transform-fit-to-width | ||
| 373 | :visible (eq image-type 'imagemagick) | ||
| 374 | :help "Resize image to match the window width"] | ||
| 375 | ["Rotate Image..." image-transform-set-rotation | ||
| 376 | :visible (eq image-type 'imagemagick) | ||
| 377 | :help "Rotate the image"] | ||
| 378 | "--" | ||
| 379 | ["Next Image" image-next-file :active t | ||
| 380 | :help "Move to next image in this directory"] | ||
| 381 | ["Previous Image" image-previous-file :active t | ||
| 382 | :help "Move to previous image in this directory"] | ||
| 383 | "--" | ||
| 384 | ["Animate Image" image-toggle-animation :style toggle | ||
| 385 | :selected (let ((image (image-get-display-property))) | ||
| 386 | (and image (image-animate-timer image))) | ||
| 387 | :active image-current-frame | ||
| 388 | :help "Toggle image animation"] | ||
| 389 | ["Loop Animation" | ||
| 390 | (lambda () (interactive) | ||
| 391 | ;;; (make-variable-buffer-local 'image-animate-loop) | ||
| 392 | (setq image-animate-loop (not image-animate-loop)) | ||
| 393 | ;; FIXME this is a hacky way to make it affect a currently | ||
| 394 | ;; animating image. | ||
| 395 | (when (let ((image (image-get-display-property))) | ||
| 396 | (and image (image-animate-timer image))) | ||
| 397 | (image-toggle-animation) | ||
| 398 | (image-toggle-animation))) | ||
| 399 | :style toggle :selected image-animate-loop | ||
| 400 | :active image-current-frame | ||
| 401 | :help "Animate images once, or forever?"] | ||
| 402 | ["Next Frame" image-next-frame :active image-current-frame | ||
| 403 | :help "Show the next frame of this image"] | ||
| 404 | ["Previous Frame" image-previous-frame :active image-current-frame | ||
| 405 | :help "Show the previous frame of this image"] | ||
| 406 | ["Goto Frame..." image-goto-frame :active image-current-frame | ||
| 407 | :help "Show a specific frame of this image"] | ||
| 408 | )) | ||
| 362 | map) | 409 | map) |
| 363 | "Mode keymap for `image-mode'.") | 410 | "Mode keymap for `image-mode'.") |
| 364 | 411 | ||
| @@ -637,8 +684,7 @@ current frame. Frames are indexed from 1." | |||
| 637 | (interactive | 684 | (interactive |
| 638 | (list (or current-prefix-arg | 685 | (list (or current-prefix-arg |
| 639 | (read-number "Show frame number: ")))) | 686 | (read-number "Show frame number: ")))) |
| 640 | (let ((image (image-get-display-property)) | 687 | (let ((image (image-get-display-property))) |
| 641 | animation) | ||
| 642 | (cond | 688 | (cond |
| 643 | ((null image) | 689 | ((null image) |
| 644 | (error "No image is present")) | 690 | (error "No image is present")) |