From: Kai Gro?j. <ka...@us...> - 2001-12-26 19:35:17
|
Update of /cvsroot/tramp/tramp/lisp In directory usw-pr-cvs1:/tmp/cvs-serv2321/tramp/lisp Modified Files: ChangeLog tramp.el Log Message: (tramp-buffer-file-attributes): Doc string fix. (tramp-handle-set-visited-file-modtime): Don't barf if called without arguments. Use output of "ls -ild", not return value of file-attributes, for tramp-buffer-file-attributes. (tramp-handle-verify-visited-file-modtime): Use output of "ls -ild", not return value of file-attributes, for tramp-buffer-file-attributes. (tramp-handle-insert-file-contents): Call set-visited-file-modtime without args. (tramp-handle-insert-file-contents): Ditto. (tramp-handle-write-region): Pass VISIT arg on to call of real handler. (The old code of passing the `no-message' symbol instead was a little strange -- an XEmacsism?) (tramp-handle-write-region): Call set-visited-file-modtime, if VISIT. Remove some todo items. Index: ChangeLog =================================================================== RCS file: /cvsroot/tramp/tramp/lisp/ChangeLog,v retrieving revision 2.47 retrieving revision 2.48 diff -C2 -d -r2.47 -r2.48 *** ChangeLog 2001/12/25 21:38:53 2.47 --- ChangeLog 2001/12/26 19:35:13 2.48 *************** *** 1,2 **** --- 1,21 ---- + 2001-12-26 Kai Grossjohann <ka...@ls...> + + * tramp.el (tramp-buffer-file-attributes): Doc string fix. + (tramp-handle-set-visited-file-modtime): Don't barf if called + without arguments. Use output of "ls -ild", not return value of + file-attributes, for tramp-buffer-file-attributes. + (tramp-handle-verify-visited-file-modtime): Use output of "ls + -ild", not return value of file-attributes, for + tramp-buffer-file-attributes. + (tramp-handle-insert-file-contents): Call set-visited-file-modtime + without args. + (tramp-handle-insert-file-contents): Ditto. + (tramp-handle-write-region): Pass VISIT arg on to call of real + handler. (The old code of passing the `no-message' symbol instead + was a little strange -- an XEmacsism?) + (tramp-handle-write-region): Call set-visited-file-modtime, if + VISIT. + Remove some todo items. + 2001-12-25 Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> Index: tramp.el =================================================================== RCS file: /cvsroot/tramp/tramp/lisp/tramp.el,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -d -r2.50 -r2.51 *** tramp.el 2001/12/25 21:38:53 2.50 --- tramp.el 2001/12/26 19:35:13 2.51 *************** *** 947,951 **** (defvar tramp-buffer-file-attributes nil ! "Holds the `ls -li' output for the current buffer. This variable is local to each buffer. It is not used if the remote machine groks Perl. If it is used, it's used as an emulation for --- 947,951 ---- (defvar tramp-buffer-file-attributes nil ! "Holds the `ls -ild' output for the current buffer. This variable is local to each buffer. It is not used if the remote machine groks Perl. If it is used, it's used as an emulation for *************** *** 1514,1519 **** (defun tramp-handle-set-visited-file-modtime (&optional time-list) "Like `set-visited-file-modtime' for tramp files." - (when time-list - (error "Use set-visited-file-modtime directly with a time-list")) (let* ((f (buffer-file-name)) (v (tramp-dissect-file-name f)) --- 1514,1517 ---- *************** *** 1526,1530 **** (modtime (nth 5 attr))) (if (tramp-get-remote-perl multi-method method user host) ! (set-visited-file-modtime modtime) (setq tramp-buffer-file-attributes attr)) nil)) --- 1524,1537 ---- (modtime (nth 5 attr))) (if (tramp-get-remote-perl multi-method method user host) ! (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) ! (save-excursion ! (tramp-send-command ! multi-method method user host ! (format "%s -ild %s" ! (tramp-get-ls-command multi-method method user host) ! (tramp-shell-quote-argument path))) ! (tramp-wait-for-output) ! (setq attr (buffer-substring (point) ! (progn (end-of-line) (point))))) (setq tramp-buffer-file-attributes attr)) nil)) *************** *** 1549,1552 **** --- 1556,1568 ---- (and (equal (car (visited-file-modtime)) (nth 0 modtime)) (equal (cdr (visited-file-modtime)) (nth 1 modtime))) + (save-excursion + (tramp-send-command + multi-method method user host + (format "%s -ild %s" + (tramp-get-ls-command multi-method method user host) + (tramp-shell-quote-argument path))) + (tramp-wait-for-output) + (setq attr (buffer-substring (point) + (progn (end-of-line) (point))))) (equal tramp-buffer-file-attributes attr))))) *************** *** 2417,2421 **** (when visit (setq buffer-file-name filename) ! (set-visited-file-modtime '(0 0)) (set-buffer-modified-p nil)) (signal 'file-error --- 2433,2437 ---- (when visit (setq buffer-file-name filename) ! (set-visited-file-modtime) (set-buffer-modified-p nil)) (signal 'file-error *************** *** 2426,2430 **** (when visit (setq buffer-file-name filename) ! (set-visited-file-modtime '(0 0)) (set-buffer-modified-p nil)) (tramp-message 9 "Inserting local temp file `%s'..." local-copy) --- 2442,2446 ---- (when visit (setq buffer-file-name filename) ! (set-visited-file-modtime) (set-buffer-modified-p nil)) (tramp-message 9 "Inserting local temp file `%s'..." local-copy) *************** *** 2482,2490 **** ;; because this makes the logic simpler. (setq tmpfil (tramp-make-temp-file)) (tramp-run-real-handler 'write-region (if confirm ; don't pass this arg unless defined for backward compat. ! (list start end tmpfil append 'no-message lockname confirm) ! (list start end tmpfil append 'no-message lockname))) ;; Now, `last-coding-system-used' has the right value. Remember it. (when (boundp 'last-coding-system-used) --- 2498,2508 ---- ;; because this makes the logic simpler. (setq tmpfil (tramp-make-temp-file)) + ;; We used to pass 'no-message instead of visit in the following + ;; call. Why? 2001-12-26 grossjoh (tramp-run-real-handler 'write-region (if confirm ; don't pass this arg unless defined for backward compat. ! (list start end tmpfil append visit lockname confirm) ! (list start end tmpfil append visit lockname))) ;; Now, `last-coding-system-used' has the right value. Remember it. (when (boundp 'last-coding-system-used) *************** *** 2614,2617 **** --- 2632,2637 ---- (when (boundp 'last-coding-system-used) (setq last-coding-system-used coding-system-used)) + (when visit + (set-visited-file-modtime)) (when (or (eq visit t) (eq visit nil) *************** *** 4791,4799 **** ;; get-file-buffer -- use primitive ;; load - ;; set-visited-file-modtime - ;; shell-command ;; unhandled-file-name-directory ;; vc-registered - ;; verify-visited-file-modtime ;;; tramp.el ends here --- 4811,4816 ---- |