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

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

Re: No line break within [[foo bar]] (wikipedia)


From: Karl Eichwalder
Subject: Re: No line break within [[foo bar]] (wikipedia)
Date: Sun, 20 Apr 2003 11:35:45 +0200
User-agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux)

kai.grossjohann@gmx.net (Kai Großjohann) writes:

Thanks for advise!

> I guess it's obvious how to change the code to look for * or # at
> beginning of line.  So I guess you did that, but it didn't work.
> What exactly did you try, and what happened when you tried it?
>
> (save-excursion
>   (beginning-of-line)
>   (member (char-after (point)) '(?\* ?\#)))
> ...seems to be code that looks whether the line starts with * or #.

I tried serveral way (w/o understanding what I'm actually doing); here
is the last experiment:

(defun fill-list-item-nobreak-p () 
  (save-excursion
    (beginning-of-line)
    (member (char-after (point)) '(?\* ?\#))))

(add-to-list 'fill-nobreak-predicate 'fill-list-item-nobreak-p)

The result is (let's assume the limit is at the word "limit"):

   * this is a very long line, longer than the fill limit

==>

   *
     this is a very long line, longer than the fill
     limit

Thus Emacs will break the line after "* " and that's not what I want.

-- 
                                                         |      ,__o
http://www.gnu.franken.de/ke/                            |    _-\_<,
ke@suse.de (work) / keichwa@gmx.net (home)               |   (*)/'(*)


reply via email to

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