From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: Inserting date, Disabling the Yes/No question Date: Tue, 10 Sep 2002 15:14:43 +0200 Organization: Olymp Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1031658366 5943 127.0.0.1 (10 Sep 2002 11:46:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2002 11:46:06 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17ojT2-0001Xb-00 for ; Tue, 10 Sep 2002 13:46:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ojT6-0001HV-00; Tue, 10 Sep 2002 07:46:08 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-192-231.arcor-ip.NET!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 56 Original-NNTP-Posting-Host: dialin-145-254-192-231.arcor-ip.net (145.254.192.231) Original-X-Trace: fu-berlin.de 1031657926 62182139 145.254.192.231 (16 [87814]) X-Orig-Path: hermes!nobody X-Operating-System: Linux from Scratch X-Attribution: os X-Face: "HgH2sgK|bfH$;PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) Cancel-Lock: sha1:G2PrWqMeLce6RRXEONnQzn/gVHc= Original-Xref: nntp.stanford.edu comp.emacs:74339 gnu.emacs.help:104665 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1221 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1221 Jesse Mathias Marder writes: > Hello, > > Is there a built in function or a package to gnu emacs 21.2 that > inserts the current date in the document, undepedent of the current > major mode? Yes. There is time-stamp.el, which ships with Emacs 21 ,---- | Commentary: | A template in a file can be updated with a new time stamp when | you save the file. For example: | static char *ts = "sdmain.c Time-stamp: <1996-08-13 10:20:51 gildea>"; | See the top of `time-stamp.el' for another example. | | To use time-stamping, add this line to your .emacs file: | (add-hook 'write-file-hooks 'time-stamp) | Now any time-stamp templates in your files will be updated automatically. | | See the documentation for the functions `time-stamp' | and `time-stamp-toggle-active' for details. `---- > And besides that, I'd like to disable the yes/no question when killing > a modified buffer,m or at least chatnge t it no y/n. How can I do > this? [...] Thomas Burdick once posted a nice macro to change `yes-or-no-p' to `y-or-n-p' function-wise: (require 'cl) (defmacro make-shorter-response (&rest names) `(progn ,@(mapcar (lambda (name) `(defadvice ,name (around shorter-response) (flet ((yes-or-no-p (prompt) (y-or-n-p prompt))) ad-do-it))) names) ,@(mapcar (lambda (name) `(ad-activate (quote ,name))) names))) Then you can simply do: (make-shorter-response kill-buffer) -- Oliver -- 24 Fructidor an 210 de la Révolution Liberté, Egalité, Fraternité!