From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: robert.thorpe@antenova.com (Rob Thorpe) Newsgroups: gmane.emacs.help Subject: Re: Two questions.... Date: 3 Jun 2003 06:05:31 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1a61f7e5.0306030505.3a07617b@posting.google.com> References: <84vfvoubrx.fsf@lucy.is.informatik.uni-duisburg.de> <8an0h0rvea.fsf@sm.intel.com> NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1054646510 18481 80.91.224.249 (3 Jun 2003 13:21:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2003 13:21:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 03 15:21:47 2003 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 19NBhl-0004g5-00 for ; Tue, 03 Jun 2003 15:19:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19NBZV-0005vt-FW for gnu-help-gnu-emacs@m.gmane.org; Tue, 03 Jun 2003 09:11:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 212.135.40.163 Original-X-Trace: posting.google.com 1054645531 8726 127.0.0.1 (3 Jun 2003 13:05:31 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 3 Jun 2003 13:05:31 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:114036 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10530 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10530 Balaji Venkataraman wrote in message news:<8an0h0rvea.fsf@sm.intel.com>... > >>>>> "Kai" == Kai Großjohann writes: > > Kai> Urban Gabor writes: > > >> 2. I generaly do C/C++ and Perl editing with emacs. It would be very > >> convenient to ha a generic macro, which insert an empty comment in > >> the code. My problem is, that the formar of the comment is dependig > >> on the programming language (mode) you use. Is there a genereal > >> solution? > > Kai> I hit M-;. (This is new in Emacs 21.) -- This line is not blank. > > If I understand Urban correctly, he wants to insert a new comment block - > like say some header text - he does not want to know how to (un)comment > existing lines etc. > > Meaning if I'm in C mode I want to say "M-x insert-my-header" and it does > > // Filename: > // Date started: > > but in Perl mode it does > > # Filename: > # Date started: > > At least that's what I've wished for a while. Thought I'd learn enough elisp > to write a function to do that. But when is the question! In any particular mode this is given by the value of comment-start. (insert comment-start "Filename:" comment-end "\n") etc