Re: BibTeX Mode Fill Paragraph

New Message Reply Date view Thread view Subject view Author view

From: Craig B Upright (cupright@Princeton.EDU)
Date: 13 Mar 01, 09:21 EST


From: Craig B Upright <cupright@Princeton.EDU>
Subject: Re: BibTeX Mode Fill Paragraph


On Mon, 12 Mar 2001, Mr. Noyb wrote:

| Has something changed in BibTeX mode with respect to Fill Paragraph
| behaviour?  It doesn't seem to do anything any more - that is, the key
| is bound to a proc but the target paragraph is not filled when the key
| is typed.

More information would be useful:

Which version of Bib mode -- 4.0 or 4.1.4 ?  
  (The newer version was included in the recent 7.5d1 release.)

Are you trying to fill an entry or a comment?  
  (I'll assume a comment, because filling an entry has always
   resulted in treating the entire doc as one long paragraph.)

Is "the key" you refer to command-i ?

--------

Assuming that you are trying to fill a commented paragraph using
command-i, I think that I tracked down the problem. "fillParagraph"
calls "paragraph::start", which includes

	switch -- $mode {
	    "TeX" -
	    "Bib" {
		global texParaCommands
		set startPara {^[ \t]*$|\\\\       [snip]
		append startPara $texParaCommands  [snip]
	    } 
	    [snip]

Since Bib mode no longer automatically sources TeX mode (in an effort to 
speed things up a bit if all you're doing is editing a .bib file), the 
global variable "texParaCommands" is not necessarily defined.

Solution: remove the dependency on texParaCommands, which appears to be
unnecessary anyway  (feel free to prove me wrong ...), by defining the
preferential ${mode}::start/endPara variables:

(1) Include this in a BibPrefs.tcl file

set Bib::startPara {^[\t ]*.*(\}|\"),[\t ]*$}
set Bib::endPara   {^[\t ]*(([a-zA-Z0-9\t ]+=.*)|((\}|\")[\t ]))*$}

This should guarantee that comments can be properly filled, and gives a
much better (though not yet ideal) result for filling a field in an
entry. Of course, formatting the entry works much better for this.

(Vince -- could you include this somewhere in bibtexMode.tcl for the
next release?)

(2)  Remove the "Bib" part of the switch from both of the procs
paragraph::start and paragraph::finish.

Thanks for pointing this out,

-- Craig

______________________________________________________________

Craig Barton Upright     	email:  cupright@princeton.edu
Department of Sociology  	phone:  (609) 258.4539
Princeton University     	fax:    (609) 258.2180
Princeton, New Jersey  08544	http://www.princeton.edu/~cupright/
______________________________________________________________



_______________________________________________
AlphaTcl-developers mailing list
AlphaTcl-developers@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/alphatcl-developers


New Message Reply Date view Thread view Subject view Author view

This archive was generated by das@users.sourceforge.net with hypermail 2b29 on 31 Mar 01, 11:51 EST