all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bastien Guerry <bzg@altern.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 16453@debbugs.gnu.org
Subject: bug#16453: 24.3.50; Motion functions not respecting field boundaries as documented
Date: Fri, 24 Jan 2014 17:15:03 +0100	[thread overview]
Message-ID: <87iot9nypk.fsf@bzg.ath.cx> (raw)
In-Reply-To: <c28d0f8f-d0d5-4a50-889a-8f4e205234e2@default> (Drew Adams's message of "Wed, 15 Jan 2014 08:17:19 -0800 (PST)")

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

Drew Adams <drew.adams@oracle.com> writes:

> (elisp) `Introduction to Minibuffers' says this:
>
>  The text in the minibuffer always starts with the "prompt string",
>  the text that was specified by the program that is using the minibuffer
>  to tell the user what sort of input to type.  This text is marked
>  read-only so you won't accidentally delete or change it.  It is also
>  marked as a field (*note Fields::), so that certain motion functions,
>  including `beginning-of-line', `forward-word', `forward-sentence', and
>  `forward-paragraph', stop at the boundary between the prompt and the
>  actual text.
>
> So I would expect that `backward-word' and `backward-sexp' would stop at
> the field boundary, which is the end of the prompt.  `beginning-of-line'
> does indeed do this, as the doc suggests.  But `backward-word' and
> `backward-sexp', at least, do not - they move backward into the prompt.
>
> Seems like this is the wrong behavior, and the doc describes the right
> behavior.  But perhaps it is the other way around and this is a doc
> bug.

The attached patch let `forward-word' does what the docstring says.
It uses `t' as the value for the ESCAPE-FROM-EDGE parameter within
the call to `constrain-to-field'.

I agree this seems the correct behavior in the minibuffer.

But I'm often frustrated by such constraints for `beginning-of-line'
(e.g. hit G c on a Gnus group and get stuck in a non-selected field
anyone?).

So perhaps the nil value for ESCAPE-FROM-EDGE is intentional here.

In any case, this is just to bring attention to the problem and
a possible solution: I don't know C so I won't commit this myself.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: syntax.c.patch --]
[-- Type: text/x-diff, Size: 562 bytes --]

=== modified file 'src/syntax.c'
*** src/syntax.c	2014-01-01 07:43:34 +0000
--- src/syntax.c	2014-01-24 16:05:37 +0000
***************
*** 1485,1491 ****
  
    /* Avoid jumping out of an input field.  */
    tmp = Fconstrain_to_field (make_number (val), make_number (PT),
! 			     Qt, Qnil, Qnil);
    val = XFASTINT (tmp);
  
    SET_PT (val);
--- 1485,1491 ----
  
    /* Avoid jumping out of an input field.  */
    tmp = Fconstrain_to_field (make_number (val), make_number (PT),
! 			     Qnil, Qnil, Qnil);
    val = XFASTINT (tmp);
  
    SET_PT (val);


[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  reply	other threads:[~2014-01-24 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 16:17 bug#16453: 24.3.50; Motion functions not respecting field boundaries as documented Drew Adams
2014-01-24 16:15 ` Bastien Guerry [this message]
2014-01-27 11:07   ` Bastien Guerry
2014-01-27 14:55     ` Drew Adams
2014-02-05 10:32       ` Bastien

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=87iot9nypk.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=16453@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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.