diff options
| author | Dan Nicolaescu | 2007-08-25 20:04:26 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-08-25 20:04:26 +0000 |
| commit | 6f222162a7b840f73ad4e645af5bcdf5649ef7b8 (patch) | |
| tree | a3e7c38ad4129a25612b5683997fbd97bde6aa7b | |
| parent | 02df5de4cad21eb7125d32da5d1f18b62bb143b3 (diff) | |
| download | emacs-6f222162a7b840f73ad4e645af5bcdf5649ef7b8.tar.gz emacs-6f222162a7b840f73ad4e645af5bcdf5649ef7b8.zip | |
* vc-git.el (vc-git-mode-line-string): New function.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc-git.el | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d81cf3a4691..1e061579124 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-08-25 Alexandre Julliard <julliard@winehq.org> | ||
| 2 | |||
| 3 | * vc-git.el (vc-git-mode-line-string): New function. | ||
| 4 | |||
| 1 | 2007-08-25 Alan Mackenzie <acm@muc.de> | 5 | 2007-08-25 Alan Mackenzie <acm@muc.de> |
| 2 | 6 | ||
| 3 | * progmodes/cc-langs.el (c-other-decl-block-key-in-symbols-alist): | 7 | * progmodes/cc-langs.el (c-other-decl-block-key-in-symbols-alist): |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 156b2866eb9..32d8d48299c 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -57,7 +57,7 @@ | |||
| 57 | ;; - latest-on-branch-p (file) NOT NEEDED | 57 | ;; - latest-on-branch-p (file) NOT NEEDED |
| 58 | ;; * checkout-model (file) OK | 58 | ;; * checkout-model (file) OK |
| 59 | ;; - workfile-unchanged-p (file) OK | 59 | ;; - workfile-unchanged-p (file) OK |
| 60 | ;; - mode-line-string (file) NOT NEEDED | 60 | ;; - mode-line-string (file) OK |
| 61 | ;; - dired-state-info (file) OK | 61 | ;; - dired-state-info (file) OK |
| 62 | ;; STATE-CHANGING FUNCTIONS | 62 | ;; STATE-CHANGING FUNCTIONS |
| 63 | ;; * create-repo () OK | 63 | ;; * create-repo () OK |
| @@ -208,6 +208,18 @@ | |||
| 208 | (string-match "[0-7]\\{6\\} blob \\([0-9a-f]\\{40\\}\\)\t[^\0]+\0" head) | 208 | (string-match "[0-7]\\{6\\} blob \\([0-9a-f]\\{40\\}\\)\t[^\0]+\0" head) |
| 209 | (string= (car (split-string sha1 "\n")) (match-string 1 head))))) | 209 | (string= (car (split-string sha1 "\n")) (match-string 1 head))))) |
| 210 | 210 | ||
| 211 | (defun vc-git-mode-line-string (file) | ||
| 212 | "Return string for placement into the modeline for FILE." | ||
| 213 | (let* ((branch (vc-git-workfile-version file)) | ||
| 214 | (def-ml (vc-default-mode-line-string 'Git file)) | ||
| 215 | (help-echo (get-text-property 0 'help-echo def-ml))) | ||
| 216 | (if (zerop (length branch)) | ||
| 217 | (propertize | ||
| 218 | (concat def-ml "!") | ||
| 219 | 'help-echo (concat help-echo "\nNo current branch (detached HEAD)")) | ||
| 220 | (propertize def-ml | ||
| 221 | 'help-echo (concat help-echo "\nCurrent branch: " branch))))) | ||
| 222 | |||
| 211 | (defun vc-git-dired-state-info (file) | 223 | (defun vc-git-dired-state-info (file) |
| 212 | "Git-specific version of `vc-dired-state-info'." | 224 | "Git-specific version of `vc-dired-state-info'." |
| 213 | (let ((git-state (vc-state file))) | 225 | (let ((git-state (vc-state file))) |