Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
fill-paragraph doesn't
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter Seibel  
View profile  
 More options Jan 29 2005, 6:10 pm
Newsgroups: comp.emacs
From: Peter Seibel <pe...@javamonkey.com>
Date: Sat, 29 Jan 2005 23:10:26 GMT
Local: Sat, Jan 29 2005 6:10 pm
Subject: fill-paragraph doesn't
I have the following function which loops finding words in a text that
can possibly be conracted. Because replacing two words with one will
sometimes join two lines, I want to refill the paragraphs where I
replace text. Thus the call to fill-paragraph. But it seems to have no
effect. Am I doing something wrong?

  (defun pbs:contract ()
    "Finds potential contractions and lets you convert them."
    (interactive)
    (let ((overlay nil))
      (unwind-protect
          (with-syntax-table *normal-syntax-table*
            (while (search-forward-regexp *contraction-regexp* (point-max) t)
              (let ((first (match-string 1))
                    (second (match-string 2)))
                (setq overlay (make-overlay (match-beginning 0) (match-end 0)))
                (mom-highlight-and-center overlay)
                (let ((correction (prompt-for-contraction first second)))
                  (if (not (zerop (length correction)))
                    (progn
                      (delete-overlay overlay)
                      (replace-match correction t)
                      (fill-paragraph nil)))))
              (delete-overlay overlay)
              (setq overlay nil)))
        (if overlay (delete-overlay overlay)))))

I'm using a fairly recent CVS emacs on GNU/Linux.

-Peter

--
Peter Seibel                                      pe...@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
roodwriter@core.com  
View profile  
 More options Jan 29 2005, 6:26 pm
Newsgroups: comp.emacs
From: "roodwri...@core.com" <roodwri...@core.com>
Date: Sat, 29 Jan 2005 18:26:05 -0500
Local: Sat, Jan 29 2005 6:26 pm
Subject: Re: fill-paragraph doesn't

Two things come to mind for me. Have you tried refill-mode? That
automatically autofills when you insert in the middle of a line. You
wouldn't need to add that to your code. It's built in.

But the best I've found for word-wrap is the newest version of
longlines.el. Again, this would work from outside your code.

Try them both.

--Rod
Author of "Linux for Non-Geeks--Clear-eyed Answers for Practical Consumers"
and "Boring Stories from Uncle Rod." Both are available at
http://www.rodwriterpublishing.com/index.html.

To reply take the extra "o" out of the name.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Seibel  
View profile  
 More options Jan 31 2005, 4:26 pm
Newsgroups: comp.emacs
From: Peter Seibel <pe...@javamonkey.com>
Date: Mon, 31 Jan 2005 21:26:10 GMT
Local: Mon, Jan 31 2005 4:26 pm
Subject: Re: fill-paragraph doesn't

Interesting; I hadn't know about that. Seems to work. Thanks.

(I'd still be interested to know why calling fill-paragraph doesn't
seem to have any effect, if anyone knows.)

-Peter

--
Peter Seibel                                      pe...@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Seibel  
View profile  
 More options Feb 3 2005, 8:28 pm
Newsgroups: comp.emacs
From: Peter Seibel <pe...@javamonkey.com>
Date: Fri, 04 Feb 2005 01:28:58 GMT
Local: Thurs, Feb 3 2005 8:28 pm
Subject: Re: fill-paragraph doesn't

Ah, I figured it out. The problem was that the point wasn't actually
at the place where I was replacing the text. I happened to change the
code to use goto-char and then the fill-paragraph started working.
Never mind.

-Peter

--
Peter Seibel                                      pe...@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »