comparison lisp/vc.el @ 87692:c1ba1fb56b96

* vc.el (vc-status-unmark-all-files): New function. (vc-status-unmark-all-files): Likewise. (vc-status-mode-map): Add bindings.
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 10 Jan 2008 07:51:25 +0000
parents caf9a76fd5a3
children 28dc34f6a246
comparison
equal deleted inserted replaced
87691:f2c8fd594360 87692:c1ba1fb56b96
2550 (defvar vc-status-mode-map 2550 (defvar vc-status-mode-map
2551 (let ((map (make-keymap))) 2551 (let ((map (make-keymap)))
2552 (suppress-keymap map) 2552 (suppress-keymap map)
2553 ;; Marking. 2553 ;; Marking.
2554 (define-key map "m" 'vc-status-mark-file) 2554 (define-key map "m" 'vc-status-mark-file)
2555 (define-key map "M" 'vc-status-mark-all-files)
2555 (define-key map "u" 'vc-status-unmark-file) 2556 (define-key map "u" 'vc-status-unmark-file)
2556 (define-key map "\C-?" 'vc-status-unmark-file-up) 2557 (define-key map "\C-?" 'vc-status-unmark-file-up)
2558 (define-key map "\M-\C-?" 'vc-status-unmark-all-files)
2557 ;; Movement. 2559 ;; Movement.
2558 (define-key map "n" 'vc-status-next-line) 2560 (define-key map "n" 'vc-status-next-line)
2559 (define-key map " " 'vc-status-next-line) 2561 (define-key map " " 'vc-status-next-line)
2560 (define-key map "\t" 'vc-status-next-line) 2562 (define-key map "\t" 'vc-status-next-line)
2561 (define-key map "p" 'vc-status-previous-line) 2563 (define-key map "p" 'vc-status-previous-line)
2625 (file (ewoc-data crt))) 2627 (file (ewoc-data crt)))
2626 (setf (vc-status-fileinfo->marked file) t) 2628 (setf (vc-status-fileinfo->marked file) t)
2627 (ewoc-invalidate vc-status crt) 2629 (ewoc-invalidate vc-status crt)
2628 (vc-status-next-line 1))) 2630 (vc-status-next-line 1)))
2629 2631
2632 (defun vc-status-mark-all-files ()
2633 "Mark all files."
2634 (interactive)
2635 (ewoc-map
2636 (lambda (file)
2637 (unless (vc-status-fileinfo->marked file)
2638 (setf (vc-status-fileinfo->marked file) t)
2639 t))
2640 vc-status))
2641
2630 (defun vc-status-unmark-file () 2642 (defun vc-status-unmark-file ()
2631 "Unmark the current file and move to the next line." 2643 "Unmark the current file and move to the next line."
2632 (interactive) 2644 (interactive)
2633 (let* ((crt (ewoc-locate vc-status)) 2645 (let* ((crt (ewoc-locate vc-status))
2634 (file (ewoc-data crt))) 2646 (file (ewoc-data crt)))
2645 (let* ((prev (ewoc-goto-prev vc-status 1)) 2657 (let* ((prev (ewoc-goto-prev vc-status 1))
2646 (file (ewoc-data prev))) 2658 (file (ewoc-data prev)))
2647 (setf (vc-status-fileinfo->marked file) nil) 2659 (setf (vc-status-fileinfo->marked file) nil)
2648 (ewoc-invalidate vc-status prev) 2660 (ewoc-invalidate vc-status prev)
2649 (vc-status-move-to-goal-column))) 2661 (vc-status-move-to-goal-column)))
2662
2663 (defun vc-status-unmark-all-files ()
2664 "Unmark all files."
2665 (interactive)
2666 (ewoc-map
2667 (lambda (file)
2668 (when (vc-status-fileinfo->marked file)
2669 (setf (vc-status-fileinfo->marked file) nil)
2670 t))
2671 vc-status))
2650 2672
2651 (defun vc-status-register () 2673 (defun vc-status-register ()
2652 "Register the marked files, or the current file if no marks." 2674 "Register the marked files, or the current file if no marks."
2653 (interactive) 2675 (interactive)
2654 (let ((files (or (vc-status-marked-files) 2676 (let ((files (or (vc-status-marked-files)