From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Selecting default prompt text Date: Thu, 12 Feb 2009 09:34:11 -0800 Message-ID: <00fb01c98d38$1f604e60$c2b22382@us.oracle.com> References: <1234441717.125678@arno.fh-trier.de> 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 1234460090 8632 80.91.229.12 (12 Feb 2009 17:34:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2009 17:34:50 +0000 (UTC) To: "'Richard Riley'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 12 18:36:03 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LXfTj-00011u-Tm for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Feb 2009 18:36:00 +0100 Original-Received: from localhost ([127.0.0.1]:49721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXfSP-0008Q9-Rw for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Feb 2009 12:34:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXfS7-0008PZ-By for help-gnu-emacs@gnu.org; Thu, 12 Feb 2009 12:34:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXfS6-0008PE-Jh for help-gnu-emacs@gnu.org; Thu, 12 Feb 2009 12:34:18 -0500 Original-Received: from [199.232.76.173] (port=44091 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXfS6-0008P9-DC for help-gnu-emacs@gnu.org; Thu, 12 Feb 2009 12:34:18 -0500 Original-Received: from rcsinet13.oracle.com ([148.87.113.125]:19248 helo=rgminet13.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXfS5-0002cG-TF for help-gnu-emacs@gnu.org; Thu, 12 Feb 2009 12:34:18 -0500 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n1CHZDA9003530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Feb 2009 17:35:14 GMT Original-Received: from acsmt701.oracle.com (acsmt701.oracle.com [141.146.40.71]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n1CHYB4Z021679; Thu, 12 Feb 2009 17:34:13 GMT Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Feb 2009 09:34:10 -0800 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 In-Reply-To: Thread-Index: AcmNF6DmeQJ5Y1ZNT7+VB9IgGA+r0gAGeZag X-Source-IP: acsmt701.oracle.com [141.146.40.71] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.49945D94.01BA:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62086 Archived-At: > > Something like this ? > > > > (defun minibuffer-select-inital-input () > > (let ((start (next-single-char-property-change 1 'read-only))) > > (when (< start (point-max)) > > (set-mark start) (setq mark-active t)))) > > > > (add-hook 'minibuffer-setup-hook 'minibuffer-select-inital-input) > > (read-string "> " "Hallo") > > > > -ap > > Yes, thanks. But I released I was hoping for too much here since > region/mark etc works so many different ways depending on settings. As > "dim" in the #emacs said, probably best to rely on C-a C-k. > e.g With my setting hitting right arrow there results in > "end of buffer" error. 1. I was going to suggest something like what ap said. That seems to respond to your request, so I'm not sure what you meant above - in particular about using the right arrow. If point is at the end of the input (end of buffer), then why would you hit the right arrow? What would you like the right arrow to do in that context? 2. [You won't like this related answer, but it might help someone else. ;-)] In Icicles you can elect to always insert the default value as initial text. And if you do that, you can also elect to automatically select it (as the active region). And you can choose where to leave the cursor: before or after the default text (whether or not you choose to auto-select it). This means that if you use, say, Delete Selection mode, and you choose to auto-select the default input, then you can just type other text to replace it, or hit `C-d' or Backspace (DEL) to delete it. And even if you choose not to auto-select the default text, you can use `M-k' anytime to clear the minibuffer (easier than `C-a C-k'). http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-d efault-value