[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: kill-buffer-if-not-modified: Wrong type argument: bufferp, t
From: |
Eli Zaretskii |
Subject: |
Re: kill-buffer-if-not-modified: Wrong type argument: bufferp, t |
Date: |
Mon, 21 Jan 2008 22:07:54 +0200 |
> From: Sven Joachim <address@hidden>
> Date: Mon, 21 Jan 2008 19:44:37 +0100
>
> The following change in EMACS_22_BASE:
>
> ,----
> | 2008-01-12 Eli Zaretskii <address@hidden>
> |
> | * 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?
Re: kill-buffer-if-not-modified: Wrong type argument: bufferp, t, Stefan Monnier, 2008/01/21