From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: by default, point should not enter the minibuffer prompt Date: Wed, 8 Oct 2008 09:34:08 -0700 Message-ID: <000d01c92963$b0813a50$c2b22382@us.oracle.com> References: <007501c928dd$97682c80$0200a8c0@us.oracle.com><008801c9290c$55434c70$0200a8c0@us.oracle.com> <000001c92958$6d770fb0$c2b22382@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223484017 3971 80.91.229.12 (8 Oct 2008 16:40:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 16:40:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Miles Bader'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 08 18:41:14 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Knc1d-00051a-96 for ged-emacs-devel@m.gmane.org; Wed, 08 Oct 2008 18:36:37 +0200 Original-Received: from localhost ([127.0.0.1]:56697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Knc0Z-0007P8-FY for ged-emacs-devel@m.gmane.org; Wed, 08 Oct 2008 12:35:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnbzP-00063W-6d for emacs-devel@gnu.org; Wed, 08 Oct 2008 12:34:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnbzO-00061o-2W for emacs-devel@gnu.org; Wed, 08 Oct 2008 12:34:18 -0400 Original-Received: from [199.232.76.173] (port=59501 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnbzN-00061d-Kn for emacs-devel@gnu.org; Wed, 08 Oct 2008 12:34:17 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:45855) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KnbzM-0000oP-7e; Wed, 08 Oct 2008 12:34:16 -0400 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m98GYBjn030871; Wed, 8 Oct 2008 10:34:11 -0600 Original-Received: from acsmt700.oracle.com (acsmt700.oracle.com [141.146.40.70]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m98GYA5d030384; Wed, 8 Oct 2008 10:34:10 -0600 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 08 Oct 2008 16:34:08 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <000001c92958$6d770fb0$c2b22382@us.oracle.com> Thread-Index: AckpHpo5ydc9M94NTdKWFjOe5uOwRwAOX8KgAAKSNPA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104425 Archived-At: > > 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.