From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Patrick Drechsler Newsgroups: gmane.emacs.help Subject: Re: inserting comment headings Date: Mon, 19 Jan 2004 23:57:25 +0100 Organization: Dept. of Zoology 2, Biocenter, University of Wuerzburg, Germany Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87k73o9vz2.fsf@tiger.rapttech.com.au> <400C5C69.20000@yahoo.com> Reply-To: patrick.drechsler@gmx.net NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074553439 18335 80.91.224.253 (19 Jan 2004 23:03:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2004 23:03:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 20 00:03:56 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AiiR1-0005sH-00 for ; Tue, 20 Jan 2004 00:03:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AiiOl-0001Uz-BF for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jan 2004 18:01:35 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!dsl-213-023-034-030.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: dsl-213-023-034-030.arcor-ip.net (213.23.34.30) Original-X-Trace: news.uni-berlin.de 1074552699 19025007 213.23.34.30 ([166469]) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUOICsoQ1BJbXX+//7P 1c/9/vz8/PvtcgaEAAACJklEQVR4nG2TUZKkIBBEoaMPQBEeoCEMDzCu/DfBeoA18H8bqfsfYbNQ e5yZ5YvgmWRRlarxsnLheOdSJuzVFXDYXB+57b+Bjz4qnn6AcYxbx+WnonDv5jr+56rUdzx9V3AY I5m5cJOGiyKz825u1vnLVbwR2Z53j+kCpg9Hxv9uV60XxTS+LNFtgCKEcfkEYYneOdexXFrrAZi5 bM57+9I985y4HGANzE/yHsynlGbmA5SSI1kvi4zu5nAC6asjOXdKKf0GE6+RXJMQgOKz3AkO1huy 5ESham2Ay8rsHD4mItM9lT6buIYaLRRKK1S7PW4HCJU3OEOgbdqcjcMBSkBfyRqjzX38S3peDrCG l5XySdMdUj2XA1R+tvpJadRFNiUBmAn/Qice2gjAugHk3MAfvMwIQL1G3eZ5Ali+AFl3Hk8gFqSN ogPUcQcBFs42b0FdmCCRqjb0zlgjBQsYwnKC3UJLr8zdn0nMY7TewQFAGTOsnwDeRL55az3zBVhn tHet3L6GAyzr5K3TAK1axCW/AdKkURVs5HHrReEMNEpq7TDl02OdyMlFGm1SwxjKJ7APLfaiGN6J BVicftwwKeqUQgTRp3yAJ0Y9v4gSklbXvNcl4JWSJJeemEcv+x3klbeUvBJvLIS6PR5t5xRl5Biq 9F3iXveZM879o6Xw1vKeivyDuYQt7iExuv0I/Q4K3gqPJF/G1JYELqsSEHWsdsRJtvL2/A/cfNVA 56hf7gAAAABJRU5ErkJggg== User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:AVleGuWGSKYMdf+9AQSq3xcCYLA= Original-Xref: shelby.stanford.edu gnu.emacs.help:120237 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16182 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16182 Kevin Rodgers wrote on 19 Jan 2004 23:38:33 MET: > Patrick Drechsler wrote: > >> Tim X. wrote on 19 Jan 2004 09:35:45 MET: [...] >> [...M-;, M-j...] >> Thanks for the answers, I already use these commands >> frequently. But this is not quit what I was looking for. >> I wanted to include the `-----------------' stuff after the >> comment automatically: >> ;;* comment ----------------------------------------------- >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> Any ideas? > > > (defun insert-comment-heading (comment) > "Insert COMMENT, preceded by \";;* \" and followed by \" ---...\"." > (interactive "sComment: ") > (insert ";;* " comment " " (make-string (- (window-width) > (+ (length comment) 5) > 1) > ?-)) > (newline)) Cool! Thank you very much Kevin! Now I just have to figure out how to let this function detect the mode emacs is in. But I'll go ahead and try that on my own. Cheers Patrick -- The shortest unit of time in the universe is the New York Second, defined as the period of time between the traffic lights turning green and the cab behind you honking. -- Terry Pratchett 'Lords and Ladies'