[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
with-demoted-errors (was: [Emacs-diffs] trunk r114172: * lisp/saveplace.
From: |
Karl Fogel |
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 |
From: Stefan Monnier <address@hidden>
>> + ;; 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