From: "Alfred M. Szmidt" <ams@gnu.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: find-file-literally and save-buffer
Date: Tue, 27 Mar 2007 20:56:51 +0200 (CEST) [thread overview]
Message-ID: <20070327185651.421CD30140@Psilocybe.Update.UU.SE> (raw)
In-Reply-To: <87y7lircb4.fsf@stupidchicken.com> (message from Chong Yidong on Tue, 27 Mar 2007 10:27:59 -0400)
> >> | 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
next prev parent reply other threads:[~2007-03-27 18:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-26 11:59 find-file-literally and save-buffer Alfred M. Szmidt
2007-03-27 3:54 ` Chong Yidong
2007-03-27 4:07 ` Chong Yidong
2007-03-27 9:47 ` Alfred M. Szmidt
2007-03-27 11:37 ` Alfred M. Szmidt
2007-03-27 14:27 ` Chong Yidong
2007-03-27 18:56 ` Alfred M. Szmidt [this message]
2007-03-28 1:19 ` Stefan Monnier
2007-03-28 1:51 ` Alfred M. Szmidt
2007-03-28 2:33 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070327185651.421CD30140@Psilocybe.Update.UU.SE \
--to=ams@gnu.org \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.