unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* clear minibuffer text wehn open a file
@ 2014-04-08  6:52 tomer
  2014-04-08 15:50 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: tomer @ 2014-04-08  6:52 UTC (permalink / raw)
  To: help-gnu-emacs

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 ?

Thanks
Tomer


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: clear minibuffer text wehn open a file
  2014-04-08  6:52 clear minibuffer text wehn open a file tomer
@ 2014-04-08 15:50 ` Drew Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2014-04-08 15:50 UTC (permalink / raw)
  To: tomer, help-gnu-emacs

> 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.)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-08 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08  6:52 clear minibuffer text wehn open a file tomer
2014-04-08 15:50 ` Drew Adams

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).