comparison lisp/efs/dired-xemacs.el @ 179:9ad43877534d r20-3b16

Import from CVS: tag r20-3b16
author cvs
date Mon, 13 Aug 2007 09:52:19 +0200
parents 0132846995bd
children
comparison
equal deleted inserted replaced
178:e703507b8a00 179:9ad43877534d
84 dired-visit-popup-menu 84 dired-visit-popup-menu
85 '(["Find File" dired-find-file t] 85 '(["Find File" dired-find-file t]
86 ["Find in Other Window" dired-find-file-other-window t] 86 ["Find in Other Window" dired-find-file-other-window t]
87 ["Find in Other Frame" dired-find-file-other-frame t] 87 ["Find in Other Frame" dired-find-file-other-frame t]
88 ["View File" dired-view-file t] 88 ["View File" dired-view-file t]
89 ["Display in Other Window" dired-find-file-other-window t])) 89 ["Display in Other Window" dired-display-file t]))
90 90
91 (setq 91 (setq
92 dired-do-popup-menu 92 dired-do-popup-menu
93 '(["Copy to..." dired-do-copy t] 93 '(["Copy to..." dired-do-copy t]
94 ["Rename to..." dired-do-rename t] 94 ["Rename to..." dired-do-rename t]
291 291
292 (add-hook 'dired-mode-hook 'dired-install-menubar) 292 (add-hook 'dired-mode-hook 'dired-install-menubar)
293 293
294 ;;; Mouse functions 294 ;;; Mouse functions
295 295
296 (defun dired-mouse-find-file (event) 296 (defun dired-mouse-file-action (event fun)
297 "In dired, visit the file or directory name you click on." 297 "In dired, apply function FUN to the file or directory name you click on."
298 (interactive "e")
299 (save-excursion 298 (save-excursion
300 (set-buffer (window-buffer (event-window event))) 299 (set-buffer (window-buffer (event-window event)))
301 (if dired-subdir-alist 300 (if dired-subdir-alist
302 (save-excursion 301 (save-excursion
303 (goto-char (event-point event)) 302 (goto-char (event-point event))
304 (dired-find-file)) 303 (funcall fun))
305 (error 304 (error
306 (concat "dired-subdir-alist seems to be mangled. " 305 (concat "dired-subdir-alist seems to be mangled. "
307 (substitute-command-keys 306 (substitute-command-keys
308 "\\<dired-mode-map>Try dired-revert (\\[dired-revert]).")))))) 307 "\\<dired-mode-map>Try dired-revert (\\[dired-revert])."))))))
308
309 (defun dired-mouse-find-file (event)
310 "In dired, visit the file or directory name you click on."
311 (interactive "e")
312 (dired-mouse-file-action event 'dired-find-file))
313
314 (defun dired-mouse-display-file (event)
315 "In dired, display the file or directory name you click on."
316 (interactive "e")
317 (dired-mouse-file-action event 'dired-display-file))
318
319 (defun dired-mouse-find-file-other-window (event)
320 "In dired, visit the file or directory name you click on in another window."
321 (interactive "e")
322 (dired-mouse-file-action event 'dired-find-file-other-window))
323
324 (defun dired-mouse-find-file-other-frame (event)
325 "In dired, visit the file or directory name you click on in another frame."
326 (interactive "e")
327 (dired-mouse-file-action event 'dired-find-file-other-frame))
309 328
310 (defun dired-mouse-mark (event) 329 (defun dired-mouse-mark (event)
311 "In dired, mark the file name that you click on. 330 "In dired, mark the file name that you click on.
312 If the file name is already marked, this unmarks it." 331 If the file name is already marked, this unmarks it."
313 (interactive "e") 332 (interactive "e")
402 (dispatch-event (next-event))))) 421 (dispatch-event (next-event)))))
403 422
404 (defvar dired-filename-local-map 423 (defvar dired-filename-local-map
405 (let ((map (make-sparse-keymap))) 424 (let ((map (make-sparse-keymap)))
406 (set-keymap-name map 'dired-filename-local-map) 425 (set-keymap-name map 'dired-filename-local-map)
407 (define-key map 'button2 'dired-mouse-find-file) 426 (define-key map [button2] 'dired-mouse-find-file)
408 (define-key map 'button3 'dired-visit-popup-menu) 427 (define-key map [(shift button2)] 'dired-mouse-display-file)
409 (define-key map '(control button2) 'dired-do-popup-menu) 428 (define-key map [(meta button2)] 'dired-mouse-find-file-other-frame)
410 (define-key map '(shift button1) 'dired-mouse-mark) 429 (define-key map [button3] 'dired-visit-popup-menu)
411 (define-key map '(control shift button1) 'dired-mouse-flag) 430 (define-key map [(control button2)] 'dired-do-popup-menu)
431 (define-key map [(shift button1)] 'dired-mouse-mark)
432 (define-key map [(control shift button1)] 'dired-mouse-flag)
412 map) 433 map)
413 "Keymap used to activate actions on files in dired.") 434 "Keymap used to activate actions on files in dired.")
414 435
415 ;; Make this defined everywhere in the dired buffer. 436 ;; Make this defined everywhere in the dired buffer.
416 (define-key dired-mode-map '(meta button3) 'dired-mouse-get-target) 437 (define-key dired-mode-map '(meta button3) 'dired-mouse-get-target)