unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: tomer <tomer1levin@walla.co.il>, help-gnu-emacs@gnu.org
Subject: RE: clear minibuffer text wehn open a file
Date: Tue, 8 Apr 2014 08:50:19 -0700 (PDT)	[thread overview]
Message-ID: <6098cce7-101c-4ff6-b047-69caed54bbb5@default> (raw)
In-Reply-To: <7be89e9a-097c-4f69-b412-d6999602ee08@googlegroups.com>

> when load file I want to clear minibuffer text without killing to ring.
> 
> 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"))
> 
> 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.)



      reply	other threads:[~2014-04-08 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08  6:52 clear minibuffer text wehn open a file tomer
2014-04-08 15:50 ` Drew Adams [this message]

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=6098cce7-101c-4ff6-b047-69caed54bbb5@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomer1levin@walla.co.il \
    /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.
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).