all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: over-engineered (and under-standardized) inferior interfaces
Date: Fri, 22 Aug 2014 07:57:11 +0200	[thread overview]
Message-ID: <53F6DBB7.1030803@online.de> (raw)
In-Reply-To: <jwvegw9chve.fsf-monnier+emacs@gnu.org>

On 22.08.2014 05:45, Stefan Monnier wrote:
>> 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.
>
> Sure.  prog-proc-mode is really just an experiment, and I'm quite open
> to changes, both in terms of UI and implementation.
>
>> With the availability of an "active region", I think it would be nice
>> to consolidate send-buffer and send-region to a single binding.
>
> Fine.
>
>> 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.
>
> FWIW under sml-mode, C-c C-c runs a "make"-like command (but it's
> a command passed to the inferior process rather than being a separate
> process like in M-x compile).
>
>> So I'd suggest using C-c C-c for a new prog-proc-send-region-or-buffer.
>
> I think "send the current buffer" is not good enough, except for those
> rare systems where a single file is all you need.
>
>> 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).
>
> My memory failed me: if you look at the code, you'll see that
> prog-proc-mode is not a minor mode but a major-mode, to be used as
> parent mode (in place of prog-mode, from which it derives).
> So major modes can very easily override those bindings.
> But yes: we shouldn't use too many such bindings.
>
>
>          Stefan
>
>

Hi,

very interesting move, thanks all.

Started some weeks o project "general-key", which seems to point into the very same direction.

Below the README:

[...]

For common items like `line', `word' or `symbol' Emacs' language modes
commonly don't touch the keybinding.

That way `backward-word', `copy-word', `forward-word',
`kill-word', `mark-word' etc. don't need configuration.

However, with programming, there are a couple of common cases,
not dealt with yet.

- statements, for example assigments
- conditionals resp. loops
- combinations of that, i.e. functions

for example WRT to function we might have for all modes

`general-key-function-backward'
`general-key-function-copy'
`general-key-function-forward'
`general-key-function-kill'
`general-key-function-mark'

If general-key-mode provides key-binding for basic types, these keys must
not be changed or configured again by language-modes.

Now it would be at the modes, for example WRT python-mode.el:

(setq general-key-function-backward 'py-backward-def-or-class)
(setq general-key-function-copy 'py-copy-def-or-class)
(setq general-key-function-forward 'py-forward-def-or-class)
(setq general-key-function-kill 'py-kill-def-or-class)
(setq general-key-function-mark 'py-mark-def-or-class)

Respective with block, statement and expression maybe.

(setq general-key-block-backward 'py-backward-block)
...

A second group of commands simplified that way deals with braces,
brakcets, parenthesis or does a trim.

(setq general-key-region-brace 'ar-brace-region-atpt)
(setq general-key-region-bracket 'ar-bracket-region-atpt)
(setq general-key-region-trim 'ar-trim-region-atpt)
(setq general-key-region-parentize 'ar-parentize-region-atpt)

If a region might be braced, parenthized etc. in a suitable way, these
objects also should be easy to mark, copy, delete resp. kill and moved
on:

Here an example using the parentized form:

(setq general-key-parentized-backward 'ar-beginning-of-parentized-atpt)
(setq general-key-parentized-copy 'ar-copy-parentized-atpt)
(setq general-key-parentized-trim 'ar-trim-parentized-atpt)
(setq general-key-parentized-forward 'ar-forward-parentized-atpt)
(setq general-key-parentized-kill 'ar-kill-parentized-atpt)
(setq general-key-parentized-mark 'ar-mark-parentized-atpt)

;;;;;;;

Cheers,

Andreas
http://bazaar.launchpad.net/~a-roehler/s-x-emacs-werkstatt



  reply	other threads:[~2014-08-22  5:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 19:20 over-engineered (and under-standardized) inferior interfaces Sam Steingold
2014-08-21 20:29 ` Stefan Monnier
2014-08-21 21:21   ` Jorgen Schaefer
2014-08-21 22:00     ` Dmitry
2014-08-21 22:10       ` Eric S. Raymond
2014-08-22  3:45     ` Stefan Monnier
2014-08-22  5:57       ` Andreas Röhler [this message]
2014-08-22 10:55       ` Phillip Lord
2014-08-22 11:41         ` Jorgen Schaefer
2014-08-22 21:29   ` Sam Steingold
2014-08-31 16:30   ` Elias Mårtenson
2014-08-31 20:01     ` Stefan Monnier
2014-08-21 20:43 ` Andreas Schwab
2014-08-21 21:06   ` Sam Steingold
2014-08-22  5:56     ` Andreas Schwab
2014-08-22  6:17     ` Michael Albinus
2014-08-22 21:25       ` Sam Steingold
2014-08-23 15:16         ` Michael Albinus
2014-08-25 17:05           ` Sam Steingold
2014-08-27  6:57             ` Michael Albinus
2014-08-27 10:46               ` Sam Steingold
2014-08-27 11:29                 ` Michael Albinus
2014-08-27 12:32                   ` Sam Steingold
2014-08-27 12:51                     ` Michael Albinus
2014-08-27 13:00                       ` Sam Steingold
2014-08-27 13:16                         ` Michael Albinus
2014-08-27 13:52                           ` Sam Steingold
2014-08-27 13:57                             ` Sam Steingold
2014-08-27 18:17                               ` Michael Albinus
2014-08-28  1:01                                 ` Sam Steingold
2014-08-28  8:48                                   ` Michael Albinus
2014-08-28 16:02                                     ` Sam Steingold
2014-08-28 18:35                                       ` Michael Albinus
2014-08-28 19:22                                         ` Sam Steingold
2014-08-28 19:44                                           ` Michael Albinus
2014-08-28 19:54                                             ` Sam Steingold
2014-08-28 20:04                                               ` Michael Albinus
2014-08-29 15:00                                                 ` Sam Steingold
2014-09-05 14:19                                                   ` Michael Albinus
2014-09-08 13:17                                                     ` Sam Steingold
2014-09-08 14:15                                                       ` Michael Albinus
2014-09-08 14:38                                                         ` Sam Steingold
2014-09-08 14:47                                                           ` Michael Albinus
2014-08-27 14:05                             ` Tassilo Horn
2014-08-27 18:13                               ` Michael Albinus
2014-08-25  9:23 ` Michael Mattie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F6DBB7.1030803@online.de \
    --to=andreas.roehler@online.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.