annotate lisp/efs/dired-xemacs.el @ 152:4c132ee2d62b

Added tag r20-3b2 for changeset 59463afc5666
author cvs
date Mon, 13 Aug 2007 09:37:21 +0200
parents 9f59509498e1
children 0132846995bd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
2 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
3 ;; File: dired-xemacs.el
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
4 ;; Dired Version: #Revision: 7.9 $
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
5 ;; RCS:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
6 ;; Description: dired functions for XEmacs
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
7 ;; Author: Mike Sperber <sperber@informatik.uni-tuebingen.de>
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
8 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
9 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
10
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
11 (provide 'dired-xemacs)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
12 (require 'dired)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
13 (require 'dired-faces)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
14
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
15 (require 'backquote)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
16
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
17
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
18 ;;; Variables not meant for user editing
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
19
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
20 ;; kludge
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
21 (defun dired-demarkify-regexp (re)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
22 (if (string-equal (substring re 0 (length dired-re-maybe-mark))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
23 dired-re-maybe-mark)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
24 (concat "^" (substring re
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
25 (length dired-re-maybe-mark)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
26 (length re)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
27 re))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
28
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
29 (defvar dired-re-raw-dir (dired-demarkify-regexp dired-re-dir))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
30 (defvar dired-re-raw-sym (dired-demarkify-regexp dired-re-sym))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
31 (defvar dired-re-raw-exe (dired-demarkify-regexp dired-re-exe))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
32
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
33 (defvar dired-re-raw-boring (dired-omit-regexp)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
34 "Regexp to match backup, autosave and otherwise boring files.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
35
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
36 (defvar dired-re-raw-socket (concat "^" dired-re-inode-size "s"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
37
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
38 (defvar dired-re-raw-setuid
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
39 (concat "^" dired-re-inode-size
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
40 "-[-r][-w][Ss][-r][-w][sx][-r][-w][xst]")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
41 "setuid plain file (even if not executable)")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
42
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
43 (defvar dired-re-raw-setgid
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
44 (concat "^" dired-re-inode-size
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
45 "-[-r][-w][-x][-r][-w][sS][-r][-w][xst]")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
46 "setgid plain file (even if not executable)")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
47
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
48 (defvar dired-re-pre-permissions "^[^-d]? ?[0-9 ]*[-d]"
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
49 "Regexp matching the preamble to file permissions part of a dired line.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
50 This shouldn't match socket or symbolic link lines (which aren't editable).")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
51
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
52 (defvar dired-re-permissions "[-r][-w][-Ssx][-r][-w][-Ssx][-r][-w][-xstT]"
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
53 "Regexp matching the file permissions part of a dired line.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
54
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
55 ;;; Setup
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
56
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
57 (setq dired-modeline-tracking-cmds '(mouse-track))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
58
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
59
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
60 ;;; Menus
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
61
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
62 (defvar dired-subdir-menu nil "The Subdir menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
63 (defvar dired-mark-menu nil "The Mark menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
64 (defvar dired-do-menu nil "The Do menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
65 (defvar dired-regexp-menu nil "The Regexp menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
66 (defvar dired-look-menu nil "The Look menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
67 (defvar dired-sort-menu nil "The Sort menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
68 (defvar dired-help-menu nil "The Help menu for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
69
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
70 (defvar dired-menubar-menus
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
71 '(("Subdir" . dired-subdir-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
72 ("Mark" . dired-mark-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
73 ("Do" . dired-do-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
74 ("Regexp" . dired-regexp-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
75 ("Look" . dired-look-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
76 ("Sort" . dired-sort-menu))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
77 "All the dired menus.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
78
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
79 (defvar dired-visit-popup-menu nil "The Visit popup for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
80 (defvar dired-do-popup-menu nil "The Do popup for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
81
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
82 (defun dired-setup-menus ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
83 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
84 dired-visit-popup-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
85 '(["Find File" dired-find-file t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
86 ["Find in Other Window" dired-find-file-other-window t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
87 ["Find in Other Frame" dired-find-file-other-frame t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
88 ["View File" dired-view-file t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
89 ["Display in Other Window" dired-find-file-other-window t]))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
90
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
91 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
92 dired-do-popup-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
93 '(["Copy to..." dired-do-copy t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
94 ["Rename to..." dired-do-rename t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
95 ["Compress/Uncompress" dired-do-compress t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
96 ["Uuencode/Uudecode" dired-do-uucode t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
97 ["Change Mode..." dired-do-chmod t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
98 ["Change Owner..." dired-do-chown t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
99 ["Change Group..." dired-do-chgrp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
100 ["Load" dired-do-load t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
101 ["Byte-compile" dired-do-byte-compile t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
102 ["Hardlink to..." dired-do-hardlink t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
103 ["Symlink to..." dired-do-symlink t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
104 ["Shell Command..." dired-do-shell-command t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
105 ["Background Shell Command..." dired-do-background-shell-command t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
106 ["Delete" dired-do-delete t]))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
107
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
108 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
109 dired-subdir-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
110 (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
111 ["Next Subdir" dired-next-subdir t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
112 ["Prev Subdir" dired-prev-subdir t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
113 ["Next Dirline" dired-next-dirline t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
114 ["Prev Dirline" dired-prev-dirline t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
115 ["Up Dir" dired-up-directory t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
116 ["Down Dir" dired-down-directory t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
117 ["Insert This Subdir" dired-maybe-insert-subdir t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
118 ["Create Directory..." dired-create-directory t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
119 ["Kill This Subdir" dired-kill-subdir t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
120 "-- Commands on All Files in Subdir --"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
121 ["Redisplay Subdir" dired-redisplay-subdir t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
122 ["Mark Files" dired-mark-subdir-files t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
123 ["Flag Files for Deletion" dired-flag-subdir-files t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
124 ["Compress Uncompressed Files" dired-compress-subdir-files t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
125 (vector "Uncompress Compressed Files"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
126 '(let ((current-prefix-arg t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
127 (dired-compress-subdir-files))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
128 ':keys (dired-key-description 'dired-compress-subdir-files
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
129 'universal-argument))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
130
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
131 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
132 dired-mark-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
133 (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
134 ["Next Marked" dired-next-marked-file t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
135 ["Previous Marked" dired-prev-marked-file t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
136 ["Change Marks..." dired-change-marks t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
137 ["Unmark All" dired-unmark-all-files t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
138 (vector "Toggle marks..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
139 '(let ((current-prefix-arg t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
140 (call-interactively 'dired-change-marks))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
141 ':keys (dired-key-description 'dired-change-marks
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
142 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
143 ["Mark Symlinks" dired-mark-symlinks t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
144 ["Mark Directories" dired-mark-directories t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
145 ["Mark Old Backups" dired-clean-directory t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
146 ["Mark Executables" dired-mark-executables t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
147 ["Flag Backup Files" dired-flag-backup-files t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
148 ["Flag Auto-save Files" dired-flag-auto-save-files t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
149 ["Set new marker char" dired-set-marker-char t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
150 ["Restore marker char" dired-restore-marker-char t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
151 ["Marker stack left" dired-marker-stack-left t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
152 ["Marker stack right" dired-marker-stack-right t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
153 "---"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
154 ["Mark Files from Other Dired" dired-mark-files-from-other-dired-buffer t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
155 ["Mark Files from Compile Buffer..." dired-mark-files-compilation-buffer t]))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
156
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
157 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
158 dired-do-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
159 '(["Copy to..." dired-do-copy t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
160 ["Rename to..." dired-do-rename t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
161 ["Expunge File Flagged for Deletion" dired-expunge-deletions t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
162 ["Compress/Uncompress" dired-do-compress t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
163 ["Uuencode/Uudecode" dired-do-uucode t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
164 ["Print..." dired-do-print t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
165 ["Change Mode..." dired-do-interactive-chmod t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
166 ["Change Owner..." dired-do-chown t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
167 ["Change Group..." dired-do-chgrp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
168 ["Byte-compile" dired-do-byte-compile t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
169 ["Hardlink to..." dired-do-hardlink t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
170 ["Symlink to..." dired-do-symlink t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
171 ["Shell Command..." dired-do-shell-command t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
172 ["Background Shell Command..." dired-do-background-shell-command t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
173 ["Delete Marked Files" dired-do-delete t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
174 ["Visit file menu >" dired-visit-popup-menu-internal t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
175 ["Operate on file menu >" dired-do-popup-menu-internal t]))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
176
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
177 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
178 dired-regexp-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
179 (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
180 ["Mark..." dired-mark-files-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
181 ["Mark Files with Extension..." dired-mark-extension t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
182 ["Flag..." dired-flag-files-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
183 ["Flag Files with Extension..." dired-flag-extension t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
184 ["Downcase" dired-downcase t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
185 ["Upcase" dired-upcase t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
186 ["Copy..." dired-do-copy-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
187 ["Rename..." dired-do-rename-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
188 ["Hardlink..." dired-do-hardlink-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
189 ["Symlink..." dired-do-symlink-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
190 ["Relative Symlink..." dired-do-relsymlink-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
191 "---"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
192 ["Add Omit Regex..." dired-add-omit-regexp t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
193 (vector "Remove Omit Regex..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
194 '(let ((current-prefix-arg 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
195 (call-interactively 'dired-add-omit-regexp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
196 ':keys (dired-key-description 'dired-add-omit-regexp 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
197 (vector "Add Omit Extension..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
198 '(let ((current-prefix-arg '(4)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
199 (call-interactively 'dired-add-omit-regexp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
200 ':keys (dired-key-description 'dired-add-omit-regexp 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
201 (vector "Remove Omit Extension..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
202 '(let ((current-prefix-arg '(16)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
203 (call-interactively 'dired-add-omit-regexp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
204 ':keys (dired-key-description 'dired-add-omit-regexp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
205 'universal-argument 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
206 (vector "Show Omit Regex"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
207 '(let ((current-prefix-arg 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
208 (call-interactively 'dired-add-omit-regexp))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
209 ':keys (dired-key-description 'dired-add-omit-regexp 0))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
210
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
211 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
212 dired-look-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
213 '(["Grep for..." dired-do-grep t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
214 ["Tags Search for..." dired-do-tags-search t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
215 ["Tags Query Replace..." dired-do-tags-query-replace t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
216 "---"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
217 ["Diff File..." dired-diff t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
218 ["Diff with Backup" dired-backup-diff t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
219 ["Merge Files..." dired-emerge t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
220 ["Merge Files Having Common Ancestor..." dired-emerge-with-ancestor t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
221 ["Ediff Files..." dired-ediff t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
222 ["Patch File" dired-epatch t]))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
223
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
224 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
225 dired-sort-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
226 (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
227 ["Toggle Current Subdir by Name/Date" dired-sort-toggle-or-edit t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
228 (vector "Show Current Switches"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
229 '(dired-sort-toggle-or-edit 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
230 ':keys (dired-key-description 'dired-sort-toggle-or-edit 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
231 (vector "Edit Switches for Current Subdir..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
232 '(dired-sort-toggle-or-edit 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
233 ':keys (dired-key-description 'dired-sort-toggle-or-edit 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
234 (vector "Edit Default Switches for Inserted Subdirs..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
235 '(dired-sort-toggle-or-edit 2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
236 ':keys (dired-key-description 'dired-sort-toggle-or-edit 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
237 (vector "Sort Entire Buffer by Date"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
238 '(dired-sort-toggle-or-edit 'date)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
239 ':keys (dired-key-description 'dired-sort-toggle-or-edit
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
240 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
241 (vector "Sort Entire Buffer by Name"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
242 '(dired-sort-toggle-or-edit 'name)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
243 ':keys (dired-key-description 'dired-sort-toggle-or-edit
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
244 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
245 (vector "Edit Switches for Entire Buffer..."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
246 '(dired-sort-toggle-or-edit '(16))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
247 ':keys (dired-key-description 'dired-sort-toggle-or-edit
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
248 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
249 "---"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
250 ["Hide All Subdirs" dired-hide-all t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
251 ["Hide Subdir" dired-hide-subdir t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
252 ["Toggle Omit" dired-omit-toggle t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
253 ["Kill Marked Lines" dired-do-kill-file-lines t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
254 (vector "Redisplay Killed Lines"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
255 '(dired-do-kill-file-lines 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
256 ':keys (dired-key-description 'dired-do-kill-file-lines "0"))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
257 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
258 dired-help-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
259 (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
260 ["Dired Summary Help" dired-summary t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
261 ["Describe Dired" dired-describe-mode t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
262 (vector "Dired Info Manual"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
263 '(dired-describe-mode t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
264 ':keys (dired-key-description 'dired-describe-mode
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
265 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
266 ["Dired Command Apropos" dired-apropos t]
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
267 (vector "Dired Variable Apropos"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
268 '(let ((current-prefix-arg t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
269 (call-interactively 'dired-apropos))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
270 ':keys (dired-key-description 'dired-apropos 'universal-argument))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
271 ["Report Dired Bug" dired-report-bug t])))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
272
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
273 (defun dired-install-menubar ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
274 "Installs the Dired menu at the menubar."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
275 (if (null dired-help-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
276 (dired-setup-menus))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
277 (if (and (featurep 'menubar) current-menubar)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
278 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
279 (let ((buffer-menubar (copy-sequence current-menubar)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
280 (delete (assoc "Edit" buffer-menubar) buffer-menubar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
281 (set-buffer-menubar buffer-menubar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
282 (mapcar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
283 (function
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
284 (lambda (pair)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
285 (let ((name (car pair))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
286 (menu (symbol-value (cdr pair))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
287 (add-submenu nil (cons name menu)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
288 dired-menubar-menus))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
289 (add-menu-button '("Help") (list "---"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
290 (add-submenu '("Help") (cons "Dired" dired-help-menu)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
291
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
292 (add-hook 'dired-mode-hook 'dired-install-menubar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
293
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
294 ;;; Mouse functions
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
295
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
296 (defun dired-mouse-find-file (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
297 "In dired, visit the file or directory name you click on."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
298 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
299 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
300 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
301 (if dired-subdir-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
302 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
303 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
304 (dired-find-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
305 (error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
306 (concat "dired-subdir-alist seems to be mangled. "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
307 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
308 "\\<dired-mode-map>Try dired-revert (\\[dired-revert])."))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
309
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
310 (defun dired-mouse-mark (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
311 "In dired, mark the file name that you click on.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
312 If the file name is already marked, this unmarks it."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
313 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
314 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
315 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
316 (if dired-subdir-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
317 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
318 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
319 (beginning-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
320 (if (looking-at dired-re-mark)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
321 (dired-unmark 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
322 (dired-mark 1)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
323 (error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
324 (concat "dired-subdir-alist seems to be mangled. "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
325 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
326 "\\<dired-mode-map>Try dired-revert (\\[dired-revert])."))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
327
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
328 (defun dired-mouse-flag (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
329 "In dired, flag for deletion the file name that you click on.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
330 If the file name is already flag, this unflags it."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
331 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
332 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
333 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
334 (if dired-subdir-alist
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
335 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
336 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
337 (beginning-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
338 (if (char-equal (following-char) dired-del-marker)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
339 (dired-unflag 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
340 (dired-flag-file-deletion 1)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
341 (error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
342 (concat "dired-subdir-alist seems to be mangled. "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
343 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
344 "\\<dired-mode-map>Try dired-revert (\\[dired-revert])."))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
345
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
346 (defun dired-mouse-get-target (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
347 "In dired, put a copy of the selected directory in the active minibuffer."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
348 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
349 (let ((obuff (current-buffer))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
350 mb)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
351 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
352 (if (and dired-subdir-alist (setq mb (dired-get-active-minibuffer-window)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
353 (let (dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
354 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
355 (setq dir (dired-current-directory))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
356 (select-window mb)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
357 (set-buffer (window-buffer mb))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
358 (erase-buffer)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
359 (insert dir))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
360 (set-buffer obuff)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
361 (if mb
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
362 (error "No directory specified")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
363 (error "No active minibuffer")))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
364
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
365 (defun dired-visit-popup-menu (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
366 "Popup a menu to visit the moused file."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
367 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
368 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
369 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
370 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
371 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
372 (dired-visit-popup-menu-internal event))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
373
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
374 (defun dired-visit-popup-menu-internal (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
375 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
376 (let ((fn (dired-get-filename 'no-dir)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
377 (popup-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
378 (cons (concat "Visit " fn " with") dired-visit-popup-menu))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
379 ;; this looks like a kludge to me ...
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
380 (while (popup-up-p)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
381 (dispatch-event (next-event)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
382
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
383 (defun dired-do-popup-menu (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
384 "Pop up a menu to do an operation on the moused file."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
385 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
386 (let ((obuff (current-buffer)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
387 (unwind-protect
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
388 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
389 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
390 (dired-save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
391 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
392 (dired-do-popup-menu-internal event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
393 (set-buffer obuff))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
394
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
395 (defun dired-do-popup-menu-internal (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
396 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
397 (let ((fn (dired-get-filename 'no-dir))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
398 (current-prefix-arg 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
399 (popup-menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
400 (cons (concat "Do operation on " fn) dired-do-popup-menu))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
401 (while (popup-up-p)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
402 (dispatch-event (next-event)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
403
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
404 (defvar dired-filename-local-map
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
405 (let ((map (make-sparse-keymap)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
406 (set-keymap-name map 'dired-filename-local-map)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
407 (define-key map 'button2 'dired-mouse-find-file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
408 (define-key map 'button3 'dired-visit-popup-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
409 (define-key map '(control button2) 'dired-do-popup-menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
410 (define-key map '(shift button1) 'dired-mouse-mark)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
411 (define-key map '(control shift button1) 'dired-mouse-flag)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
412 map)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
413 "Keymap used to activate actions on files in dired.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
414
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
415 ;; Make this defined everywhere in the dired buffer.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
416 (define-key dired-mode-map '(meta button3) 'dired-mouse-get-target)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
417
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
418 ;;; Extent managment
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
419
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
420 (defun dired-set-text-properties (start end &optional face)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
421 (let ((filename-extent (make-extent start end)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
422 (set-extent-face filename-extent (or face 'default))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
423 (set-extent-property filename-extent 'dired-file-name t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
424 (set-extent-property filename-extent 'start-open t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
425 (set-extent-property filename-extent 'end-open t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
426 (set-extent-property filename-extent 'keymap dired-filename-local-map)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
427 (set-extent-property filename-extent 'highlight t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
428 (set-extent-property
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
429 filename-extent 'help-echo
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
430 (concat
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
431 "button2 finds, button3 visits, "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
432 "C-button2 file ops, [C-]shift-button1 marks/flags."))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
433 filename-extent))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
434
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
435 (defun dired-insert-set-properties (beg end)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
436 ;; Sets the extents for the file names and their properties
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
437 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
438 (goto-char beg)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
439 (beginning-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
440 (let ((eol (save-excursion (end-of-line) (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
441 (bol (point))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
442 start)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
443 (while (< (point) end)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
444 (setq eol (save-excursion (end-of-line) (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
445
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
446 (if dired-do-interactive-permissions
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
447 (dired-make-permissions-interactive (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
448
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
449 (if (dired-manual-move-to-filename nil bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
450 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
451 (setq start (point))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
452 (dired-manual-move-to-end-of-filename nil bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
453 (dired-set-text-properties
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
454 start
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
455 (point)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
456 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
457 (beginning-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
458 (cond
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
459 ((null dired-do-highlighting) nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
460 ((looking-at dired-re-raw-dir) 'dired-face-directory)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
461 ((looking-at dired-re-raw-sym) 'dired-face-symlink)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
462 ((or (looking-at dired-re-raw-setuid)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
463 (looking-at dired-re-raw-setgid)) 'dired-face-setuid)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
464 ((looking-at dired-re-raw-exe) 'dired-face-executable)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
465 ((looking-at dired-re-raw-socket) 'dired-face-socket)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
466 ((save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
467 (goto-char start)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
468 (re-search-forward dired-re-raw-boring eol t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
469 'dired-face-boring))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
470
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
471 (setq bol (1+ eol))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
472 (goto-char bol)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
473
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
474 (defun dired-remove-text-properties (start end)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
475 ;; Removes text properties. Called in popup buffers.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
476 (map-extents
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
477 (function
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
478 (lambda (extent maparg)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
479 (if (extent-property extent 'dired-file-name)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
480 (delete-extent extent))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
481 nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
482 nil start end))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
483
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
484 (defun dired-highlight-filename-mark (extent)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
485 (let ((mark
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
486 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
487 (skip-chars-backward "^\n\r")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
488 (following-char)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
489 (face (extent-face extent)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
490 (if (char-equal mark ?\ )
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
491 (if (consp face)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
492 (set-extent-face extent (cadr face)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
493 (let ((new-face
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
494 (cond
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
495 ((char-equal dired-default-marker mark)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
496 'dired-face-marked)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
497 ((char-equal dired-del-marker mark)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
498 'dired-face-flagged)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
499 (t 'default))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
500 (set-extent-face
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
501 extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
502 (if (consp face)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
503 (list new-face (cadr face))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
504 (list new-face face)))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
505
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
506 (defun dired-move-to-filename (&optional raise-error bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
507 (or bol (setq bol (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
508 (skip-chars-backward "^\n\r")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
509 (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
510 (or eol (setq eol (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
511 (skip-chars-forward "^\n\r")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
512 (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
513 (goto-char bol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
514 (let ((extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
515 (map-extents
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
516 (function
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
517 (lambda (extent maparg)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
518 (if (extent-property extent 'dired-file-name)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
519 extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
520 nil)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
521 nil bol eol)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
522 (if extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
523 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
524 (if dired-do-highlighting
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
525 (dired-highlight-filename-mark extent))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
526 (goto-char (extent-start-position extent)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
527 (if raise-error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
528 (error "No file on this line")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
529 nil))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
530
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
531
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
532 (defun dired-move-to-end-of-filename (&optional no-error bol eol)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
533 ;; Assumes point is at beginning of filename,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
534 ;; thus the rwx bit re-search-backward below will succeed in *this*
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
535 ;; line if at all. So, it should be called only after
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
536 ;; (dired-move-to-filename t).
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
537 ;; On failure, signals an error (with non-nil NO-ERROR just returns nil).
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
538 (or eol (setq eol (save-excursion (skip-chars-forward "^\r\n") (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
539 (and
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
540 (null no-error)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
541 selective-display
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
542 (or bol (setq bol (save-excursion (skip-chars-backward "^\r\n") (point))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
543 (eq (char-after (1- bol)) ?\r)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
544 (cond
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
545 ((dired-subdir-hidden-p (dired-current-directory))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
546 (error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
547 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
548 "File line is hidden. Type \\[dired-hide-subdir] to unhide.")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
549 ((error
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
550 (substitute-command-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
551 "File line is omitted. Type \\[dired-omit-toggle] to un-omit.")))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
552 (let ((filename-extent (map-extents
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
553 (function
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
554 (lambda (e p) (and (extent-property e p) e)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
555 (current-buffer) bol eol 'dired-file-name)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
556 (if filename-extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
557 (goto-char (extent-end-position filename-extent))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
558 (and (null no-error) (error "No file on this line")))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
559
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
560 ;;; Interactive chmod
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
561 ;;; (based on ideas from Russell Ritchie's dired-chmod.el)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
562
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
563 (defun dired-do-interactive-chmod (new-attribute)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
564 (let* ((file (dired-get-filename))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
565 (operation (concat "chmod " new-attribute " " file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
566 (failure (apply (function dired-check-process)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
567 operation
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
568 "chmod" new-attribute (list file))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
569 (dired-do-redisplay)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
570 (if failure
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
571 (dired-log-summary (buffer-name (current-buffer))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
572 (format "%s: error" operation) nil))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
573
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
574 (defun dired-chmod-popup-menu (event menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
575 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
576 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
577 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
578 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
579 (popup-menu menu)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
580 ;; this looks like a kludge to me ...
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
581 (while (popup-up-p)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
582 (dispatch-event (next-event))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
583
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
584 ;; This is probably overdoing it.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
585 ;; Someone give me lexical scoping here ...
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
586
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
587 (defun dired-setup-chmod-keymap (domain id keys &optional toggle-keys)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
588 (let* ((names
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
589 (mapcar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
590 (function
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
591 (lambda (key)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
592 (let ((name (intern (concat "dired-"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
593 (list domain ?- key)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
594 (eval
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
595 `(defun ,name ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
596 (interactive)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
597 (dired-do-interactive-chmod ,(concat (list domain ?+ key)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
598 name)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
599 keys))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
600 (prefix (concat "dired-" (list domain) "-" (list id)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
601 (remove-name (intern (concat prefix "-remove")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
602 (toggle-name (intern (concat prefix "-toggle")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
603 (mouse-toggle-name (intern (concat prefix "-mouse-toggle")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
604 (mouse-menu-name (intern (concat prefix "-menu"))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
605
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
606 (eval
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
607 `(defun ,remove-name ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
608 (interactive)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
609 (cond ,@(mapcar (function
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
610 (lambda (key)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
611 `((looking-at ,(regexp-quote (char-to-string key)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
612 (dired-do-interactive-chmod
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
613 ,(concat (list domain ?- key))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
614 keys))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
615
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
616 (eval
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
617 `(defun ,toggle-name ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
618 (interactive)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
619 (cond ((looking-at "-") (dired-do-interactive-chmod
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
620 ,(concat (list domain ?+ (car keys)))))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
621 ,@(let ((l (or toggle-keys keys))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
622 (c '()))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
623 (while l
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
624 (setq c
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
625 (cons
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
626 `((looking-at (regexp-quote (char-to-string ,(car l))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
627 (dired-do-interactive-chmod
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
628 ,(if (null (cdr l))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
629 (concat (list domain ?- (car l)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
630 (concat (list domain ?+ (cadr l))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
631 c))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
632 (setq l (cdr l)))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
633 (reverse c))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
634 (t (dired-do-interactive-chmod
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
635 ,(concat (list domain ?+ (car keys))))))))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
636
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
637 (eval
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
638 `(defun ,mouse-toggle-name (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
639 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
640 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
641 (set-buffer (window-buffer (event-window event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
642 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
643 (goto-char (event-point event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
644 (,toggle-name)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
645
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
646 (let ((menu '())
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
647 (loop-keys keys)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
648 (loop-names names))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
649 (while loop-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
650 (setq menu
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
651 (cons (vector (concat (list ?+ (car loop-keys)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
652 (car loop-names)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
653 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
654 menu))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
655 (setq loop-keys (cdr loop-keys)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
656 loop-names (cdr loop-names)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
657 (setq menu (append menu (list (vector "Toggle" toggle-name t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
658 (vector "Clear" remove-name t))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
659 (setq menu (cons (char-to-string domain) menu))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
660
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
661 (eval
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
662 `(defun ,mouse-menu-name (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
663 (interactive "e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
664 (dired-chmod-popup-menu event ',menu))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
665
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
666 (let ((keymap (make-sparse-keymap)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
667 (let ((loop-keys (cons ?. (cons ?- keys)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
668 (loop-names (cons toggle-name (cons remove-name names))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
669 (while loop-keys
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
670 (define-key keymap (car loop-keys) (car loop-names))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
671 (setq loop-keys (cdr loop-keys)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
672 loop-names (cdr loop-names))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
673
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
674 (define-key keymap 'button2 mouse-toggle-name)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
675 (define-key keymap 'button3 mouse-menu-name)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
676 keymap)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
677
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
678 (defvar dired-u-r-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
679 (defvar dired-u-w-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
680 (defvar dired-u-x-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
681 (defvar dired-g-r-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
682 (defvar dired-g-w-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
683 (defvar dired-g-x-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
684 (defvar dired-o-r-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
685 (defvar dired-o-w-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
686 (defvar dired-o-x-keymap nil "internal keymap for dired")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
687
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
688
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
689 (defun dired-setup-chmod-keymaps ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
690 (setq
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
691 dired-u-r-keymap (dired-setup-chmod-keymap ?u ?r '(?r))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
692 dired-u-w-keymap (dired-setup-chmod-keymap ?u ?w '(?w))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
693 dired-u-x-keymap (dired-setup-chmod-keymap ?u ?x '(?x ?s) '(?x))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
694 dired-g-r-keymap (dired-setup-chmod-keymap ?g ?r '(?r))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
695 dired-g-w-keymap (dired-setup-chmod-keymap ?g ?w '(?w))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
696 dired-g-x-keymap (dired-setup-chmod-keymap ?g ?x '(?x ?s) '(?x))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
697 dired-o-r-keymap (dired-setup-chmod-keymap ?o ?r '(?r))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
698 dired-o-w-keymap (dired-setup-chmod-keymap ?o ?w '(?w))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 22
diff changeset
699 dired-o-x-keymap (dired-setup-chmod-keymap ?o ?x '(?x ?s ?t) '(?x))))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
700
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
701 (defun dired-make-permissions-interactive (beg)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
702 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
703 (goto-char beg)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
704 (buffer-substring (point) (save-excursion (end-of-line) (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
705 (if (and (re-search-forward dired-re-pre-permissions
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
706 (save-excursion (end-of-line) (point))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
707 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
708 (looking-at dired-re-permissions))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
709 (let ((p (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
710 (dired-activate-permissions (make-extent p (+ 1 p)) dired-u-r-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
711 (dired-activate-permissions (make-extent (+ 1 p) (+ 2 p)) dired-u-w-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
712 (dired-activate-permissions (make-extent (+ 2 p) (+ 3 p)) dired-u-x-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
713 (dired-activate-permissions (make-extent (+ 3 p) (+ 4 p)) dired-g-r-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
714 (dired-activate-permissions (make-extent (+ 4 p) (+ 5 p)) dired-g-w-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
715 (dired-activate-permissions (make-extent (+ 5 p) (+ 6 p)) dired-g-x-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
716 (dired-activate-permissions (make-extent (+ 6 p) (+ 7 p)) dired-o-r-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
717 (dired-activate-permissions (make-extent (+ 7 p) (+ 8 p)) dired-o-w-keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
718 (dired-activate-permissions (make-extent (+ 8 p) (+ 9 p)) dired-o-x-keymap)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
719
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
720 (defun dired-activate-permissions (extent keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
721 (set-extent-face extent 'dired-face-permissions)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
722 (set-extent-property extent 'keymap keymap)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
723 (set-extent-property extent 'highlight t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
724 (set-extent-property
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
725 extent 'help-echo
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
726 "button2 toggles, button3 changes otherwise."))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
727
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
728 (dired-setup-chmod-keymaps)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
729
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
730 ;;; end of dired-xemacs.el