From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: hoel@gl-group.com (Berthold =?iso-8859-15?q?H=F6llmann?=) Newsgroups: gmane.emacs.help Subject: Re: Using comment-region in function Date: Thu, 13 May 2004 17:28:43 +0200 Organization: Germanischer Lloyd AG Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1084462932 23249 80.91.224.253 (13 May 2004 15:42:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 May 2004 15:42:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 13 17:41:49 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 1BOILD-0008EU-00 for ; Thu, 13 May 2004 17:41:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOICh-00039A-Q7 for geh-help-gnu-emacs@m.gmane.org; Thu, 13 May 2004 11:32:59 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-X-Complaints-To: http://news.individual.net/abuse.html Original-X-Trace: news.uni-berlin.de ZIkiiyMDI5Wlg465s1FeBA7+EQ6cYbkhBnBiFPjt0O0PJtujR1 X-Orig-Path: ID-156053.news.dfncis.de!news User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:bZv36cyQJmgTFv/bi2EGRMZJwNs= Original-Xref: shelby.stanford.edu gnu.emacs.help:123168 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 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:18461 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18461 Jesper Harder writes: > hoel@gl-group.com (Berthold Höllmann) writes: > >> The text should be the same and inserted as comment regardles the >> programming language. I need a hint to achiev this. > > Use `comment-region'? > > (comment-region > (point) > (progn > (insert "This is a comment") > (point))) This does not work for skeletons: (define-skeleton blurb-head "aa" "test: " "test " str > n) (define-skeleton head "Insert a standard header for C files" "" (comment-region (point) blurb-head (point))) M-x head gives eval: Symbol's value as variable is void: blurb-head Changing "head" to (define-skeleton head "Insert a standard header for C files" "" (comment-region (point) (blurb-head) (point))) gives eval: Wrong type argument: number-or-marker-p, nil Regards Berthold -- Dipl.-Ing. Berthold Höllmann __ Address: hoel@GL-Group.com G / \ L Germanischer Lloyd phone: +49-40-36149-7374 -+----+- Vorsetzen 32/35 P.O.Box 111606 fax : +49-40-36149-7320 \__/ D-20459 Hamburg D-20416 Hamburg