/[emacs]/emacs/lisp/image-file.el
ViewVC logotype

Diff of /emacs/lisp/image-file.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by lute, Mon Jul 4 23:08:55 2005 UTC revision 1.24 by kfstorm, Thu Jul 21 08:56:23 2005 UTC
# Line 118  the command `insert-file-contents'." Line 118  the command `insert-file-contents'."
118                (create-image data nil t))                (create-image data nil t))
119               (props               (props
120                `(display ,image                `(display ,image
121                            yank-handler (image-file-yank-handler)
122                          intangible ,image                          intangible ,image
123                          rear-nonsticky (display intangible)                          rear-nonsticky (display intangible)
124                          ;; This a cheap attempt to make the whole buffer                          ;; This a cheap attempt to make the whole buffer
# Line 135  the command `insert-file-contents'." Line 136  the command `insert-file-contents'."
136            (setq truncate-lines t))))            (setq truncate-lines t))))
137      rval))      rval))
138    
139    ;; We use a yank-handler to make yanked images unique, so that
140    ;; yanking two copies of the same image next to each other are
141    ;; recognized as two different images.
142    (defun image-file-yank-handler (string)
143      "Yank handler for inserting an image into a buffer."
144      (let ((image (get-text-property 0 'display string)))
145        (if (consp image)
146            (put-text-property 0 (length string)
147                               'display
148                               (cons (car image) (cdr image))
149                               string))
150        (insert string)))
151    
152  (put 'image-file-handler 'safe-magic t)  (put 'image-file-handler 'safe-magic t)
153  (defun image-file-handler (operation &rest args)  (defun image-file-handler (operation &rest args)
154    "Filename handler for inserting image files.    "Filename handler for inserting image files.

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26