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: Sat, 30 Jun 2007 13:32:55 +0200 Message-ID: <46863F67.20208@gmx.at> References: <4666BF5F.5030301@gmx.at> <46753850.2090708@gmx.at> <46778ACB.1000704@gmx.at> <467E47AF.1080702@gmx.at> <4680B80E.5090709@gmx.at> <468204D8.8010700@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 1183203236 14411 80.91.229.12 (30 Jun 2007 11:33:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2007 11:33:56 +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 Sat Jun 30 13:33:50 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 1I4bD1-0003Vj-D5 for ged-emacs-devel@m.gmane.org; Sat, 30 Jun 2007 13:33:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4bD0-0001qc-Tl for ged-emacs-devel@m.gmane.org; Sat, 30 Jun 2007 07:33:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I4bCT-0001aG-Om for emacs-devel@gnu.org; Sat, 30 Jun 2007 07:33:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I4bCS-0001Zt-FK for emacs-devel@gnu.org; Sat, 30 Jun 2007 07:33:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4bCS-0001Zp-6z for emacs-devel@gnu.org; Sat, 30 Jun 2007 07:33:12 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1I4bCR-00037b-Es for emacs-devel@gnu.org; Sat, 30 Jun 2007 07:33:11 -0400 Original-Received: (qmail invoked by alias); 30 Jun 2007 11:33:10 -0000 Original-Received: from N740P012.adsl.highway.telekom.at (EHLO [62.47.36.108]) [62.47.36.108] by mail.gmx.net (mp035) with SMTP; 30 Jun 2007 13:33:10 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18nFz8cTa4nF5flN27eW6NqeqxSuHZbgkBwFmhh3F 7Z7/gGlGti+DgY 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:74056 Archived-At: > We have a plan for dealing with functions called by `format-decode'. We > do not have a plan yet for dealing with `after-insert-file-functions'. > Shall we treat functions there the same way we treat functions called by > `format-decode'? > > If it's good for one, it's probably good for the other. Consistency > between the two features is also good. > > Do you see any reason NOT to do so? We could introduce one: Keep `format-decode' for practical use and `after-insert-file-functions' for applications that want to fine-tune every single step of the decoding process. > When I insert the contents of a file with `visit-flag' nil the buffer > should be reasonably narrowed to work only on the inserted text as in > `decode-coding-inserted-region'. Currently, neither `format-alist' nor > `after-insert-file-functions' handling provides such a service. The > functions there are supposed to do the narrowing themselves. > > Perhaps it would be convenient to narrow around the call to > the `after-insert-file-functions'. This would not contradict the > established calling convention. > > If we want to narrow around format conversion functions, the place > to do that is inside format.el. I already changed my mind: I now think instead that `format-decode' and `after-insert-file-functions' _should_ be able to detect whether the insertion is done at the beginning of the current buffer or any other position (simply by comparing the `begin' argument with `point-min' wthout any need to widen the buffer). The only clean way to handle this would be using a temporary buffer for decoding.