summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/dired.el19
-rw-r--r--lisp/dnd.el2
3 files changed, 23 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 95b6f0d3605..5a12dd84340 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-11 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * dnd.el (dnd-protocol-alist): Improve custom type.
+
+ * dired.el (dired-dnd-protocol-alist): New variable.
+ (dired-mode): Use `dired-dnd-protocol-alist'. Move call of
+ `dired-mode-hook' to the end.
+
2005-05-11 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (executable-find): Move from executable.el. Use locate-file.
diff --git a/lisp/dired.el b/lisp/dired.el
index 474b4f3d9b5..afea6b173a6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -200,6 +200,18 @@ with the buffer narrowed to the listing."
;; Note this can't simply be run inside function `dired-ls' as the hook
;; functions probably depend on the dired-subdir-alist to be OK.
+(defcustom dired-dnd-protocol-alist
+ '(("^file:///" . dired-dnd-handle-local-file)
+ ("^file://" . dired-dnd-handle-file)
+ ("^file:" . dired-dnd-handle-local-file))
+ "The functions to call when a drop in `dired-mode' is made.
+See `dnd-protocol-alist' for more information. When nil, behave
+as in other buffers."
+ :type '(choice (repeat (cons (regexp) (function)))
+ (const :tag "Behave as in other buffers" nil))
+ :version "22.1"
+ :group 'dired)
+
;; Internal variables
(defvar dired-marker-char ?* ; the answer is 42
@@ -1522,14 +1534,11 @@ Keybindings:
'dired-desktop-buffer-misc-data)
(setq dired-switches-alist nil)
(dired-sort-other dired-actual-switches t)
- (run-mode-hooks 'dired-mode-hook)
(when (featurep 'dnd)
(make-variable-buffer-local 'dnd-protocol-alist)
(setq dnd-protocol-alist
- (append '(("^file:///" . dired-dnd-handle-local-file)
- ("^file://" . dired-dnd-handle-file)
- ("^file:" . dired-dnd-handle-local-file))
- dnd-protocol-alist))))
+ (append dired-dnd-protocol-alist dnd-protocol-alist)))
+ (run-mode-hooks 'dired-mode-hook))
;; Idiosyncratic dired commands that don't deal with marks.
diff --git a/lisp/dnd.el b/lisp/dnd.el
index b6d4d498c95..927f2e3bdb6 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -55,7 +55,7 @@ If no match is found, the URL is inserted as text by calling `dnd-insert-text'.
The function shall return the action done (move, copy, link or private)
if some action was made, or nil if the URL is ignored."
:version "22.1"
- :type 'alist
+ :type '(repeat (cons (regexp) (function)))
:group 'dnd)