unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Emacs Development <emacs-devel@gnu.org>
Subject: with-demoted-errors (was: [Emacs-diffs] trunk r114172: * lisp/saveplace.el (load-save-place-alist-from-file): Demote errors.)
Date: Tue, 10 Sep 2013 10:54:05 -0500	[thread overview]
Message-ID: <878uz4pt9e.fsf@floss.red-bean.com> (raw)
In-Reply-To: <jwvy575zx9t.fsf-monnier+emacs@gnu.org>

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.

Not a facetious question; I'm sure I'm just missing something obvious,
but having pondered I can't think of what it is, so am asking.

-Karl



  parent reply	other threads:[~2013-09-10 15:54 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   ` Karl Fogel [this message]
2013-09-10 16:07     ` with-demoted-errors Glenn Morris
2013-09-11 20:22       ` with-demoted-errors Karl Fogel

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=878uz4pt9e.fsf@floss.red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=emacs-devel@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 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).