annotate lisp/image-mode.el @ 87757:72c1548afeed

*** empty log message ***
author Glenn Morris <rgm@gnu.org>
date Tue, 15 Jan 2008 03:44:41 +0000
parents 9ada3b121e1f
children 1341d54b08e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; image-mode.el --- support for visiting image files
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 ;;
87557
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
3 ;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 ;;
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Richard Stallman <rms@gnu.org>
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Keywords: multimedia
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
78236
9355f9b7bbff Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 77989
diff changeset
12 ;; the Free Software Foundation; either version 3, or (at your option)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; any later version.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64091
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 60943
diff changeset
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 60943
diff changeset
23 ;; Boston, MA 02110-1301, USA.
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; Defines a major mode for visiting image files
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; that allows conversion between viewing the text of the file
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; and viewing the file as an image. Viewing the image
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; works by putting a `display' text-property on the
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; image data, with the image-data still present underneath; if the
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; resulting buffer file is saved to another name it will correctly save
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; the image data to the new file.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;;; Code:
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 (require 'image)
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
39 ;;;###autoload (push '("\\.jpe?g\\'" . image-mode) auto-mode-alist)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
40 ;;;###autoload (push '("\\.png\\'" . image-mode) auto-mode-alist)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
41 ;;;###autoload (push '("\\.gif\\'" . image-mode) auto-mode-alist)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
42 ;;;###autoload (push '("\\.tiff?\\'" . image-mode) auto-mode-alist)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
43 ;;;###autoload (push '("\\.p[bpgn]m\\'" . image-mode) auto-mode-alist)
82836
4526cbe33367 Add autoloads to put associations in auto-mode-alist:
Juri Linkov <juri@jurta.org>
parents: 82770
diff changeset
44
4526cbe33367 Add autoloads to put associations in auto-mode-alist:
Juri Linkov <juri@jurta.org>
parents: 82770
diff changeset
45 ;;;###autoload (push '("\\.x[bp]m\\'" . c-mode) auto-mode-alist)
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
46 ;;;###autoload (push '("\\.x[bp]m\\'" . image-mode-maybe) auto-mode-alist)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
82836
4526cbe33367 Add autoloads to put associations in auto-mode-alist:
Juri Linkov <juri@jurta.org>
parents: 82770
diff changeset
48 ;;;###autoload (push '("\\.svgz?\\'" . xml-mode) auto-mode-alist)
4526cbe33367 Add autoloads to put associations in auto-mode-alist:
Juri Linkov <juri@jurta.org>
parents: 82770
diff changeset
49 ;;;###autoload (push '("\\.svgz?\\'" . image-mode-maybe) auto-mode-alist)
4526cbe33367 Add autoloads to put associations in auto-mode-alist:
Juri Linkov <juri@jurta.org>
parents: 82770
diff changeset
50
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
51 ;;; Image scrolling functions
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
52
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
53 (defun image-forward-hscroll (&optional n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
54 "Scroll image in current window to the left by N character widths.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
55 Stop if the right edge of the image is reached."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
56 (interactive "p")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
57 (cond ((= n 0) nil)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
58 ((< n 0)
81063
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
59 (set-window-hscroll (selected-window)
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
60 (max 0 (+ (window-hscroll) n))))
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
61 (t
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
62 (let* ((image (get-char-property (point-min) 'display))
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
63 (edges (window-inside-edges))
81063
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
64 (win-width (- (nth 2 edges) (nth 0 edges)))
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
65 (img-width (ceiling (car (image-size image)))))
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
66 (set-window-hscroll (selected-window)
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
67 (min (max 0 (- img-width win-width))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
68 (+ n (window-hscroll))))))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
69
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
70 (defun image-backward-hscroll (&optional n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
71 "Scroll image in current window to the right by N character widths.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
72 Stop if the left edge of the image is reached."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
73 (interactive "p")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
74 (image-forward-hscroll (- n)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
75
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
76 (defun image-next-line (&optional n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
77 "Scroll image in current window upward by N lines.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
78 Stop if the bottom edge of the image is reached."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
79 (interactive "p")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
80 (cond ((= n 0) nil)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
81 ((< n 0)
81063
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
82 (set-window-vscroll (selected-window)
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
83 (max 0 (+ (window-vscroll) n))))
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
84 (t
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
85 (let* ((image (get-char-property (point-min) 'display))
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
86 (edges (window-inside-edges))
81063
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
87 (win-height (- (nth 3 edges) (nth 1 edges)))
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
88 (img-height (ceiling (cdr (image-size image)))))
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
89 (set-window-vscroll (selected-window)
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
90 (min (max 0 (- img-height win-height))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
91 (+ n (window-vscroll))))))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
92
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
93 (defun image-previous-line (&optional n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
94 "Scroll image in current window downward by N lines.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
95 Stop if the top edge of the image is reached."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
96 (interactive "p")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
97 (image-next-line (- n)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
98
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
99 (defun image-scroll-up (&optional n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
100 "Scroll image in current window upward by N lines.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
101 Stop if the bottom edge of the image is reached.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
102 If ARG is omitted or nil, scroll upward by a near full screen.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
103 A near full screen is `next-screen-context-lines' less than a full screen.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
104 Negative ARG means scroll downward.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
105 If ARG is the atom `-', scroll downward by nearly full screen.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
106 When calling from a program, supply as argument a number, nil, or `-'."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
107 (interactive "P")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
108 (cond ((null n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
109 (let* ((edges (window-inside-edges))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
110 (win-height (- (nth 3 edges) (nth 1 edges))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
111 (image-next-line
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
112 (max 0 (- win-height next-screen-context-lines)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
113 ((eq n '-)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
114 (let* ((edges (window-inside-edges))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
115 (win-height (- (nth 3 edges) (nth 1 edges))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
116 (image-next-line
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
117 (min 0 (- next-screen-context-lines win-height)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
118 (t (image-next-line (prefix-numeric-value n)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
119
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
120 (defun image-scroll-down (&optional n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
121 "Scroll image in current window downward by N lines
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
122 Stop if the top edge of the image is reached.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
123 If ARG is omitted or nil, scroll downward by a near full screen.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
124 A near full screen is `next-screen-context-lines' less than a full screen.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
125 Negative ARG means scroll upward.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
126 If ARG is the atom `-', scroll upward by nearly full screen.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
127 When calling from a program, supply as argument a number, nil, or `-'."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
128 (interactive "P")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
129 (cond ((null n)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
130 (let* ((edges (window-inside-edges))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
131 (win-height (- (nth 3 edges) (nth 1 edges))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
132 (image-next-line
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
133 (min 0 (- next-screen-context-lines win-height)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
134 ((eq n '-)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
135 (let* ((edges (window-inside-edges))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
136 (win-height (- (nth 3 edges) (nth 1 edges))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
137 (image-next-line
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
138 (max 0 (- win-height next-screen-context-lines)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
139 (t (image-next-line (- (prefix-numeric-value n))))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
140
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
141 (defun image-bol (arg)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
142 "Scroll horizontally to the left edge of the image in the current window.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
143 With argument ARG not nil or 1, move forward ARG - 1 lines first,
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
144 stopping if the top or bottom edge of the image is reached."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
145 (interactive "p")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
146 (and arg
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
147 (/= (setq arg (prefix-numeric-value arg)) 1)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
148 (image-next-line (- arg 1)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
149 (set-window-hscroll (selected-window) 0))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
150
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
151 (defun image-eol (arg)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
152 "Scroll horizontally to the right edge of the image in the current window.
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
153 With argument ARG not nil or 1, move forward ARG - 1 lines first,
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
154 stopping if the top or bottom edge of the image is reached."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
155 (interactive "p")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
156 (and arg
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
157 (/= (setq arg (prefix-numeric-value arg)) 1)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
158 (image-next-line (- arg 1)))
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
159 (let* ((image (get-char-property (point-min) 'display))
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
160 (edges (window-inside-edges))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
161 (win-width (- (nth 2 edges) (nth 0 edges)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
162 (img-width (ceiling (car (image-size image)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
163 (set-window-hscroll (selected-window)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
164 (max 0 (- img-width win-width)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
165
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
166 (defun image-bob ()
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
167 "Scroll to the top-left corner of the image in the current window."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
168 (interactive)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
169 (set-window-hscroll (selected-window) 0)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
170 (set-window-vscroll (selected-window) 0))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
171
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
172 (defun image-eob ()
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
173 "Scroll to the bottom-right corner of the image in the current window."
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
174 (interactive)
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
175 (let* ((image (get-char-property (point-min) 'display))
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
176 (edges (window-inside-edges))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
177 (win-width (- (nth 2 edges) (nth 0 edges)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
178 (img-width (ceiling (car (image-size image))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
179 (win-height (- (nth 3 edges) (nth 1 edges)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
180 (img-height (ceiling (cdr (image-size image)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
181 (set-window-hscroll (selected-window) (max 0 (- img-width win-width)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
182 (set-window-vscroll (selected-window) (max 0 (- img-height win-height)))))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
183
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
184 ;;; Image Mode setup
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
185
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
186 (defvar image-type nil
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
187 "Current image type.
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
188 This variable is used to display the current image type in the mode line.")
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
189 (make-variable-buffer-local 'image-type)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
190
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (defvar image-mode-map
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 (let ((map (make-sparse-keymap)))
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 (define-key map "\C-c\C-c" 'image-toggle-display)
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
194 (define-key map [remap forward-char] 'image-forward-hscroll)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
195 (define-key map [remap backward-char] 'image-backward-hscroll)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
196 (define-key map [remap previous-line] 'image-previous-line)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
197 (define-key map [remap next-line] 'image-next-line)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
198 (define-key map [remap scroll-up] 'image-scroll-up)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
199 (define-key map [remap scroll-down] 'image-scroll-down)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
200 (define-key map [remap move-beginning-of-line] 'image-bol)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
201 (define-key map [remap move-end-of-line] 'image-eol)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
202 (define-key map [remap beginning-of-buffer] 'image-bob)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
203 (define-key map [remap end-of-buffer] 'image-eob)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 map)
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
205 "Major mode keymap for viewing images in Image mode.")
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
206
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
207 (defvar image-mode-text-map
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
208 (let ((map (make-sparse-keymap)))
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
209 (define-key map "\C-c\C-c" 'image-toggle-display)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
210 map)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
211 "Major mode keymap for viewing images as text in Image mode.")
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212
87557
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
213 (defvar bookmark-make-cell-function)
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
214
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 ;;;###autoload
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 (defun image-mode ()
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 "Major mode for image files.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 You can use \\<image-mode-map>\\[image-toggle-display]
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 to toggle between display as an image and display as text."
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 (interactive)
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 (kill-all-local-variables)
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
222 (setq mode-name "Image[text]")
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 (setq major-mode 'image-mode)
87412
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
224 ;; Use our own bookmarking function for images.
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
225 (set (make-local-variable 'bookmark-make-cell-function)
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
226 'image-bookmark-make-cell)
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
227 (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
75745
19d4ee6e5621 (image-mode): Revert 2007-01-30 changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 75626
diff changeset
228 (if (and (display-images-p)
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
229 (not (get-char-property (point-min) 'display)))
75745
19d4ee6e5621 (image-mode): Revert 2007-01-30 changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 75626
diff changeset
230 (image-toggle-display)
19d4ee6e5621 (image-mode): Revert 2007-01-30 changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 75626
diff changeset
231 ;; Set next vars when image is already displayed but local
19d4ee6e5621 (image-mode): Revert 2007-01-30 changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 75626
diff changeset
232 ;; variables were cleared by kill-all-local-variables
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
233 (use-local-map image-mode-map)
75745
19d4ee6e5621 (image-mode): Revert 2007-01-30 changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 75626
diff changeset
234 (setq cursor-type nil truncate-lines t))
72570
7011a586dd45 * image-mode.el (image-mode): Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 72568
diff changeset
235 (run-mode-hooks 'image-mode-hook)
7011a586dd45 * image-mode.el (image-mode): Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 72568
diff changeset
236 (if (display-images-p)
7011a586dd45 * image-mode.el (image-mode): Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 72568
diff changeset
237 (message "%s" (concat
7011a586dd45 * image-mode.el (image-mode): Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 72568
diff changeset
238 (substitute-command-keys
75545
4f14c21e4f44 (image-mode): Don't automatically view as image.
Chong Yidong <cyd@stupidchicken.com>
parents: 75347
diff changeset
239 "Type \\[image-toggle-display] to view as ")
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
240 (if (get-char-property (point-min) 'display)
72570
7011a586dd45 * image-mode.el (image-mode): Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 72568
diff changeset
241 "text" "an image") "."))))
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
242
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
243 ;;;###autoload
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
244 (define-minor-mode image-minor-mode
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
245 "Toggle Image minor mode.
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
246 With arg, turn Image minor mode on if arg is positive, off otherwise.
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
247 See the command `image-mode' for more information on this mode."
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
248 nil (:eval (format " Image[%s]" image-type)) image-mode-text-map
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
249 :group 'image
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
250 :version "22.1"
60943
258772850c9a (image-minor-mode): Set `cursor-type' and `truncate-lines' if the
Juri Linkov <juri@jurta.org>
parents: 60937
diff changeset
251 (if (not image-minor-mode)
258772850c9a (image-minor-mode): Set `cursor-type' and `truncate-lines' if the
Juri Linkov <juri@jurta.org>
parents: 60937
diff changeset
252 (image-toggle-display-text)
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
253 (if (get-char-property (point-min) 'display)
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
254 (setq cursor-type nil truncate-lines t)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
255 (setq image-type "text"))
60943
258772850c9a (image-minor-mode): Set `cursor-type' and `truncate-lines' if the
Juri Linkov <juri@jurta.org>
parents: 60937
diff changeset
256 (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
65582
4d1085b02d64 Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents: 64091
diff changeset
257 (message "%s" (concat (substitute-command-keys
60943
258772850c9a (image-minor-mode): Set `cursor-type' and `truncate-lines' if the
Juri Linkov <juri@jurta.org>
parents: 60937
diff changeset
258 "Type \\[image-toggle-display] to view the image as ")
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
259 (if (get-char-property (point-min) 'display)
60943
258772850c9a (image-minor-mode): Set `cursor-type' and `truncate-lines' if the
Juri Linkov <juri@jurta.org>
parents: 60937
diff changeset
260 "text" "an image") "."))))
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
261
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
262 ;;;###autoload
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
263 (defun image-mode-maybe ()
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
264 "Set major or minor mode for image files.
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
265 Set Image major mode only when there are no other major modes
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
266 associated with a filename in `auto-mode-alist'. When an image
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
267 filename matches another major mode in `auto-mode-alist' then
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
268 set that major mode and Image minor mode.
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
269
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
270 See commands `image-mode' and `image-minor-mode' for more
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
271 information on these modes."
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
272 (interactive)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
273 (let* ((mode-alist
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
274 (delq nil (mapcar
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
275 (lambda (elt)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
276 (unless (memq (or (car-safe (cdr elt)) (cdr elt))
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
277 '(image-mode image-mode-maybe))
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
278 elt))
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
279 auto-mode-alist))))
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
280 (if (assoc-default buffer-file-name mode-alist 'string-match)
75568
146ba0f8974c (image-mode-maybe): Prevent magic-mode-alist from
Jason Rumney <jasonr@gnu.org>
parents: 75547
diff changeset
281 (let ((auto-mode-alist mode-alist)
146ba0f8974c (image-mode-maybe): Prevent magic-mode-alist from
Jason Rumney <jasonr@gnu.org>
parents: 75547
diff changeset
282 (magic-mode-alist nil))
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
283 (set-auto-mode)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
284 (image-minor-mode t))
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
285 (image-mode))))
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
286
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
287 (defun image-toggle-display-text ()
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
288 "Showing the text of the image file."
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
289 (if (get-char-property (point-min) 'display)
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
290 (image-toggle-display)))
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291
71939
3c0fceee4b4a (tar-superior-buffer, archive-superior-buffer):
Richard M. Stallman <rms@gnu.org>
parents: 70943
diff changeset
292 (defvar archive-superior-buffer)
3c0fceee4b4a (tar-superior-buffer, archive-superior-buffer):
Richard M. Stallman <rms@gnu.org>
parents: 70943
diff changeset
293 (defvar tar-superior-buffer)
3c0fceee4b4a (tar-superior-buffer, archive-superior-buffer):
Richard M. Stallman <rms@gnu.org>
parents: 70943
diff changeset
294
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 (defun image-toggle-display ()
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 "Start or stop displaying an image file as the actual image.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 This command toggles between showing the text of the image file
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 and showing the image as an image."
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 (interactive)
85800
0810efbbb396 (image-forward-hscroll, image-next-line, image-eol)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82944
diff changeset
300 (if (get-char-property (point-min) 'display)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (let ((inhibit-read-only t)
60780
391ee1dd9e7a Handle .xpm files too.
Richard M. Stallman <rms@gnu.org>
parents: 60697
diff changeset
302 (buffer-undo-list t)
391ee1dd9e7a Handle .xpm files too.
Richard M. Stallman <rms@gnu.org>
parents: 60697
diff changeset
303 (modified (buffer-modified-p)))
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 (remove-list-of-text-properties (point-min) (point-max)
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 '(display intangible read-nonsticky
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 read-only front-sticky))
60780
391ee1dd9e7a Handle .xpm files too.
Richard M. Stallman <rms@gnu.org>
parents: 60697
diff changeset
307 (set-buffer-modified-p modified)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (kill-local-variable 'cursor-type)
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 (kill-local-variable 'truncate-lines)
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
310 (kill-local-variable 'auto-hscroll-mode)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
311 (use-local-map image-mode-text-map)
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
312 (setq image-type "text")
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
313 (if (eq major-mode 'image-mode)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
314 (setq mode-name "Image[text]"))
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
315 (if (called-interactively-p)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
316 (message "Repeat this command to go back to displaying the image")))
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 ;; Turn the image data into a real image, but only if the whole file
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 ;; was inserted
81019
a1b4792efa5e (image-toggle-display): Don't clear image cache. Only use filename in
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
319 (let* ((filename (buffer-file-name))
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
320 (data-p (not (and filename
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
321 (file-readable-p filename)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
322 (not (file-remote-p filename))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
323 (not (buffer-modified-p))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
324 (not (and (boundp 'archive-superior-buffer)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
325 archive-superior-buffer))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
326 (not (and (boundp 'tar-superior-buffer)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
327 tar-superior-buffer)))))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
328 (file-or-data (if data-p
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
329 (string-make-unibyte
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
330 (buffer-substring-no-properties (point-min) (point-max)))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
331 filename))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
332 (type (image-type file-or-data nil data-p))
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
333 (image (create-image file-or-data type data-p))
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (props
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 `(display ,image
81063
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
336 intangible ,image
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
337 rear-nonsticky (display intangible)
b3fc5c4daa5f (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 81019
diff changeset
338 read-only t front-sticky (read-only)))
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
339 (inhibit-read-only t)
60780
391ee1dd9e7a Handle .xpm files too.
Richard M. Stallman <rms@gnu.org>
parents: 60697
diff changeset
340 (buffer-undo-list t)
391ee1dd9e7a Handle .xpm files too.
Richard M. Stallman <rms@gnu.org>
parents: 60697
diff changeset
341 (modified (buffer-modified-p)))
81019
a1b4792efa5e (image-toggle-display): Don't clear image cache. Only use filename in
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
342 (image-refresh image)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 (add-text-properties (point-min) (point-max) props)
60780
391ee1dd9e7a Handle .xpm files too.
Richard M. Stallman <rms@gnu.org>
parents: 60697
diff changeset
344 (set-buffer-modified-p modified)
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 ;; Inhibit the cursor when the buffer contains only an image,
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 ;; because cursors look very strange on top of images.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 (setq cursor-type nil)
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 ;; This just makes the arrow displayed in the right fringe
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 ;; area look correct when the image is wider than the window.
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 (setq truncate-lines t)
77989
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
351 ;; Allow navigation of large images
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
352 (set (make-local-variable 'auto-hscroll-mode) nil)
6393038dae4d (image-forward-hscroll, image-backward-hscroll)
Chong Yidong <cyd@stupidchicken.com>
parents: 75745
diff changeset
353 (use-local-map image-mode-map)
82944
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
354 (setq image-type type)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
355 (if (eq major-mode 'image-mode)
827101d5eacc (image-type): New variable.
Juri Linkov <juri@jurta.org>
parents: 82836
diff changeset
356 (setq mode-name (format "Image[%s]" type)))
60937
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
357 (if (called-interactively-p)
ddcbccff39ce Optimize image filename extension regexps in
Juri Linkov <juri@jurta.org>
parents: 60780
diff changeset
358 (message "Repeat this command to go back to displaying the file as text")))))
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359
87412
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
360 ;;; Support for bookmark.el
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
361
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
362 (defun image-bookmark-make-cell (annotation &rest args)
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
363 (let ((the-record
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
364 `((filename . ,(buffer-file-name))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
365 (image-type . ,image-type)
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
366 (position . ,(point))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
367 (handler . image-bookmark-jump))))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
368
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
369 ;; Take no chances with text properties
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
370 (set-text-properties 0 (length annotation) nil annotation)
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
371
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
372 (when annotation
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
373 (nconc the-record (list (cons 'annotation annotation))))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
374
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
375 ;; Finally, return the completed record.
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
376 the-record))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
377
87557
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
378 (declare-function bookmark-get-filename "bookmark" (bookmark))
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
379 (declare-function bookmark-get-bookmark-record "bookmark" (bookmark))
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
380 (declare-function bookmark-get-position "bookmark" (bookmark))
9ada3b121e1f (bookmark-make-cell-function)
Glenn Morris <rgm@gnu.org>
parents: 87521
diff changeset
381
87412
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
382 ;;;###autoload
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
383 (defun image-bookmark-jump (bmk)
87521
0140d3ebb262 Change a return type, for greater extensibility. See
Karl Fogel <kfogel@red-bean.com>
parents: 87412
diff changeset
384 ;; This implements the `handler' function interface for record type
0140d3ebb262 Change a return type, for greater extensibility. See
Karl Fogel <kfogel@red-bean.com>
parents: 87412
diff changeset
385 ;; returned by `bookmark-make-cell-function', which see.
87412
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
386 (save-window-excursion
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
387 (let ((filename (bookmark-get-filename bmk))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
388 (type (cdr (assq 'image-type (bookmark-get-bookmark-record bmk))))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
389 (pos (bookmark-get-position bmk)))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
390 (find-file filename)
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
391 (when (not (string= image-type type))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
392 (image-toggle-display))
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
393 (when (string= image-type "text")
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
394 (goto-char pos))
87521
0140d3ebb262 Change a return type, for greater extensibility. See
Karl Fogel <kfogel@red-bean.com>
parents: 87412
diff changeset
395 `((buffer ,(current-buffer)) (position ,(point))))))
87412
f6ce12419345 2007-12-26 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents: 85800
diff changeset
396
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 (provide 'image-mode)
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398
60697
d9c9ad74e719 Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 60694
diff changeset
399 ;; arch-tag: b5b2b7e6-26a7-4b79-96e3-1546b5c4c6cb
60694
9e7ee067df09 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 ;;; image-mode.el ends here