Revision | 321 (tree) |
---|---|
Time | 2015-07-01 11:19:59 |
Author | mhayashi1120 |
removing some vc advices.
@@ -405,17 +405,9 @@ | ||
405 | 405 | |
406 | 406 | |
407 | 407 | |
408 | -(defun fsvn-vc-mode-p () | |
409 | - "Is vc-svn active?" | |
410 | - (defvar vc-mode) | |
411 | - (and (boundp 'vc-mode) | |
412 | - (stringp vc-mode) | |
413 | - (string-match "\\` SVN" vc-mode))) | |
414 | - | |
415 | -(defun fsvn-vc-registered (file) | |
416 | - (vc-mode-line file) | |
417 | - (vc-registered file)) | |
418 | - | |
408 | +(defun fsvn-current-buffer-unver-version-p () | |
409 | + (and default-directory | |
410 | + (fsvn-directory-under-versioned-p default-directory))) | |
419 | 411 | |
420 | 412 | |
421 | 413 | (defun fsvn-lisp-save (value file) |
@@ -1,3 +1,7 @@ | ||
1 | +2015-03-18 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com> | |
2 | + | |
3 | + * Fix: removing some vc advices. | |
4 | + | |
1 | 5 | 2015-03-10 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com> |
2 | 6 | |
3 | 7 | * Fix: Check fsvn-process-list-display-p-function is function |
@@ -40,8 +40,6 @@ | ||
40 | 40 | (dired-goto-file around fsvn-dired-goto-file-ad) |
41 | 41 | (dired-get-filename around fsvn-dired-get-filename-ad) |
42 | 42 | (after-find-file around fsvn-after-find-file) |
43 | - (vc-find-file-hook after fsvn-ui-fancy-vc-find-file-hook) | |
44 | - (vc-after-save after fsvn-ui-fancy-vc-after-save) | |
45 | 43 | (ediff-refresh-mode-lines around fsvn-ui-fancy-ediff-modeline-fixup) |
46 | 44 | )) |
47 | 45 |
@@ -389,6 +387,8 @@ | ||
389 | 387 | ;; redraw mode-line `kill-all-local-varable' destroy after `vc-find-file' |
390 | 388 | ;; advice |
391 | 389 | (add-hook 'after-change-major-mode-hook 'fsvn-ui-fancy-redraw) |
390 | + (add-hook 'find-file-hook 'fsvn-ui-fancy-redraw) | |
391 | + (add-hook 'after-save-hook 'fsvn-ui-fancy-redraw) | |
392 | 392 | ;; iswitchb ignore buffers |
393 | 393 | (eval-after-load 'iswitchb |
394 | 394 | `(let ((ignore-var (if iswitchb-buffer-ignore |
@@ -406,6 +406,8 @@ | ||
406 | 406 | (setq file-name-handler-alist (delq file-handler file-name-handler-alist)) |
407 | 407 | (remove-hook 'pre-command-hook 'fsvn-magic-clear-cache-if-toplevel) |
408 | 408 | (remove-hook 'after-change-major-mode-hook 'fsvn-ui-fancy-redraw) |
409 | + (remove-hook 'find-file-hook 'fsvn-ui-fancy-redraw) | |
410 | + (remove-hook 'after-save-hook 'fsvn-ui-fancy-redraw) | |
409 | 411 | (when (boundp 'iswitchb-buffer-ignore-orig) |
410 | 412 | (mapc |
411 | 413 | (lambda (regexp) |
@@ -3,7 +3,7 @@ | ||
3 | 3 | |
4 | 4 | ;; Author: Masahiro Hayashi <mhayashi1120@gmail.com> |
5 | 5 | ;; URL: http://fsvn.sourceforge.jp/ |
6 | -;; Keywords: vc | |
6 | +;; Keywords: application | |
7 | 7 | ;; Version: 0.9.13 |
8 | 8 | |
9 | 9 | ;; fsvn.el is free software; you can redistribute it and/or modify |
@@ -31,7 +31,7 @@ | ||
31 | 31 | ;; Have following advantages of other Emacs svn client. |
32 | 32 | ;; * tsvn:*, bugtraq:* like property supported. (or will be supported) |
33 | 33 | ;; * Using `svn help' output for completing read. |
34 | -;; * Fast in huge working copy by background process. | |
34 | +;; * Fast in huge working copy by background (asynchronous) process. | |
35 | 35 | ;; * Has repository browser. |
36 | 36 | ;; * Has visualize blame/annotate/praise minor-mode. |
37 | 37 | ;; * Has svk support |
@@ -43,8 +43,8 @@ | ||
43 | 43 | |
44 | 44 | ;; This package is tested on following environment. |
45 | 45 | ;; NTEmacs (based Emacs 23.3) on Windows. svn 1.6.x - 1.7.x |
46 | -;; Emacs (24.3) on GNU/Linux (Debian). svn svn 1.6.x - 1.7.x | |
47 | -;; Emacs current (24.3.50) on GNU/Linux (Debian). svn 1.6.x - 1.7.x | |
46 | +;; Emacs (24.4) on GNU/Linux (Debian). svn svn 1.6.x - 1.8.x | |
47 | +;; Emacs current (25.0.50) on GNU/Linux (Debian). svn 1.6.x - 1.8.x | |
48 | 48 | |
49 | 49 | ;;; Code: |
50 | 50 |
@@ -886,12 +886,12 @@ | ||
886 | 886 | (t |
887 | 887 | (setcar (cdr mode) (fsvn-ui-fancy--modeline-picture color)))))) |
888 | 888 | |
889 | -(defun fsvn-ui-fancy--update-modeline () | |
889 | +(defun fsvn-ui-fancy--update-modeline (&optional status) | |
890 | 890 | "Update modeline state dot mark properly" |
891 | 891 | (fsvn-let* |
892 | 892 | ((buffer-file-name) |
893 | - ((fsvn-vc-mode-p)) | |
894 | - (status (fsvn-ui-fancy--get-status buffer-file-name))) | |
893 | + ((fsvn-current-buffer-unver-version-p)) | |
894 | + (status (or status (fsvn-ui-fancy--get-status buffer-file-name)))) | |
895 | 895 | (fsvn-ui-fancy--update-state-mark status))) |
896 | 896 | |
897 | 897 | (defun fsvn-ui-fancy--get-status (file) |
@@ -900,6 +900,9 @@ | ||
900 | 900 | (val (fsvn-xml-status->target->entry=>wc-status.item status))) |
901 | 901 | val)) |
902 | 902 | |
903 | +(defun fsvn-ui-fancy--color-exists-p (status) | |
904 | + (not (memq status '(unversioned)))) | |
905 | + | |
903 | 906 | (defun fsvn-ui-fancy--interpret-state-mode-color (val) |
904 | 907 | "Interpret vc-svn-state symbol to mode line color" |
905 | 908 | (cond |
@@ -917,14 +920,6 @@ | ||
917 | 920 | (t |
918 | 921 | "GreenYellow"))) |
919 | 922 | |
920 | -(defadvice vc-find-file-hook (after fsvn-ui-fancy-vc-find-file-hook disable) | |
921 | - "vc-find-file-hook advice for synchronizing psvn with vc-svn interface" | |
922 | - (fsvn-ui-fancy-redraw)) | |
923 | - | |
924 | -(defadvice vc-after-save (after fsvn-ui-fancy-vc-after-save disable) | |
925 | - "vc-after-save advice for synchronizing psvn when saving buffer" | |
926 | - (fsvn-ui-fancy-redraw)) | |
927 | - | |
928 | 923 | (defadvice ediff-refresh-mode-lines |
929 | 924 | (around fsvn-ui-fancy-ediff-modeline-fixup disable compile) |
930 | 925 | "Fixup svn file status in the modeline when using ediff" |
@@ -939,12 +934,16 @@ | ||
939 | 934 | (fsvn-ui-fancy--update-modeline))) |
940 | 935 | |
941 | 936 | (defun fsvn-ui-fancy-redraw () |
942 | - (cond | |
943 | - ((and fsvn-ui-fancy-file-state-in-modeline | |
944 | - (fsvn-vc-mode-p)) | |
945 | - (fsvn-ui-fancy--update-modeline)) | |
946 | - (t | |
947 | - (fsvn-ui-fancy--uninstall-state-mark)))) | |
937 | + (let (status) | |
938 | + (cond | |
939 | + ((and fsvn-ui-fancy-file-state-in-modeline | |
940 | + buffer-file-name | |
941 | + (fsvn-current-buffer-unver-version-p) | |
942 | + (setq status (fsvn-ui-fancy--get-status buffer-file-name)) | |
943 | + (fsvn-ui-fancy--color-exists-p status)) | |
944 | + (fsvn-ui-fancy--update-modeline status)) | |
945 | + (t | |
946 | + (fsvn-ui-fancy--uninstall-state-mark))))) | |
948 | 947 | |
949 | 948 | (defun fsvn-ui-fancy-install () |
950 | 949 | (fsvn-let* |
@@ -951,9 +950,8 @@ | ||
951 | 950 | ((fsvn-ui-fancy-file-state-in-modeline) |
952 | 951 | (file buffer-file-name) |
953 | 952 | (status (fsvn-ui-fancy--get-status file)) |
953 | + ((fsvn-ui-fancy--color-exists-p status)) | |
954 | 954 | (color (fsvn-ui-fancy--interpret-state-mode-color status))) |
955 | - ;; fancy mode line depend on vc | |
956 | - (fsvn-vc-registered file) | |
957 | 955 | (fsvn-ui-fancy--install-state-mark color))) |
958 | 956 | |
959 | 957 |