Mercurial > emacs
comparison lisp/dired.el @ 12736:a7253dcf5f9d
(dired-insert-set-properties): Catch errors.
(dired-do-flagged-delete): New arg nomessage.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 31 Jul 1995 23:13:54 +0000 |
parents | 472729271c30 |
children | f4e3e478c1b1 |
comparison
equal
deleted
inserted
replaced
12735:2e79a07a9c27 | 12736:a7253dcf5f9d |
---|---|
575 ;; Make the file names highlight when the mouse is on them. | 575 ;; Make the file names highlight when the mouse is on them. |
576 (defun dired-insert-set-properties (beg end) | 576 (defun dired-insert-set-properties (beg end) |
577 (save-excursion | 577 (save-excursion |
578 (goto-char beg) | 578 (goto-char beg) |
579 (while (< (point) end) | 579 (while (< (point) end) |
580 (if (dired-move-to-filename) | 580 (condition-case nil |
581 (put-text-property (point) | 581 (if (dired-move-to-filename) |
582 (save-excursion | 582 (put-text-property (point) |
583 (dired-move-to-end-of-filename) | 583 (save-excursion |
584 (point)) | 584 (dired-move-to-end-of-filename) |
585 'mouse-face 'highlight)) | 585 (point)) |
586 'mouse-face 'highlight)) | |
587 (error nil)) | |
586 (forward-line 1)))) | 588 (forward-line 1)))) |
587 | 589 |
588 (defun dired-insert-headerline (dir);; also used by dired-insert-subdir | 590 (defun dired-insert-headerline (dir);; also used by dired-insert-subdir |
589 ;; Insert DIR's headerline with no trailing slash, exactly like ls | 591 ;; Insert DIR's headerline with no trailing slash, exactly like ls |
590 ;; would, and put cursor where dired-build-subdir-alist puts subdir | 592 ;; would, and put cursor where dired-build-subdir-alist puts subdir |
1586 (point-max) | 1588 (point-max) |
1587 (point)))) | 1589 (point)))) |
1588 | 1590 |
1589 ;; Deleting files | 1591 ;; Deleting files |
1590 | 1592 |
1591 (defun dired-do-flagged-delete () | 1593 (defun dired-do-flagged-delete (&optional nomessage) |
1592 "In dired, delete the files flagged for deletion." | 1594 "In dired, delete the files flagged for deletion. |
1595 If NOMESSAGE is non-nil, we don't display any message | |
1596 if there are no flagged files." | |
1593 (interactive) | 1597 (interactive) |
1594 (let* ((dired-marker-char dired-del-marker) | 1598 (let* ((dired-marker-char dired-del-marker) |
1595 (regexp (dired-marker-regexp)) | 1599 (regexp (dired-marker-regexp)) |
1596 case-fold-search) | 1600 case-fold-search) |
1597 (if (save-excursion (goto-char (point-min)) | 1601 (if (save-excursion (goto-char (point-min)) |
1599 (dired-internal-do-deletions | 1603 (dired-internal-do-deletions |
1600 ;; this can't move point since ARG is nil | 1604 ;; this can't move point since ARG is nil |
1601 (dired-map-over-marks (cons (dired-get-filename) (point)) | 1605 (dired-map-over-marks (cons (dired-get-filename) (point)) |
1602 nil) | 1606 nil) |
1603 nil) | 1607 nil) |
1604 (message "(No deletions requested)")))) | 1608 (or nomessage |
1609 (message "(No deletions requested)"))))) | |
1605 | 1610 |
1606 (defun dired-do-delete (&optional arg) | 1611 (defun dired-do-delete (&optional arg) |
1607 "Delete all marked (or next ARG) files." | 1612 "Delete all marked (or next ARG) files." |
1608 ;; This is more consistent with the file marking feature than | 1613 ;; This is more consistent with the file marking feature than |
1609 ;; dired-do-flagged-delete. | 1614 ;; dired-do-flagged-delete. |