[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 21ecf6b24d: Fix minor issues with dired-mouse-drag-files
From: |
Po Lu |
Subject: |
master 21ecf6b24d: Fix minor issues with dired-mouse-drag-files |
Date: |
Fri, 25 Mar 2022 20:45:56 -0400 (EDT) |
branch: master
commit 21ecf6b24d0549a9f27bcab51dbd8c8b1a37ef86
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix minor issues with dired-mouse-drag-files
* lisp/dired.el (dired-mouse-drag-files): Update doc string and
add setter.
(dired-insert-set-properties): Don't insert misleading tooltip
if feature is not available.
---
lisp/dired.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/lisp/dired.el b/lisp/dired.el
index b1208cec25..c5e389c9ce 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -248,17 +248,27 @@ The target is used in the prompt for file copy, rename
etc."
(other :tag "Try to guess" t))
:group 'dired)
+
(defcustom dired-mouse-drag-files nil
"If non-nil, allow the mouse to drag files from inside a Dired buffer.
Dragging the mouse and then releasing it over the window of
another program will result in that program opening the file, or
-creating a copy of it.
+creating a copy of it. This feature is supported only on X
+Windows and Haiku.
If the value is `link', then a symbolic link will be created to
the file instead by the other program (usually a file manager)."
+ :set (lambda (option value)
+ (set-default option value)
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (derived-mode-p 'dired-mode)
+ (revert-buffer nil t)))))
:type '(choice (const :tag "Don't allow dragging" nil)
(const :tag "Copy file to other window" t)
- (const :tag "Create symbolic link to file" link)))
+ (const :tag "Create symbolic link to file" link))
+ :group 'dired
+ :version "29.1")
(defcustom dired-copy-preserve-time t
"If non-nil, Dired preserves the last-modified time in a file copy.
@@ -1734,7 +1744,7 @@ see `dired-use-ls-dired' for more details.")
'invisible 'dired-hide-details-information))
(put-text-property (+ (line-beginning-position) 1) (1- (point))
'invisible 'dired-hide-details-detail)
- (when dired-mouse-drag-files
+ (when (and dired-mouse-drag-files (fboundp 'x-begin-drag))
(put-text-property (point)
(save-excursion
(dired-move-to-end-of-filename)
@@ -1750,7 +1760,8 @@ see `dired-use-ls-dired' for more details.")
`(mouse-face
highlight
dired-filename t
- help-echo ,(if dired-mouse-drag-files
+ help-echo ,(if (and dired-mouse-drag-files
+ (fboundp 'x-begin-drag))
"down-mouse-1: drag this file to another program
mouse-2: visit this file in other window"
"mouse-2: visit this file in other window")))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 21ecf6b24d: Fix minor issues with dired-mouse-drag-files,
Po Lu <=