From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: insert-file-contents and format-decode Date: Tue, 19 Jun 2007 09:50:35 +0200 Message-ID: <46778ACB.1000704@gmx.at> References: <4666BF5F.5030301@gmx.at> <46753850.2090708@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1182239418 6223 80.91.229.12 (19 Jun 2007 07:50:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2007 07:50:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 09:50:16 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 1I0YTf-0006ba-UN for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2007 09:50:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I0YTf-00029W-Is for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2007 03:50:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I0YTc-00029H-Mh for emacs-devel@gnu.org; Tue, 19 Jun 2007 03:50:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I0YTb-000295-Ag for emacs-devel@gnu.org; Tue, 19 Jun 2007 03:50:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I0YTb-000292-5T for emacs-devel@gnu.org; Tue, 19 Jun 2007 03:50:11 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1I0YTa-0005DN-IP for emacs-devel@gnu.org; Tue, 19 Jun 2007 03:50:10 -0400 Original-Received: (qmail invoked by alias); 19 Jun 2007 07:50:08 -0000 Original-Received: from N833P007.adsl.highway.telekom.at (EHLO [62.47.48.7]) [62.47.48.7] by mail.gmx.net (mp046) with SMTP; 19 Jun 2007 09:50:08 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19Sx34UT3ZS+3jjcuzc7tZg9evsKd4g1lKjWUxfeI cttcM69IC9u2lK User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:73283 Archived-At: > I test the attached patch for a week now and didn't encounter any > problems. In addition to fixing the bug I described it moves the call > of after-change hooks _after_ the call to `after-insert-file-functions'. > > That seems like a mistake to me. The `after-insert-file-functions' > are Lisp functions, and if they change the buffer, they will call the > after change hooks for what they did. Therefore, the calls to the > after change hooks for this function's own direct changes in the > buffer should be done before. (1) The `format-decode' ("round-trip" as the new Elisp manual entry calls them) based functions are Lisp functions, may change the buffer, and may call the after-change functions for what they do. They precede, within `insert-file-contents', the after-change-functions call. If a distinction between round-trip and "piecemeal" functions with respect to calling after-change-functions is desired it should be documented. (2) Calling `after-change-functions' from within `format-decode' or `after-insert-file-functions' seems to me highly risky. Personally, I'd never trust any of them if they don't use `inhibit-modification-hooks'. (3) Not calling `after-change-functions' after performing all functions in `after-insert-file-functions' may mean, for example, not executing `font-lock-after-change-function' after inserting the contents of some file in the current buffer. I think the only live and safe place to call `after-change-functions' is after the entire file contents have been decoded, that means, after all functions in `after-insert-file-functions' have been called.