diff options
author | Richard M. Stallman <[email protected]> | 1994-04-01 18:51:39 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1994-04-01 18:51:39 +0000 |
commit | cb88a3db201aa1d5c9312471323be87583a4e602 (patch) | |
tree | 1ce08d59a07f7be4717883e21d8e5161cfeb71b2 /lisp | |
parent | 60e4eb54299120df58a837874df32fde0126e286 (diff) |
(dired-insert-directory): Add mouse-face properties.
(dired-insert-set-properties): New subroutine.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/dired.el | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 2559418bcf..525edb0984 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -513,14 +513,28 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." ;; Do the right thing whether dir-or-list is atomic or not. If it is, ;; inset all files listed in the cdr (the car is the passed-in directory ;; list. - (if (consp dir-or-list) - (progn - (mapcar - (function (lambda (x) (insert-directory x switches wildcard full-p))) - (cdr dir-or-list))) - (insert-directory dir-or-list switches wildcard full-p)) + (let ((opoint (point))) + (if (consp dir-or-list) + (progn + (mapcar + (function (lambda (x) (insert-directory x switches wildcard full-p))) + (cdr dir-or-list))) + (insert-directory dir-or-list switches wildcard full-p)) + (dired-insert-set-properties opoint (point))) (setq dired-directory dir-or-list)) +(defun dired-insert-set-properties (beg end) + (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)) + (forward-line 1)))) + (defun dired-insert-headerline (dir);; also used by dired-insert-subdir ;; Insert DIR's headerline with no trailing slash, exactly like ls ;; would, and put cursor where dired-build-subdir-alist puts subdir |