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

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

Help with (or gift of?) two wee elisp cmds -- please


From: David Combs
Subject: Help with (or gift of?) two wee elisp cmds -- please
Date: 16 Feb 2003 00:18:41 -0500

I need to proofread & edit (NOW) a 40-page single-spaced
piece of text (it's a proposed set of bylaws for
an organization I belong to), and there's punctuation
and other errors on almost every other line.

(My ascii-text copy came from running their .doc-file through
that wonderful "antiword" program.)

So that my suggested edits are easy for them to see, 
and then decide whether or not to do them (which they'd do
in M$ Word), I'd like to show my suggested edits
on an extra line just under their original line, like this:

---- eg: changing this:

Now is the time for all gud
people to come to the the
aid of their after which
they should to to the nearest
bar and have a drink or five.

---- into eg this:

Now is the time for all gud
                        ^good
people to come to the the
^men                  ^delete 2nd "the"
aid of their after which
            ^country,
they should to to the nearest but grungiest
                             (             )
bar and have a drink or two.
  ^,                    ^five



QUESTION: Is there an existing mode, or can someone show me
some elisp (or even a macro?  elisp probably better, simpler,
actually) to let me do the following:

I search to some place in a line of text for which I want to
show a possible correction.  Once there, I'd like to run
a function that would, with this line (which needs a comma
after "to me"):

---- CASE ONE:

This is a line that, according to me needs a 2nd comma.

(a) Generates a newline at the end of the line, thus
    "double spacing" that line.

(b) space (not tab) me over to *under* where point had
    gotten to at the end of my search.

At which point I can type in my caret and suggested comma:


This is a line that, according to me needs a 2nd comma.
                                    ^,
, with point now being just after my comma.


---- CASE TWO:

In my now way-too-tired state, I "discover", in the above line, a 
misspelling: "line" should have been "zine", and I want to add 
my suggested (and stupid) "fix" for it:

So, I'd like to be able to search for "line", leaving point 
after the "l" in "line", and run some command that will end up: 

(a) "line-feeding" (not newlining) me down just "below" point, and

(b) meanwhile ensuring that that (assumed to already exist) following 
    line is long enough, by, if needed, appending enough spaces to it
    to put me where I, and point, want to be, so I can enter my "^z" 
    or "^zine" or whatever I choose to show.

(c) If there's any collision of my fixes on that next
    line, well, I'll have to handle that by hand,
    perhaps by either:

      (1) Sliding things around on that correction-line,
          and switching the caret to the other side of one 
          of them, or 

      (2) Doing a CASE ONE operation, giving me a *second* 
          suggested-corrections line under the first one.


Please, could some friendly elisp-hacker to show the code for 
doing this?

(It'd probably take me two days to code this, 
what with having to learn the debugger, etc --
and I have this huge editing job to do NOW
(well, YESTERDAY).

Thanks so very much!

David

PS: Now I go down and finish finding the
many, many things that need fixing.




reply via email to

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