From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mattie Newsgroups: gmane.emacs.devel Subject: Re: over-engineered (and under-standardized) inferior interfaces Date: Mon, 25 Aug 2014 02:23:00 -0700 Message-ID: <20140825022300.6049e88c@runbox.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1408958623 7457 80.91.229.3 (25 Aug 2014 09:23:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Aug 2014 09:23:43 +0000 (UTC) Cc: sds@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 25 11:23:36 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XLqUw-0000NY-Nc for ged-emacs-devel@m.gmane.org; Mon, 25 Aug 2014 11:23:34 +0200 Original-Received: from localhost ([::1]:47022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLqUv-0008Lh-V3 for ged-emacs-devel@m.gmane.org; Mon, 25 Aug 2014 05:23:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLqUc-0008Kf-TH for emacs-devel@gnu.org; Mon, 25 Aug 2014 05:23:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLqUW-0004ii-K5 for emacs-devel@gnu.org; Mon, 25 Aug 2014 05:23:14 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:52035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLqUW-0004hN-Dq; Mon, 25 Aug 2014 05:23:08 -0400 Original-Received: from [10.9.9.206] (helo=mailfront02.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1XLqUU-0006LH-DA; Mon, 25 Aug 2014 11:23:06 +0200 Original-Received: from c-50-135-50-173.hsd1.wa.comcast.net ([50.135.50.173] helo=localhost) by mailfront02.runbox.com with esmtpsa (uid:809090 ) (SSL3.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) id 1XLqUT-0004IZ-4k; Mon, 25 Aug 2014 11:23:05 +0200 In-Reply-To: X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.24; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 91.220.196.211 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173820 Archived-At: On Thu, 21 Aug 2014 15:20:32 -0400 Sam Steingold wrote: > Hi, > > I am talking about the various inferior-FOO modes which run on top of > the comint mode and talk to an underlying interpreter. > E.g., sql, R(ESS), lisp, bash, python, pig, &c &c &c. > > There are two main problems I have with them: > > > 1. Over-engineering of connecting to the interpreter. > > Take a look, e.g., at sql.el:sql-product-alist with its program, > options, login &c. > > It all makes perfect sense, I am sure, most of the time. > > However, sometimes the way I connect is more convoluted, e.g., I need > to ssh to server, then sudo to the right user, only then invoke a > command. > This means that I have to set sql-program to "ssh", then pull all the > sudo &c into sql-options, then disable login-params because sql.el > stuffs them into the command line too early. > > It would be nice if, as an alternative to all the many options, I > could just tell Emacs "run this command line as is and ask me no > questions". > > > > 2. Lack of standardization in interaction and keybindings. > > The few standard interaction operations are: > > -- start an interaction (e.g., run Python on a python-mode buffer) > -- switch to an existing interaction > -- send a region, paragraph, function, line > > standard options are > > -- switch to the interaction buffer after sending the code there? > -- display the code sent in the buffer? > > these things are done differently (if at all) in all the various > modes. E.g., not all modes bind C-c C-z to switch to the interaction > buffer. Not all even have a function to send the current line and > move to the next line (granted, this does not make sense for _all_ > languages). > > I wonder if it would be possible to abstract this into a macro: > > (define-interaction name get-interaction-buffer-function map) > > which will define all those functions and options above (and add > standard bindings to the map) > > > Thank you for your attention. > > > PS. I know that ESS, pig-mode and some others are not a part of Emacs. > I did standard interface, standard API, and used a dynamic ring as a model https://lispblivet.sx/code/?p=emacs.git;a=blob_plain;f=emacs/local/elisp/borg-repl.el;hb=refs/heads/master the idea is impose a standard interface with bindings that map to buffer local function pointers. for a mode API side do a dynamic ring with rotation with some nice facades.