diff options
| author | Stefan Monnier | 2007-07-23 21:07:03 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-07-23 21:07:03 +0000 |
| commit | 5719a0989e2cc1e155a1d0ef499aa3d84ad102ec (patch) | |
| tree | 09355412d1416e6c7f4a0146418068da59f821ba | |
| parent | f09ff28afcea079e8f8e6909e095dddebb0e4a4b (diff) | |
| download | emacs-5719a0989e2cc1e155a1d0ef499aa3d84ad102ec.tar.gz emacs-5719a0989e2cc1e155a1d0ef499aa3d84ad102ec.zip | |
(vc-mode-line-map): New const.
(vc-mode-line): Use it.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/vc-hooks.el | 43 |
2 files changed, 32 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e3b2f3cbf3..957c05fba4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-07-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * vc-hooks.el (vc-mode-line-map): New const. | ||
| 4 | (vc-mode-line): Use it. | ||
| 5 | |||
| 1 | 2007-07-23 Alexandre Julliard <julliard@winehq.org> | 6 | 2007-07-23 Alexandre Julliard <julliard@winehq.org> |
| 2 | 7 | ||
| 3 | * vc-git.el (vc-git-delete-file, vc-git-rename-file) | 8 | * vc-git.el (vc-git-delete-file, vc-git-rename-file) |
| @@ -39,7 +44,8 @@ | |||
| 39 | 44 | ||
| 40 | 2007-07-23 Stefan Monnier <monnier@iro.umontreal.ca> | 45 | 2007-07-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 41 | 46 | ||
| 42 | * emacs-lisp/copyright.el (copyright-update-year): Fix 2007-05-25 change. | 47 | * emacs-lisp/copyright.el (copyright-update-year): Fix 2007-05-25 |
| 48 | change by reverting a small part. | ||
| 43 | 49 | ||
| 44 | 2007-07-23 Richard Stallman <rms@gnu.org> | 50 | 2007-07-23 Richard Stallman <rms@gnu.org> |
| 45 | 51 | ||
| @@ -59,9 +65,9 @@ | |||
| 59 | 65 | ||
| 60 | 2007-07-20 Kenichi Handa <handa@m17n.org> | 66 | 2007-07-20 Kenichi Handa <handa@m17n.org> |
| 61 | 67 | ||
| 62 | * international/utf-8.el (utf-8-post-read-conversion): Temporarily | 68 | * international/utf-8.el (utf-8-post-read-conversion): |
| 63 | bind utf-8-compose-scripts to nil while running *-compose-region | 69 | Temporarily bind utf-8-compose-scripts to nil while running |
| 64 | functions. | 70 | *-compose-region functions. |
| 65 | 71 | ||
| 66 | 2007-07-23 Dan Nicolaescu <dann@ics.uci.edu> | 72 | 2007-07-23 Dan Nicolaescu <dann@ics.uci.edu> |
| 67 | 73 | ||
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 2d3a0886c22..1029e745cde 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -716,34 +716,35 @@ Before doing that, check if there are any old backups and get rid of them." | |||
| 716 | ;; any VC Dired buffer to synchronize. | 716 | ;; any VC Dired buffer to synchronize. |
| 717 | (vc-dired-resynch-file file))))) | 717 | (vc-dired-resynch-file file))))) |
| 718 | 718 | ||
| 719 | (defconst vc-mode-line-map | ||
| 720 | (let ((map (make-sparse-keymap))) | ||
| 721 | (define-key map [mode-line down-mouse-1] 'vc-menu-map) | ||
| 722 | map)) | ||
| 723 | |||
| 719 | (defun vc-mode-line (file) | 724 | (defun vc-mode-line (file) |
| 720 | "Set `vc-mode' to display type of version control for FILE. | 725 | "Set `vc-mode' to display type of version control for FILE. |
| 721 | The value is set in the current buffer, which should be the buffer | 726 | The value is set in the current buffer, which should be the buffer |
| 722 | visiting FILE." | 727 | visiting FILE." |
| 723 | (interactive (list buffer-file-name)) | 728 | (interactive (list buffer-file-name)) |
| 724 | (let ((backend (vc-backend file)) | 729 | (let ((backend (vc-backend file))) |
| 725 | ml-string ml-echo) | ||
| 726 | (if (not backend) | 730 | (if (not backend) |
| 727 | (setq vc-mode nil) | 731 | (setq vc-mode nil) |
| 728 | (setq ml-string (vc-call mode-line-string file)) | 732 | (let* ((ml-string (vc-call mode-line-string file)) |
| 729 | (setq ml-echo (get-text-property 0 'help-echo ml-string)) | 733 | (ml-echo (get-text-property 0 'help-echo ml-string))) |
| 730 | (setq vc-mode | 734 | (setq vc-mode |
| 731 | (concat | 735 | (concat |
| 732 | " " | 736 | " " |
| 733 | (if vc-display-status | 737 | (if (null vc-display-status) |
| 734 | (propertize | 738 | (symbol-name backend) |
| 735 | ml-string | 739 | (propertize |
| 736 | 'mouse-face 'mode-line-highlight | 740 | ml-string |
| 737 | 'help-echo | 741 | 'mouse-face 'mode-line-highlight |
| 738 | (concat (if ml-echo | 742 | 'help-echo |
| 739 | ml-echo | 743 | (concat (or ml-echo |
| 740 | (format "File under the %s version control system" | 744 | (format "File under the %s version control system" |
| 741 | backend)) | 745 | backend)) |
| 742 | "\nmouse-1: Version Control menu") | 746 | "\nmouse-1: Version Control menu") |
| 743 | 'local-map (let ((map (make-sparse-keymap))) | 747 | 'local-map vc-mode-line-map))))) |
| 744 | (define-key map [mode-line down-mouse-1] | ||
| 745 | 'vc-menu-map) map)) | ||
| 746 | (symbol-name backend)))) | ||
| 747 | ;; If the file is locked by some other user, make | 748 | ;; If the file is locked by some other user, make |
| 748 | ;; the buffer read-only. Like this, even root | 749 | ;; the buffer read-only. Like this, even root |
| 749 | ;; cannot modify a file that someone else has locked. | 750 | ;; cannot modify a file that someone else has locked. |