unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bash TMOUT for emacs
@ 2004-12-19  0:28 Dan Jacobson
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Jacobson @ 2004-12-19  0:28 UTC (permalink / raw)


Gentlemen, at the gala festival I have left emacs running and
forgotten on a terminal that I can't even remember what room is in.
Well, if emacs had a timeout setting, like bash's TMOUT, then I
wouldn't need to worry that some perpetrator could molest my files.

       TMOUT  If  set  to a value greater than zero, the value is
              interpreted as the number of seconds  to  wait  for
              input  after issuing the primary prompt.  Bash ter-
              minates after waiting for that number of seconds if
              input does not arrive.

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

* Re: bash TMOUT for emacs
       [not found] <mailman.7156.1103416780.27204.bug-gnu-emacs@gnu.org>
@ 2004-12-19  0:49 ` Thien-Thi Nguyen
  2004-12-19  0:52   ` Thien-Thi Nguyen
  2004-12-20 16:43 ` Kevin Rodgers
  1 sibling, 1 reply; 4+ messages in thread
From: Thien-Thi Nguyen @ 2004-12-19  0:49 UTC (permalink / raw)


jidanni@debian.linux.org.tw (Dan Jacobson) writes:

>        TMOUT  If  set  to a value greater than zero, the value is
>               interpreted as the number of seconds  to  wait  for
>               input  after issuing the primary prompt.

you can try:

(defun save-buffers-kill-emacs-when-idle (tmout)
  (interactive "nKill emacs when idle (seconds): ")
  (setq save-buffers-kill-emacs-when-idle-timer
        (run-with-idle-timer
          n tmout t
          (lambda ()
            (save-buffers-kill-emacs t))))

this sets the variable `save-buffers-kill-emacs-when-idle-timer'
which you can use to cancel the timer later, should you find your
computer again after galaing.

thi

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

* Re: bash TMOUT for emacs
  2004-12-19  0:49 ` bash TMOUT for emacs Thien-Thi Nguyen
@ 2004-12-19  0:52   ` Thien-Thi Nguyen
  0 siblings, 0 replies; 4+ messages in thread
From: Thien-Thi Nguyen @ 2004-12-19  0:52 UTC (permalink / raw)


Thien-Thi Nguyen <ttn@gnu.org> writes:

>           n tmout t

this is wrong.  it should read:

>           tmout t

thi

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

* Re: bash TMOUT for emacs
       [not found] <mailman.7156.1103416780.27204.bug-gnu-emacs@gnu.org>
  2004-12-19  0:49 ` bash TMOUT for emacs Thien-Thi Nguyen
@ 2004-12-20 16:43 ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2004-12-20 16:43 UTC (permalink / raw)


Dan Jacobson wrote:
 > Gentlemen, at the gala festival I have left emacs running and
 > forgotten on a terminal that I can't even remember what room is in.
 > Well, if emacs had a timeout setting, like bash's TMOUT, then I
 > wouldn't need to worry that some perpetrator could molest my files.
 >
 >        TMOUT  If  set  to a value greater than zero, the value is
 >               interpreted as the number of seconds  to  wait  for
 >               input  after issuing the primary prompt.  Bash ter-
 >               minates after waiting for that number of seconds if
 >               input does not arrive.

Does this work?

(when (getenv "TMOUT")
   (run-with-idle-timer (getenv "TMOUT") nil 'kill-emacs))

-- 
Kevin Rodgers

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

end of thread, other threads:[~2004-12-20 16:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.7156.1103416780.27204.bug-gnu-emacs@gnu.org>
2004-12-19  0:49 ` bash TMOUT for emacs Thien-Thi Nguyen
2004-12-19  0:52   ` Thien-Thi Nguyen
2004-12-20 16:43 ` Kevin Rodgers
2004-12-19  0:28 Dan Jacobson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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