I use tempo for this purpose:

(tempo-define-template 
 "code"                      ; template name 
 '("<code>" 'p "</code>")    ; template definition 
 "co"                        ; abbreviation 
 "Inserts an HTML code tag") ; template documentation 

This defines a function called tempo-template-code.
This doesn't actually put the HTML tag around the
region, but instead puts the cursor between the start
and end tags, which is also quite useful.

/Rudolf

 --- Lars Thuring <[EMAIL PROTECTED]> skrev:
> I downloaded the latest version from
> http://perso.wanadoo.fr/david.ponce/more-elisp.html
> but it highlight areas
> already marked by HTML tags. What I really wanted
> was to *insert* those markers,
> e.g. something along the lines:
> 
> 
> (defun jex-insert-html-b()
>   "Extention that insert HTML tag pair for bold at
> point and mark (selected
> area)"
>   (interactive)
>     (goto-char (point))
>     (insert "</B>")
>     (goto-char (mark))
>     (insert "<B>"))
> 
> (defun jex-insert-html-i()
>   "Extention that insert HTML tag pair for italic at
> point and mark (selected
> area)"
>   (interactive)
>     (goto-char (point))
>     (insert "</i>")
>     (goto-char (mark))
>     (insert "<i>"))
> 
> (defun jex-insert-html-tt()
>   "Extention that insert HTML tag pair for code at
> point and mark (selected
> area)"
>   (interactive)
>     (goto-char (point))
>     (insert "</tt>")
>     (goto-char (mark))
>     (insert "<tt>"))
> 
> 
> etc.
> 
> I'm not Lisp literate really, so there are probably
> better ways of writing
> these, for example to swap the insertion points if
> (mark) is > (point).
> 
> Did someone already do this?
> 
> cheers,
> 
> Lars
> 
> 
> 
> --
> 
> 
>
+--------------------------------------------------------+
> | Lars Thuring                                      
>     |
> | Development Manager                               
>     |
> |                                                   
>     |
> | Logopak Systeme               tel: (0) 4195 -
> 99750    |
> | Dorfstrasse 40                fax: (0) 4195 - 1265
>     |
> | 24628 Hartenholm           mailto:
> [EMAIL PROTECTED] |
> | Germany                      http: www.logopak.com
>     |
>
+--------------------------------------------------------+
> 
> 
> 


_____________________________________________________
Do You Yahoo!?
[EMAIL PROTECTED] - skaffa en gratis mailadress p� http://mail.yahoo.se

Reply via email to