From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#28797: 26.0.90; Improve printing of error on catching file-error in dired Date: Thu, 12 Oct 2017 23:16:28 -0400 Message-ID: <87a80vbuur.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1507864636 20510 195.159.176.226 (13 Oct 2017 03:17:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Oct 2017 03:17:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 28797@debbugs.gnu.org, tino.calancha@gmail.com To: Kaushal Modi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 13 05:17:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2qTC-0004Gf-Ak for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Oct 2017 05:17:06 +0200 Original-Received: from localhost ([::1]:48248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2qTJ-0001sb-PM for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 23:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2qTB-0001qf-Cu for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 23:17:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2qT8-0005T5-7q for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 23:17:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2qT8-0005Sz-2B for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 23:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2qT7-0007Tb-PH for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 23:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Oct 2017 03:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28797 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28797-submit@debbugs.gnu.org id=B28797.150786459927659 (code B ref 28797); Fri, 13 Oct 2017 03:17:01 +0000 Original-Received: (at 28797) by debbugs.gnu.org; 13 Oct 2017 03:16:39 +0000 Original-Received: from localhost ([127.0.0.1]:36566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2qSl-0007Bl-5s for submit@debbugs.gnu.org; Thu, 12 Oct 2017 23:16:39 -0400 Original-Received: from mail-io0-f180.google.com ([209.85.223.180]:43934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2qSi-00073u-Ip; Thu, 12 Oct 2017 23:16:36 -0400 Original-Received: by mail-io0-f180.google.com with SMTP id 134so3380276ioo.0; Thu, 12 Oct 2017 20:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2/evnU9XidgWF0EuCvp7xThXfLNTfAKD9T5UIVUeO7U=; b=Lq3fSL6WI6+YCSvwL+mP0l2VQbumBvvV/YOD/v6fRKC7SfzVEXpOQT+eeAjfVTfdM+ iLsrAH2SuYg3zhxsF/++/qtM1FWSbHzrWa+s+3R8hO5UFXgVX7Q4BIWTApYhNqXZs3Lc JfDeBKJ9sLkIZBL42wKsq0DhMjFIFDhQfy3RFfCJcHjRxmAPkwid1010d93kalXRIgYI eVTFKSTynh1z7wanNKYAukmZ/8rIqsD7rXZOv57buTxxoDmzFoR4kAWRaoeowb0PvsVi 3+tXbbBPrNBMcklsm+frERrcszEuoTQYS3IZrBW/Wh9+GosnjPVPCARG/8cvYeMQ1Pt5 H2JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=2/evnU9XidgWF0EuCvp7xThXfLNTfAKD9T5UIVUeO7U=; b=pzWL4SIQ2DqJi22QuXxUloCaHFGdA769gwuS1ICqVnFdzQ+6ubSeagqeWz36k3Pj6N QwIQLtF7pznR6bDiHzi4hHLiU9A2c2jpGUwNHa5JGvGdXQjtBt7mn6AHEQTHUvTFgi4E hnFCJIS9wTNcShwflTEfCelpMT8WYe7gY0rIfqu3xLhjyiWNNtiapUCXtp84QCuPDLN/ HoRoiTMSMppq6rV+XqJ1RetED8zazDZyw4aE6O6JxbLJIiql/qXCQMTPDb7mDEsdSYr/ fYV6PdQVePRWGOOCQBVEMBeiHYKz8kjAZ6MhgDwg5rVcbWdmJw+2JS7S1IO2MrKOsLVL Oobg== X-Gm-Message-State: AMCzsaVDnrsWEBeV19CLa/9W++vlSDNyJYmdtzlxUP429j77Eytwd5QI tvqsGeIkFvr5fynnVGzqOQORyE+f X-Google-Smtp-Source: AOwi7QDJmnSIPMUkzmc3rmTuVU2tEgch5Hz9yyfBScjhjN80p93lEGy+OpaUYUZP7YKVPBJ0wG4geg== X-Received: by 10.107.201.69 with SMTP id z66mr48032iof.118.1507864590891; Thu, 12 Oct 2017 20:16:30 -0700 (PDT) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id u125sm5564725ioe.65.2017.10.12.20.16.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 20:16:29 -0700 (PDT) In-Reply-To: (Kaushal Modi's message of "Thu, 12 Oct 2017 14:56:08 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138319 Archived-At: --=-=-= Content-Type: text/plain severity 28797 minor tags 28797 + patch quit Kaushal Modi writes: > 1. Improving the format of error messages generated by catching error > signals from C, so that the errors look almost like readable English > instead of a dump of a list. > 2. Those errors should generate a backtrace.. right now, a user needs > to update the debug-on-message variable to force back traces for such > messages which is, first: more cumbersome than doing M-x > toggle-debug-on-error and then recreating the error, and second: not > a common knowledge. Here's a patch, uses error-message-string for #1, condition-case-unless-debug for #2. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Improve-dired-deletion-error-handling-Bug-28797.patch Content-Description: patch >From a150d99f8e278e9b90240e4b0c460ca974b32aeb Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Oct 2017 23:12:00 -0400 Subject: [PATCH v1] Improve dired deletion error handling (Bug#28797) * lisp/dired.el (dired-internal-do-deletions): Use condition-case-unless-debug. Use `error-message-string' to produce a human readable error message. --- lisp/dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 9e09d349f7..b24fea703a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3132,7 +3132,7 @@ dired-internal-do-deletions (while l (goto-char (cdr (car l))) (let ((inhibit-read-only t)) - (condition-case err + (condition-case-unless-debug err (let ((fn (car (car l)))) (dired-delete-file fn dired-recursive-deletes trash) ;; if we get here, removing worked @@ -3143,7 +3143,7 @@ dired-internal-do-deletions #'dired-delete-entry fn)) (quit (throw '--delete-cancel (message "OK, canceled"))) (error ;; catch errors from failed deletions - (dired-log "%s\n" err) + (dired-log "%s: %s\n" (car err) (error-message-string err)) (setq failures (cons (car (car l)) failures))))) (setq l (cdr l))) (if (not failures) -- 2.11.0 --=-=-=--