all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: 28797@debbugs.gnu.org, tino.calancha@gmail.com
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	[thread overview]
Message-ID: <87a80vbuur.fsf@users.sourceforge.net> (raw)
In-Reply-To: <CAFyQvY2P7YAJi1DzYthAfpcMfsoxbTUe-bpUBCY3ZQ8-fW83uQ@mail.gmail.com> (Kaushal Modi's message of "Thu, 12 Oct 2017 14:56:08 +0000")

[-- Attachment #1: Type: text/plain, Size: 651 bytes --]

severity 28797 minor
tags 28797 + patch
quit

Kaushal Modi <kaushal.modi@gmail.com> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1329 bytes --]

From a150d99f8e278e9b90240e4b0c460ca974b32aeb Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
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


  parent reply	other threads:[~2017-10-13  3:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 14:56 bug#28797: 26.0.90; Improve printing of error on catching file-error in dired Kaushal Modi
2017-10-12 15:08 ` Noam Postavsky
2017-10-13  3:16 ` Noam Postavsky [this message]
2017-10-13  8:58   ` Eli Zaretskii
2017-10-13 13:15     ` Noam Postavsky
2017-10-13 13:43       ` Eli Zaretskii
2017-10-22 16:28         ` Noam Postavsky
2017-10-24 15:41           ` Tino Calancha
2017-10-24 23:33             ` Noam Postavsky
2017-11-05 17:20         ` Noam Postavsky

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=87a80vbuur.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=28797@debbugs.gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=tino.calancha@gmail.com \
    /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.