From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: with-demoted-errors Date: Tue, 10 Sep 2013 12:07:22 -0400 Message-ID: <58uz4lkxx.fsf@fencepost.gnu.org> References: <878uz4pt9e.fsf@floss.red-bean.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1378829254 7386 80.91.229.3 (10 Sep 2013 16:07:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2013 16:07:34 +0000 (UTC) Cc: Emacs Development To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 10 18:07:37 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJQTY-00017Q-Kx for ged-emacs-devel@m.gmane.org; Tue, 10 Sep 2013 18:07:36 +0200 Original-Received: from localhost ([::1]:58958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQTX-0005Jv-Rw for ged-emacs-devel@m.gmane.org; Tue, 10 Sep 2013 12:07:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQTR-0005Iv-9u for emacs-devel@gnu.org; Tue, 10 Sep 2013 12:07:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJQTM-0006OO-Fq for emacs-devel@gnu.org; Tue, 10 Sep 2013 12:07:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQTM-0006OK-C5 for emacs-devel@gnu.org; Tue, 10 Sep 2013 12:07:24 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VJQTL-0004IX-7i; Tue, 10 Sep 2013 12:07:23 -0400 X-Spook: anthrax Cohiba diwn BLU-97 A/B national information X-Ran: *wQ$TScG"}B@1ZS.~h;t5tqu_'{-d_8trgJ}'X1lEq9Of6{7h}\rp\zp=abS@Is.^o*}/z X-Hue: white X-Attribution: GM In-Reply-To: <878uz4pt9e.fsf@floss.red-bean.com> (Karl Fogel's message of "Tue, 10 Sep 2013 10:54:05 -0500") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163288 Archived-At: Karl Fogel wrote: > From: Stefan Monnier >>> + ;; 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.