unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* kill-buffer-if-not-modified: Wrong type argument: bufferp, t
@ 2008-01-21 18:44 Sven Joachim
  2008-01-21 19:55 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Sven Joachim @ 2008-01-21 18:44 UTC (permalink / raw)
  To: emacs-devel

The following change in EMACS_22_BASE:

,----
| 2008-01-12  Eli Zaretskii  <eliz@gnu.org>
| 
| 	* view.el (view-file-other-window, view-file-other-frame): Don't
| 	kill the buffer if it is modified.  Doc fixes.
| 	(kill-buffer-if-not-modified): New function.
| 	(view-file): Don't kill the buffer if it is modified.
`----

causes the error mentioned in the subject every time view-mode is
exited.  It seems that this patch fixes the issue:

--8<---------------cut here---------------start------------->8---
--- view.el	21 Jan 2008 18:51:02 +0100	1.84.2.9
+++ view.el	21 Jan 2008 19:26:10 +0100	
@@ -244,7 +244,9 @@
 ;; types C-x C-q again to return to view mode.
 (defun kill-buffer-if-not-modified (buf)
   "Like `kill-buffer', but does nothing if the buffer is modified."
-  (let ((buf (or (bufferp buf) (get-buffer buf))))
+  (let ((buf (if (bufferp buf)
+		 buf
+	       (get-buffer buf))))
     (and buf (not (buffer-modified-p buf))
 	 (kill-buffer buf))))
 
--8<---------------cut here---------------end--------------->8---

Changelog entry:

2008-01-21  Sven Joachim  <svenjoac@gmx.de>

	* view.el (kill-buffer-if-not-modified): Fix argument to kill-buffer.

Eli, is switching away from the buffer even if it is modified the
intended behavior?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-01-25  4:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 18:44 kill-buffer-if-not-modified: Wrong type argument: bufferp, t Sven Joachim
2008-01-21 19:55 ` Andreas Schwab
2008-01-21 20:07 ` Eli Zaretskii
2008-01-21 20:44   ` Sven Joachim
2008-01-22  6:55     ` Sven Joachim
2008-01-22 13:57       ` martin rudalics
2008-01-24 18:48     ` Sven Joachim
2008-01-25  4:42       ` Glenn Morris
2008-01-21 20:08 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).