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: clear minibuffer text wehn open a file Date: Tue, 8 Apr 2014 08:50:19 -0700 (PDT) Message-ID: <6098cce7-101c-4ff6-b047-69caed54bbb5@default> References: <7be89e9a-097c-4f69-b412-d6999602ee08@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1396972268 19304 80.91.229.3 (8 Apr 2014 15:51:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2014 15:51:08 +0000 (UTC) To: tomer , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 08 17:50:59 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WXYId-0001Ep-9T for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Apr 2014 17:50:59 +0200 Original-Received: from localhost ([::1]:41238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYIc-00067M-Ui for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Apr 2014 11:50:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYID-0005rY-He for help-gnu-emacs@gnu.org; Tue, 08 Apr 2014 11:50:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXYI4-0004cX-Ht for help-gnu-emacs@gnu.org; Tue, 08 Apr 2014 11:50:33 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:41163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYI4-0004b5-AZ for help-gnu-emacs@gnu.org; Tue, 08 Apr 2014 11:50:24 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s38FoL8E022444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Apr 2014 15:50:21 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s38FoK8h005311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 8 Apr 2014 15:50:21 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s38FoK8Y005290; Tue, 8 Apr 2014 15:50:20 GMT In-Reply-To: <7be89e9a-097c-4f69-b412-d6999602ee08@googlegroups.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97045 Archived-At: > when load file I want to clear minibuffer text without killing to ring. >=20 > I use this code: > global-set-key [(control ?7)] 'tl-delete-line) > (defun tl-delete-line() > (interactive) > (beginning-of-line) > (kill-line) > (insert "/vobs/aaa/DV")) >=20 > I use kill-line which add to the ring.I want to clear the line without > saving to ring. Is is possible ? 1. If you want to do something only in the minibuffer, then bind the key only in minibuffer keymaps, not in the global map. 2. Function `delete-minibuffer-contents' erases the minibuffer contents. 3. If you didn't care about inserting "/vobs/aaa/DV" you could even just bind `delete-minibuffer-contents', since it is a command: (define-key minibuffer-local-must-match-map "\M-k" 'delete-minibuffer-contents) (define-key minibuffer-local-completion-map "\M-k" 'delete-minibuffer-contents) (There are some more minibuffer keymaps. Which you use can depend on your Emacs version.)