all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Glenn Morris <rgm@gnu.org>
Cc: Emacs Development <emacs-devel@gnu.org>
Subject: Re: with-demoted-errors
Date: Wed, 11 Sep 2013 15:22:44 -0500	[thread overview]
Message-ID: <87r4cvrtuz.fsf@kwarm.red-bean.com> (raw)
In-Reply-To: <58uz4lkxx.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 10 Sep 2013 12:07:22 -0400")

Glenn Morris <rgm@gnu.org> writes:
>Karl Fogel wrote:
>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>>>> +                      ;; This is with-demoted-errors, but we want to
>>>> +                      ;; mention save-place in any error message.
>>>> +                      (condition-case err
>>>> +                        (car (read-from-string
>>>> +                              (buffer-substring (point-min) (point-max))))
>>>> +                        (error (message "Error reading save-place-file: %S" err)
>>>> +                               nil)))
>>> 
>>>I remember having similar desires in other places.  Should we add
>>>a "format" argument to with-demoted-errors?
>>
>> I'm not sure I understand the original comment in saveplace.el,
>> actually.  Does "mention save-place" mean something special there?
>>
>> The error string already says "save-place-file", and it will print `err'
>> too...  In other words, why couldn't one just use `with-demoted-errors'
>> in that spot right now?  Another way to say it is: the BODY argument to
>> `with-demoted-errors' can format anything in its error messages that it
>> want to, so I don't see why that code in saveplace.el isn't using
>> `with-demoted-errors' already.
>
>Because
>
>(with-demoted-errors 
>   (car (read-from-string
>      (buffer-substring (point-min) (point-max)))))
>
>just prints "end-of-file", which gives you no clue that the error is
>coming from save-place.

Oh I see it now; and the proposed solution obviously makes sense.
Thanks.

-K



      reply	other threads:[~2013-09-11 20:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1VIoCR-0003nJ-A6@vcs.savannah.gnu.org>
2013-09-09 18:06 ` with-demoted-errors (was: [Emacs-diffs] trunk r114172: * lisp/saveplace.el (load-save-place-alist-from-file): Demote errors.) Stefan Monnier
2013-09-09 18:13   ` with-demoted-errors Glenn Morris
2013-09-10 15:30     ` with-demoted-errors Stefan Monnier
2013-09-10 15:54   ` with-demoted-errors (was: [Emacs-diffs] trunk r114172: * lisp/saveplace.el (load-save-place-alist-from-file): Demote errors.) Karl Fogel
2013-09-10 16:07     ` with-demoted-errors Glenn Morris
2013-09-11 20:22       ` Karl Fogel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4cvrtuz.fsf@kwarm.red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.