Re: Please help with function

[email protected] Wed, 2 Feb 2005 11:20:34 -0500
Newsgroups gmane.emacs.xemacs.general
Message-ID <OF01F28C1D.1C3FCE6A-ON85256F9C.005843CD-85256F9C.0059C60F@iqfinancial.com>
Two things:

1. If you already have the text and just want to turn
     struct dbrmhdr {
   into
     s t r u c t d b r m h d r {

You can do it by replace-regexp
   A. Select range
   B. narrow-to-region
   C. replace-regexp '.' to '\& '.
   D. widen  (opposite of narrow to region).

If you are not yet familiar with regular expressions, it is certainly worth
the time to learn. All of a sudden the things you thought you had to do via
home-grown commands (or even keyboard macros) become a simple replace
command.

2. If you want to learn lisp and write your own commands from scratch, try:
     www.gnu.org
   for several books and related materials.
   I have also found such at my local book store (including a biggie called
- I think - the Emacs Reference manual, which I highly recommend, and a few
others, such as for writing macros (which I didn't think was as good as the
Ref), etc.).

   As I recall the emacs tutorial (c-h i) also provides a fair bit of
detail.

   and don't overlook the online doc (such as F1-? to see about finding
info on variables, functions, etc.

   Finally, look at your emacs.el or .emacs, or whatever you call it, not
to mention the hundreds of modules of examples in your 'load-path'  (F1-v
load-path). Someone probably has something that you need...

Good luck...



                                                                                                               
                      Markus.Grunwald@pruf                                                                     
                      technik.com                 To:       [email protected]                             
                      Sent by:                    cc:                                                          
                      xemacs-news-bounces@        Subject:  Please help with function                          
                      xemacs.org                                                                               
                                                                                                               
                                                                                                               
                      02/02/2005 07:27 AM                                                                      
                                                                                                               
                                                                                                               




Hello,

I would like to write a lisp function that reads a string and inserts a
space after every character: "String" -> "S t r i n g ".
I have a little lisp experience, but don't know which functions to use to
modify the string.

Could you just give me some hints, where I have to look/ which functions I
can use ? I would like to find out the "rest" myself to learn a bit...

TIA,

Markus Grunwald
Softwareentwicklung

PRÜFTECHNIK Condition Monitoring GmbH
Oskar-Messter-Straße 19-21
85737 Ismaning
www.pruftechnik.com
Tel: +49 (0)89 99616177
Fax: +49 (0)89 99616200