emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Re: [BUG?] muse-publish handling abnormal exit duri


From: drkm
Subject: [emacs-wiki-discuss] Re: [BUG?] muse-publish handling abnormal exit during call to publish
Date: Fri, 15 Jul 2005 19:52:24 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (windows-nt)

Peter K.Lee <address@hidden> writes:

> Perhaps.  The issue I have with the current macro has more to do with
> the fact that the request to close the buffer comes *before* the error
> is thrown.

  IMHO, it comes after the error is thrown, while walking througt
the stack, when encountering 'with-temp-buffer'.  So it comes
before the error is /displayed/.

> So, when you're making the decision whether to close the buffer (and
> discard the content), or keep it around, you have no idea what you
> should do (or why you're asked for that matter).

  Yes, it's a pitty.

  BTW, I can't reproduce such a request to save the temporary
buffer.  Calling the following function results in displaying the
error, and beeping, in the usual way:

    (defun drkm:test ()
      (interactive)
      (with-temp-buffer
        (insert "To modify the buffer...")
        (error "Some error")))

  Here is the definition of 'with-temp-buffer' on my Emacs:

    (defmacro with-temp-buffer (&rest body)
      "Create a temporary buffer, and evaluate BODY there like `progn'.
    See also `with-temp-file' and `with-output-to-string'."
      (declare (indent 0) (debug t))
      (let ((temp-buffer (make-symbol "temp-buffer")))
        `(let ((,temp-buffer (generate-new-buffer " *temp*")))
           (unwind-protect
               (with-current-buffer ,temp-buffer
                 ,@body)
             (and (buffer-name ,temp-buffer)
                  (kill-buffer ,temp-buffer))))))

  What's the version of the Emacs you use?

--drkm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]