From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Alfred M. Szmidt" Newsgroups: gmane.emacs.devel Subject: Re: find-file-literally and save-buffer Date: Tue, 27 Mar 2007 20:56:51 +0200 (CEST) Message-ID: <20070327185651.421CD30140@Psilocybe.Update.UU.SE> References: <20070326115910.697F830147@Psilocybe.Update.UU.SE> <87odmfnxxw.fsf@stupidchicken.com> <87k5x3nxcl.fsf@stupidchicken.com> <20070327113711.6EE393012B@Psilocybe.Update.UU.SE> <87y7lircb4.fsf@stupidchicken.com> Reply-To: ams@gnu.org NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1175021831 26922 80.91.229.12 (27 Mar 2007 18:57:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Mar 2007 18:57:11 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 27 20:57:04 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HWGqp-0006Yr-DC for ged-emacs-devel@m.gmane.org; Tue, 27 Mar 2007 20:56:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWGtC-0007uZ-L1 for ged-emacs-devel@m.gmane.org; Tue, 27 Mar 2007 13:59:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HWGt8-0007uB-Sq for emacs-devel@gnu.org; Tue, 27 Mar 2007 14:59:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HWGt6-0007ty-KN for emacs-devel@gnu.org; Tue, 27 Mar 2007 14:59:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWGt6-0007tv-Ex for emacs-devel@gnu.org; Tue, 27 Mar 2007 13:59:20 -0500 Original-Received: from psilocybe.update.uu.se ([130.238.19.25]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HWGqi-0006SP-1H for emacs-devel@gnu.org; Tue, 27 Mar 2007 14:56:52 -0400 Original-Received: by Psilocybe.Update.UU.SE (Postfix, from userid 30270) id 421CD30140; Tue, 27 Mar 2007 20:56:51 +0200 (CEST) In-reply-to: <87y7lircb4.fsf@stupidchicken.com> (message from Chong Yidong on Tue, 27 Mar 2007 10:27:59 -0400) X-detected-kernel: Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68677 Archived-At: > >> | 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