From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Defining functions on the fly Date: Tue, 16 Jun 2015 18:13:11 +0200 Organization: Informatimago Message-ID: <87oakftyw8.fsf@kuiper.lan.informatimago.com> References: <557E99BE.2060407@easy-emacs.de> <557FBB3C.8060208@easy-emacs.de> <87lhfkjfvr.fsf@gnu.org> <557FEACC.3030101@easy-emacs.de> <87k2v3rjnv.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1434471336 7035 80.91.229.3 (16 Jun 2015 16:15:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Jun 2015 16:15:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 16 18:15:24 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z4tWD-0002Lt-A7 for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Jun 2015 18:15:21 +0200 Original-Received: from localhost ([::1]:41338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4tWC-0005iF-HY for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Jun 2015 12:15:20 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-X-Trace: individual.net JPtDSemHd7iaSaO8Ul1Z5wT7qfdJkSx+4SWOi5C+1EQnz5JCZ4 Cancel-Lock: sha1:MGVhYjM1ODI3ZWRjNDRhMjE3MzRlZDM4YTE0ZDNkNzk5NmY5NzM5ZA== sha1:2huOPXB3aoEIR0yZoC6avkmATGg= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:212699 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104983 Archived-At: Andreas, you might be interested in reading: https://www.ics.uci.edu/~taylor/ics228/SynGen.pdf and Teitelbaum, T.; T. Reps (September 1981). "The Cornell Program Synthesizer: A syntax-directed programming environment". Communications of the ACM 24 (9): 563–573. doi:10.1145/358746.358755. if you can get your hands on it. Check also: https://en.wikipedia.org/wiki/Structure_editor Basically, you could generate the whole mode all the structured editing commands, from a grammar of the language you want to edit. And since you could include in the grammar, grammars of other languages when you have such escape, such as html scripts, or php, etc, you would get automatically "multi-mode" structured editing modes. Now, when you generate code (eg. a programming language compiler), it is perfectly normal to have parts that are generated, and functions and stubs that are written once for all for all the programs: a run-time library. Your code generate would naturally bind mode commands whose name would be prefixed by the name of the grammar (= the mode), but the run-time library would be the same for all those generated mode, and would have a library prefix instead. -- __Pascal Bourguignon__ http://www.informatimago.com/ “The factory of the future will have only two employees, a man and a dog. The man will be there to feed the dog. The dog will be there to keep the man from touching the equipment.” -- Carl Bass CEO Autodesk