From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: kill-buffer-if-not-modified: Wrong type argument: bufferp, t Date: Mon, 21 Jan 2008 22:07:54 +0200 Message-ID: References: <87fxwrc92i.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1200946101 16650 80.91.229.12 (21 Jan 2008 20:08:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2008 20:08:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Sven Joachim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 21 21:08:39 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JH2wX-0007T3-9w for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2008 21:08:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JH2w7-0005zS-OZ for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2008 15:08:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JH2w3-0005yv-99 for emacs-devel@gnu.org; Mon, 21 Jan 2008 15:07:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JH2w0-0005yQ-9C for emacs-devel@gnu.org; Mon, 21 Jan 2008 15:07:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JH2w0-0005yN-2z for emacs-devel@gnu.org; Mon, 21 Jan 2008 15:07:56 -0500 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JH2vz-00064s-M4 for emacs-devel@gnu.org; Mon, 21 Jan 2008 15:07:55 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-11-6.inter.net.il [80.230.11.6]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id IXY72902 (AUTH halo1); Mon, 21 Jan 2008 22:05:24 +0200 (IST) In-reply-to: <87fxwrc92i.fsf@gmx.de> (message from Sven Joachim on Mon, 21 Jan 2008 19:44:37 +0100) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87233 Archived-At: > From: Sven Joachim > Date: Mon, 21 Jan 2008 19:44:37 +0100 > > The following change in EMACS_22_BASE: > > ,---- > | 2008-01-12 Eli Zaretskii > | > | * 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. Sorry for messing up. Please show me the full traceback, I didn't expect this function to be called with t as its argument. > 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)))) I'm not sure this is the right fix, that's why I want to see the traceback. > Eli, is switching away from the buffer even if it is modified the > intended behavior? Sorry, I don't understand the question. Could you please explain?