[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find-file-literally and save-buffer
From: |
Alfred M. Szmidt |
Subject: |
Re: find-file-literally and save-buffer |
Date: |
Tue, 27 Mar 2007 20:56:51 +0200 (CEST) |
> >> | emacs -Q
> >> | M-x find-file-literally ~/RMAIL.empty RET
> >> | C-u M-~ (not-modified t)
> >> | C-x C-s (save-buffer)
>
> I think this might be related to me having my home directory
> under version control ... I think it is because
> vc-arch-file-source-p calls find-file-noselect, which in turn
> calls vc-arch-file-source-p, and so on...
Probably the fix is for vc-arch-file-source-p to check if
get-file-buffer is nil; if so, it should perform
insert-file-contents on a temp buffer, instead of visiting the file
directly.
I tried changing the code in a similar fashion, but without the
get-file-buffer check, like this, but it didn't have the desrired
result, no question pops up if I wish to revisit the file normally.
Any ideas?
*** vc-arch.el 28 Jan 2007 21:10:40 +0100 1.23
--- vc-arch.el 27 Mar 2007 20:56:19 +0200
***************
*** 122,134 ****
(concat ".arch-ids/" (file-name-nondirectory file) ".id")
(file-name-directory file)))
;; Check the presence of a tagline.
! (with-current-buffer (find-file-noselect file)
! (save-excursion
! (goto-char (point-max))
! (or (re-search-backward vc-arch-tagline-re (- (point) 1000) t)
! (progn
! (goto-char (point-min))
! (re-search-forward vc-arch-tagline-re (+ (point) 1000) t)))))
;; FIXME: check =tagging-method to see whether untagged files might
;; be source or not.
(with-current-buffer
--- 122,135 ----
(concat ".arch-ids/" (file-name-nondirectory file) ".id")
(file-name-directory file)))
;; Check the presence of a tagline.
! (with-temp-buffer
! (insert-file-contents-literally file)
! (save-excursion
! (goto-char (point-max))
! (or (re-search-backward vc-arch-tagline-re (- (point) 1000) t)
! (progn
! (goto-char (point-min))
! (re-search-forward vc-arch-tagline-re (+ (point) 1000)
t)))))
;; FIXME: check =tagging-method to see whether untagged files might
;; be source or not.
(with-current-buffer
- find-file-literally and save-buffer, Alfred M. Szmidt, 2007/03/26
- Re: find-file-literally and save-buffer, Chong Yidong, 2007/03/26
- Re: find-file-literally and save-buffer, Chong Yidong, 2007/03/27
- Re: find-file-literally and save-buffer, Alfred M. Szmidt, 2007/03/27
- Re: find-file-literally and save-buffer, Alfred M. Szmidt, 2007/03/27
- Re: find-file-literally and save-buffer, Chong Yidong, 2007/03/27
- Re: find-file-literally and save-buffer,
Alfred M. Szmidt <=
- Re: find-file-literally and save-buffer, Stefan Monnier, 2007/03/27
- Re: find-file-literally and save-buffer, Alfred M. Szmidt, 2007/03/27
- Re: find-file-literally and save-buffer, Stefan Monnier, 2007/03/27