help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using comment-region in function


From: Berthold Höllmann
Subject: Re: Using comment-region in function
Date: Thu, 13 May 2004 17:28:43 +0200
User-agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux)

Jesper Harder <harder@myrealbox.com> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]