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

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

RE: Emacs Book Vs Emacs Manuals


From: Doug Lewan
Subject: RE: Emacs Book Vs Emacs Manuals
Date: Fri, 15 May 2015 18:45:53 +0000

> -----Original Message-----
> On
> Behalf Of MBR
> Subject: Re: Emacs Book Vs Emacs Manuals
> 
> Instead, why not challenge them to do some task whose end result
> they'll
> consider useful, but that you know will be a royal pain in the ass to
> do
> with a simple-minded text editor.  Make sure it's not something
> contrived.  Tell them to use whatever editor they're most comfortable
> with. After 15 min. or more of tedious editing in their underpowered,
> brain-dead editor, show them that you can do the same thing in 15
> seconds using some general-purpose Emacs feature.

I agree. Letting them do a complex repetitive task would be a good 
demonstration.

Here's my proposed task; I do this all the time during development.

Given a long structure of some sort, write a print function for it.
The wrapper is easy, something like the following:
    void
    print_long_structure (FILE *fp, long_struct_t *ls)
    {
        fprintf(fp,"long structure name:\n");

        return;
    }
Each element should be printed on a line of its own, indented a little with 
name and value separated by TAB:
        structure_element_name:      element_value

If you know emacs, then it's an obvious keyboard macro.
If not, then there's some education to be had, 
including rehearsing keyboard macros, 
thinking about initial conditions, 
preparing for the next iteration (forward-line), etc.

Once you get through all that, writing the code for the next, e.g. 30 lines is 
easy and very satisfying.

I hope this is worthwhile to someone.

-- 
,Doug
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224 or ext 4335

The human brain is the most complex thing known to man, according to the human 
brain.





reply via email to

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