Mercurial > hg > xemacs-beta
comparison lisp/modes/image-mode.el @ 169:15872534500d r20-3b11
Import from CVS: tag r20-3b11
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:46:53 +0200 |
parents | 85ec50267440 |
children | 78f53ef88e17 |
comparison
equal
deleted
inserted
replaced
168:9851d5c6556e | 169:15872534500d |
---|---|
2 | 2 |
3 ;; Copyright (C) 1997 MORIOKA Tomohiko | 3 ;; Copyright (C) 1997 MORIOKA Tomohiko |
4 | 4 |
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | 5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
6 ;; Created: 1997/6/27 | 6 ;; Created: 1997/6/27 |
7 ;; Version: $Id: image-mode.el,v 1.1 1997/06/29 23:12:55 steve Exp $ | 7 ;; Version: image-mode.el,v 20.3.1.2 1997/07/01 17:29:44 morioka Exp |
8 ;; Keywords: image, graphics | 8 ;; Keywords: image, graphics |
9 | 9 |
10 ;; This file is part of XEmacs. | 10 ;; This file is part of XEmacs. |
11 | 11 |
12 ;; XEmacs is free software; you can redistribute it and/or modify it | 12 ;; XEmacs is free software; you can redistribute it and/or modify it |
121 "Exit image-mode." | 121 "Exit image-mode." |
122 (interactive) | 122 (interactive) |
123 (kill-buffer (current-buffer)) | 123 (kill-buffer (current-buffer)) |
124 ) | 124 ) |
125 | 125 |
126 (defun image-maybe-restore () | |
127 "Restore buffer from file if it is decoded as `buffer-file-format'." | |
128 (when (and buffer-file-format | |
129 buffer-file-name) | |
130 (setq buffer-read-only nil) | |
131 (erase-buffer) | |
132 (map-extents (function | |
133 (lambda (extent maparg) | |
134 (delete-extent extent) | |
135 )) nil (point-min)(point-min)) | |
136 (setq buffer-file-format nil) | |
137 (insert-file-contents-literally buffer-file-name) | |
138 (set-buffer-modified-p nil) | |
139 )) | |
140 | |
141 (add-hook 'change-major-mode-hook 'image-maybe-restore) | |
142 | |
143 | |
126 ;;;###autoload | 144 ;;;###autoload |
127 (defun image-mode (&optional arg) | 145 (defun image-mode (&optional arg) |
128 "\\{image-mode-map}" | 146 "\\{image-mode-map}" |
129 (interactive) | 147 (interactive) |
130 (setq major-mode 'image-mode) | 148 (setq major-mode 'image-mode) |