From: Richard M. Stallman Date: Mon, 31 Jul 1995 23:13:54 +0000 (+0000) Subject: (dired-insert-set-properties): Catch errors. X-Git-Tag: emacs-19.34~3124 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7da0e9b4eb4f1daeaf624dd34c089cb36333e58b;p=emacs.git (dired-insert-set-properties): Catch errors. (dired-do-flagged-delete): New arg nomessage. --- diff --git a/lisp/dired.el b/lisp/dired.el index 4afb66871cf..eeb0f7891f1 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -577,12 +577,14 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." (save-excursion (goto-char beg) (while (< (point) end) - (if (dired-move-to-filename) - (put-text-property (point) - (save-excursion - (dired-move-to-end-of-filename) - (point)) - 'mouse-face 'highlight)) + (condition-case nil + (if (dired-move-to-filename) + (put-text-property (point) + (save-excursion + (dired-move-to-end-of-filename) + (point)) + 'mouse-face 'highlight)) + (error nil)) (forward-line 1)))) (defun dired-insert-headerline (dir);; also used by dired-insert-subdir @@ -1588,8 +1590,10 @@ Optional argument means return a file name relative to `default-directory'." ;; Deleting files -(defun dired-do-flagged-delete () - "In dired, delete the files flagged for deletion." +(defun dired-do-flagged-delete (&optional nomessage) + "In dired, delete the files flagged for deletion. +If NOMESSAGE is non-nil, we don't display any message +if there are no flagged files." (interactive) (let* ((dired-marker-char dired-del-marker) (regexp (dired-marker-regexp)) @@ -1601,7 +1605,8 @@ Optional argument means return a file name relative to `default-directory'." (dired-map-over-marks (cons (dired-get-filename) (point)) nil) nil) - (message "(No deletions requested)")))) + (or nomessage + (message "(No deletions requested)"))))) (defun dired-do-delete (&optional arg) "Delete all marked (or next ARG) files."