1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* vc.el (vc-status-menu, vc-status-menu-map-filter): New functions.

(vc-status-mode-menu): Add a :filter.
(vc-status-printer): Add faces.

* vc-hg.el (vc-hg-extra-status-menu): New function.
(vc-hg-dir-status): Clean up the buffer before using it.
This commit is contained in:
Dan Nicolaescu 2008-02-19 07:10:33 +00:00
parent 57e828aed9
commit 6656ecaa46
3 changed files with 61 additions and 5 deletions

View file

@ -1,3 +1,12 @@
2008-02-19 Dan Nicolaescu <dann@ics.uci.edu>
* vc.el (vc-status-menu, vc-status-menu-map-filter): New functions.
(vc-status-mode-menu): Add a :filter.
(vc-status-printer): Add faces.
* vc-hg.el (vc-hg-extra-status-menu): New function.
(vc-hg-dir-status): Clean up the buffer before using it.
2008-02-19 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/gdb-ui.el (gdb-output-sink): Define with an invalid value.

View file

@ -475,6 +475,10 @@ REV is the revision to check out into WORKFILE."
(defun vc-hg-extra-menu () vc-hg-extra-menu-map)
(defun vc-hg-extra-status-menu ()
'(["Show incoming" vc-hg-incoming]
["Show outgoing" vc-hg-outgoing])
(define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing")
(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."
(with-current-buffer
(get-buffer-create
(expand-file-name " *VC-hg* tmp status" dir))
(erase-buffer)
(vc-hg-command (current-buffer) 'async dir "status")
(vc-exec-after
`(vc-hg-after-dir-status (quote ,update-function) ,status-buffer))))

View file

@ -520,6 +520,16 @@
;; you can provide menu entries for functionality that is specific
;; to your backend and which does not map to any of the VC generic
;; concepts.
;;
;; - extra-status-menu ()
;;
;; Return list of menu items. The items will appear at the end of
;; the VC menu. The goal is to allow backends to specify extra menu
;; items that appear in the VC Status menu. This way you can
;; provide menu entries for functionality that is specific to your
;; backend and which does not map to any of the VC generic concepts.
;; XXX: this should be changed to be a keymap, for consistency with
;; extra-menu.
;;; Todo:
@ -2621,12 +2631,21 @@ With prefix arg READ-SWITCHES, specify a value to override
(defun vc-status-printer (fileentry)
"Pretty print FILEENTRY."
;; If you change the layout here, change vc-status-move-to-goal-column.
(insert
;; If you change this, change vc-status-move-to-goal-column.
(format "%c %-20s %s"
(if (vc-status-fileinfo->marked fileentry) ?* ? )
(vc-status-fileinfo->state fileentry)
(vc-status-fileinfo->name fileentry))))
(propertize
(format "%c" (if (vc-status-fileinfo->marked fileentry) ?* ? ))
'face 'font-lock-type-face)
" "
(propertize
(format "%-20s" (vc-status-fileinfo->state fileentry))
'face 'font-lock-variable-name-face
'mouse-face 'highlight)
" "
(propertize
(format "%s" (vc-status-fileinfo->name fileentry))
'face 'font-lock-function-name-face
'mouse-face 'highlight)))
(defun vc-status-move-to-goal-column ()
(beginning-of-line)
@ -2669,12 +2688,30 @@ With prefix arg READ-SWITCHES, specify a value to override
(define-key map "o" 'vc-status-find-file-other-window)
(define-key map "q" 'bury-buffer)
(define-key map "g" 'vc-status-refresh)
;; Not working yet. Functions like vc-status-find-file need to
;; find the file from the mouse position, not `point'.
;; (define-key map [(down-mouse-3)] 'vc-status-menu)
map)
"Keymap for VC status")
(defun vc-status-menu-map-filter (orig-binding)
(when (and (symbolp orig-binding) (fboundp orig-binding))
(setq orig-binding (indirect-function orig-binding)))
(let ((ext-binding
(vc-call-backend (vc-responsible-backend default-directory)
'extra-status-menu)))
(if (null ext-binding)
orig-binding
(append orig-binding
'("----")
ext-binding))))
(easy-menu-define vc-status-mode-menu vc-status-mode-map
"Menu for vc-status."
'("VC Status"
;; This is used to that VC backends could add backend specific
;; menu items to vc-status-mode-menu.
:filter vc-status-menu-map-filter
["Open file" vc-status-find-file
:help "Find the file on the current line"]
["Open in other window" vc-status-find-file-other-window
@ -2714,6 +2751,11 @@ With prefix arg READ-SWITCHES, specify a value to override
["Quit" bury-buffer
:help "Quit"]))
(defun vc-status-menu (e)
"Popup the VC status menu."
(interactive "e")
(popup-menu vc-status-mode-menu e))
(defun vc-status-mode ()
"Major mode for VC status.
\\{vc-status-mode-map}"