From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.devel Subject: Re: over-engineered (and under-standardized) inferior interfaces Date: Thu, 21 Aug 2014 23:21:58 +0200 Message-ID: <20140821232158.3d0aea56@forcix> 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 1408656185 1454 80.91.229.3 (21 Aug 2014 21:23:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2014 21:23:05 +0000 (UTC) Cc: Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 21 23:22:58 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 1XKZou-00085F-OT for ged-emacs-devel@m.gmane.org; Thu, 21 Aug 2014 23:22:56 +0200 Original-Received: from localhost ([::1]:34181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKZou-0002wf-9P for ged-emacs-devel@m.gmane.org; Thu, 21 Aug 2014 17:22:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKZo7-0001rT-Lh for emacs-devel@gnu.org; Thu, 21 Aug 2014 17:22:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKZo1-0006yt-Pe for emacs-devel@gnu.org; Thu, 21 Aug 2014 17:22:07 -0400 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:38650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKZo1-0006yh-CB for emacs-devel@gnu.org; Thu, 21 Aug 2014 17:22:01 -0400 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id 7E665204137; Thu, 21 Aug 2014 23:21:59 +0200 (CEST) Original-Received: from forcix (port-17787.pppoe.wtnet.de [46.59.131.23]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id BD2B7204134; Thu, 21 Aug 2014 23:21:58 +0200 (CEST) In-Reply-To: X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 87.230.15.51 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:173797 Archived-At: On Thu, 21 Aug 2014 16:29:35 -0400 Stefan Monnier wrote: > prog-proc-mode First of all, this is an excellent initiative. Thank you. > (define-key map [?\C-c ?\C-l] 'prog-proc-load-file) > (define-key map [?\C-c ?\C-c] 'prog-proc-compile) > (define-key map [?\C-c ?\C-z] 'prog-proc-switch-to) > (define-key map [?\C-c ?\C-r] 'prog-proc-send-region) > (define-key map [?\C-c ?\C-b] 'prog-proc-send-buffer) > ;; FIXME: Add > ;; (define-key map [?\M-C-x] 'prog-proc-send-defun) > ;; (define-key map [?\C-x ?\C-e] 'prog-proc-send-last-sexp) Just some comments on the default bindings. I understand these are the historically-available ones, but I do feel that if we create a new mode like this, it might be worthwhile to rethink them. With the availability of an "active region", I think it would be nice to consolidate send-buffer and send-region to a single binding. If there is an active region, send the region; if not, send the buffer. Using a nice binding like C-c C-c for a somewhat less-common command like "compile the current file in the REPL" (as opposed to using M-x (re)compile) seems like a waste. So I'd suggest using C-c C-c for a new prog-proc-send-region-or-buffer. I'm also unsure about using up too many C-c C-X bindings in this minor mode; the major mode that activates it won't be able to easily override those bindings locally, so it might be a good idea to be a bit more conservative with the default bindings, providing the commands but not the bindings for the less common use cases (load, compile, region, buffer). That would leave us with a default set of C-c C-c (send-region-or-buffer) and C-c C-z (switch to repl, starting it if necessary) (*) which seems like a nice default set to me that modes can extend with options that make sense for them. (*) And C-M-x, which I think is a nice addition for most modes and also does not conflict with other mode bindings and uses. Regards, Jorgen