comparison lisp/view.el @ 79917:65bec4800891

Sven Joachim <svenjoac at gmx.de> (kill-buffer-if-not-modified): Don't pass t to buffer-modified-p.
author Glenn Morris <rgm@gnu.org>
date Fri, 25 Jan 2008 04:39:51 +0000
parents 2be6cb49457d
children
comparison
equal deleted inserted replaced
79916:a959314f358f 79917:65bec4800891
242 ;; kill a buffer modified by the user. A buffer in view mode can 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 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. 244 ;; types C-x C-q again to return to view mode.
245 (defun kill-buffer-if-not-modified (buf) 245 (defun kill-buffer-if-not-modified (buf)
246 "Like `kill-buffer', but does nothing if the buffer is modified." 246 "Like `kill-buffer', but does nothing if the buffer is modified."
247 (let ((buf (or (bufferp buf) (get-buffer buf)))) 247 (let ((buf (get-buffer buf)))
248 (and buf (not (buffer-modified-p buf)) 248 (and buf (not (buffer-modified-p buf))
249 (kill-buffer buf)))) 249 (kill-buffer buf))))
250 250
251 ;;;###autoload 251 ;;;###autoload
252 (defun view-file (file) 252 (defun view-file (file)