unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to make Ctrl-d not log off the shell?
@ 2007-05-16  0:09 mowgli
  2007-05-16  3:38 ` Tyler Smith
  0 siblings, 1 reply; 8+ messages in thread
From: mowgli @ 2007-05-16  0:09 UTC (permalink / raw)
  To: help-gnu-emacs

How do you make pressing Ctrl-d not log off the shell and instead ask
a question like Do you really want to quit? typing y quits the shell.

Ctrl-d is something I love in emacs and it works on the shell too but
sometimes is inconvinient due to this log off thing when erasing some
characters and you accidentally keep the Ctrl-d pressed a bit more.

Regards,
mowgli

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: How to make Ctrl-d not log off the shell?
@ 2007-05-16  6:48 martin rudalics
  0 siblings, 0 replies; 8+ messages in thread
From: martin rudalics @ 2007-05-16  6:48 UTC (permalink / raw)
  To: tyler.smith; +Cc: help-gnu-emacs

We could rather do

(defun comint-delchar-or-maybe-eof (arg)
   "Delete ARG characters forward or send an EOF to subprocess.
Sends an EOF only if point is at the end of the buffer and there is no input."
   (interactive "p")
   (let ((proc (get-buffer-process (current-buffer))))
     (if (and (eobp) proc (= (point) (marker-position (process-mark proc))))
	(when (y-or-n-p "Really send EOF? ")
	  (comint-send-eof))
       (delete-char arg))))

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

end of thread, other threads:[~2007-06-09 22:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16  0:09 How to make Ctrl-d not log off the shell? mowgli
2007-05-16  3:38 ` Tyler Smith
2007-05-17  8:48   ` Dieter Wilhelm
     [not found]   ` <mailman.761.1179392245.32220.help-gnu-emacs@gnu.org>
2007-05-17 19:53     ` mowgli
2007-05-18  7:17       ` Dieter Wilhelm
2007-05-22  4:37         ` Xavier Maillard
2007-06-09 22:37   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2007-05-16  6:48 martin rudalics

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