diff options
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 5 | ||||
| -rw-r--r-- | lisp/vc.el | 52 |
3 files changed, 61 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3916891fdac..cd4b6a650e2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2008-02-19 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc.el (vc-status-menu, vc-status-menu-map-filter): New functions. | ||
| 4 | (vc-status-mode-menu): Add a :filter. | ||
| 5 | (vc-status-printer): Add faces. | ||
| 6 | |||
| 7 | * vc-hg.el (vc-hg-extra-status-menu): New function. | ||
| 8 | (vc-hg-dir-status): Clean up the buffer before using it. | ||
| 9 | |||
| 1 | 2008-02-19 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2008-02-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * progmodes/gdb-ui.el (gdb-output-sink): Define with an invalid value. | 12 | * progmodes/gdb-ui.el (gdb-output-sink): Define with an invalid value. |
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 4bcffebd3cb..eac341cc5f0 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -475,6 +475,10 @@ REV is the revision to check out into WORKFILE." | |||
| 475 | 475 | ||
| 476 | (defun vc-hg-extra-menu () vc-hg-extra-menu-map) | 476 | (defun vc-hg-extra-menu () vc-hg-extra-menu-map) |
| 477 | 477 | ||
| 478 | (defun vc-hg-extra-status-menu () | ||
| 479 | '(["Show incoming" vc-hg-incoming] | ||
| 480 | ["Show outgoing" vc-hg-outgoing]) | ||
| 481 | |||
| 478 | (define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing") | 482 | (define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing") |
| 479 | 483 | ||
| 480 | (define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming") | 484 | (define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming") |
| @@ -511,6 +515,7 @@ REV is the revision to check out into WORKFILE." | |||
| 511 | (with-current-buffer | 515 | (with-current-buffer |
| 512 | (get-buffer-create | 516 | (get-buffer-create |
| 513 | (expand-file-name " *VC-hg* tmp status" dir)) | 517 | (expand-file-name " *VC-hg* tmp status" dir)) |
| 518 | (erase-buffer) | ||
| 514 | (vc-hg-command (current-buffer) 'async dir "status") | 519 | (vc-hg-command (current-buffer) 'async dir "status") |
| 515 | (vc-exec-after | 520 | (vc-exec-after |
| 516 | `(vc-hg-after-dir-status (quote ,update-function) ,status-buffer)))) | 521 | `(vc-hg-after-dir-status (quote ,update-function) ,status-buffer)))) |
diff --git a/lisp/vc.el b/lisp/vc.el index a7b25aaad64..cc9f89dd109 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -520,6 +520,16 @@ | |||
| 520 | ;; you can provide menu entries for functionality that is specific | 520 | ;; you can provide menu entries for functionality that is specific |
| 521 | ;; to your backend and which does not map to any of the VC generic | 521 | ;; to your backend and which does not map to any of the VC generic |
| 522 | ;; concepts. | 522 | ;; concepts. |
| 523 | ;; | ||
| 524 | ;; - extra-status-menu () | ||
| 525 | ;; | ||
| 526 | ;; Return list of menu items. The items will appear at the end of | ||
| 527 | ;; the VC menu. The goal is to allow backends to specify extra menu | ||
| 528 | ;; items that appear in the VC Status menu. This way you can | ||
| 529 | ;; provide menu entries for functionality that is specific to your | ||
| 530 | ;; backend and which does not map to any of the VC generic concepts. | ||
| 531 | ;; XXX: this should be changed to be a keymap, for consistency with | ||
| 532 | ;; extra-menu. | ||
| 523 | 533 | ||
| 524 | ;;; Todo: | 534 | ;;; Todo: |
| 525 | 535 | ||
| @@ -2621,12 +2631,21 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2621 | 2631 | ||
| 2622 | (defun vc-status-printer (fileentry) | 2632 | (defun vc-status-printer (fileentry) |
| 2623 | "Pretty print FILEENTRY." | 2633 | "Pretty print FILEENTRY." |
| 2634 | ;; If you change the layout here, change vc-status-move-to-goal-column. | ||
| 2624 | (insert | 2635 | (insert |
| 2625 | ;; If you change this, change vc-status-move-to-goal-column. | 2636 | (propertize |
| 2626 | (format "%c %-20s %s" | 2637 | (format "%c" (if (vc-status-fileinfo->marked fileentry) ?* ? )) |
| 2627 | (if (vc-status-fileinfo->marked fileentry) ?* ? ) | 2638 | 'face 'font-lock-type-face) |
| 2628 | (vc-status-fileinfo->state fileentry) | 2639 | " " |
| 2629 | (vc-status-fileinfo->name fileentry)))) | 2640 | (propertize |
| 2641 | (format "%-20s" (vc-status-fileinfo->state fileentry)) | ||
| 2642 | 'face 'font-lock-variable-name-face | ||
| 2643 | 'mouse-face 'highlight) | ||
| 2644 | " " | ||
| 2645 | (propertize | ||
| 2646 | (format "%s" (vc-status-fileinfo->name fileentry)) | ||
| 2647 | 'face 'font-lock-function-name-face | ||
| 2648 | 'mouse-face 'highlight))) | ||
| 2630 | 2649 | ||
| 2631 | (defun vc-status-move-to-goal-column () | 2650 | (defun vc-status-move-to-goal-column () |
| 2632 | (beginning-of-line) | 2651 | (beginning-of-line) |
| @@ -2669,12 +2688,30 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2669 | (define-key map "o" 'vc-status-find-file-other-window) | 2688 | (define-key map "o" 'vc-status-find-file-other-window) |
| 2670 | (define-key map "q" 'bury-buffer) | 2689 | (define-key map "q" 'bury-buffer) |
| 2671 | (define-key map "g" 'vc-status-refresh) | 2690 | (define-key map "g" 'vc-status-refresh) |
| 2691 | ;; Not working yet. Functions like vc-status-find-file need to | ||
| 2692 | ;; find the file from the mouse position, not `point'. | ||
| 2693 | ;; (define-key map [(down-mouse-3)] 'vc-status-menu) | ||
| 2672 | map) | 2694 | map) |
| 2673 | "Keymap for VC status") | 2695 | "Keymap for VC status") |
| 2674 | 2696 | ||
| 2697 | (defun vc-status-menu-map-filter (orig-binding) | ||
| 2698 | (when (and (symbolp orig-binding) (fboundp orig-binding)) | ||
| 2699 | (setq orig-binding (indirect-function orig-binding))) | ||
| 2700 | (let ((ext-binding | ||
| 2701 | (vc-call-backend (vc-responsible-backend default-directory) | ||
| 2702 | 'extra-status-menu))) | ||
| 2703 | (if (null ext-binding) | ||
| 2704 | orig-binding | ||
| 2705 | (append orig-binding | ||
| 2706 | '("----") | ||
| 2707 | ext-binding)))) | ||
| 2708 | |||
| 2675 | (easy-menu-define vc-status-mode-menu vc-status-mode-map | 2709 | (easy-menu-define vc-status-mode-menu vc-status-mode-map |
| 2676 | "Menu for vc-status." | 2710 | "Menu for vc-status." |
| 2677 | '("VC Status" | 2711 | '("VC Status" |
| 2712 | ;; This is used to that VC backends could add backend specific | ||
| 2713 | ;; menu items to vc-status-mode-menu. | ||
| 2714 | :filter vc-status-menu-map-filter | ||
| 2678 | ["Open file" vc-status-find-file | 2715 | ["Open file" vc-status-find-file |
| 2679 | :help "Find the file on the current line"] | 2716 | :help "Find the file on the current line"] |
| 2680 | ["Open in other window" vc-status-find-file-other-window | 2717 | ["Open in other window" vc-status-find-file-other-window |
| @@ -2714,6 +2751,11 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2714 | ["Quit" bury-buffer | 2751 | ["Quit" bury-buffer |
| 2715 | :help "Quit"])) | 2752 | :help "Quit"])) |
| 2716 | 2753 | ||
| 2754 | (defun vc-status-menu (e) | ||
| 2755 | "Popup the VC status menu." | ||
| 2756 | (interactive "e") | ||
| 2757 | (popup-menu vc-status-mode-menu e)) | ||
| 2758 | |||
| 2717 | (defun vc-status-mode () | 2759 | (defun vc-status-mode () |
| 2718 | "Major mode for VC status. | 2760 | "Major mode for VC status. |
| 2719 | \\{vc-status-mode-map}" | 2761 | \\{vc-status-mode-map}" |