diff options
| author | Richard M. Stallman | 1996-02-26 00:17:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-02-26 00:17:43 +0000 |
| commit | e7f5ddc2c864f21242a9bdcebc96aa1e9b78a922 (patch) | |
| tree | 249f8f547034d01a649b2f6c3f3f8b7675705b64 | |
| parent | 58ffb6ae8eb36c1758ae4e4db2aa830bfab07c69 (diff) | |
| download | emacs-e7f5ddc2c864f21242a9bdcebc96aa1e9b78a922.tar.gz emacs-e7f5ddc2c864f21242a9bdcebc96aa1e9b78a922.zip | |
(vc-follow-link): Simplify by taking advantage
of Feb 21 change in find-file-noselect.
| -rw-r--r-- | lisp/vc-hooks.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index f65a39fc5ec..9fce8a43d09 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -924,12 +924,18 @@ control system name." | |||
| 924 | ;; visit the real file instead. If the real file is already visited in | 924 | ;; visit the real file instead. If the real file is already visited in |
| 925 | ;; another buffer, make that buffer current, and kill the buffer | 925 | ;; another buffer, make that buffer current, and kill the buffer |
| 926 | ;; that visits the link. | 926 | ;; that visits the link. |
| 927 | (let* ((truename (file-truename buffer-file-name)) | 927 | (let* ((truename (abbreviate-file-name (file-truename buffer-file-name))) |
| 928 | (true-buffer (get-file-buffer truename))) | 928 | (true-buffer (find-buffer-visiting truename)) |
| 929 | (if true-buffer | 929 | (this-buffer (current-buffer))) |
| 930 | (set-buffer true-buffer) | 930 | (if (eq true-buffer this-buffer) |
| 931 | (kill-buffer (current-buffer)) | 931 | (progn |
| 932 | (set-buffer (find-file-noselect truename))))) | 932 | ;; In principle, we could do something like set-visited-file-name. |
| 933 | ;; However, it can't be exactly the same as set-visited-file-name. | ||
| 934 | ;; I'm not going to work out the details right now. -- rms. | ||
| 935 | (set-buffer (find-file-noselect truename)) | ||
| 936 | (kill-buffer this-buffer)) | ||
| 937 | (set-buffer true-buffer) | ||
| 938 | (kill-buffer this-buffer)))) | ||
| 933 | 939 | ||
| 934 | ;;; install a call to the above as a find-file hook | 940 | ;;; install a call to the above as a find-file hook |
| 935 | (defun vc-find-file-hook () | 941 | (defun vc-find-file-hook () |