diff options
| author | Po Lu | 2022-03-25 20:33:23 +0800 |
|---|---|---|
| committer | Po Lu | 2022-03-25 20:34:18 +0800 |
| commit | 3fac06dfb8d11985e855d4243518095cbdfede05 (patch) | |
| tree | 057f3e676876be0c7c672b44b8eedbc2bdb5f497 | |
| parent | 1b7a9753e105c5cc39b554c99bf93c7e2e9d6630 (diff) | |
| download | emacs-3fac06dfb8d11985e855d4243518095cbdfede05.tar.gz emacs-3fac06dfb8d11985e855d4243518095cbdfede05.zip | |
Make it easier to select text inside dired when mouse dragging is on
* lisp/dired.el (dired-insert-set-properties): Only set drag
keymap on the filename itself.
| -rw-r--r-- | lisp/dired.el | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 3790197f661..d6c5721ca28 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1733,20 +1733,26 @@ see `dired-use-ls-dired' for more details.") | |||
| 1733 | 'invisible 'dired-hide-details-information)) | 1733 | 'invisible 'dired-hide-details-information)) |
| 1734 | (put-text-property (+ (line-beginning-position) 1) (1- (point)) | 1734 | (put-text-property (+ (line-beginning-position) 1) (1- (point)) |
| 1735 | 'invisible 'dired-hide-details-detail) | 1735 | 'invisible 'dired-hide-details-detail) |
| 1736 | (when dired-mouse-drag-files | ||
| 1737 | (put-text-property (point) | ||
| 1738 | (save-excursion | ||
| 1739 | (dired-move-to-end-of-filename) | ||
| 1740 | (backward-char) | ||
| 1741 | (point)) | ||
| 1742 | 'keymap | ||
| 1743 | dired-mouse-drag-files-map)) | ||
| 1736 | (add-text-properties | 1744 | (add-text-properties |
| 1737 | (point) | 1745 | (point) |
| 1738 | (progn | 1746 | (progn |
| 1739 | (dired-move-to-end-of-filename) | 1747 | (dired-move-to-end-of-filename) |
| 1740 | (point)) | 1748 | (point)) |
| 1741 | (append `(mouse-face | 1749 | `(mouse-face |
| 1742 | highlight | 1750 | highlight |
| 1743 | dired-filename t | 1751 | dired-filename t |
| 1744 | help-echo ,(if dired-mouse-drag-files | 1752 | help-echo ,(if dired-mouse-drag-files |
| 1745 | "down-mouse-1: drag this file to another program | 1753 | "down-mouse-1: drag this file to another program |
| 1746 | mouse-2: visit this file in other window" | 1754 | mouse-2: visit this file in other window" |
| 1747 | "mouse-2: visit this file in other window")) | 1755 | "mouse-2: visit this file in other window"))) |
| 1748 | (when dired-mouse-drag-files | ||
| 1749 | `(keymap ,dired-mouse-drag-files-map)))) | ||
| 1750 | (when (< (+ (point) 4) (line-end-position)) | 1756 | (when (< (+ (point) 4) (line-end-position)) |
| 1751 | (put-text-property (+ (point) 4) (line-end-position) | 1757 | (put-text-property (+ (point) 4) (line-end-position) |
| 1752 | 'invisible 'dired-hide-details-link)))) | 1758 | 'invisible 'dired-hide-details-link)))) |