unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Miles Bader'" <miles@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: by default, point should not enter the minibuffer prompt
Date: Wed, 8 Oct 2008 09:34:08 -0700	[thread overview]
Message-ID: <000d01c92963$b0813a50$c2b22382@us.oracle.com> (raw)
In-Reply-To: <000001c92958$6d770fb0$c2b22382@us.oracle.com>

> > The problem is that you are using `forward-line'.  It is a
> > low-level function that does not do any sort of checking.
> > Emacs commands intended for user use (C-a, C-p, etc) should
> > act correctly and avoid the prompt.
> 
> Got it. I'll change my minibuffer C-a command to DTRT. Thx.

A little help please.

I tried simply binding `minibuffer-prompt-properties' so that it included
`point-entered minibuffer-avoid-prompt' during my `C-a', but that had no effect.

When is `minibuffer-prompt-properties' examined? Is it too late once the
minibuffer is activated and a minibuffer key is hit?

Simple test:

(defun beg-line ()
  (interactive)
  (let ((minibuffer-prompt-properties
	 (append '(point-entered minibuffer-avoid-prompt)
		   minibuffer-prompt-properties)))
    (forward-line -1)))

(define-key minibuffer-local-completion-map "\C-a" 'beg-line)

The binding has no effect - doesn't prevent C-a from moving to the prompt
beginning. This code is not really what I'd use, but it's a simplified version.
My code needs to use `forward-line', in any case. I'm just ignorant of how to
prevent point from moving into the prompt.

I grepped the Lisp Emacs files for `minibuffer-prompt-properties', but there is
no real use of it, beyond initialization. I looked at the C source code in
cmds.c for `beginning-of-line', but I don't see (understand) how it's done.
What's the secret? ;-)

If it can't be done by simply binding `minibuffer-prompt-properties', what is
the way to go? Do I need to explicitly move to `minibuffer-prompt-end', or is
there a simple, elegant way to DTRT here.

I'm not really familiar with fields and such. Suggestions appreciated. Thx.






  parent reply	other threads:[~2008-10-08 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08  0:34 by default, point should not enter the minibuffer prompt Drew Adams
2008-10-08  1:59 ` Stefan Monnier
2008-10-08  2:07 ` Miles Bader
2008-10-08  6:08   ` Drew Adams
2008-10-08  8:08     ` Miles Bader
2008-10-08 15:13       ` Drew Adams
2008-10-08 16:24         ` Miles Bader
2008-10-08 16:52           ` Drew Adams
2008-10-08 16:34         ` Drew Adams [this message]
2008-10-09  0:22           ` Miles Bader
2008-10-09 16:03             ` Drew Adams
2008-10-08 20:22 ` Richard M. Stallman

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='000d01c92963$b0813a50$c2b22382@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@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).