unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: rms@gnu.org, emacs-pretest-bug@gnu.org, emacs-devel@gnu.org
Subject: Re: [ortmann@isl.net: asymmetries and contradictions in shell navigation using C-a and C-e on a prompt line]
Date: 18 Mar 2002 16:17:54 +0100	[thread overview]
Message-ID: <5xd6y1aorh.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <buou1rey4yg.fsf@mcspd15.ucom.lsi.nec.co.jp>

Miles Bader <miles@lsi.nec.co.jp> writes:

> [ This is in reply to an old message complainging that commands like C-e
>   or C-k, when invoked inside a comint prompt, would jump-to/kill-to
>   the end of the prompt, instead of the end of the line.  ] 

> It seems to me that the right answer to this problem is to augment
> the field handling to distinguish between the `inside' and the
> `outside' of a field (currently there is no such distinction).  Then
> some commands (such as `end-of-line' or `kill-line') would only use
> the field- sensitive behavior when invoked inside a field, and would
> act normally when invoked outside a field.

I think the proper way to achieve this is by using different keymap
text properties on input fields and prompt fields.

Of course, that will not happen "automatically", but it avoids
"cluttering" all the standard (and non-standard) movement and killing
commands with such "field aware" exceptions.

As a service to the lisp programmers, we could define new `standard'
functions like end-of-input-field, end-of-prompt-field, etc. for this
and add keymaps input-field-keymap and prompt-field-keymap utilizing
the "command remap" feature to remap end-of-line, beginning-of-line
and other relevant commands to those commands.  Then it would be easy
(but tedious?) to put the proper keymap property on the fields and
prompts...


> I suggest saying that a field property of `nil' is always `outside', and
> any non-nil value is `inside'.  This is very easy to understand and
> implement, and would be convenient for most user code (since the bulk of
> text would automatically be considered `outside').
> 

What happens if you have two fields next to each other -- in that
case, the inside of one field is the outside the other field - and
vice versa.

> The question is, what's a good interface to distinguish the inside of a
> field from the outside?
> 
> Unfortunately, the most common use of fields currently is in the
> minibuffer, and it uses a `nil' field property as the `inside'
> (and puts a non-nil field property on the prompt, to distinguish it).

Which indicates to me that your proposed solutions isn't the right one.

> However, I think this can be handled by making the minibuffer input use
> an overlay for the input field, instead of relying on the nil-properties
> inserted at the end of the buffer.  [The field code doesn't seem to
> always handle this properly, but I think that's an implementation bug.]

If there is a problem with inheriting the field/text properties at the
end of the buffer (notably the minibuffer), we need to look at that as
a separate issue.  IMO, a right-sticky property should be honoured
also at the end of the buffer, so if that doesn't happen, it's sounds
like a bug.  

Hm, the problem is that the input field is initially zero-length, so
maybe there isn't anywhere to define those properties in the first
place...  But we already handle the minibuffer correctly, so this
will continue to work if we don't start messing up the existing
movement & killing functions!!!

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  reply	other threads:[~2002-03-18 15:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200201210941.g0L9f9s14343@aztec.santafe.edu>
2002-03-18  2:39 ` [ortmann@isl.net: asymmetries and contradictions in shell navigation using C-a and C-e on a prompt line] Miles Bader
2002-03-18 15:17   ` Kim F. Storm [this message]
2002-03-18 15:39     ` Miles Bader
2002-03-18 16:59       ` Kim F. Storm
2002-03-19  0:02         ` Miles Bader
2002-03-19  9:07           ` Kim F. Storm
2002-03-19  9:24             ` Miles Bader
2002-03-19  8:44     ` Richard Stallman
2002-03-18 20:07   ` Richard Stallman
2002-03-19  0:18     ` Miles Bader
2002-03-20  5:11       ` Richard Stallman
2002-03-20  5:41         ` Miles Bader
2002-03-20  6:30           ` Eli Zaretskii
2002-03-20  6:38             ` Miles Bader

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=5xd6y1aorh.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=rms@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).