[pmwiki-users] (:linebreak:) as a global setting

Joachim Durchholz jo at durchholz.org
Tue Sep 26 05:59:24 CDT 2006

Patrick R. Michaud schrieb:
> On Mon, Sep 25, 2006 at 09:28:29PM +0000, Pico wrote:
>> I don't know if this is new to beta2, or whether you even consider 
>> it a bug, but adding a (:linebreaks:) directive on a page can have 
>> an impact on the SideBar as well as the body of the page.
> It's not new to beta2 -- it's been around for a long time.
> Essentially, (:linebreaks:) takes effect until it's turned off,
> and this can even affect the markups in sidebars and other
> included pages.
> While it's arguable that this is a bug, I've decided it's
> not really worth the effort or hassle to fix it.

Hmm... that's a standard problem that I've seen as far back as from my 
Clipper days, and there's a relatively simple standard solution: make 
changes in settings undoable.

E.g. have a new directive (:revertlinebreaks:), which will restore the 
line break settings as they were before the last (:linebreaks:) resp. 
(:nolinebreaks:) directive.

Internally, you'd have to keep a stack of linebreak states, but I hope 
you agree that this doesn't turn it into a big effort :-)

The mechanism could be extended in two directions:
1) Apply it to other settings that have an effect until end-of-text.
2) Generate an implied (:revertlinebreaks:) when exiting from an include 
file. That would implement what Crisses wanted, with little effort.

> If a SideBar doesn't want linebreaks, then it can explicitly turn
> them off using (:nolinebreaks:).  So can the pagelist template, for
> that matter.  :-)

That would require everybody to go through templates and add 
(:nolinebreaks:) everywhere. That's a lot of work, and it's too easy to 
overlook a place where it would have to be added.
Plus, things tend to get ugly if they want (:linebreaks:) in some parts 
of their site and (:nolinebreaks:) in others. At that point, most people 
start fiddling with moving the directives from the include files to the 
places where they are included and vice versa, and the final result is a 
general mess.
I think having undoable setter directives would be far better :-)


More information about the pmwiki-users mailing list