]> code.delx.au - gnu-emacs/blob - lisp/vc-dir.el
(vc-dir-search): New function.
[gnu-emacs] / lisp / vc-dir.el
1 ;;; vc-dir.el --- Directory status display under VC
2
3 ;; Copyright (C) 2007, 2008
4 ;; Free Software Foundation, Inc.
5
6 ;; Author: Dan Nicolaescu <dann@ics.uci.edu>
7 ;; Keywords: tools
8
9 ;; This file is part of GNU Emacs.
10
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Credits:
25
26 ;; The original VC directory status implementation was based on dired.
27 ;; This implementation was inspired by PCL-CVS.
28 ;; Many people contributed comments, ideas and code to this
29 ;; implementation. These include:
30 ;;
31 ;; Alexandre Julliard <julliard@winehq.org>
32 ;; Stefan Monnier <monnier@iro.umontreal.ca>
33 ;; Tom Tromey <tromey@redhat.com>
34
35 ;;; Commentary:
36 ;;
37
38 ;;; Todo: see vc.el.
39
40 (require 'vc-hooks)
41 (require 'vc)
42 (require 'tool-bar)
43 (require 'ewoc)
44
45 ;;; Code:
46 (eval-when-compile
47 (require 'cl))
48
49 (defcustom vc-dir-mode-hook nil
50 "Normal hook run by `vc-dir-mode'.
51 See `run-hooks'."
52 :type 'hook
53 :group 'vc)
54
55 ;; Used to store information for the files displayed in the directory buffer.
56 ;; Each item displayed corresponds to one of these defstructs.
57 (defstruct (vc-dir-fileinfo
58 (:copier nil)
59 (:type list) ;So we can use `member' on lists of FIs.
60 (:constructor
61 ;; We could define it as an alias for `list'.
62 vc-dir-create-fileinfo (name state &optional extra marked directory))
63 (:conc-name vc-dir-fileinfo->))
64 name ;Keep it as first, for `member'.
65 state
66 ;; For storing backend specific information.
67 extra
68 marked
69 ;; To keep track of not updated files during a global refresh
70 needs-update
71 ;; To distinguish files and directories.
72 directory)
73
74 (defvar vc-ewoc nil)
75
76 (defvar vc-dir-process-buffer nil
77 "The buffer used for the asynchronous call that computes status.")
78
79 (defvar vc-dir-backend nil
80 "The backend used by the current *vc-dir* buffer.")
81
82 (defun vc-dir-move-to-goal-column ()
83 ;; Used to keep the cursor on the file name column.
84 (beginning-of-line)
85 (unless (eolp)
86 ;; Must be in sync with vc-default-status-printer.
87 (forward-char 25)))
88
89 (defun vc-dir-prepare-status-buffer (bname dir backend &optional create-new)
90 "Find a buffer named BNAME showing DIR, or create a new one."
91 (setq dir (expand-file-name dir))
92 (let*
93 ;; Look for another buffer name BNAME visiting the same directory.
94 ((buf (save-excursion
95 (unless create-new
96 (dolist (buffer (buffer-list))
97 (set-buffer buffer)
98 (when (and (derived-mode-p 'vc-dir-mode)
99 (eq vc-dir-backend backend)
100 (string= (expand-file-name default-directory) dir))
101 (return buffer)))))))
102 (or buf
103 ;; Create a new buffer named BNAME.
104 (with-current-buffer (create-file-buffer bname)
105 (cd dir)
106 (vc-setup-buffer (current-buffer))
107 ;; Reset the vc-parent-buffer-name so that it does not appear
108 ;; in the mode-line.
109 (setq vc-parent-buffer-name nil)
110 (current-buffer)))))
111
112 (defvar vc-dir-menu-map
113 (let ((map (make-sparse-keymap "VC-dir")))
114 (define-key map [quit]
115 '(menu-item "Quit" quit-window
116 :help "Quit"))
117 (define-key map [kill]
118 '(menu-item "Kill Update Command" vc-dir-kill-dir-status-process
119 :enable (vc-dir-busy)
120 :help "Kill the command that updates the directory buffer"))
121 (define-key map [refresh]
122 '(menu-item "Refresh" revert-buffer
123 :enable (not (vc-dir-busy))
124 :help "Refresh the contents of the directory buffer"))
125 (define-key map [remup]
126 '(menu-item "Hide up-to-date" vc-dir-hide-up-to-date
127 :help "Hide up-to-date items from display"))
128 ;; Movement.
129 (define-key map [sepmv] '("--"))
130 (define-key map [next-line]
131 '(menu-item "Next line" vc-dir-next-line
132 :help "Go to the next line" :keys "n"))
133 (define-key map [previous-line]
134 '(menu-item "Previous line" vc-dir-previous-line
135 :help "Go to the previous line"))
136 ;; Marking.
137 (define-key map [sepmrk] '("--"))
138 (define-key map [unmark-all]
139 '(menu-item "Unmark All" vc-dir-unmark-all-files
140 :help "Unmark all files that are in the same state as the current file\
141 \nWith prefix argument unmark all files"))
142 (define-key map [unmark-previous]
143 '(menu-item "Unmark previous " vc-dir-unmark-file-up
144 :help "Move to the previous line and unmark the file"))
145
146 (define-key map [mark-all]
147 '(menu-item "Mark All" vc-dir-mark-all-files
148 :help "Mark all files that are in the same state as the current file\
149 \nWith prefix argument mark all files"))
150 (define-key map [unmark]
151 '(menu-item "Unmark" vc-dir-unmark
152 :help "Unmark the current file or all files in the region"))
153
154 (define-key map [mark]
155 '(menu-item "Mark" vc-dir-mark
156 :help "Mark the current file or all files in the region"))
157
158 (define-key map [sepopn] '("--"))
159 (define-key map [qr]
160 '(menu-item "Query Replace in Files" vc-dir-query-replace-regexp
161 :help "Replace a string in the marked files"))
162 (define-key map [se]
163 '(menu-item "Search Files" vc-dir-search
164 :help "Search a regexp in the marked files"))
165 (define-key map [open-other]
166 '(menu-item "Open in other window" vc-dir-find-file-other-window
167 :help "Find the file on the current line, in another window"))
168 (define-key map [open]
169 '(menu-item "Open file" vc-dir-find-file
170 :help "Find the file on the current line"))
171 (define-key map [sepvcdet] '("--"))
172 ;; FIXME: This needs a key binding. And maybe a better name
173 ;; ("Insert" like PCL-CVS uses does not sound that great either)...
174 (define-key map [ins]
175 '(menu-item "Show File" vc-dir-show-fileentry
176 :help "Show a file in the VC status listing even though it might be up to date"))
177 (define-key map [annotate]
178 '(menu-item "Annotate" vc-annotate
179 :help "Display the edit history of the current file using colors"))
180 (define-key map [diff]
181 '(menu-item "Compare with Base Version" vc-diff
182 :help "Compare file set with the base version"))
183 (define-key map [log]
184 '(menu-item "Show history" vc-print-log
185 :help "List the change log of the current file set in a window"))
186 ;; VC commands.
187 (define-key map [sepvccmd] '("--"))
188 (define-key map [update]
189 '(menu-item "Update to latest version" vc-update
190 :help "Update the current fileset's files to their tip revisions"))
191 (define-key map [revert]
192 '(menu-item "Revert to base version" vc-revert
193 :help "Revert working copies of the selected fileset to their repository contents."))
194 (define-key map [next-action]
195 ;; FIXME: This really really really needs a better name!
196 ;; And a key binding too.
197 '(menu-item "Check In/Out" vc-next-action
198 :help "Do the next logical version control operation on the current fileset"))
199 (define-key map [register]
200 '(menu-item "Register" vc-register
201 :help "Register file set into the version control system"))
202 map)
203 "Menu for dispatcher status")
204
205 ;; VC backends can use this to add mode-specific menu items to
206 ;; vc-dir-menu-map.
207 (defun vc-dir-menu-map-filter (orig-binding)
208 (when (and (symbolp orig-binding) (fboundp orig-binding))
209 (setq orig-binding (indirect-function orig-binding)))
210 (let ((ext-binding
211 (when (derived-mode-p 'vc-dir-mode)
212 (vc-call-backend vc-dir-backend 'extra-status-menu))))
213 (if (null ext-binding)
214 orig-binding
215 (append orig-binding
216 '("----")
217 ext-binding))))
218
219 (defvar vc-dir-mode-map
220 (let ((map (make-sparse-keymap)))
221 ;; VC commands
222 (define-key map "v" 'vc-next-action) ;; C-x v v
223 (define-key map "=" 'vc-diff) ;; C-x v =
224 (define-key map "i" 'vc-register) ;; C-x v i
225 (define-key map "+" 'vc-update) ;; C-x v +
226 (define-key map "l" 'vc-print-log) ;; C-x v l
227 ;; More confusing than helpful, probably
228 ;;(define-key map "R" 'vc-revert) ;; u is taken by dispatcher unmark.
229 ;;(define-key map "A" 'vc-annotate) ;; g is taken by dispatcher refresh
230 ;; Marking.
231 (define-key map "m" 'vc-dir-mark)
232 (define-key map "M" 'vc-dir-mark-all-files)
233 (define-key map "u" 'vc-dir-unmark)
234 (define-key map "U" 'vc-dir-unmark-all-files)
235 (define-key map "\C-?" 'vc-dir-unmark-file-up)
236 (define-key map "\M-\C-?" 'vc-dir-unmark-all-files)
237 ;; Movement.
238 (define-key map "n" 'vc-dir-next-line)
239 (define-key map " " 'vc-dir-next-line)
240 (define-key map "\t" 'vc-dir-next-directory)
241 (define-key map "p" 'vc-dir-previous-line)
242 (define-key map [backtab] 'vc-dir-previous-directory)
243 ;;; Rebind paragraph-movement commands.
244 (define-key map "\M-}" 'vc-dir-next-directory)
245 (define-key map "\M-{" 'vc-dir-previous-directory)
246 (define-key map [C-down] 'vc-dir-next-directory)
247 (define-key map [C-up] 'vc-dir-previous-directory)
248 ;; The remainder.
249 (define-key map "f" 'vc-dir-find-file)
250 (define-key map "\C-m" 'vc-dir-find-file)
251 (define-key map "o" 'vc-dir-find-file-other-window)
252 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
253 (define-key map [down-mouse-3] 'vc-dir-menu)
254 (define-key map [mouse-2] 'vc-dir-toggle-mark)
255 (define-key map "x" 'vc-dir-hide-up-to-date)
256 (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired?
257 (define-key map "Q" 'vc-dir-query-replace-regexp)
258
259 ;; Hook up the menu.
260 (define-key map [menu-bar vc-dir-mode]
261 `(menu-item
262 ;; VC backends can use this to add mode-specific menu items to
263 ;; vc-dir-menu-map.
264 "VC-dir" ,vc-dir-menu-map :filter vc-dir-menu-map-filter))
265 map)
266 "Keymap for directory buffer.")
267
268 (defmacro vc-at-event (event &rest body)
269 "Evaluate `body' with point located at event-start of `event'.
270 If `body' uses `event', it should be a variable,
271 otherwise it will be evaluated twice."
272 (let ((posn (make-symbol "vc-at-event-posn")))
273 `(let ((,posn (event-start ,event)))
274 (save-excursion
275 (set-buffer (window-buffer (posn-window ,posn)))
276 (goto-char (posn-point ,posn))
277 ,@body))))
278
279 (defun vc-dir-menu (e)
280 "Popup the dispatcher status menu."
281 (interactive "e")
282 (vc-at-event e (popup-menu vc-dir-menu-map e)))
283
284 (defvar vc-dir-tool-bar-map
285 (let ((map (make-sparse-keymap)))
286 (tool-bar-local-item-from-menu 'vc-dir-find-file "open"
287 map vc-dir-mode-map)
288 (tool-bar-local-item "bookmark_add"
289 'vc-dir-toggle-mark 'vc-dir-toggle-mark map
290 :help "Toggle mark on current item")
291 (tool-bar-local-item-from-menu 'vc-dir-previous-line "left-arrow"
292 map vc-dir-mode-map
293 :rtl "right-arrow")
294 (tool-bar-local-item-from-menu 'vc-dir-next-line "right-arrow"
295 map vc-dir-mode-map
296 :rtl "left-arrow")
297 (tool-bar-local-item-from-menu 'vc-print-log "info"
298 map vc-dir-mode-map)
299 (tool-bar-local-item-from-menu 'revert-buffer "refresh"
300 map vc-dir-mode-map)
301 (tool-bar-local-item-from-menu 'nonincremental-search-forward
302 "search" map)
303 (tool-bar-local-item-from-menu 'vc-dir-query-replace-regexp
304 "search-replace" map vc-dir-mode-map)
305 (tool-bar-local-item-from-menu 'vc-dir-kill-dir-status-process "cancel"
306 map vc-dir-mode-map)
307 (tool-bar-local-item-from-menu 'quit-window "exit"
308 map vc-dir-mode-map)
309 map))
310
311 (defun vc-dir-node-directory (node)
312 ;; Compute the directory for NODE.
313 ;; If it's a directory node, get it from the the node.
314 (let ((data (ewoc-data node)))
315 (or (vc-dir-fileinfo->directory data)
316 ;; Otherwise compute it from the file name.
317 (file-name-directory
318 (expand-file-name
319 (vc-dir-fileinfo->name data))))))
320
321 (defun vc-dir-update (entries buffer &optional noinsert)
322 "Update BUFFER's ewoc from the list of ENTRIES.
323 If NOINSERT, ignore elements on ENTRIES which are not in the ewoc."
324 ;; Add ENTRIES to the vc-dir buffer BUFFER.
325 (with-current-buffer buffer
326 ;; Insert the entries sorted by name into the ewoc.
327 ;; We assume the ewoc is sorted too, which should be the
328 ;; case if we always add entries with vc-dir-update.
329 (setq entries
330 ;; Sort: first files and then subdirectories.
331 ;; XXX: this is VERY inefficient, it computes the directory
332 ;; names too many times
333 (sort entries
334 (lambda (entry1 entry2)
335 (let ((dir1 (file-name-directory (expand-file-name (car entry1))))
336 (dir2 (file-name-directory (expand-file-name (car entry2)))))
337 (cond
338 ((string< dir1 dir2) t)
339 ((not (string= dir1 dir2)) nil)
340 ((string< (car entry1) (car entry2))))))))
341 ;; Insert directory entries in the right places.
342 (let ((entry (car entries))
343 (node (ewoc-nth vc-ewoc 0)))
344 ;; Insert . if it is not present.
345 (unless node
346 (let ((rd (file-relative-name default-directory)))
347 (ewoc-enter-last
348 vc-ewoc (vc-dir-create-fileinfo
349 rd nil nil nil (expand-file-name default-directory))))
350 (setq node (ewoc-nth vc-ewoc 0)))
351
352 (while (and entry node)
353 (let* ((entryfile (car entry))
354 (entrydir (file-name-directory (expand-file-name entryfile)))
355 (nodedir (vc-dir-node-directory node)))
356 (cond
357 ;; First try to find the directory.
358 ((string-lessp nodedir entrydir)
359 (setq node (ewoc-next vc-ewoc node)))
360 ((string-equal nodedir entrydir)
361 ;; Found the directory, find the place for the file name.
362 (let ((nodefile (vc-dir-fileinfo->name (ewoc-data node))))
363 (cond
364 ((string-lessp nodefile entryfile)
365 (setq node (ewoc-next vc-ewoc node)))
366 ((string-equal nodefile entryfile)
367 (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry))
368 (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry))
369 (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil)
370 (ewoc-invalidate vc-ewoc node)
371 (setq entries (cdr entries))
372 (setq entry (car entries))
373 (setq node (ewoc-next vc-ewoc node)))
374 (t
375 (ewoc-enter-before vc-ewoc node
376 (apply 'vc-dir-create-fileinfo entry))
377 (setq entries (cdr entries))
378 (setq entry (car entries))))))
379 (t
380 ;; We might need to insert a directory node if the
381 ;; previous node was in a different directory.
382 (let* ((rd (file-relative-name entrydir))
383 (prev-node (ewoc-prev vc-ewoc node))
384 (prev-dir (vc-dir-node-directory prev-node)))
385 (unless (string-equal entrydir prev-dir)
386 (ewoc-enter-before
387 vc-ewoc node (vc-dir-create-fileinfo rd nil nil nil entrydir))))
388 ;; Now insert the node itself.
389 (ewoc-enter-before vc-ewoc node
390 (apply 'vc-dir-create-fileinfo entry))
391 (setq entries (cdr entries) entry (car entries))))))
392 ;; We're past the last node, all remaining entries go to the end.
393 (unless (or node noinsert)
394 (let ((lastdir (vc-dir-node-directory (ewoc-nth vc-ewoc -1))))
395 (dolist (entry entries)
396 (let ((entrydir (file-name-directory (expand-file-name (car entry)))))
397 ;; Insert a directory node if needed.
398 (unless (string-equal lastdir entrydir)
399 (setq lastdir entrydir)
400 (let ((rd (file-relative-name entrydir)))
401 (ewoc-enter-last
402 vc-ewoc (vc-dir-create-fileinfo rd nil nil nil entrydir))))
403 ;; Now insert the node itself.
404 (ewoc-enter-last vc-ewoc
405 (apply 'vc-dir-create-fileinfo entry)))))))))
406
407 (defun vc-dir-busy ()
408 (and (buffer-live-p vc-dir-process-buffer)
409 (get-buffer-process vc-dir-process-buffer)))
410
411 (defun vc-dir-kill-dir-status-process ()
412 "Kill the temporary buffer and associated process."
413 (interactive)
414 (when (buffer-live-p vc-dir-process-buffer)
415 (let ((proc (get-buffer-process vc-dir-process-buffer)))
416 (when proc (delete-process proc))
417 (setq vc-dir-process-buffer nil)
418 (setq mode-line-process nil))))
419
420 (defun vc-dir-kill-query ()
421 ;; Make sure that when the status buffer is killed the update
422 ;; process running in background is also killed.
423 (if (vc-dir-busy)
424 (when (y-or-n-p "Status update process running, really kill status buffer? ")
425 (vc-dir-kill-dir-status-process)
426 t)
427 t))
428
429 (defun vc-dir-next-line (arg)
430 "Go to the next line.
431 If a prefix argument is given, move by that many lines."
432 (interactive "p")
433 (with-no-warnings
434 (ewoc-goto-next vc-ewoc arg)
435 (vc-dir-move-to-goal-column)))
436
437 (defun vc-dir-previous-line (arg)
438 "Go to the previous line.
439 If a prefix argument is given, move by that many lines."
440 (interactive "p")
441 (ewoc-goto-prev vc-ewoc arg)
442 (vc-dir-move-to-goal-column))
443
444 (defun vc-dir-next-directory ()
445 "Go to the next directory."
446 (interactive)
447 (let ((orig (point)))
448 (if
449 (catch 'foundit
450 (while t
451 (let* ((next (ewoc-next vc-ewoc (ewoc-locate vc-ewoc))))
452 (cond ((not next)
453 (throw 'foundit t))
454 (t
455 (progn
456 (ewoc-goto-node vc-ewoc next)
457 (vc-dir-move-to-goal-column)
458 (if (vc-dir-fileinfo->directory (ewoc-data next))
459 (throw 'foundit nil))))))))
460 (goto-char orig))))
461
462 (defun vc-dir-previous-directory ()
463 "Go to the previous directory."
464 (interactive)
465 (let ((orig (point)))
466 (if
467 (catch 'foundit
468 (while t
469 (let* ((prev (ewoc-prev vc-ewoc (ewoc-locate vc-ewoc))))
470 (cond ((not prev)
471 (throw 'foundit t))
472 (t
473 (progn
474 (ewoc-goto-node vc-ewoc prev)
475 (vc-dir-move-to-goal-column)
476 (if (vc-dir-fileinfo->directory (ewoc-data prev))
477 (throw 'foundit nil))))))))
478 (goto-char orig))))
479
480 (defun vc-dir-mark-unmark (mark-unmark-function)
481 (if (use-region-p)
482 (let ((firstl (line-number-at-pos (region-beginning)))
483 (lastl (line-number-at-pos (region-end))))
484 (save-excursion
485 (goto-char (region-beginning))
486 (while (<= (line-number-at-pos) lastl)
487 (funcall mark-unmark-function))))
488 (funcall mark-unmark-function)))
489
490 (defun vc-dir-parent-marked-p (arg)
491 ;; Return nil if none of the parent directories of arg is marked.
492 (let* ((argdir (vc-dir-node-directory arg))
493 (arglen (length argdir))
494 (crt arg)
495 data dir)
496 ;; Go through the predecessors, checking if any directory that is
497 ;; a parent is marked.
498 (while (setq crt (ewoc-prev vc-ewoc crt))
499 (setq data (ewoc-data crt))
500 (setq dir (vc-dir-node-directory crt))
501 (when (and (vc-dir-fileinfo->directory data)
502 (vc-string-prefix-p dir argdir))
503 (when (vc-dir-fileinfo->marked data)
504 (error "Cannot mark `%s', parent directory `%s' marked"
505 (vc-dir-fileinfo->name (ewoc-data arg))
506 (vc-dir-fileinfo->name data)))))
507 nil))
508
509 (defun vc-dir-children-marked-p (arg)
510 ;; Return nil if none of the children of arg is marked.
511 (let* ((argdir-re (concat "\\`" (regexp-quote (vc-dir-node-directory arg))))
512 (is-child t)
513 (crt arg)
514 data dir)
515 (while (and is-child (setq crt (ewoc-next vc-ewoc crt)))
516 (setq data (ewoc-data crt))
517 (setq dir (vc-dir-node-directory crt))
518 (if (string-match argdir-re dir)
519 (when (vc-dir-fileinfo->marked data)
520 (error "Cannot mark `%s', child `%s' marked"
521 (vc-dir-fileinfo->name (ewoc-data arg))
522 (vc-dir-fileinfo->name data)))
523 ;; We are done, we got to an entry that is not a child of `arg'.
524 (setq is-child nil)))
525 nil))
526
527 (defun vc-dir-mark-file (&optional arg)
528 ;; Mark ARG or the current file and move to the next line.
529 (let* ((crt (or arg (ewoc-locate vc-ewoc)))
530 (file (ewoc-data crt))
531 (isdir (vc-dir-fileinfo->directory file)))
532 (when (or (and isdir (not (vc-dir-children-marked-p crt)))
533 (and (not isdir) (not (vc-dir-parent-marked-p crt))))
534 (setf (vc-dir-fileinfo->marked file) t)
535 (ewoc-invalidate vc-ewoc crt)
536 (unless (or arg (mouse-event-p last-command-event))
537 (vc-dir-next-line 1)))))
538
539 (defun vc-dir-mark ()
540 "Mark the current file or all files in the region.
541 If the region is active, mark all the files in the region.
542 Otherwise mark the file on the current line and move to the next
543 line."
544 (interactive)
545 (vc-dir-mark-unmark 'vc-dir-mark-file))
546
547 (defun vc-dir-mark-all-files (arg)
548 "Mark all files with the same state as the current one.
549 With a prefix argument mark all files.
550 If the current entry is a directory, mark all child files.
551
552 The commands operate on files that are on the same state.
553 This command is intended to make it easy to select all files that
554 share the same state."
555 (interactive "P")
556 (if arg
557 ;; Mark all files.
558 (progn
559 ;; First check that no directory is marked, we can't mark
560 ;; files in that case.
561 (ewoc-map
562 (lambda (filearg)
563 (when (and (vc-dir-fileinfo->directory filearg)
564 (vc-dir-fileinfo->marked filearg))
565 (error "Cannot mark all files, directory `%s' marked"
566 (vc-dir-fileinfo->name filearg))))
567 vc-ewoc)
568 (ewoc-map
569 (lambda (filearg)
570 (unless (vc-dir-fileinfo->marked filearg)
571 (setf (vc-dir-fileinfo->marked filearg) t)
572 t))
573 vc-ewoc))
574 (let ((data (ewoc-data (ewoc-locate vc-ewoc))))
575 (if (vc-dir-fileinfo->directory data)
576 ;; It's a directory, mark child files.
577 (let ((crt (ewoc-locate vc-ewoc)))
578 (unless (vc-dir-children-marked-p crt)
579 (while (setq crt (ewoc-next vc-ewoc crt))
580 (let ((crt-data (ewoc-data crt)))
581 (unless (vc-dir-fileinfo->directory crt-data)
582 (setf (vc-dir-fileinfo->marked crt-data) t)
583 (ewoc-invalidate vc-ewoc crt))))))
584 ;; It's a file
585 (let ((state (vc-dir-fileinfo->state data))
586 (crt (ewoc-nth vc-ewoc 0)))
587 (while crt
588 (let ((crt-data (ewoc-data crt)))
589 (when (and (not (vc-dir-fileinfo->marked crt-data))
590 (eq (vc-dir-fileinfo->state crt-data) state)
591 (not (vc-dir-fileinfo->directory crt-data)))
592 (vc-dir-mark-file crt)))
593 (setq crt (ewoc-next vc-ewoc crt))))))))
594
595 (defun vc-dir-unmark-file ()
596 ;; Unmark the current file and move to the next line.
597 (let* ((crt (ewoc-locate vc-ewoc))
598 (file (ewoc-data crt)))
599 (setf (vc-dir-fileinfo->marked file) nil)
600 (ewoc-invalidate vc-ewoc crt)
601 (unless (mouse-event-p last-command-event)
602 (vc-dir-next-line 1))))
603
604 (defun vc-dir-unmark ()
605 "Unmark the current file or all files in the region.
606 If the region is active, unmark all the files in the region.
607 Otherwise mark the file on the current line and move to the next
608 line."
609 (interactive)
610 (vc-dir-mark-unmark 'vc-dir-unmark-file))
611
612 (defun vc-dir-unmark-file-up ()
613 "Move to the previous line and unmark the file."
614 (interactive)
615 ;; If we're on the first line, we won't move up, but we will still
616 ;; remove the mark. This seems a bit odd but it is what buffer-menu
617 ;; does.
618 (let* ((prev (ewoc-goto-prev vc-ewoc 1))
619 (file (ewoc-data prev)))
620 (setf (vc-dir-fileinfo->marked file) nil)
621 (ewoc-invalidate vc-ewoc prev)
622 (vc-dir-move-to-goal-column)))
623
624 (defun vc-dir-unmark-all-files (arg)
625 "Unmark all files with the same state as the current one.
626 With a prefix argument unmark all files.
627 If the current entry is a directory, unmark all the child files.
628
629 The commands operate on files that are on the same state.
630 This command is intended to make it easy to deselect all files
631 that share the same state."
632 (interactive "P")
633 (if arg
634 (ewoc-map
635 (lambda (filearg)
636 (when (vc-dir-fileinfo->marked filearg)
637 (setf (vc-dir-fileinfo->marked filearg) nil)
638 t))
639 vc-ewoc)
640 (let* ((crt (ewoc-locate vc-ewoc))
641 (data (ewoc-data crt)))
642 (if (vc-dir-fileinfo->directory data)
643 ;; It's a directory, unmark child files.
644 (while (setq crt (ewoc-next vc-ewoc crt))
645 (let ((crt-data (ewoc-data crt)))
646 (unless (vc-dir-fileinfo->directory crt-data)
647 (setf (vc-dir-fileinfo->marked crt-data) nil)
648 (ewoc-invalidate vc-ewoc crt))))
649 ;; It's a file
650 (let ((crt-state (vc-dir-fileinfo->state (ewoc-data crt))))
651 (ewoc-map
652 (lambda (filearg)
653 (when (and (vc-dir-fileinfo->marked filearg)
654 (eq (vc-dir-fileinfo->state filearg) crt-state))
655 (setf (vc-dir-fileinfo->marked filearg) nil)
656 t))
657 vc-ewoc))))))
658
659 (defun vc-dir-toggle-mark-file ()
660 (let* ((crt (ewoc-locate vc-ewoc))
661 (file (ewoc-data crt)))
662 (if (vc-dir-fileinfo->marked file)
663 (vc-dir-unmark-file)
664 (vc-dir-mark-file))))
665
666 (defun vc-dir-toggle-mark (e)
667 (interactive "e")
668 (vc-at-event e (vc-dir-mark-unmark 'vc-dir-toggle-mark-file)))
669
670 (defun vc-dir-delete-file ()
671 "Delete the marked files, or the current file if no marks."
672 (interactive)
673 (mapc 'vc-delete-file (or (vc-dir-marked-files)
674 (list (vc-dir-current-file)))))
675
676 (defun vc-dir-find-file ()
677 "Find the file on the current line."
678 (interactive)
679 (find-file (vc-dir-current-file)))
680
681 (defun vc-dir-find-file-other-window ()
682 "Find the file on the current line, in another window."
683 (interactive)
684 (find-file-other-window (vc-dir-current-file)))
685
686 (defun vc-dir-search (regexp)
687 "Search through all marked files for a match for REGEXP.
688 For marked directories, use the files displayed from those directories.
689 Stops when a match is found.
690 To continue searching for next match, use command \\[tags-loop-continue]."
691 (interactive "sSearch marked files (regexp): ")
692 (tags-search regexp '(mapcar 'car (vc-dir-marked-only-files-and-states))))
693
694 (defun vc-dir-query-replace-regexp (from to &optional delimited)
695 "Do `query-replace-regexp' of FROM with TO, on all marked files.
696 For marked directories, use the files displayed from those directories.
697 If a directory is marked, then use the files displayed for that directory.
698 Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
699 If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
700 with the command \\[tags-loop-continue]."
701 ;; FIXME: this is almost a copy of `dired-do-replace-regexp'. This
702 ;; should probably be made generic and used in both places instead of
703 ;; duplicating it here.
704 (interactive
705 (let ((common
706 (query-replace-read-args
707 "Query replace regexp in marked files" t t)))
708 (list (nth 0 common) (nth 1 common) (nth 2 common))))
709 (dolist (file (mapcar 'car (vc-dir-marked-only-files-and-states)))
710 (let ((buffer (get-file-buffer file)))
711 (if (and buffer (with-current-buffer buffer
712 buffer-read-only))
713 (error "File `%s' is visited read-only" file))))
714 (tags-query-replace from to delimited
715 '(mapcar 'car (vc-dir-marked-only-files-and-states))))
716
717 (defun vc-dir-current-file ()
718 (let ((node (ewoc-locate vc-ewoc)))
719 (unless node
720 (error "No file available"))
721 (expand-file-name (vc-dir-fileinfo->name (ewoc-data node)))))
722
723 (defun vc-dir-marked-files ()
724 "Return the list of marked files."
725 (mapcar
726 (lambda (elem) (expand-file-name (vc-dir-fileinfo->name elem)))
727 (ewoc-collect vc-ewoc 'vc-dir-fileinfo->marked)))
728
729 (defun vc-dir-marked-only-files-and-states ()
730 "Return the list of conses (FILE . STATE) for the marked files.
731 For marked directories return the corresponding conses for the
732 child files."
733 (let ((crt (ewoc-nth vc-ewoc 0))
734 result)
735 (while crt
736 (let ((crt-data (ewoc-data crt)))
737 (if (vc-dir-fileinfo->marked crt-data)
738 ;; FIXME: use vc-dir-child-files-and-states here instead of duplicating it.
739 (if (vc-dir-fileinfo->directory crt-data)
740 (let* ((dir (vc-dir-fileinfo->directory crt-data))
741 (dirlen (length dir))
742 data)
743 (while
744 (and (setq crt (ewoc-next vc-ewoc crt))
745 (vc-string-prefix-p dir
746 (progn
747 (setq data (ewoc-data crt))
748 (vc-dir-node-directory crt))))
749 (unless (vc-dir-fileinfo->directory data)
750 (push
751 (cons (expand-file-name (vc-dir-fileinfo->name data))
752 (vc-dir-fileinfo->state data))
753 result))))
754 (push (cons (expand-file-name (vc-dir-fileinfo->name crt-data))
755 (vc-dir-fileinfo->state crt-data))
756 result)
757 (setq crt (ewoc-next vc-ewoc crt)))
758 (setq crt (ewoc-next vc-ewoc crt)))))
759 result))
760
761 (defun vc-dir-child-files-and-states ()
762 "Return the list of conses (FILE . STATE) for child files of the current entry if it's a directory.
763 If it is a file, return the corresponding cons for the file itself."
764 (let* ((crt (ewoc-locate vc-ewoc))
765 (crt-data (ewoc-data crt))
766 result)
767 (if (vc-dir-fileinfo->directory crt-data)
768 (let* ((dir (vc-dir-fileinfo->directory crt-data))
769 (dirlen (length dir))
770 data)
771 (while
772 (and (setq crt (ewoc-next vc-ewoc crt))
773 (vc-string-prefix-p dir (progn
774 (setq data (ewoc-data crt))
775 (vc-dir-node-directory crt))))
776 (unless (vc-dir-fileinfo->directory data)
777 (push
778 (cons (expand-file-name (vc-dir-fileinfo->name data))
779 (vc-dir-fileinfo->state data))
780 result))))
781 (push
782 (cons (expand-file-name (vc-dir-fileinfo->name crt-data))
783 (vc-dir-fileinfo->state crt-data)) result))
784 result))
785
786 (defun vc-dir-recompute-file-state (fname def-dir)
787 (let* ((file-short (file-relative-name fname def-dir))
788 (remove-me-when-CVS-works
789 (when (eq vc-dir-backend 'CVS)
790 ;; FIXME: Warning: UGLY HACK. The CVS backend caches the state
791 ;; info, this forces the backend to update it.
792 (vc-call-backend vc-dir-backend 'registered fname)))
793 (state (vc-call-backend vc-dir-backend 'state fname))
794 (extra (vc-call-backend vc-dir-backend
795 'status-fileinfo-extra fname)))
796 (list file-short state extra)))
797
798 (defun vc-dir-find-child-files (dirname)
799 ;; Give a DIRNAME string return the list of all child files shown in
800 ;; the current *vc-dir* buffer.
801 (let ((crt (ewoc-nth vc-ewoc 0))
802 children
803 dname)
804 ;; Find DIR
805 (while (and crt (not (vc-string-prefix-p
806 dirname (vc-dir-node-directory crt))))
807 (setq crt (ewoc-next vc-ewoc crt)))
808 (while (and crt (vc-string-prefix-p
809 dirname
810 (setq dname (vc-dir-node-directory crt))))
811 (let ((data (ewoc-data crt)))
812 (unless (vc-dir-fileinfo->directory data)
813 (push (expand-file-name (vc-dir-fileinfo->name data)) children)))
814 (setq crt (ewoc-next vc-ewoc crt)))
815 children))
816
817 (defun vc-dir-resync-directory-files (dirname)
818 ;; Update the entries for all the child files of DIRNAME shown in
819 ;; the current *vc-dir* buffer.
820 (let ((files (vc-dir-find-child-files dirname))
821 (ddir (expand-file-name default-directory))
822 fileentries)
823 (when files
824 (dolist (crt files)
825 (push (vc-dir-recompute-file-state crt ddir)
826 fileentries))
827 (vc-dir-update fileentries (current-buffer)))))
828
829 (defun vc-dir-resynch-file (&optional fname)
830 "Update the entries for FILE in any directory buffers that list it."
831 (let ((file (or fname (expand-file-name buffer-file-name)))
832 (found-vc-dir-buf nil))
833 (save-excursion
834 (dolist (status-buf (buffer-list))
835 (set-buffer status-buf)
836 ;; look for a vc-dir buffer that might show this file.
837 (when (derived-mode-p 'vc-dir-mode)
838 (setq found-vc-dir-buf t)
839 (let ((ddir (expand-file-name default-directory)))
840 (when (vc-string-prefix-p ddir file)
841 (if (file-directory-p file)
842 (vc-dir-resync-directory-files file)
843 (vc-dir-update
844 (list (vc-dir-recompute-file-state file ddir))
845 status-buf)))))))
846 ;; We didn't find any vc-dir buffers, remove the hook, it is
847 ;; not needed.
848 (unless found-vc-dir-buf
849 (remove-hook 'after-save-hook 'vc-dir-resynch-file))))
850
851 (defvar use-vc-backend) ;; dynamically bound
852
853 (define-derived-mode vc-dir-mode special-mode "VC dir"
854 "Major mode for dispatcher directory buffers.
855 Marking/Unmarking key bindings and actions:
856 m - marks a file/directory or if the region is active, mark all the files
857 in region.
858 Restrictions: - a file cannot be marked if any parent directory is marked
859 - a directory cannot be marked if any child file or
860 directory is marked
861 u - marks a file/directory or if the region is active, unmark all the files
862 in region.
863 M - if the cursor is on a file: mark all the files with the same state as
864 the current file
865 - if the cursor is on a directory: mark all child files
866 - with a prefix argument: mark all files
867 U - if the cursor is on a file: unmark all the files with the same state
868 as the current file
869 - if the cursor is on a directory: unmark all child files
870 - with a prefix argument: unmark all files
871
872
873 \\{vc-dir-mode-map}"
874 (set (make-local-variable 'vc-dir-backend) use-vc-backend)
875 (setq buffer-read-only t)
876 (when (boundp 'tool-bar-map)
877 (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map))
878 (let ((buffer-read-only nil))
879 (erase-buffer)
880 (set (make-local-variable 'vc-dir-process-buffer) nil)
881 (set (make-local-variable 'vc-ewoc)
882 (ewoc-create #'vc-dir-status-printer
883 (vc-dir-headers vc-dir-backend default-directory)))
884 (set (make-local-variable 'revert-buffer-function)
885 'vc-dir-revert-buffer-function)
886 (set (make-local-variable 'list-buffers-directory)
887 (expand-file-name default-directory))
888 (add-hook 'after-save-hook 'vc-dir-resynch-file)
889 ;; Make sure that if the directory buffer is killed, the update
890 ;; process running in the background is also killed.
891 (add-hook 'kill-buffer-query-functions 'vc-dir-kill-query nil t)
892 (vc-dir-refresh)))
893
894 (defun vc-dir-headers (backend dir)
895 "Display the headers in the *VC dir* buffer.
896 It calls the `status-extra-headers' backend method to display backend
897 specific headers."
898 (concat
899 (propertize "VC backend : " 'face 'font-lock-type-face)
900 (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face)
901 (propertize "Working dir: " 'face 'font-lock-type-face)
902 (propertize (format "%s\n" dir) 'face 'font-lock-variable-name-face)
903 (vc-call-backend backend 'status-extra-headers dir)
904 "\n"))
905
906 (defun vc-dir-refresh-files (files default-state)
907 "Refresh some files in the *VC-dir* buffer."
908 (let ((def-dir default-directory)
909 (backend vc-dir-backend))
910 (vc-set-mode-line-busy-indicator)
911 ;; Call the `dir-status-file' backend function.
912 ;; `dir-status-file' is supposed to be asynchronous.
913 ;; It should compute the results, and then call the function
914 ;; passed as an argument in order to update the vc-dir buffer
915 ;; with the results.
916 (unless (buffer-live-p vc-dir-process-buffer)
917 (setq vc-dir-process-buffer
918 (generate-new-buffer (format " *VC-%s* tmp status" backend))))
919 (lexical-let ((buffer (current-buffer)))
920 (with-current-buffer vc-dir-process-buffer
921 (cd def-dir)
922 (erase-buffer)
923 (vc-call-backend
924 backend 'dir-status-files def-dir files default-state
925 (lambda (entries &optional more-to-come)
926 ;; ENTRIES is a list of (FILE VC_STATE EXTRA) items.
927 ;; If MORE-TO-COME is true, then more updates will come from
928 ;; the asynchronous process.
929 (with-current-buffer buffer
930 (vc-dir-update entries buffer)
931 (unless more-to-come
932 (setq mode-line-process nil)
933 ;; Remove the ones that haven't been updated at all.
934 ;; Those not-updated are those whose state is nil because the
935 ;; file/dir doesn't exist and isn't versioned.
936 (ewoc-filter vc-ewoc
937 (lambda (info)
938 ;; The state for directory entries might
939 ;; have been changed to 'up-to-date,
940 ;; reset it, othewise it will be removed when doing 'x'
941 ;; next time.
942 ;; FIXME: There should be a more elegant way to do this.
943 (when (and (vc-dir-fileinfo->directory info)
944 (eq (vc-dir-fileinfo->state info)
945 'up-to-date))
946 (setf (vc-dir-fileinfo->state info) nil))
947
948 (not (vc-dir-fileinfo->needs-update info))))))))))))
949
950 (defun vc-dir-revert-buffer-function (&optional ignore-auto noconfirm)
951 (vc-dir-refresh))
952
953 (defun vc-dir-refresh ()
954 "Refresh the contents of the *VC-dir* buffer.
955 Throw an error if another update process is in progress."
956 (interactive)
957 (if (vc-dir-busy)
958 (error "Another update process is in progress, cannot run two at a time")
959 (let ((def-dir default-directory)
960 (backend vc-dir-backend))
961 (vc-set-mode-line-busy-indicator)
962 ;; Call the `dir-status' backend function.
963 ;; `dir-status' is supposed to be asynchronous.
964 ;; It should compute the results, and then call the function
965 ;; passed as an argument in order to update the vc-dir buffer
966 ;; with the results.
967
968 ;; Create a buffer that can be used by `dir-status' and call
969 ;; `dir-status' with this buffer as the current buffer. Use
970 ;; `vc-dir-process-buffer' to remember this buffer, so that
971 ;; it can be used later to kill the update process in case it
972 ;; takes too long.
973 (unless (buffer-live-p vc-dir-process-buffer)
974 (setq vc-dir-process-buffer
975 (generate-new-buffer (format " *VC-%s* tmp status" backend))))
976 ;; set the needs-update flag on all non-directory entries
977 (ewoc-map (lambda (info)
978 (unless (vc-dir-fileinfo->directory info)
979 (setf (vc-dir-fileinfo->needs-update info) t) nil))
980 vc-ewoc)
981 (lexical-let ((buffer (current-buffer)))
982 (with-current-buffer vc-dir-process-buffer
983 (cd def-dir)
984 (erase-buffer)
985 (vc-call-backend
986 backend 'dir-status def-dir
987 (lambda (entries &optional more-to-come)
988 ;; ENTRIES is a list of (FILE VC_STATE EXTRA) items.
989 ;; If MORE-TO-COME is true, then more updates will come from
990 ;; the asynchronous process.
991 (with-current-buffer buffer
992 (vc-dir-update entries buffer)
993 (unless more-to-come
994 (let ((remaining
995 (ewoc-collect
996 vc-ewoc 'vc-dir-fileinfo->needs-update)))
997 (if remaining
998 (vc-dir-refresh-files
999 (mapcar 'vc-dir-fileinfo->name remaining)
1000 'up-to-date)
1001 (setq mode-line-process nil))))))))))))
1002
1003 (defun vc-dir-show-fileentry (file)
1004 "Insert an entry for a specific file into the current *VC-dir* listing.
1005 This is typically used if the file is up-to-date (or has been added
1006 outside of VC) and one wants to do some operation on it."
1007 (interactive "fShow file: ")
1008 (vc-dir-update (list (list (file-relative-name file) (vc-state file))) (current-buffer)))
1009
1010 (defun vc-dir-hide-up-to-date ()
1011 "Hide up-to-date items from display."
1012 (interactive)
1013 (let ((crt (ewoc-nth vc-ewoc -1))
1014 (first (ewoc-nth vc-ewoc 0)))
1015 ;; Go over from the last item to the first and remove the
1016 ;; up-to-date files and directories with no child files.
1017 (while (not (eq crt first))
1018 (let* ((data (ewoc-data crt))
1019 (dir (vc-dir-fileinfo->directory data))
1020 (next (ewoc-next vc-ewoc crt))
1021 (prev (ewoc-prev vc-ewoc crt))
1022 ;; ewoc-delete does not work without this...
1023 (inhibit-read-only t))
1024 (when (or
1025 ;; Remove directories with no child files.
1026 (and dir
1027 (or
1028 ;; Nothing follows this directory.
1029 (not next)
1030 ;; Next item is a directory.
1031 (vc-dir-fileinfo->directory (ewoc-data next))))
1032 ;; Remove files in the up-to-date state.
1033 (eq (vc-dir-fileinfo->state data) 'up-to-date))
1034 (ewoc-delete vc-ewoc crt))
1035 (setq crt prev)))))
1036
1037 (defun vc-dir-status-printer (fileentry)
1038 (vc-call-backend vc-dir-backend 'status-printer fileentry))
1039
1040 (defun vc-dir-deduce-fileset (&optional state-model-only-files)
1041 (let ((marked (vc-dir-marked-files))
1042 files
1043 only-files-list
1044 state
1045 model)
1046 (if marked
1047 (progn
1048 (setq files marked)
1049 (when state-model-only-files
1050 (setq only-files-list (vc-dir-marked-only-files-and-states))))
1051 (let ((crt (vc-dir-current-file)))
1052 (setq files (list crt))
1053 (when state-model-only-files
1054 (setq only-files-list (vc-dir-child-files-and-states)))))
1055
1056 (when state-model-only-files
1057 (setq state (cdar only-files-list))
1058 ;; Check that all files are in a consistent state, since we use that
1059 ;; state to decide which operation to perform.
1060 (dolist (crt (cdr only-files-list))
1061 (unless (vc-compatible-state (cdr crt) state)
1062 (error "%s:%s clashes with %s:%s"
1063 (car crt) (cdr crt) (caar only-files-list) state)))
1064 (setq only-files-list (mapcar 'car only-files-list))
1065 (when (and state (not (eq state 'unregistered)))
1066 (setq model (vc-checkout-model vc-dir-backend only-files-list))))
1067 (list vc-dir-backend files only-files-list state model)))
1068
1069 ;;;###autoload
1070 (defun vc-dir (dir &optional backend)
1071 "Show the VC status for DIR.
1072 Optional second argument BACKEND specifies the VC backend to use.
1073 Interactively, a prefix argument means to ask for the backend."
1074 (interactive
1075 (list
1076 (read-file-name "VC status for directory: "
1077 default-directory default-directory t
1078 nil #'file-directory-p)
1079 (if current-prefix-arg
1080 (intern
1081 (completing-read
1082 "Use VC backend: "
1083 (mapcar (lambda (b) (list (symbol-name b)))
1084 vc-handled-backends)
1085 nil t nil nil)))))
1086 (unless backend
1087 (setq backend (vc-responsible-backend dir)))
1088 (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend))
1089 (if (derived-mode-p 'vc-dir-mode)
1090 (vc-dir-refresh)
1091 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
1092 (let ((use-vc-backend backend))
1093 (vc-dir-mode))))
1094
1095 (defun vc-default-status-extra-headers (backend dir)
1096 ;; Be loud by default to remind people to add code to display
1097 ;; backend specific headers.
1098 ;; XXX: change this to return nil before the release.
1099 (concat
1100 (propertize "Extra : " 'face 'font-lock-type-face)
1101 (propertize "Please add backend specific headers here. It's easy!"
1102 'face 'font-lock-warning-face)))
1103
1104 (defun vc-default-status-printer (backend fileentry)
1105 "Pretty print FILEENTRY."
1106 ;; If you change the layout here, change vc-dir-move-to-goal-column.
1107 (let* ((isdir (vc-dir-fileinfo->directory fileentry))
1108 (state (if isdir "" (vc-dir-fileinfo->state fileentry)))
1109 (filename (vc-dir-fileinfo->name fileentry)))
1110 (insert
1111 (propertize
1112 (format "%c" (if (vc-dir-fileinfo->marked fileentry) ?* ? ))
1113 'face 'font-lock-type-face)
1114 " "
1115 (propertize
1116 (format "%-20s" state)
1117 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face)
1118 ((memq state '(missing conflict)) 'font-lock-warning-face)
1119 (t 'font-lock-variable-name-face))
1120 'mouse-face 'highlight)
1121 " "
1122 (propertize
1123 (format "%s" filename)
1124 'face
1125 (if isdir 'font-lock-comment-delimiter-face 'font-lock-function-name-face)
1126 'help-echo
1127 (if isdir
1128 "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu"
1129 "File\nmouse-3: Pop-up menu")
1130 'mouse-face 'highlight))))
1131
1132 (defun vc-default-extra-status-menu (backend)
1133 nil)
1134
1135 (defun vc-default-status-fileinfo-extra (backend file)
1136 "Default absence of extra information returned for a file."
1137 nil)
1138
1139 (provide 'vc-dir)
1140
1141 ;; arch-tag: 0274a2e3-e8e9-4b1a-a73c-e8b9129d5d15
1142 ;;; vc-dir.el ends here