Mercurial > emacs
comparison lisp/view.el @ 79880:2be6cb49457d
Add comment before kill-buffer-if-not-modified.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 19 Jan 2008 14:04:35 +0000 |
parents | 8b17197a6be3 |
children | 65bec4800891 5d58981e6690 |
comparison
equal
deleted
inserted
replaced
79879:457037a18993 | 79880:2be6cb49457d |
---|---|
236 (setq minor-mode-map-alist | 236 (setq minor-mode-map-alist |
237 (cons (cons 'view-mode view-mode-map) minor-mode-map-alist))) | 237 (cons (cons 'view-mode view-mode-map) minor-mode-map-alist))) |
238 | 238 |
239 ;;; Commands that enter or exit view mode. | 239 ;;; Commands that enter or exit view mode. |
240 | 240 |
241 ;; This is used when view mode is exited, to make sure we don't try to | |
242 ;; kill a buffer modified by the user. A buffer in view mode can | |
243 ;; become modified if the user types C-x C-q, edits the buffer, then | |
244 ;; types C-x C-q again to return to view mode. | |
241 (defun kill-buffer-if-not-modified (buf) | 245 (defun kill-buffer-if-not-modified (buf) |
242 "Like `kill-buffer', but does nothing if the buffer is modified." | 246 "Like `kill-buffer', but does nothing if the buffer is modified." |
243 (let ((buf (or (bufferp buf) (get-buffer buf)))) | 247 (let ((buf (or (bufferp buf) (get-buffer buf)))) |
244 (and buf (not (buffer-modified-p buf)) | 248 (and buf (not (buffer-modified-p buf)) |
245 (kill-buffer buf)))) | 249 (kill-buffer buf)))) |