/[emacs]/emacs/lisp/vc-hooks.el
ViewVC logotype

Diff of /emacs/lisp/vc-hooks.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.148 by monnier, Wed May 7 17:20:29 2003 UTC revision 1.149 by monnier, Wed May 7 17:22:28 2003 UTC
# Line 633  current, and kill the buffer that visits Line 633  current, and kill the buffer that visits
633        (kill-buffer this-buffer))))        (kill-buffer this-buffer))))
634    
635  (defun vc-find-file-hook ()  (defun vc-find-file-hook ()
636    "Function for `find-file-hooks' activating VC mode if appropriate."    "Function for `find-file-hook' activating VC mode if appropriate."
637    ;; Recompute whether file is version controlled,    ;; Recompute whether file is version controlled,
638    ;; if user has killed the buffer and revisited.    ;; if user has killed the buffer and revisited.
639    (if vc-mode    (if vc-mode
# Line 676  current, and kill the buffer that visits Line 676  current, and kill the buffer that visits
676          "Warning: editing through the link bypasses version control")          "Warning: editing through the link bypasses version control")
677                       )))))))))                       )))))))))
678    
679  (add-hook 'find-file-hooks 'vc-find-file-hook)  (add-hook 'find-file-hook 'vc-find-file-hook)
680    
681  ;; more hooks, this time for file-not-found  ;; more hooks, this time for file-not-found
682  (defun vc-file-not-found-hook ()  (defun vc-file-not-found-hook ()
683    "When file is not found, try to check it out from version control.    "When file is not found, try to check it out from version control.
684  Returns t if checkout was successful, nil otherwise.  Returns t if checkout was successful, nil otherwise.
685  Used in `find-file-not-found-hooks'."  Used in `find-file-not-found-hook'."
686    ;; When a file does not exist, ignore cached info about it    ;; When a file does not exist, ignore cached info about it
687    ;; from a previous visit.    ;; from a previous visit.
688    (vc-file-clearprops buffer-file-name)    (vc-file-clearprops buffer-file-name)
# Line 695  Used in `find-file-not-found-hooks'." Line 695  Used in `find-file-not-found-hooks'."
695        (setq default-directory (file-name-directory buffer-file-name))        (setq default-directory (file-name-directory buffer-file-name))
696        (not (vc-error-occurred (vc-checkout buffer-file-name))))))        (not (vc-error-occurred (vc-checkout buffer-file-name))))))
697    
698  (add-hook 'find-file-not-found-hooks 'vc-file-not-found-hook)  (add-hook 'find-file-not-found-hook 'vc-file-not-found-hook)
699    
700  (defun vc-kill-buffer-hook ()  (defun vc-kill-buffer-hook ()
701    "Discard VC info about a file when we kill its buffer."    "Discard VC info about a file when we kill its buffer."

Legend:
Removed from v.1.148  
changed lines
  Added in v.1.149

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26