[Top][All Lists]

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

Re: newbie elisp help ??

From: William Case
Subject: Re: newbie elisp help ??
Date: Wed, 15 Aug 2007 22:30:17 -0400

Thanks for your comments Joel;

On Wed, 2007-08-15 at 16:08 -0400, Joel J. Adamson wrote:
> William Case <address@hidden> writes:
> > I suppose I am asking for the programming equivalent of 'C-u n'.
> Well yeah: my question is "why do you want to program this?"  Whenever
> I want such a divider, I just enter "M-7 M-0 *", like this:
> **********************************************************************
> That took three keystrokes.  If you want to repeat it a bunch of
> times, you can make it a macro, and name the macro.  However, either
> making it a macro and calling it by name, or programming it as an
> interactive function takes more keystrokes (unless you give it a
> one-letter name or bind it to a key, e.g., C-c *).
> If you want to call this from inside a function, or make it part of a
> mode, I'd suggest looking at the code for major modes, such as sh-mode
> or message-mode.

To respond to your curiosity, I want to build a function that inserts
lines as I have described for several reasons.

     1. I called it a section a divider in my posts because there are
        file header programs in the emacs wiki and elsewhere.  They are
        all too big and complex for what I need.  They are more suited
        to a professional programmer who is building a major project
        with the expectation that those files will be widely
        distributed.  Perhaps, one day I will need something like that.
        For now, I wanted to avoid debate and just create a simple
        header for files that are tantamount to practise or sample
        files, using 'C', elisp or bash. File name, Purpose of program,
        Author's name, programming date will do for me.
     2. I have tried to use something like you suggest, but find the use
        of a solid line of characters too dense, drawing attention away
        from the actual programming, and, thus would like to alternate
        character with a space.
     3. It seemed like building a function and sub-functions, was a good
        self-imposed exercise to practise some of the lisp I had picked
        up in the tutorial.
     4. I wanted to avoid the need for variable arguments, parameters
        and hooks by writing a simple set of functions where I could
        copy and manually substitute ';' and '#' for '/*  */' commenting
        out symbols.  Hooks, buffer/file names, etc. might come later.
     5. I did not ask for advice on the emacs mailing list lightly.  I
        did my due diligence with manuals, info, wiki, archives, google
        and trial and error.  I thought that after several hours of
        frustration it would be appropriate to ask for guidance.

My understanding was that this emacs mailing list is for beginners and
experienced people alike.

Regards Bill,
Emacs 22.0.990.1  Fedora 7 

reply via email to

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