annotate lisp/dired/dired-xemacs-menu.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; dired-xemacs-menu.el: A menu for the dired-mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; v2.90; 7 Dec 1993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; Copyright (C) 1993 Heiko Muenkel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; email: muenkel@tnt.uni-hannover.de
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; the Free Software Foundation; either version 1, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 (require 'mode-motion)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Popup and Pulldown Menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 (defvar dired-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 '("Dired Commands"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ["Open File" dired-find-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ["Open File Other Window" dired-find-file-other-window t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ["View File" dired-view-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ("Mark"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ["Mark File" dired-mark-subdir-or-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ["Mark Files in Region" dired-mark-region (mark)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ["Mark Files by Regexp..." dired-mark-files-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ["Mark All Directories" dired-mark-directories t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ["Mark All Executables" dired-mark-executables t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ["Mark All Symbolic Links" dired-mark-symlinks t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ["Unmark File" dired-unmark-subdir-or-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ["Unmark All Files" (dired-unflag-all-files nil) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ["Unmark All Files (Query)..." (dired-unflag-all-files nil t) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ["Unmark Files in Region" dired-unmark-region (mark)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ("Copy/Link"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ["Copy Files..." dired-do-copy t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ["Copy Files by Regexp..." dired-do-copy-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ["Symlink Files in Directory..." dired-do-symlink t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ["Symlink Files in Directory by Regexp..." dired-do-symlink-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ["Hard-Link Files in Directory..." dired-do-hardlink t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ["Hard-Link Files in Directory by Regexp..." dired-do-hardlink-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ("Rename"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ["Rename Marked Files..." dired-do-move t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ["Rename Files by Regexp..." dired-do-rename-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ["Downcase Names of Marked Files..." dired-downcase t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ["Upcase Names of Marked Files..." dired-upcase t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ("Delete"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ["Delete Marked Files..." dired-do-delete t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ["Delete Flagged Files..." dired-do-deletions t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ["Flag Marked Files for Deletion" dired-flag-file-deleted t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ["Flag Files in Region for Deletion" dired-flag-region (mark)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ["Flag Files for Deletion by Regexp..." dired-flag-regexp-files t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ["Flag Backup Files for Deletion" dired-clean-directory t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ["Flag Autosave Files for Deletion" dired-flag-auto-save-files t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ["Unflag Marked Files" dired-unflag t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ["Unflag Backup Files" dired-backup-unflag t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ["Unflag All Files" (dired-unflag-all-files nil) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ["Unflag All Files (Query)..." (dired-unflag-all-files nil) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ["Unflag Files in Region" dired-unflag-region (mark)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ("Shell commands"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ["Compress Marked Files..." dired-do-compress t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ["Uncompress Marked Files..." dired-do-uncompress t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ["Print Marked Files..." dired-do-print t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ["Shell Command on Marked Files..." dired-do-shell-command t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ["Load Marked Files" dired-do-load t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ["Byte-Compile Marked Files..." dired-do-byte-compile t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ["Diff File Against Backup" dired-backup-diff t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ["Diff File..." dired-diff t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ["Change Permissions of Marked Files..." dired-do-chmod t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ["Change Group of Marked Files..." dired-do-chgrp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ["Change Owner of Marked Files..." dired-do-chown t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ("Directory"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ["Up Directory" dired-up-directory t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ["Home Directory" (dired "~/") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ["Dired..." dired t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ["Dired Other Window..." dired-other-window t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ["Redisplay All Files" revert-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ["Create Directory..." dired-create-directory t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ["Insert Subdirectory" dired-insert-subdir t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ["Hide Subdirectory" dired-kill-subdir t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ["Hide All Subdirectories..." dired-kill-tree t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ("Goto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ["Next Directory Line" dired-next-dirline t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ["Previous Directory Line" dired-prev-dirline t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ["Next Marked File" dired-next-marked-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ["Previous Marked File" dired-prev-marked-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ["File..." dired-goto-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ["Top of Directory..." dired-goto-subdir t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ["Down Directory" dired-tree-down t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ["Up Directory" dired-tree-up t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ("Display"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ["Undisplay Line or Subdirectory" dired-kill-line-or-subdir t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ["Undisplay Tree" dired-kill-tree t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ["Undisplay Marked Lines" dired-do-kill t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ["Redisplay All Files" revert-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ["Redisplay All Marked Files" dired-do-redisplay t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ["Undo" dired-undo t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ["Sort by Date/Name (Toggle)" dired-sort-toggle-or-edit t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ["Edit `ls' Switches..." (dired-sort-toggle-or-edit t) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ("Options, This Buffer"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ["Action is find-file" (set (make-local-variable 'dired-mouse-action)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 'dired-mouse-find-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 :selected (eq dired-mouse-action 'dired-mouse-find-file)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ["Action is find-file-other-window"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (set (make-local-variable 'dired-mouse-action)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 'dired-mouse-find-file-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 :selected (eq dired-mouse-action 'dired-mouse-find-file-other-window)])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ("Options, Global"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ["Action is find-file" (setq-default dired-mouse-action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 'dired-mouse-find-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 :selected (eq (default-value 'dired-mouse-action)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 'dired-mouse-find-file)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ["Action is find-file-other-window"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (setq-default dired-mouse-action 'dired-mouse-find-file-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 :selected (eq (default-value 'dired-mouse-action)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 'dired-mouse-find-file-other-window)])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ["Explain Last Failure" dired-why t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 "*The menu for Dired.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (defun dired-mouse-file-on-line-p (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 "Return t if there is a file under the mouse."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (interactive "@e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (mouse-set-point event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (if (dired-move-to-filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (defun dired-mode-motion-highlight-line (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (if (dired-mouse-file-on-line-p event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (mode-motion-highlight-line event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (defun dired-install-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 "Installs the Dired menu at the menubar."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (if (and (boundp 'current-menubar) current-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (not (assoc "Dired" current-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (set-buffer-menubar (copy-sequence current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (add-menu nil "Dired" (cdr dired-menu))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (make-local-variable 'mode-motion-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (setq mode-motion-hook '(dired-mode-motion-highlight-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 mode-motion-add-help-echo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ;; #### double-click left is supposed to work but it doesn't.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ;; I'm not sure why.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (setq mode-motion-help-echo-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 "Middle button to select file under mouse.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (add-hook 'dired-mode-hook 'dired-install-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (defun dired-popup-menu (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 "Display the Dired Menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (interactive "@e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (mouse-set-point event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (dired-next-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (popup-menu dired-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (defun dired-mouse-find-file (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "Edit the file under the mouse."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (mouse-set-point event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (dired-next-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (dired-find-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (defun dired-mouse-find-file-other-window (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 "Edit the file under the mouse, in another window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (mouse-set-point event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (dired-next-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (dired-find-file-other-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defvar dired-mouse-action 'dired-mouse-find-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 "*Function to be called when button2 is clicked on a file in Dired.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (defun dired-mouse-do-action (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (funcall dired-mouse-action event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (defun dired-mark-region (&optional form-to-eval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 "Mark all files in the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (or form-to-eval (setq form-to-eval '(dired-mark-subdir-or-file nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (let ((end (region-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (goto-char (region-beginning))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (while (<= (point) end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (save-excursion (eval form-to-eval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (forward-line 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (defun dired-unmark-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 "Unmark all files in the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (dired-mark-region '(dired-unmark-subdir-or-file nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (defun dired-flag-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 "Flag all files in the region for deletion."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (dired-mark-region '(dired-flag-file-deleted nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (defun dired-unflag-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 "Unflag all files in the region for deletion."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (dired-mark-region '(dired-unflag 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (define-key dired-mode-map 'button2 'dired-mouse-do-action)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (define-key dired-mode-map 'button3 'dired-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (provide 'dired-xemacs-menu)