From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.devel Subject: Re: narrow-to-here-document Date: Fri, 20 Jun 2003 07:10:28 -0700 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030620141028.GA1331@math.berkeley.edu> References: <20030620.225909.39171959.jet@gyve.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1056118404 10955 80.91.224.249 (20 Jun 2003 14:13:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2003 14:13:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jun 20 16:13:17 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19TMdh-0002qB-00 for ; Fri, 20 Jun 2003 16:13:17 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19TMfK-0002gh-00 for ; Fri, 20 Jun 2003 16:14:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19TMcN-0004Ac-C2 for emacs-devel@quimby.gnus.org; Fri, 20 Jun 2003 10:11:55 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19TMbf-0003cq-U5 for emacs-devel@gnu.org; Fri, 20 Jun 2003 10:11:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19TMbN-0003GK-Je for emacs-devel@gnu.org; Fri, 20 Jun 2003 10:10:54 -0400 Original-Received: from gold.math.berkeley.edu ([169.229.58.61] helo=Math.Berkeley.EDU) by monty-python.gnu.org with esmtp (Exim 4.20) id 19TMb1-0002yO-B9 for emacs-devel@gnu.org; Fri, 20 Jun 2003 10:10:31 -0400 Original-Received: from powdermilk.math.berkeley.edu (powdermilk [169.229.140.13]) by Math.Berkeley.EDU (8.12.9/8.12.8) with ESMTP id h5KEATST027650; Fri, 20 Jun 2003 07:10:29 -0700 (PDT) X-Authentication-Warning: gold.math.berkeley.edu: Host powdermilk [169.229.140.13] claimed to be powdermilk.math.berkeley.edu Original-Received: (from ilya@localhost) by powdermilk.math.berkeley.edu (8.9.3/8.9.3) id HAA01337; Fri, 20 Jun 2003 07:10:28 -0700 (PDT) Original-To: Masatake YAMATO Content-Disposition: inline In-Reply-To: <20030620.225909.39171959.jet@gyve.org> User-Agent: Mutt/1.4i Original-cc: cperl@ilyaz.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15172 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15172 On Fri, Jun 20, 2003 at 10:59:09PM +0900, Masatake YAMATO wrote: > I've written a new function, narrot-to-here-document. This might be > useful to edit here document region in a script file. > How to you think to add this feature to emacs? > 1. hdoc.el --- Generic here document support > 2. sh-script.el and cperl-mode.el adapters But are there any other modes with here-docs? I would do it like this: a) defined a variable which keeps a function looking for a here-doc. b) Merge your two adapters into one function (which makes a runtime dispatch basing on the mode - and croaks if the mode is not known); put the function into the variable. c) delegate the other work to the mode writers - when a mode supports an interaction with your function, it should make your variable buffer-local, and will put its helper function into the variable. Hope this helps, Ilya