diff options
| author | Richard M. Stallman | 1994-04-01 18:51:39 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-01 18:51:39 +0000 |
| commit | cb88a3db201aa1d5c9312471323be87583a4e602 (patch) | |
| tree | 1ce08d59a07f7be4717883e21d8e5161cfeb71b2 | |
| parent | 60e4eb54299120df58a837874df32fde0126e286 (diff) | |
| download | emacs-cb88a3db201aa1d5c9312471323be87583a4e602.tar.gz emacs-cb88a3db201aa1d5c9312471323be87583a4e602.zip | |
(dired-insert-directory): Add mouse-face properties.
(dired-insert-set-properties): New subroutine.
| -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 2559418bcf2..525edb09848 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." | |||
| 513 | ;; Do the right thing whether dir-or-list is atomic or not. If it is, | 513 | ;; Do the right thing whether dir-or-list is atomic or not. If it is, |
| 514 | ;; inset all files listed in the cdr (the car is the passed-in directory | 514 | ;; inset all files listed in the cdr (the car is the passed-in directory |
| 515 | ;; list. | 515 | ;; list. |
| 516 | (if (consp dir-or-list) | 516 | (let ((opoint (point))) |
| 517 | (progn | 517 | (if (consp dir-or-list) |
| 518 | (mapcar | 518 | (progn |
| 519 | (function (lambda (x) (insert-directory x switches wildcard full-p))) | 519 | (mapcar |
| 520 | (cdr dir-or-list))) | 520 | (function (lambda (x) (insert-directory x switches wildcard full-p))) |
| 521 | (insert-directory dir-or-list switches wildcard full-p)) | 521 | (cdr dir-or-list))) |
| 522 | (insert-directory dir-or-list switches wildcard full-p)) | ||
| 523 | (dired-insert-set-properties opoint (point))) | ||
| 522 | (setq dired-directory dir-or-list)) | 524 | (setq dired-directory dir-or-list)) |
| 523 | 525 | ||
| 526 | (defun dired-insert-set-properties (beg end) | ||
| 527 | (save-excursion | ||
| 528 | (goto-char beg) | ||
| 529 | (while (< (point) end) | ||
| 530 | (if (dired-move-to-filename) | ||
| 531 | (put-text-property (point) | ||
| 532 | (save-excursion | ||
| 533 | (dired-move-to-end-of-filename) | ||
| 534 | (point)) | ||
| 535 | 'mouse-face 'highlight)) | ||
| 536 | (forward-line 1)))) | ||
| 537 | |||
| 524 | (defun dired-insert-headerline (dir);; also used by dired-insert-subdir | 538 | (defun dired-insert-headerline (dir);; also used by dired-insert-subdir |
| 525 | ;; Insert DIR's headerline with no trailing slash, exactly like ls | 539 | ;; Insert DIR's headerline with no trailing slash, exactly like ls |
| 526 | ;; would, and put cursor where dired-build-subdir-alist puts subdir | 540 | ;; would, and put cursor where dired-build-subdir-alist puts subdir |